From 5237e1d90d74682fb09bd424c79ba2d462a36bf7 Mon Sep 17 00:00:00 2001 From: Emanuel Schuetze Date: Sun, 16 Jun 2013 00:44:41 +0200 Subject: [PATCH] Fixed #745 and #744: Make widgets fixable and collapsable. Fixed widget header style issues. --- .../static/img/glyphicons_335_pushpin.png | Bin 0 -> 979 bytes .../projector/static/javascript/dashboard.js | 10 ++++ .../projector/static/styles/dashboard.css | 38 ++++++++----- .../templates/projector/dashboard.html | 43 ++++++++++++--- .../templates/projector/live_view_widget.html | 50 ++++++++---------- tests/account/test_widgets.py | 2 +- 6 files changed, 94 insertions(+), 49 deletions(-) create mode 100644 openslides/projector/static/img/glyphicons_335_pushpin.png diff --git a/openslides/projector/static/img/glyphicons_335_pushpin.png b/openslides/projector/static/img/glyphicons_335_pushpin.png new file mode 100644 index 0000000000000000000000000000000000000000..a4ba1bb36f45f23365a773ba79dc0b5f8b6c8a93 GIT binary patch literal 979 zcmV;^11$WBP)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|o}EuSh=2xN^izM~h*3mnq0$Db;0iaKFe+&( zr3^5^AI1p|(Ziu`*dlPnf1V%MVETGC)B6MhcdV--4LT{76?nlo{XR4)7C0x|HhJw7mMl}I}EDn%<+R+nw__qUdtRYuaeEDU7y{Xe3z71jko{+002ovPDHLkV1lHo B$mak6 literal 0 HcmV?d00001 diff --git a/openslides/projector/static/javascript/dashboard.js b/openslides/projector/static/javascript/dashboard.js index c1aed73be..eb6a9f40c 100644 --- a/openslides/projector/static/javascript/dashboard.js +++ b/openslides/projector/static/javascript/dashboard.js @@ -104,6 +104,16 @@ $(function() { $('#overlay_message_text').val(data['overlay_message']); } }); + $('.fixbutton button').click(function (event) { + event.preventDefault(); + if($(this).hasClass('active')) { + $(this).closest('.widget').removeClass('affix'); + $(this).closest('.widget').removeAttr('data-spy'); + } else { + $(this).closest('.widget').addClass('affix'); + $(this).closest('.widget').attr('data-spy', 'affix'); + } + }); /* 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/ diff --git a/openslides/projector/static/styles/dashboard.css b/openslides/projector/static/styles/dashboard.css index e6f5b4266..bb649c1eb 100644 --- a/openslides/projector/static/styles/dashboard.css +++ b/openslides/projector/static/styles/dashboard.css @@ -14,8 +14,15 @@ .widget { margin: 0 10px 10px 0; } +.widget.affix { + position: fixed; + z-index: 100; + right: 20px; + top: 42px; + max-width: 40%; +} .widget-header { - height: 30px; + min-height: 30px; background: #E9E9E9; background:-moz-linear-gradient(top, #FAFAFA 0%, #E9E9E9 100%); /* FF3.6+ */ background:-webkit-gradient(linear, left top, left bottom, color-stop(0%,#FAFAFA), color-stop(100%,#E9E9E9)); /* Chrome,Safari4+ */ @@ -27,27 +34,31 @@ -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr='#FAFAFA', endColorstr='#E9E9E9')"; border: 1px solid #D5D5D5; border-radius: 5px 5px 0 0; - -moz-border-radius: 5px 5px 0 0; - -webkit-border-radius: 5px 5px 0 0; - } .widget-header h3 { - padding-left: 7px; - margin: 7px 0; - display: inline-block; + margin: 7px 0 7px 14px; font-size: 14px; color: #555; line-height: 18px; } - .widget-header [class^="icon-"], .widget-header [class*=" icon-"] { - display: inline-block; - margin: -2px 0 0 13px; + margin: -2px 5px 0 0px; color: #555; vertical-align: middle; } +.widget-header .collapsebutton, .widget-header .fixbutton{ + margin: -2px 4px 0 0px; +} +.widget-header .fixbutton{ + margin-left: 6px; +} +.widget-header .icon-pushpin { + background-image: url("../img/glyphicons_335_pushpin.png"); + background-position: 0 center; + margin-left:4px !important; +} .widget-content { - padding: 20px 15px 15px 13px; + padding: 0px 15px 0px 13px; background: #FFF; border: 1px solid #D5D5D5; border-radius: 0 0 5px 5px; @@ -97,11 +108,12 @@ height: 768px; } #iframewrapper { - width: 256px;/*100%;*/ - height: 192px;/*230px;*/ + width: 256px; + height: 192px; position: relative; overflow: hidden; border: 1px solid #D5D5D5; + margin-bottom: 10px; } #iframeoverlay { width: 256px; diff --git a/openslides/projector/templates/projector/dashboard.html b/openslides/projector/templates/projector/dashboard.html index 4e0ffbccf..6e12bd2c9 100644 --- a/openslides/projector/templates/projector/dashboard.html +++ b/openslides/projector/templates/projector/dashboard.html @@ -27,11 +27,24 @@ {% if widget.default_column == 1 %}
- -

{% trans widget.get_title %}

+

+ +
+ +
+
+ +
+ {% trans widget.get_title %} +

-
- {{ widget.html }} +
+
{{ widget.html }}
{% endif %} @@ -42,11 +55,25 @@ {% for name, widget in widgets.items %} {% if widget.default_column == 2 %}
-
-

{% trans widget.get_title %}

+
+

+ +
+ +
+
+ +
+ {% trans widget.get_title %} +

-
- {{ widget.html }} +
+
{{ widget.html }}
{% endif %} diff --git a/openslides/projector/templates/projector/live_view_widget.html b/openslides/projector/templates/projector/live_view_widget.html index 3c48813a1..32cd362e5 100644 --- a/openslides/projector/templates/projector/live_view_widget.html +++ b/openslides/projector/templates/projector/live_view_widget.html @@ -1,32 +1,5 @@ {% load i18n %} - -{% if perms.projector.can_manage_projector %} -
-

- - -
- - - -

-

- - -
- - - -

-

- - - -

-
-{% endif %} -
@@ -34,3 +7,26 @@
+ + +{% if perms.projector.can_manage_projector %} +

+ + + + + + +    + + + + + + +    + + + +

+{% endif %} diff --git a/tests/account/test_widgets.py b/tests/account/test_widgets.py index ba39d666a..4a603ff74 100644 --- a/tests/account/test_widgets.py +++ b/tests/account/test_widgets.py @@ -60,7 +60,7 @@ class PersonalInfoWidget(TestCase): def test_widget_appearance(self): response = self.client.get('/projector/dashboard/') - self.assertContains(response, '

My items, motions and elections

', status_code=200) + self.assertContains(response, 'My items, motions and elections', status_code=200) def test_item_list(self): agenda = self.import_agenda()