fix hide-closed-item function for non-manager

This commit is contained in:
Oskar Hahn 2012-07-04 13:12:07 +02:00
parent 76d2a33fc2
commit 7f2d10c9ca
4 changed files with 19 additions and 17 deletions

View File

@ -4,7 +4,7 @@
* :copyright: 2011, 2012 by OpenSlides team, see AUTHORS. * :copyright: 2011, 2012 by OpenSlides team, see AUTHORS.
* :license: GNU GPL, see LICENSE for more details. * :license: GNU GPL, see LICENSE for more details.
*/ */
function hideLine(object) { function hideLine(object) {
if (object == []) { if (object == []) {
return; return;
@ -18,7 +18,7 @@ function hideLine(object) {
function hideClosedSlides(hide) { function hideClosedSlides(hide) {
if (hide) { if (hide) {
$('#hidelink').attr('title','show'); $('#hidelink').attr('title', 'show');
$('#hidelink').removeClass('hide').addClass('show'); $('#hidelink').removeClass('hide').addClass('show');
$('.close_link.closed').parent().parent().each(function() { $('.close_link.closed').parent().parent().each(function() {
hideLine($(this)); hideLine($(this));
@ -60,7 +60,7 @@ $(function() {
$.cookie('Slide.HideClosed', 0); $.cookie('Slide.HideClosed', 0);
hideClosedSlides(false); hideClosedSlides(false);
$('#hide_closed_items').attr('checked', false); $('#hide_closed_items').attr('checked', false);
} }
else { // hide closed items else { // hide closed items
$.cookie('Slide.HideClosed', 1); $.cookie('Slide.HideClosed', 1);
hideClosedSlides(true); hideClosedSlides(true);

View File

@ -6,7 +6,7 @@
*/ */
/* agenda item open/closed */ /* agenda item open/closed */
a.close_link span { .close_link span {
background-image: url(../images/icons/done-grey.png); background-image: url(../images/icons/done-grey.png);
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: center; background-position: center;
@ -14,7 +14,8 @@ a.close_link span {
height: 16px; height: 16px;
display: inline-block; display: inline-block;
} }
a.close_link.closed span {
.close_link.closed span {
background-image: url(../images/icons/done.png); background-image: url(../images/icons/done.png);
} }

View File

@ -3,13 +3,15 @@
{% load tags %} {% load tags %}
<td> <td>
{% if perms.agenda.can_manage_agenda %} <span class="close_link{% if item.closed %} closed{% 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 %}"> {% if perms.agenda.can_manage_agenda %}
<span></span> <a href="{% if item.closed %}{% url item_open item.id %}{% else %}{% url item_close item.id %}{% endif %}">
</a> <span></span>
{% elif item.closed %} </a>
{% elif item.closed %}
<img src="{% static 'images/icons/done.png' %}" title="{% trans 'Item closed' %}"> <img src="{% static 'images/icons/done.png' %}" title="{% trans 'Item closed' %}">
{% endif %} {% endif %}
</span>
</td> </td>
<td> <td>
{% for p in item.get_ancestors %} {% for p in item.get_ancestors %}

View File

@ -10,13 +10,13 @@
{% block header %} {% block header %}
<link type="text/css" rel="stylesheet" media="all" href="{% static 'styles/tabledrag.css' %}" /> <link type="text/css" rel="stylesheet" media="all" href="{% static 'styles/tabledrag.css' %}" />
<link type="text/css" rel="stylesheet" media="all" href="{% static 'styles/agenda.css' %}" /> <link type="text/css" rel="stylesheet" media="all" href="{% static 'styles/agenda.css' %}" />
<script type="text/javascript" src="{% static 'javascript/agenda.js' %}"></script>
<script type="text/javascript" src="{% static 'javascript/jquery.cookie.js' %}"></script>
{% if perms.agenda.can_manage_agenda %} {% if perms.agenda.can_manage_agenda %}
<script type="text/javascript" src="{% static 'javascript/jquery.once.js' %}"></script> <script type="text/javascript" src="{% static 'javascript/jquery.once.js' %}"></script>
<script type="text/javascript" src="{% static 'javascript/jquery.cookie.js' %}"></script>
<script type="text/javascript" src="{% static 'javascript/jquery.tmpl.js' %}"></script> <script type="text/javascript" src="{% static 'javascript/jquery.tmpl.js' %}"></script>
<script type="text/javascript" src="{% static 'javascript/tabledrag.js' %}"></script> <script type="text/javascript" src="{% static 'javascript/tabledrag.js' %}"></script>
<script type="text/javascript" src="{% static 'javascript/agenda.js' %}"></script>
<script type="text/javascript"> <script type="text/javascript">
<!--//--><![CDATA[//><!-- <!--//--><![CDATA[//><!--
//This is Drupal Code //This is Drupal Code
@ -33,7 +33,7 @@
} }
}); });
//--><!]]> //--><!]]>
</script> </script>
{% endif %} {% endif %}
{% endblock %} {% endblock %}
@ -93,8 +93,7 @@
</tr> </tr>
{% if items %} {% if items %}
{% for item in items %} {% for item in items %}
<tr class="draggable{% cycle ' odd' '' %} <tr class="itemline draggable{% cycle ' odd' '' %}{% if item.active %} activeline{% endif %}">
{% if item.active %}activeline{% endif %}">
{% include "agenda/item_row.html" %} {% include "agenda/item_row.html" %}
</tr> </tr>
{% endfor %} {% endfor %}