admin_topic_show.html 4.84 KB
Newer Older
1 2 3 4 5 6 7 8
{% extends "admin_index.html" %}
{% from "macros.html" import render_form %}
{% block admin_title %}Topic - {{ topic.name }}{% endblock %}

{% block content %}
    <div class="mdl-cell mdl-cell--6-col mdl-cell--5-col-tablet mdl-cell--4-col-phone mdl-grid mdl-grid--no-spacing">
        <table class="mdl-data-table mdl-js-table mdl-shadow--2dp mdl-cell mdl-cell--12-col">
            <thead>
9 10 11 12 13
                <tr>
                    <th class="mdl-data-table__cell-non-numeric rede-large-text">{{ topic.name }}</th>
                    <th class="mdl-data-table__cell-non-numeric rede-medium-text" colspan=2>{{ topic.mode }}</th>
                    <th class="mdl-data-table__cell-non-numeric rede-medium-text"><a href="{{ url_for(".topic_edit", id=topic.id) }}"><i class="material-icons">edit</i></a></th>
                </tr>
14 15
                <tr>
                    <th class="mdl-data-table__cell--non-numeric">Speaker</th>
16
                    <th class="mdl-data-table__cell">Count</th>
17
                    <th class="mdl-data-table__cell--non-numeric">Done</th>
18
                    <th class="mdl-data-table__cell--non-numeric">Edit</th>
19 20 21 22 23 24 25
                    <th class="mdl-data-table__cell--non-numeric">Remove</th>
                </tr>
            </thead>
            <tbody>
            {% for statement in topic.sorted_statements() %}
                <tr>
                    <td class="mdl-data-table__cell--non-numeric">{{ statement.speaker.identifier() }}</td>
26
                    <td class="mdl-data-table__cell">{{ statement.speaker.count(statement.topic) }}</td>
27 28 29 30 31
                    <td class="mdl-data-table__cell--non-numeric">
                        <a href="{{ url_for(".statement_done", id=statement.id, topic_id=topic.id) }}">
                            <i class="material-icons">done</i>
                        </a>
                    </td>
32 33 34 35 36 37
                    <td class="mdl-data-table__cell--non-numeric">
                        <a href="{{ url_for(".speaker_edit", id=statement.speaker.id, topic_id=topic.id) }}">
                            <i class="material-icons">edit</i>
                        </a>
                    </td>
 
38 39 40 41 42 43 44 45 46 47
                    <td class="mdl-data-table__cell--non-numeric">
                        <a href="{{ url_for('.statement_delete', id=statement.id, topic_id=topic.id) }}">
                            <i class="material-icons">cancel</i>
                        </a>
                    </td>
                </tr>
            {% endfor %}
            </tbody>
        </table>
    </div>
Robin Sonnabend's avatar
Robin Sonnabend committed
48
    <div class="mdl-separator rede-separator"></div>
49
    <div class="mdl-cell mdl-cell--3-col mdl-cell--3-col-tablet mdl-cell--4-col-phone mdl-grid mdl-grid--no-spacing">
50
        {{ render_form(form, action_url=url_for(".statement_new"), action_text="Add", title="Add Statement", class_="mdl-card mdl-shadow--2dp mdl-cell mdl-cell--12-col mdl-cell--8-col-tablet mdl-cell--4-col-phone", btn_list=[("","Add Statement","add_statement"),  ("redl-btn-meta","Add Meta","add_meta_statement")] ) }}
51
        <div class="mdl-cell mdl-card mdl-shadow--2dp mdl-cell--12-col mdl-cell--8-col-tablet mdl-cell--4-col-phone">
52
            <ul class="rede-list-no-bullet">
Robin Sonnabend's avatar
Robin Sonnabend committed
53 54 55 56 57 58
                {% if topic.sorted_statements()|length() > 0 %}
                <li>
                    <a href="{{ url_for(".statement_done", id=topic.sorted_statements()[0].id, topic_id=topic.id) }}" class="rede-href"><i class="material-icons" role="presentation">redo</i> Next</a>
                </li>
                {% endif %}
                <li><a href="{{ url_for(".statement_undo") }}" class="rede-href"><i class="material-icons" role="presentation">undo</i> Previous</a></li>
Robin Sonnabend's avatar
Robin Sonnabend committed
59
                <li><a href="{{ url_for(".topic_show", id=topic.get_next_index()) }}"><i class="material-icons">arrow_forward</i> Next Topic</a></li>
60 61 62
            </ul>
        </div>
    </div>
Robin Sonnabend's avatar
Robin Sonnabend committed
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
    <div class="mdl-cell mdl-cell--3-col mdl-cell--3-col-tablet mdl-cell--4-col-phone mdl-card mdl-shadow--2dp">
        <div class="mdl-card__title">
            <h4 class="mdl-card__title-text">Topics</h4>
        </div>
        <table>
        {% for t in topics %}
            <tr class="{% if t == topic %}rede-list-point-big{% else %}rede-list-point-normal{% endif %}">
                <td>
                    {% if t != topics[0] %}
                    <a href="{{ url_for(".topic_swap_up", id=t.id, original=topic.id) }}"><i class="material-icons">keyboard_arrow_up</i></a>
                    {% endif %}
                </td>
                <td>
                    {{ t.name }}
                </td>
                <td>
                    {% if t != topics[-1] %}
                    <a href="{{ url_for(".topic_swap_down", id=t.id, original=topic.id) }}"><i class="material-icons">keyboard_arrow_down</i></a>
                    {% endif %}
                </td>
            <tr>
        {% endfor %}
        </table>
    </div>
87
{% endblock %}