From 4ce8facd1a63bf3b4d4fce8722ead4a9b54a4fcb Mon Sep 17 00:00:00 2001 From: Emanuel Schuetze Date: Wed, 18 Apr 2012 18:29:31 +0200 Subject: [PATCH] #98: Add new filter for active/inactive items. --- openslides/agenda/static/javascript/agenda.js | 14 ++++++--- openslides/agenda/static/styles/agenda.css | 29 +++---------------- .../agenda/templates/agenda/item_row.html | 2 +- .../agenda/templates/agenda/overview.html | 15 +++++----- 4 files changed, 23 insertions(+), 37 deletions(-) diff --git a/openslides/agenda/static/javascript/agenda.js b/openslides/agenda/static/javascript/agenda.js index 0dfdfd92d..f834c5e69 100644 --- a/openslides/agenda/static/javascript/agenda.js +++ b/openslides/agenda/static/javascript/agenda.js @@ -65,19 +65,25 @@ $(function() { } }); }); - // hide closed items - $('#action_field span').after($('').click(function () { + // filter to show/hide closed items + $('#hide_closed_items').click(function(event) { + // show all items if ($.cookie('Slide.HideClosed') == 1) { $.cookie('Slide.HideClosed', 0); hideClosedSlides(false); - } else { + $('#hide_closed_items').attr('checked', false); + } + else { // hide closed items $.cookie('Slide.HideClosed', 1); hideClosedSlides(true); + $('#hide_closed_items').attr('checked', true); } - })); + }); if ($.cookie('Slide.HideClosed') === null) { + $('#hide_closed_items').attr('checked', false); $.cookie('Slide.HideClosed', 0); } else if ($.cookie('Slide.HideClosed') == 1) { hideClosedSlides(true); + $('#hide_closed_items').attr('checked', true); } }); diff --git a/openslides/agenda/static/styles/agenda.css b/openslides/agenda/static/styles/agenda.css index 42cde9622..3983d3826 100644 --- a/openslides/agenda/static/styles/agenda.css +++ b/openslides/agenda/static/styles/agenda.css @@ -1,4 +1,5 @@ -a.close_link.closed span { +/* agenda item open/closed */ +a.close_link span { background-image: url(../images/icons/task-complete-grey.png); background-repeat: no-repeat; background-position: center; @@ -6,32 +7,11 @@ a.close_link.closed span { height: 16px; display: inline-block; } -a.close_link.open span { +a.close_link.closed span { background-image: url(../images/icons/task-complete.png); - background-repeat: no-repeat; - background-position: center; - width: 16px; - height: 16px; - display: inline-block; } -a.hidelink.hide span { - background-image: url(../images/icons/layer-visible-off.png); - background-repeat: no-repeat; - background-position: center; - width: 16px; - height: 16px; - display: inline-block; -} -a.hidelink.show span { - background-image: url(../images/icons/layer-visible-on.png); - background-repeat: no-repeat; - background-position: center; - width: 16px; - height: 16px; - display: inline-block; -} -/* activate link */ +/* agenda item inactive/active */ a.activate_link span { background-image: url(../images/icons/task-accepted-grey.png); background-repeat: no-repeat; @@ -43,4 +23,3 @@ a.activate_link span { a.activate_link.active span { background-image: url(../images/icons/task-accepted.png); } - diff --git a/openslides/agenda/templates/agenda/item_row.html b/openslides/agenda/templates/agenda/item_row.html index d43a41fdc..b2c9d5676 100644 --- a/openslides/agenda/templates/agenda/item_row.html +++ b/openslides/agenda/templates/agenda/item_row.html @@ -5,7 +5,7 @@ {% if item.active %}activeline{% endif %}"> {% if perms.agenda.can_manage_agenda %} - + {% elif item.closed %} diff --git a/openslides/agenda/templates/agenda/overview.html b/openslides/agenda/templates/agenda/overview.html index dd6eb24f4..90e9447aa 100644 --- a/openslides/agenda/templates/agenda/overview.html +++ b/openslides/agenda/templates/agenda/overview.html @@ -40,6 +40,12 @@ {% block content %}

{% trans "Agenda" %}

+ +

+ {%trans "Filter" %}: + {%trans "Hide closed items" %} +

+ {{ items|length }} {% trans "items" %} {% if items %}
{% csrf_token %} {% if perms.agenda.can_manage_agenda %} @@ -50,7 +56,6 @@ {% endif %} - @@ -63,13 +68,9 @@ - + {% for item in items %}