From 787c8ed0c0e4c78d0b395c957874bc75b9415fa0 Mon Sep 17 00:00:00 2001
From: Robin Sonnabend <robin@fsmpi.rwth-aachen.de>
Date: Sun, 8 Nov 2015 17:15:00 +0100
Subject: [PATCH] Enabled nextbutton for admin-topic-show

---
 static/js/nextbutton.js         |  8 ++------
 templates/admin_topic_show.html | 10 +++++++++-
 2 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/static/js/nextbutton.js b/static/js/nextbutton.js
index 48060e4..dd14a48 100644
--- a/static/js/nextbutton.js
+++ b/static/js/nextbutton.js
@@ -8,12 +8,8 @@ function hashkey(e) {
 }
 
 function clickNextSpeaker() {
-    var rows = document.getElementById("next-speaker-table").rows;
-    if (rows.length > 1) {
-        var row = rows[1];
-        var a = row.children[2].childNodes[1];
-        a.click();
-    }
+    var link = document.getElementById("next-statement-button");
+    link.click();
 }
 
 window.onkeypress = function(e) {
diff --git a/templates/admin_topic_show.html b/templates/admin_topic_show.html
index 0bf7acc..6f0d576 100644
--- a/templates/admin_topic_show.html
+++ b/templates/admin_topic_show.html
@@ -2,6 +2,14 @@
 {% from "macros.html" import render_form %}
 {% block admin_title %}Topic - {{ topic.name }}{% endblock %}
 
+{% 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 %}
+
 {% 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">
@@ -56,7 +64,7 @@
             <ul class="rede-list-no-bullet">
                 {% 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>
+                    <a id="next-statement-button" 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", topic_id=topic.id) }}" class="rede-href"><i class="material-icons" role="presentation">undo</i> Previous</a></li>
-- 
GitLab