diff --git a/changedetectionio/blueprint/tags/__init__.py b/changedetectionio/blueprint/tags/__init__.py index e11910ff7..86d9154c1 100644 --- a/changedetectionio/blueprint/tags/__init__.py +++ b/changedetectionio/blueprint/tags/__init__.py @@ -22,11 +22,14 @@ def construct_blueprint(datastore: ChangeDetectionStore): tag_count = Counter(tag for watch in datastore.data['watching'].values() if watch.get('tags') for tag in watch['tags']) + from changedetectionio import processors output = render_template("groups-overview.html", app_rss_token=datastore.data['settings']['application'].get('rss_access_token'), available_tags=sorted_tags, form=add_form, + generate_tag_colors=processors.generate_processor_badge_colors, tag_count=tag_count, + wcag_text_color=processors.wcag_text_color, ) return output @@ -208,9 +211,16 @@ def construct_blueprint(datastore: ChangeDetectionStore): template = env.from_string(template_str) included_content = template.render(**template_args) + matching_watches = { + w_uuid: watch + for w_uuid, watch in datastore.data['watching'].items() + if default.matches_url(watch.get('url', '')) + } + output = render_template("edit-tag.html", extra_form_content=included_content, extra_tab_content=form.extra_tab_content() if form.extra_tab_content() else None, + matching_watches=matching_watches, settings_application=datastore.data['settings']['application'], **template_args ) diff --git a/changedetectionio/blueprint/tags/form.py b/changedetectionio/blueprint/tags/form.py index 6ff3a503c..61b8bdb82 100644 --- a/changedetectionio/blueprint/tags/form.py +++ b/changedetectionio/blueprint/tags/form.py @@ -10,12 +10,11 @@ from changedetectionio.processors.restock_diff.forms import processor_settings_f class group_restock_settings_form(restock_settings_form): overrides_watch = BooleanField('Activate for individual watches in this tag/group?', default=False) + url_match_pattern = StringField('Auto-apply to watches with URLs matching', + render_kw={"placeholder": "e.g. *://example.com/* or github.com/myorg"}) + tag_colour = StringField('Tag colour', default='') class SingleTag(Form): name = StringField('Tag name', [validators.InputRequired()], render_kw={"placeholder": "Name"}) save_button = SubmitField('Save', render_kw={"class": "pure-button pure-button-primary"}) - - - - diff --git a/changedetectionio/blueprint/tags/templates/edit-tag.html b/changedetectionio/blueprint/tags/templates/edit-tag.html index 8a0260903..ecdc0bbbe 100644 --- a/changedetectionio/blueprint/tags/templates/edit-tag.html +++ b/changedetectionio/blueprint/tags/templates/edit-tag.html @@ -43,6 +43,46 @@