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

5 6 7 8 9 10 11 12
{% block additional_js %}
<script src="{{ url_for("static", filename="js/nextbutton.js") }}" async></script>
{% endblock %}

{% block additional_sidelinks %}
<a class="mdl-navigation__link" href="javascript:void(0)" onclick="setkeyhash()"><i class="mdl-color-text--blue-grey-400 material-icons">phonelink_setup</i> Set Presenter key</a>
{% endblock %}

13 14 15 16
{% 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>
Hinrikus Wolf's avatar
Hinrikus Wolf committed
17
		<tr>
18 19
                    <th class="mdl-data-table__cell-non-numeric rede-large-text" style="text-align:center;" colspan="4"> Event – {{ topic.event.name }}</th>
                    <th class="mdl-data-table__cell-non-numeric rede-medium-text" style="text-align:center;"><a href="{{ url_for(".event_edit", id=topic.event.id) }}"><i class="material-icons">edit</i></a></th>
Hinrikus Wolf's avatar
Hinrikus Wolf committed
20
		</tr>
21
                <tr>
Hinrikus Wolf's avatar
Hinrikus Wolf committed
22 23 24
                    <th class="mdl-data-table__cell-non-numeric rede-large-text" style="text-align:center;" colspan="3">{{ topic.name }}</th>
                    <th class="mdl-data-table__cell-non-numeric rede-medium-text" style="text-align:center;">{{ topic.mode }}</th>
                    <th class="mdl-data-table__cell-non-numeric rede-medium-text" style="text-align:center;"><a href="{{ url_for(".topic_edit", id=topic.id) }}"><i class="material-icons">edit</i></a></th>
25
                </tr>
26 27
                <tr>
                    <th class="mdl-data-table__cell--non-numeric">Speaker</th>
28
                    <th class="mdl-data-table__cell">Count</th>
29
                    <th class="mdl-data-table__cell--non-numeric">Done</th>
30
                    <th class="mdl-data-table__cell--non-numeric">Edit</th>
31 32 33 34 35
                    <th class="mdl-data-table__cell--non-numeric">Remove</th>
                </tr>
            </thead>
            <tbody>
            {% for statement in topic.sorted_statements() %}
36
                {% if statement.is_meta %}
Hinrikus Wolf's avatar
Hinrikus Wolf committed
37
                <tr class="mdl-color--red mdl-color-text--white">
38 39 40
                {% else %}
                <tr>
                {% endif %}
41
                    <td class="mdl-data-table__cell--non-numeric">{{ statement.speaker.identifier() }}</td>
42
                    <td class="mdl-data-table__cell">{{ statement.speaker.count(statement.topic) }}</td>
43 44 45 46 47
                    <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>
48 49 50 51 52 53
                    <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>
 
54 55 56 57 58 59 60 61 62 63
                    <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
64
    <div class="mdl-separator rede-separator"></div>
65
    <div class="mdl-cell mdl-cell--3-col mdl-cell--3-col-tablet mdl-cell--4-col-phone mdl-grid mdl-grid--no-spacing">
66
        {{ 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")] ) }}
67
        <div class="mdl-cell mdl-card mdl-shadow--2dp mdl-cell--12-col mdl-cell--8-col-tablet mdl-cell--4-col-phone">
68
            <ul class="rede-list-no-bullet">
Robin Sonnabend's avatar
Robin Sonnabend committed
69
                <li>
70 71 72 73 74 75 76 77 78 79 80 81 82 83
                    <table style="width: 100%">
                    <tr>
                    <td>
                    {% if can_undo_statement %}
                        <a href="{{ url_for(".statement_undo", topic_id=topic.id) }}" class="rede-href"><i class="material-icons" role="presentation">undo</i> Previous</a>
                    {% endif %}
                    </td>
                    <td>
                    {% if topic.sorted_statements()|length() > 0 %}
                        <a id="next-statement-button" href="{{ url_for(".statement_done", id=topic.sorted_statements()[0].id, topic_id=topic.id) }}" class="rede-href">Next <i class="material-icons" role="presentation">redo</i></a>
                    {% endif %}
                    </td>
                    <tr>
                    </table>
Robin Sonnabend's avatar
Robin Sonnabend committed
84
                </li>
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117
                <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>
118 119 120
            </ul>
        </div>
    </div>
Hinrikus Wolf's avatar
Hinrikus Wolf committed
121 122
    <div class="mdl-cell mdl-cell--3-col mdl-cell--3-col-tablet mdl-cell--4-col-phone mdl-grid mdl-grid--no-spacing">
	<div class="mdl-cell mdl-cell--12-col mdl-cell--8-col-tablet mdl-cell--4-col-phone mdl-card mdl-shadow--2dp" >
Robin Sonnabend's avatar
Robin Sonnabend committed
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144
        <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>
Hinrikus Wolf's avatar
Hinrikus Wolf committed
145
        <table style="width:100%" >
146 147 148 149 150 151 152 153
            <tr>
                <td>
                    <a href="{{ url_for(".topic_show", id=topic.get_previous_index()) }}"><i class="material-icons" style="heigth: 16pt; width:16pt;">arrow_backward</i>Previous</a>
                </td>
                <td>
                    <a href="{{ url_for(".topic_show", id=topic.get_next_index()) }}"> Next <i class="material-icons" style="height:16pt; width:16pt;">arrow_forward</i></a>   
                </td>
            </tr>
Hinrikus Wolf's avatar
Hinrikus Wolf committed
154
        </table>
155
    </div>
Robin Sonnabend's avatar
Robin Sonnabend committed
156
    </div>
Robin Sonnabend's avatar
Robin Sonnabend committed
157 158 159 160 161 162 163 164 165
    {% 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 %}
166
{% endblock %}