mirror of
https://github.com/dgtlmoon/changedetection.io.git
synced 2025-12-15 04:26:14 +00:00
Support for comma separated tags
This commit is contained in:
@@ -85,9 +85,13 @@ def main_page():
|
|||||||
sorted_watches = []
|
sorted_watches = []
|
||||||
for uuid, watch in datastore.data['watching'].items():
|
for uuid, watch in datastore.data['watching'].items():
|
||||||
if limit_tag != None:
|
if limit_tag != None:
|
||||||
if watch['tag'] == limit_tag:
|
# Support for comma separated list of tags.
|
||||||
watch['uuid'] = uuid
|
for tag_in_watch in watch['tag'].split(','):
|
||||||
sorted_watches.append(watch)
|
tag_in_watch = tag_in_watch.strip()
|
||||||
|
if tag_in_watch == limit_tag:
|
||||||
|
watch['uuid'] = uuid
|
||||||
|
sorted_watches.append(watch)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
watch['uuid'] = uuid
|
watch['uuid'] = uuid
|
||||||
sorted_watches.append(watch)
|
sorted_watches.append(watch)
|
||||||
|
|||||||
@@ -69,8 +69,12 @@ class ChangeDetectionStore:
|
|||||||
def get_all_tags(self):
|
def get_all_tags(self):
|
||||||
tags=[]
|
tags=[]
|
||||||
for uuid, watch in self.data['watching'].items():
|
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
|
return tags
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
<div class="pure-control-group">
|
<div class="pure-control-group">
|
||||||
<label for="tag">Tag</label>
|
<label for="tag">Tag</label>
|
||||||
<input type="text" placeholder="tag" size="10" id="tag" name="tag" value="{{ watch.tag}}"/>
|
<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>
|
</div>
|
||||||
|
|
||||||
<fieldset class="pure-group">
|
<fieldset class="pure-group">
|
||||||
|
|||||||
Reference in New Issue
Block a user