diff --git a/openslides/agenda/templates/agenda/overview.html b/openslides/agenda/templates/agenda/overview.html index 977d862a0..9ce74c3ef 100644 --- a/openslides/agenda/templates/agenda/overview.html +++ b/openslides/agenda/templates/agenda/overview.html @@ -66,11 +66,11 @@
- {% trans "Agenda" %} ({{ items|length }} {% trans "items" %}) + {% trans "Agenda" %} ({{ items|length }} {% trans "items" %}) {% if perms.agenda.can_manage_agenda %} {% endif %} - + {% for item in items %} {% if not item.hidden or perms.agenda.can_manage_agenda %} diff --git a/openslides/static/javascript/agenda.js b/openslides/static/javascript/agenda.js index 5028234f6..b55c91f33 100644 --- a/openslides/static/javascript/agenda.js +++ b/openslides/static/javascript/agenda.js @@ -22,11 +22,36 @@ function renderSlide(slide) { return } +function hideLine(object) { + if (object == []) { + return; + } + object.hide(); + id = object.children('td.tabledrag-hide').children('input.menu-mlid').attr('value'); + $('.menu-plid[value=\'' + id + '\']').parent().parent().each(function() { + hideLine($(this)); + }); +} + + +function hideClosedSlides(hide) { + if (hide) { + $('#hidelink').text('show'); + $('.close_link.closed').parent().parent().each(function() { + hideLine($(this)); + }); + hidden = $('#menu-overview tr:hidden').size(); + $('#hiddencount').text(' ' + hidden + ' davon verborgen.'); + } else { + $('#menu-overview tr').show(); + $('#hidelink').text('hide'); + $('#hiddencount').text(''); + } + return false; +} + $(function() { - - - $('.activate_link').click(function(event) { event.preventDefault(); $.ajax({ @@ -61,5 +86,21 @@ $(function() { } }); }); + // hide closed items + $('#action_field a').after($('hide').click(function () { + if ($.cookie('Slide.HideClosed') == 1) { + $.cookie('Slide.HideClosed', 0); + hideClosedSlides(false); + } else { + $.cookie('Slide.HideClosed', 1); + hideClosedSlides(true); + } + })); + if ($.cookie('Slide.HideClosed') === null) { + $.cookie('Slide.HideClosed', 0); + } else if ($.cookie('Slide.HideClosed') == 1) { + hideClosedSlides(true); + } + ko.applyBindings(ViewModel); });