From 80b0ab5252a83d41d0d4822756048c12d3ef6c1e Mon Sep 17 00:00:00 2001 From: Emanuel Schuetze Date: Tue, 5 Feb 2013 11:24:41 +0100 Subject: [PATCH] template: Updated dashboard. Fixed ajax functionality. Adapted style. --- .../projector/static/javascript/dashboard.js | 67 +++++++----------- .../projector/static/styles/dashboard.css | 47 ++---------- .../projector/control_countdown.html | 37 +++++----- .../projector/control_overlay_message.html | 19 +++-- .../projector/custom_slide_widget.html | 1 - .../templates/projector/dashboard.html | 2 +- .../templates/projector/live_view_widget.html | 1 - .../templates/projector/overlay_widget.html | 23 +++--- .../static/img/glyphicons_256_delete.png | Bin 0 -> 992 bytes openslides/static/styles/base.css | 7 +- 10 files changed, 80 insertions(+), 124 deletions(-) create mode 100644 openslides/static/img/glyphicons_256_delete.png diff --git a/openslides/projector/static/javascript/dashboard.js b/openslides/projector/static/javascript/dashboard.js index 02eb44d4e..454accbff 100644 --- a/openslides/projector/static/javascript/dashboard.js +++ b/openslides/projector/static/javascript/dashboard.js @@ -15,11 +15,12 @@ function saveOrder() { $.cookie(cookieName, order, { path: "/", expiry: new Date(2012, 1, 1)}); }); } + // function that restores the widget list order from a cookie function restoreOrder() { $(".column").each(function(index, value) { var colid = value.id; - var cookieName = "cookie-" + colid + var cookieName = "cookie-" + colid; var cookie = $.cookie(cookieName); if ( cookie == null ) { return; } var IDs = cookie.split(","); @@ -38,38 +39,7 @@ $(function() { stop: function() { saveOrder(); } }); - restoreOrder(); - - if ($.browser.msie) { - if ($.browser.version >= 8.0 && $.browser.version < 9.0) - { - /* scaling bug in IE8.. iframe has to be 4 times bigger */ - $( "#iframe" ).css('width', 1024 * 4); - $( "#iframe" ).css('height', 768 * 4); - } - $( "#iframe" ).css('zoom', '0.25'); - } - - $('a.overlay').click(function(event) { - event.preventDefault(); - var link = $(this); - $.ajax({ - type: 'GET', - url: $(this).attr('href'), - dataType: 'json', - success: function(data) { - if (data['active']) { - $('#' + data['def_name'] + '_active').show(); - $('#' + data['def_name'] + '_inactive').hide(); - } else { - $('#' + data['def_name'] + '_active').hide(); - $('#' + data['def_name'] + '_inactive').show(); - } - }, - }); - }); - - // control the projector + // control the projector view $('.projector_edit').click(function(event) { event.preventDefault(); var link = $(this); @@ -87,7 +57,6 @@ $(function() { event.preventDefault(); var link = $(this); var requestData = {}; - if (link.attr('id') == "countdown_set") { requestData = { "countdown_time" : $( "#countdown_time" ).val() }; } @@ -109,7 +78,8 @@ $(function() { }); }); - $('.countdown_visible_link').click(function(event) { + // activate/deactivate overlay + $('.overlay_activate_link').click(function(event) { event.preventDefault(); var link = $(this); $.ajax({ @@ -117,13 +87,13 @@ $(function() { url: link.attr('href'), dataType: 'json', success: function(data) { - if (data.countdown_visible == "True") { - newclass = 'open'; + if (data['active']) { + $('#' + data['def_name'] + '_active').show(); + $('#' + data['def_name'] + '_inactive').hide(); } else { - newclass = 'closed'; + $('#' + data['def_name'] + '_active').hide(); + $('#' + data['def_name'] + '_inactive').show(); } - link.removeClass('closed open').addClass(newclass); - link.attr('href', data.link); } }); }); @@ -134,4 +104,21 @@ $(function() { $('#overlay_message_text').val(data['overlay_message']); } }); + +/* comment out this function because '$.browser' has been removed from jquery 1.9, see: + http://blog.jquery.com/2013/01/15/jquery-1-9-final-jquery-2-0-beta-migrate-final-released/ + TODO: use jquery migrate to have $.browser support for IE8; + + if ($.browser.msie) { + if ($.browser.version >= 8.0 && $.browser.version < 9.0) + { + // scaling bug in IE8.. iframe has to be 4 times bigger + $( "#iframe" ).css('width', 1024 * 4); + $( "#iframe" ).css('height', 768 * 4); + } + $( "#iframe" ).css('zoom', '0.25'); + } +*/ + + restoreOrder(); }); diff --git a/openslides/projector/static/styles/dashboard.css b/openslides/projector/static/styles/dashboard.css index 0266e64c2..fd5134bdb 100644 --- a/openslides/projector/static/styles/dashboard.css +++ b/openslides/projector/static/styles/dashboard.css @@ -54,9 +54,12 @@ -moz-border-radius: 0 0 5px 5px; -webkit-border-radius: 0 0 5px 5px; } -.widget-content li{ +.widget-content li { padding: 4px 0; } +.widget-content .overlay_list li { + padding-bottom: 10px; +} .widget-content ul { list-style: none inside none; margin: 0; @@ -74,15 +77,13 @@ visibility: hidden; } -/*.projector_countdown_spinval {*/ +.overlay_list .form-inline { + margin: 5px 0 0 31px; +} #countdown_time { width: 40px; } -#overlay_message_text { - width: 90%; - height: 12px; -} /* iframe */ #iframe { @@ -95,7 +96,6 @@ width: 1024px; height: 768px; } - #iframewrapper { width: 256px;/*100%;*/ height: 192px;/*230px;*/ @@ -103,7 +103,6 @@ overflow: hidden; border: 1px solid #D5D5D5; } - #iframeoverlay { width: 256px; height: 192px; @@ -113,35 +112,3 @@ display: block; z-index: 1; } - -/* activate link */ -a.activate_link div { - background-image: url(../images/icons/accept-grey.png); - background-repeat: no-repeat; - float: left; - width: 16px; - height: 16px; - padding-right: 12px; - position: relative; - top: 4px; - left: 4px; -} -a.activate_link.active div { - background-image: url(../images/icons/accept.png); -} - -a.overlay div { - background-image: url(../images/icons/accept-grey.png); - background-repeat: no-repeat; - float: left; - width: 16px; - height: 16px; - padding-right: 16px; - position: relative; - top: 4px; - left: 4px; -} - -a.overlay.active div { - background-image: url(../images/icons/accept.png); -} diff --git a/openslides/projector/templates/projector/control_countdown.html b/openslides/projector/templates/projector/control_countdown.html index a2c93248a..837666093 100644 --- a/openslides/projector/templates/projector/control_countdown.html +++ b/openslides/projector/templates/projector/control_countdown.html @@ -1,24 +1,21 @@ -{% load staticfiles %} {% load i18n %} {% load tags %} - -
-
- - {% trans "s" context "seconds" %} -
- - - - - - - - +
+
+ + {% trans "s" context "seconds" %}
- + + + + + + + + +
diff --git a/openslides/projector/templates/projector/control_overlay_message.html b/openslides/projector/templates/projector/control_overlay_message.html index 5c9c205ed..ee10ace99 100644 --- a/openslides/projector/templates/projector/control_overlay_message.html +++ b/openslides/projector/templates/projector/control_overlay_message.html @@ -1,15 +1,14 @@ -{% load staticfiles %} {% load i18n %} {% load tags %} -
{% csrf_token %} -
- - - +{% csrf_token %} +
+ + +
diff --git a/openslides/projector/templates/projector/custom_slide_widget.html b/openslides/projector/templates/projector/custom_slide_widget.html index 64445a72c..f4c805047 100644 --- a/openslides/projector/templates/projector/custom_slide_widget.html +++ b/openslides/projector/templates/projector/custom_slide_widget.html @@ -1,4 +1,3 @@ -{% load staticfiles %} {% load i18n %} {% load tags %} diff --git a/openslides/projector/templates/projector/dashboard.html b/openslides/projector/templates/projector/dashboard.html index 76e50a0c8..11d5f3a7b 100644 --- a/openslides/projector/templates/projector/dashboard.html +++ b/openslides/projector/templates/projector/dashboard.html @@ -9,9 +9,9 @@ {% endblock %} {% block javascript %} - + {% endblock %} {% block content %} diff --git a/openslides/projector/templates/projector/live_view_widget.html b/openslides/projector/templates/projector/live_view_widget.html index fbcb4cb95..cd49a453f 100644 --- a/openslides/projector/templates/projector/live_view_widget.html +++ b/openslides/projector/templates/projector/live_view_widget.html @@ -1,6 +1,5 @@ {% load i18n %} {% load tags %} -{% load staticfiles %} {% if perms.projector.can_manage_projector %} diff --git a/openslides/projector/templates/projector/overlay_widget.html b/openslides/projector/templates/projector/overlay_widget.html index 51d68f8da..415590221 100644 --- a/openslides/projector/templates/projector/overlay_widget.html +++ b/openslides/projector/templates/projector/overlay_widget.html @@ -1,24 +1,29 @@ {% load i18n %} {% load tags %} -
    +
      {% for overlay in overlays %}
    • - - + + + + + - {# TODO: Call the html via overlay.html #} {% if overlay.def_name == "Countdown" %} -

      {{ overlay }}:
      + {% trans "Countdown" %}:
      {% include 'projector/control_countdown.html' %} -

      {% endif %} {% if overlay.def_name == "Message" %} - {{ overlay }}:
      + {% trans "Message" %}:
      {% include 'projector/control_overlay_message.html' %} {% endif %}
    • diff --git a/openslides/static/img/glyphicons_256_delete.png b/openslides/static/img/glyphicons_256_delete.png new file mode 100644 index 0000000000000000000000000000000000000000..81282f990032b88eb44001fe50f21e83d4e851ed GIT binary patch literal 992 zcmV<610Vc}P)4Tx04R}-l+Q~PVHn51vyB)iL11Qkh@nGBs7w}RMCGo(*tBg~f0Po$?CiU{ zle4qa%26U(f|ru*d1uDm5$(qdGxK?$AK&MB z-{F0M8d)(-JtP5n!?BWmQR({Vm{j`_Asj&+!l+YJ+l(X<1E9fUv1@F;hrqupt$X|b zI_lE4ng@jaKh%lTb}(f=ak3uu6-!kMZ8FSKs7BM z|C+c%%_(W1MkH>@24YeH&g(_h@8=*r^~@L^r0;R+=`OQ-d=_TXN_RhT8}a8f>+a#2 z#Pb=gH%8n{&sxUn9rjo_p*gW3k3%Dd9v|?z$wwEp4JbjhwM#!rpOV)g4O?IHuKzA8qHe6NWHQ4?5 zW?+>pP^lFuS83d>RC0Yby(58Yf7(5YU7B8Os@7T+7jCT7FHP^*tHQ2TvC67;&Z}|3 zd?p?hPl_?ILp%pbyd-vt7sYOxofiix8N;NaVZv3ip-`5AN%ERI{+SmG@2t6_p^q8N z(o~6`|AbY@XgUiV(SNxAbMSk`qp>3J!UhhXuG%(|?j0gDE>~^N72v`*x)0t~ZOwEZ z4m|-D&ZtGJ}8;WLk96sqPn3I;4%{fxLET5GkbR{t#`+_*~}`j zbQ|opTV)z)wgo( z>e{6^v><|mOUEv*f~%W@{c9YWzuf;~FN70L63)4ah=6|L9D4)~1s*Eyqa2!{sT#`o z?O+bw70o}1PZ(p19j>v=S_AiIY`x$TLyR!Mrs(rnDV6ym;^gWfxpoJx@K%tm;%lYY z$8)RLi->RB;ysIv