#98: Add new filter for active/inactive items.

This commit is contained in:
Emanuel Schuetze 2012-04-18 18:29:31 +02:00
parent e9e9fa54b2
commit 4ce8facd1a
4 changed files with 23 additions and 37 deletions

View File

@ -65,19 +65,25 @@ $(function() {
}
});
});
// hide closed items
$('#action_field span').after($('<a id="hidelink" class="hidelink hide" title="hide" href="#"><span></span></a>').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);
}
});

View File

@ -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);
}

View File

@ -5,7 +5,7 @@
{% if item.active %}activeline{% endif %}">
<td>
{% if perms.agenda.can_manage_agenda %}
<a class="close_link {% if item.closed %}closed{% else %}open{% endif %}" href="{% if item.closed %}{% url item_open item.id %}{% else %}{% url item_close item.id %}{% endif %}">
<a class="close_link {% if item.closed %}closed{% endif %}" href="{% if item.closed %}{% url item_open item.id %}{% else %}{% url item_close item.id %}{% endif %}">
<span></span>
</a>
{% elif item.closed %}

View File

@ -40,6 +40,12 @@
{% block content %}
<h1>{% trans "Agenda" %}</h1>
<p>
{%trans "Filter" %}:
<input type="checkbox" id="hide_closed_items"> {%trans "Hide closed items" %}
</p>
{{ items|length }} {% trans "items" %}<span id="hiddencount"></span>
{% if items %}
<form action="/agenda/" method="post">{% csrf_token %}
{% if perms.agenda.can_manage_agenda %}
@ -50,7 +56,6 @@
</em>
</div>
{% endif %}
<table id="menu-overview" class="agendatable">
<tr>
<th style="width: 1px;">{% trans "Done" %}</th>
@ -63,13 +68,9 @@
<tr class="topline {% if overview %}activeline{% endif %}">
<td></td>
<td>
<b>{% trans "Agenda" %} ({{ items|length }} {% trans "items" %}<span id="hiddencount"></span>)</b>
</td>
<td>
<span id="action_field" style="width: 1px; white-space: nowrap;">
<span></span>
</span>
<b>{% trans "Agenda" %}</b>
</td>
<td></td>
</tr>
{% for item in items %}