Support for comma separated tags

pull/1/head
Leigh Morresi 4 years ago
parent e589b441db
commit 3eaccfe5da

@ -85,9 +85,13 @@ def main_page():
sorted_watches = []
for uuid, watch in datastore.data['watching'].items():
if limit_tag != None:
if watch['tag'] == limit_tag:
watch['uuid'] = uuid
sorted_watches.append(watch)
# Support for comma separated list of tags.
for tag_in_watch in watch['tag'].split(','):
tag_in_watch = tag_in_watch.strip()
if tag_in_watch == limit_tag:
watch['uuid'] = uuid
sorted_watches.append(watch)
else:
watch['uuid'] = uuid
sorted_watches.append(watch)

@ -69,8 +69,12 @@ class ChangeDetectionStore:
def get_all_tags(self):
tags=[]
for uuid, watch in self.data['watching'].items():
if not watch['tag'] in tags:
tags.append(watch['tag'])
# Support for comma separated list of tags.
for tag in watch['tag'].split(','):
tag = tag.strip()
if not tag in tags:
tags.append(tag)
return tags

@ -15,6 +15,7 @@
<div class="pure-control-group">
<label for="tag">Tag</label>
<input type="text" placeholder="tag" size="10" id="tag" name="tag" value="{{ watch.tag}}"/>
<span class="pure-form-message-inline">Grouping tags, can be a comma separated list.</span>
</div>
<fieldset class="pure-group">

Loading…
Cancel
Save