changeset 393:14cdbeb331b6

Moar work.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 05 Dec 2013 12:03:57 +0200
parents 5a34126297b1
children 560c709ecfad
files admajax.php admin.css admin.php createdb.php showajax.php
diffstat 5 files changed, 119 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/admajax.php	Thu Dec 05 11:35:21 2013 +0200
+++ b/admajax.php	Thu Dec 05 12:03:57 2013 +0200
@@ -446,7 +446,48 @@
     //
     switch ($type)
     {
-      case "infosys":
+      case "infoEditList":
+        echo
+          "<div class=\"ctrlBox\" id=\"ctrlEditRotationList\">\n".
+          "  <div class=\"ctrlTitle\">Edit rotation list</div>\n".
+          "  ".stGetFormTextInput(30, 128, "fdsaf", "", "", "")."<br />\n".
+          stGetOptionList("ctrlEDRotationLists",
+            "SELECT * FROM displaySlides WHERE id=1",
+            "title",
+            0,
+            "selectedListSlide(this)").
+          stGetOptionList("ctrlEDDisplaySlides",
+            "SELECT displaySlides.* FROM displaySlides ".
+            "LEFT JOIN displayListSlides ON displaySlides.id=displayListSlides.slide_id ".
+            "WHERE displayListSlides.list_id=1 ".
+            "ORDER BY displayListSlides.order_num DESC",
+            "title",
+            0,
+            "selectedDisplaySlide(this)").
+          "  <div class=\"ctrlButtons\">\n".
+          "    ".stGetFormButtonInput("addslide", "", "", "Add slide", "addListSlide()")."\n".
+          "    ".stGetFormButtonInput("delslide", "", "", "Remove slide", "removeListSlide()")."\n".
+          "  </div>\n".
+          "</div>\n";
+        break;
+
+      case "infoEditSlide":
+        echo
+          "<div class=\"ctrlBox\" id=\"ctrlEditDisplaySlide\">\n".
+          "  <form method=\"post\" action=\"\" onsubmit=\"return updateDisplaySlide()\">\n".
+          "  <div class=\"ctrlTitle\">Create a new display slide</div>\n".
+          "  ".stGetFormTextInput(40, 128, "fdsaf", "", "", "")."<br />\n".
+          "  ".stGetFormTextArea(5, 40, "asdf", "", "", "")."<br />\n".
+          "  <div class=\"ctrlButtons\">\n".
+          "    ".stGetFormButtonInput("cancelslide", "", "", "Clear", "this.form.reset()")."\n".
+          "    ".stGetFormButtonInput("cancelslide", "", "", "Cancel", "cancelDisplaySlide()")."\n".
+          "    ".stGetFormSubmitInput("createslide", "Create slide")."\n".
+          "  </div>\n".
+          "  </form>\n".
+          "</div>\n";
+        break;
+
+      case "info":
         $showMode = stGetDisplayVar("showMode");
         echo
           "<div id=\"ctrlGlobalControls\">\n".
@@ -462,6 +503,66 @@
           stGetFormButtonInput("regenerate", "", "", " ReGenerate ALL show positions ", "generateEntryPositions(0, 0)")."\n".
           "</div>\n".
           "</div>\n";
+
+        echo
+          "<div class=\"ctrlBox\" id=\"ctrlListRotationLists\">\n".
+          "  <div class=\"ctrlTitle\">Rotation lists:</div>\n".
+          stGetOptionList("ctrlRotationLists",
+            "SELECT * FROM displayListData ORDER BY id DESC",
+            "name",
+            0,
+            "selectedRotationList(this)").
+          "  <div class=\"ctrlButtons\">\n".
+          "    ".stGetFormButtonInput("sellist", "", "", "Set Active", "activateRotationList()")."\n".
+          "    ".stGetFormButtonInput("newlist", "", "", "Edit", "newRotationList()")."\n".
+          "    ".stGetFormButtonInput("newlist", "", "", "New", "newRotationList()")."\n".
+          "    ".stGetFormButtonInput("dellist", "", "", "Delete", "deleteRotationList()")."\n".
+          "  </div>\n".
+          "</div>\n";
+
+        echo
+          "<div class=\"ctrlBox\" id=\"ctrlListDisplaySlides\">\n".
+          "<div class=\"ctrlTitle\">Display slides:</div>\n".
+          stGetOptionList("ctrlDisplaySlides",
+            "SELECT * FROM displaySlides ORDER BY id DESC",
+            "title",
+            0,
+            "selectedDisplaySlide(this)").
+          "  <div class=\"ctrlButtons\">\n".
+          "    ".stGetFormTextInput(3, 5, "tempDuration", "", "", stGetDisplayVar("tempDuration"))." min\n".
+          "    ".stGetFormButtonInput("setslide", "", "", "Set Temp", "activateTempSlide()")."\n".
+          "    ".stGetFormButtonInput("newslide", "", "", "New", "newDisplaySlide()")."\n".
+          "    ".stGetFormButtonInput("delslide", "", "", "Delete", "deleteDisplaySlide()")."\n".
+          "  </div>\n".
+          "</div>\n";
+
+        echo
+          "<div class=\"ctrlBox\" id=\"ctrlCompoControl\">\n".
+          "<div class=\"ctrlTitle\">Competition control:</div>\n".
+          "<div class=\"ctrlDBox\">\n".
+          stGetOptionList("ctrlCompoList",
+            "SELECT * FROM compos ORDER BY id DESC",
+            "name",
+            0,
+            "selectedCompo(this)").
+          "  <div class=\"ctrlButtons\">\n".
+          "    ".stGetFormButtonInput("setcompo", "", "", "Change compo", "activateCompo()")."\n".
+          "  </div>\n".
+          "</div>\n".
+          "<div class=\"ctrlDBox\">\n".
+          stGetOptionList("ctrlEntryList",
+            "SELECT * FROM entries WHERE compo_id=3 ORDER BY show_id ASC",
+            "name",
+            0,
+            "selectedCompo(this)").
+          "  <div class=\"ctrlButtons\">\n".
+          "    ".stGetFormButtonInput("setentry", "", "", "Set selected entry", "setSelectedEntry()")."\n".
+          "    ".stGetFormButtonInput("nextentry", "", "", "Prev entry", "gotoPrevEntry()")."\n".
+          "    ".stGetFormButtonInput("preventry", "", "", "Next entry", "gotoNextEntry()")."\n".
+          "  </div>\n".
+          "</div>\n".
+          "</div>\n";
+
         break;
 
       case "news":
--- a/admin.css	Thu Dec 05 11:35:21 2013 +0200
+++ b/admin.css	Thu Dec 05 12:03:57 2013 +0200
@@ -144,7 +144,11 @@
 
 #ctrlEditRotationList {
 	min-height: 10em;
-	width: 20em;
+	width: 40em;
+}
+
+#ctrlEditRotationList input {
+	display: inline;
 }
 
 #ctrlListRotationLists {
@@ -157,6 +161,15 @@
 	width: 20em;
 }
 
+#ctrlCompoControl {
+	display: block;
+	min-height: 10em;
+}
+
+div.ctrlDBox {
+	max-width: 50%;
+	display: inline-block;
+}
 
 div.ctrlBox .selectBox {
 	width: 100%;
--- a/admin.php	Thu Dec 05 11:35:21 2013 +0200
+++ b/admin.php	Thu Dec 05 12:03:57 2013 +0200
@@ -160,7 +160,7 @@
     case "Attendees": refreshItems("tabContCCAttendees", "attendees", ""); break;
     case "Voting": refreshItems("tabContCCVoting", "voters", ""); break;
     case "Compos": refreshItems("tabContCCCompos", "compos", ""); break;
-    case "InfoSys": refreshItems("tabContCCInfoSys", "infosys", ""); break;
+    case "InfoSys": refreshItems("tabContCCInfoSys", "info", ""); break;
     case "Entries": refreshCCEntries(); break;
   }
 }
--- a/createdb.php	Thu Dec 05 11:35:21 2013 +0200
+++ b/createdb.php	Thu Dec 05 12:03:57 2013 +0200
@@ -187,7 +187,7 @@
   "showMode"          => array(VT_INT, 0, "Currently active display mode"),
   "rotateDuration"    => array(VT_INT, 15, "Slide rotation time per slide (seconds)"),
 
-  "tempDuration"      => array(VT_INT, 120, "Temporary slide display time (seconds)"),
+  "tempDuration"      => array(VT_INT, 5, "Temporary slide display time (minutes)"),
   "tempSlide"         => array(VT_INT, 0, "Temporary slide ID"),
 
   "compoID"           => array(VT_INT, 0, "Compo ID of current compo"),
--- a/showajax.php	Thu Dec 05 11:35:21 2013 +0200
+++ b/showajax.php	Thu Dec 05 12:03:57 2013 +0200
@@ -109,7 +109,7 @@
     stSetDisplayVar("tempSlideSet", FALSE);
     stSetDisplayVar("activeSlideMode", SMODE_ROTATE);
     stSetDisplayVar("activeSlide", stGetDisplayVar("tempSlide"));
-    stSetDisplayVar("activeSlideExpire", time() + stGetDisplayVar("tempDuration"));
+    stSetDisplayVar("activeSlideExpire", time() + stGetDisplayVar("tempDuration") * 60);
     $updated = TRUE;
   }
 }