admin_topic_show.html 9.81 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
{% block content %}
Hinrikus Wolf's avatar
Hinrikus Wolf committed
14
    <div class="mdl-cell mdl-cell--6-col mdl-cell--8-col-tablet mdl-cell--4-col-phone mdl-grid mdl-grid--no-spacing mdl-card ">
Hinrikus Wolf's avatar
Hinrikus Wolf committed
15 16 17 18 19 20 21 22 23
        <div class="mdl-shadow--2dp mdl-cell mdl-cell--12-col mdl-cell--8-col-tablet mdl-cell--4-col-phone">
	    <div class="mdl-card__title"> 
	       <h4 class="mdl-card__title-text"> Event: {{ topic.event.name }} <a href="{{ url_for(".event_edit", id=topic.event.id) }}"><i class="material-icons">edit</i></a></h4>
	    </div>
	    <div class="mdl-card__supporting rede-card__supporting">
		<h5 class="mdl-card__supporting-text rede-card__supporting-text"> {{ topic.name }} – {{ topic.mode }}  <a href="{{ url_for(".topic_edit", id=topic.id) }}"><i class="material-icons">edit</i></a> </h5>
	    </div>
	</div>
	
24 25
        <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
26
		 <tr>
27
                    <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">
Hinrikus Wolf's avatar
Hinrikus Wolf committed
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
    		    <td class="mdl-data-table__cell--non-numeric">{{ statement.speaker.identifier() }}</td>
                    <td class="mdl-data-table__cell">{{ statement.speaker.count(statement.topic) }}</td>
                    <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" style="color:white;">done</i>
                        </a>
                    </td>
                    <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" style="color:white;">edit</i>
                        </a>
                    </td>
 
                    <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" style="color:white;">cancel</i>
                        </a>
                    </td>
                </tr>

		
59 60
                {% else %}
                <tr>
Hinrikus Wolf's avatar
Hinrikus Wolf committed
61
              
62
                    <td class="mdl-data-table__cell--non-numeric">{{ statement.speaker.identifier() }}</td>
63
                    <td class="mdl-data-table__cell">{{ statement.speaker.count(statement.topic) }}</td>
64 65 66 67 68
                    <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>
69 70 71 72 73 74
                    <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>
 
75 76 77 78 79
                    <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>
Hinrikus Wolf's avatar
Hinrikus Wolf committed
80 81 82
                </tr  >
		{% endif %}
             {% endfor %}
83 84 85
            </tbody>
        </table>
    </div>
Robin Sonnabend's avatar
Robin Sonnabend committed
86
    <div class="mdl-separator rede-separator"></div>
Hinrikus Wolf's avatar
Hinrikus Wolf committed
87 88
    <div class="mdl-cell mdl-cell--3-col mdl-cell--3-col-tablet mdl-cell--4-col-phone mdl-grid mdl-grid--no-spacing mdl-card ">
    <div class="mdl-cell mdl-cell--12-col mdl-cell-8-col-tablet mdl-cell--4-col-phone mdl-grid mdl-grid--no-spacing">
89
        {{ 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")] ) }}
Hinrikus Wolf's avatar
Hinrikus Wolf committed
90
     </div>
91
        <div class="mdl-cell mdl-card mdl-shadow--2dp mdl-cell--12-col mdl-cell--8-col-tablet mdl-cell--4-col-phone">
92
            <ul class="rede-list-no-bullet">
Robin Sonnabend's avatar
Robin Sonnabend committed
93
                <li>
94 95 96 97
                    <table style="width: 100%">
                    <tr>
                    <td>
                    {% if can_undo_statement %}
98
                        <a id="previous-statement-button" href="{{ url_for(".statement_undo", topic_id=topic.id) }}" class="rede-href"><i class="material-icons" role="presentation">undo</i> Previous</a>
99 100 101 102 103 104 105 106 107
                    {% 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
108
                </li>
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141
                <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>
142 143 144
            </ul>
        </div>
    </div>
Hinrikus Wolf's avatar
Hinrikus Wolf committed
145
    <div class="mdl-cell mdl-cell--3-col mdl-cell--3-col-tablet mdl-cell--4-col-phone mdl-grid mdl-grid--no-spacing mdl-card">
Hinrikus Wolf's avatar
Hinrikus Wolf committed
146
	<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
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168
        <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
169
        <table style="width:100%" >
170 171 172 173 174 175 176 177
            <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
178
        </table>
179
    </div>
Robin Sonnabend's avatar
Robin Sonnabend committed
180
    </div>
Robin Sonnabend's avatar
Robin Sonnabend committed
181 182 183 184 185 186 187 188 189
    {% 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 %}
190
{% endblock %}