admin_topic_show.html 7.27 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
                    <th class="mdl-data-table__cell--non-numeric">Remove</th>
                </tr>
            </thead>
            <tbody>
            {% for statement in topic.sorted_statements() %}
24
                {% if statement.is_meta %}
25
                <tr class="rede-table-bg-red">
26 27 28
                {% else %}
                <tr>
                {% endif %}
29
                    <td class="mdl-data-table__cell--non-numeric">{{ statement.speaker.identifier() }}</td>
30
                    <td class="mdl-data-table__cell">{{ statement.speaker.count(statement.topic) }}</td>
31 32 33 34 35
                    <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>
36 37 38 39 40 41
                    <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>
 
42 43 44 45 46 47 48 49 50 51
                    <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
52
    <div class="mdl-separator rede-separator"></div>
53
    <div class="mdl-cell mdl-cell--3-col mdl-cell--3-col-tablet mdl-cell--4-col-phone mdl-grid mdl-grid--no-spacing">
54
        {{ 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"),  ("mdl-button--colored","Add Meta","add_meta_statement")] ) }}
55
        <div class="mdl-cell mdl-card mdl-shadow--2dp mdl-cell--12-col mdl-cell--8-col-tablet mdl-cell--4-col-phone">
56
            <ul class="rede-list-no-bullet">
Robin Sonnabend's avatar
Robin Sonnabend committed
57 58 59 60 61
                {% 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 %}
62
                <li><a href="{{ url_for(".statement_undo", topic_id=topic.id) }}" class="rede-href"><i class="material-icons" role="presentation">undo</i> Previous</a></li>
Robin Sonnabend's avatar
Robin Sonnabend committed
63
                <li><a href="{{ url_for(".topic_show", id=topic.get_next_index()) }}"><i class="material-icons">arrow_forward</i> Next Topic</a></li>
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 92 93 94 95 96 97
                <li><a href="{{ url_for(".topic_show", id=topic.get_previous_index()) }}"><i class="material-icons">arrow_backward</i>Previous Topic</a></li>
                <li>
                    <form action="{{ url_for(".pause", id=topic.event.id, original=topic.id) }}" method="POST">
                        <button class="mdl-button">
                            {% if topic.event.paused %}
                            <i class="material-icons">play_arrow</i>
                            Resume
                            {% else %}
                            <i class="material-icons">pause</i>
                            Pause
                            {% endif %}
                        </button>
                        {% if not topic.event.paused %}
                        <input name="timeslider" class="mdl-slider mdl-js-slider" type="range" min="0" max="3600" value="300" step="30" onchange="settimesliderresult(this);">
                        <script>
                        function settimesliderresult(slider) {
                            var div = document.getElementById("timesliderresult");
                            var time = slider.value;
                            var text = "";
                            if (Math.floor(time / 3600) > 0) {
                                text += Math.floor(time / 3600) + "h";
                                time %= 3600;
                            }
                            if (Math.floor(time / 60) > 0) {
                                text += Math.floor(time / 60) + "m";
                                time %= 60;
                            }
                            text += time + "s";
                            div.innerHTML = text;
                        }
                        </script>
                        <div id="timesliderresult"></div>
                        {% endif %}
                </li>
98 99 100
            </ul>
        </div>
    </div>
Robin Sonnabend's avatar
Robin Sonnabend committed
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124
    <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>
Robin Sonnabend's avatar
Robin Sonnabend committed
125 126 127 128 129 130 131 132 133
    {% if topic.event.paused %}
    <div class="mdl-cell mdl-cell--12-col mdl-cell--8-col-tablet mdl-cell--4-col-phone mdl-card mdl-shadow--2dp">
        <div class="mdl-card__title rede-paused-title">
            <h4 class="mdl-card__title-text rede-paused-title-text">
                Paused until {{ topic.event.paused_until.strftime("%H:%M") }}
            </h4>
        </div>
    </div>
    {% endif %}
134
{% endblock %}