summaryrefslogtreecommitdiffstats
path: root/askbot/skins/default/templates/list_suggested_tags.html
blob: 4eeb0004e3406101ec852eea341de4570d5fdfa0 (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
{% extends "two_column_body.html" %}
{% import "macros.html" as macros %}
<!-- tags.html -->
{% block title %}{{ page_title }}{% endblock %}
{% block content %}
    {% include "tags/header.html" %}
    {% if tags %}
        <table class="suggested-tags-table">
            <thead>
                <tr>
                    <th class="tags-col">{% trans %}Tag{% endtrans %}</th>
                    <th class="users-col">{% trans %}Suggested by{% endtrans %}</th>
                    <th class="decision-col">{% trans %}Your decision{% endtrans %}</th>
                    <th>{% trans %}Suggested tag was used for questions{% endtrans %}</th>
                </tr>
            </thead>
            <tbody>
            {% for tag in tags %}
                <tr class="suggested-tag-row" data-tag-id="{{ tag.id }}">
                    <td class="tags-col">
                        {{ macros.tag_widget(tag.name, is_link = False) }}
                        <span class="tag-number">&#215;{{ tag.used_count }}</span>
                    </td>
                    <td class="users-col">
                        {% for user in tag.suggested_by.all() %}
                            <p>{{ user.get_profile_link() }}</p>
                        {% endfor %}
                    </td>
                    <td colspan="2">
                        <table>{# inner table for the list of questions #}
                        {% for thread in tag.threads.all() %}
                            <tr class="thread-info" data-thread-id="{{ thread.id }}">
                                <td class="per-thread-controls">
                                    <button class="btn accept">{% trans %}Accept{% endtrans %}</button>
                                    <button class="btn reject">{% trans %}Reject{% endtrans %}</button>
                                </td>
                                <td class="thread-links-col">
                                    <a title="{{ thread._question_post().summary|escape }}"
                                        href="{{ thread.get_absolute_url() }}"
                                    >{{ thread.title|escape }}</a>
                                </td>
                            </tr>
                        {% endfor %}
                        </table>
                    </td>
                </tr>
                <tr class="per-tag-controls" data-tag-id="{{ tag.id }}">
                    <td colspan="4">
                        {% if tag.threads.count() > 1 %}
                            <button class="btn accept">{% trans name=tag.name %}Apply tag "{{ name }}" to all above questions{% endtrans %}</button>
                            <button class="btn reject">{% trans %}Reject tag{% endtrans %}</button>
                        {% endif %}
                    </td>
                </tr>
            {% endfor %}
            </tbody>
        </table>
    {% else %}
        <span>{% trans %}Nothing found{% endtrans %}</span>
    {% endif %}
{% endblock %}
{% block endjs %}
    <script type="text/javascript">
        askbot['urls']['moderateSuggestedTag'] = '{% url "moderate_suggested_tag" %}';
    </script>
    <script type="text/javascript" src="{{ '/js/tag_moderation.js'|media }}"></script>
{% endblock %}