summaryrefslogtreecommitdiffstats
path: root/askbot/templates/widgets/tag_selector.html
blob: ba304d2cf8b8779135cf43a8f8be97ea3259a4b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
{# todo - maybe disable navigation from ignored tags here when "hide" is on - with js? #}
{% import "macros.html" as macros %}
<div id="tagSelector" class="box">
    <h2>{% trans %}Interesting tags{% endtrans %}</h2>
    {{ 
        macros.tag_list_widget(
            interesting_tag_names,
            deletable = True,
            css_class = 'interesting marked-tags',
            search_state = search_state
        )
    }}
    {# todo - add this via js
        "remove '%(tag_name)s' from the list of interesting tags"|
        format(tag_name = tag_name)
    #}
    <div class="clearfix"></div>
    <div class="inputs">
        <input id="interestingTagInput" autocomplete="off" type="text"/>
        <input id="interestingTagAdd" type="submit" value="{% trans %}add{% endtrans %}"/>
    </div>
    <h2>{% trans %}Ignored tags{% endtrans %}</h2>
    {{
        macros.tag_list_widget(
            ignored_tag_names,
            deletable = True,
            css_class = 'ignored marked-tags',
            search_state = search_state
        )
    }}
    {# todo: add this via javascript 
        "remove '%(tag_name)s' from the list of ignored tags"|
        format(tag_name = tag_name)
    #}
    <div class="inputs">
        <input id="ignoredTagInput" autocomplete="off" type="text"/>
        <input id="ignoredTagAdd" type="submit" value="{% trans %}add{% endtrans%}"/>
    </div>
    {% if settings.SUBSCRIBED_TAG_SELECTOR_ENABLED %}
        <h2>{% trans %}Subscribed tags{% endtrans %}</h2>
        {{
            macros.tag_list_widget(
                subscribed_tag_names,
                deletable = True,
                css_class = 'subscribed marked-tags',
                search_state = search_state
            )
        }}
        {# todo: add this via javascript 
            "remove '%(tag_name)s' from the list of ignored tags"|
            format(tag_name = tag_name)
        #}
        <div class="clearfix"></div>
        <div class="inputs">
            <input id="subscribedTagInput" autocomplete="off" type="text"/>
            <input id="subscribedTagAdd" type="submit" value="{% trans %}add{% endtrans%}"/>
        </div>
    {% endif %}
    <h3>{% trans %}Show only questions from{% endtrans%}</h3>
    <div id="displayTagFilterControl">
        {{
            macros.radio_select(
                name = "display_tag_filter_strategy",
                value = request.user.display_tag_filter_strategy,
                choices = display_tag_filter_strategy_choices
            )
        }}
    </div>
    {% if settings.SUBSCRIBED_TAG_SELECTOR_ENABLED %}
        <h3>{% trans %}Send me email alerts for{% endtrans%}</h3>
        <div id="emailTagFilterControl">
            {{
                macros.radio_select(
                    name = "email_tag_filter_strategy",
                    value = request.user.email_tag_filter_strategy,
                    choices = email_tag_filter_strategy_choices
                )
            }}
            {% if request.user.is_authenticated() %}
            <p>
                <a 
                    href="{% 
                        url user_profile 
                        request.user.id, request.user.username|slugify 
                    %}?sort=email_subscriptions"
                >{% trans %}Change frequency of emails{% endtrans %}</a>
            </p>
            {% endif %}
        </div>
    {% endif %}
</div>