From e0ea4e7b6cc07e18870a367b1b706afc75cd65fd Mon Sep 17 00:00:00 2001 From: Deimos Date: Wed, 24 Apr 2019 18:01:20 -0600 Subject: [PATCH] Use common group tags for tag autocompletion This applies the new stored/updated lists of common tags for each group to the topic-tagging form, both for new submissions as well as editing the tags on an existing one. --- tildes/tildes/templates/intercooler/topic_tags_edit.jinja2 | 2 +- tildes/tildes/templates/macros/forms.jinja2 | 4 ++-- tildes/tildes/templates/new_topic.jinja2 | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tildes/tildes/templates/intercooler/topic_tags_edit.jinja2 b/tildes/tildes/templates/intercooler/topic_tags_edit.jinja2 index 4287609..18b96c5 100644 --- a/tildes/tildes/templates/intercooler/topic_tags_edit.jinja2 +++ b/tildes/tildes/templates/intercooler/topic_tags_edit.jinja2 @@ -12,7 +12,7 @@ data-ic-target="#sidebar .topic-tags" data-js-remove-on-success > - {{ topic_tagging(value=topic.tags|join(', '), auto_focus=True) }} + {{ topic_tagging(value=topic.tags|join(', '), auto_focus=True, autocomplete_options=topic.group.common_topic_tags) }}
diff --git a/tildes/tildes/templates/macros/forms.jinja2 b/tildes/tildes/templates/macros/forms.jinja2 index 6970dd7..5d4be73 100644 --- a/tildes/tildes/templates/macros/forms.jinja2 +++ b/tildes/tildes/templates/macros/forms.jinja2 @@ -16,7 +16,7 @@ >{% if text %}{{ text }}{% endif %} {% endmacro %} -{% macro topic_tagging(value=None, auto_focus=False) %} +{% macro topic_tagging(value=None, auto_focus=False, autocomplete_options=None) %}
- {{ topic_tagging() }} + {{ topic_tagging(autocomplete_options=group.common_topic_tags) }}