#106: Action column for applications.

#121 (partly): Activate links for agenda and applications table.
This commit is contained in:
Emanuel Schuetze 2012-04-20 22:43:12 +02:00
parent 6125f1d88b
commit 3886449b2c
9 changed files with 64 additions and 44 deletions

View File

@ -46,25 +46,6 @@ $(function() {
}
});
});
// activate an element to show it on projector
$('.activate_link').click(function(event) {
event.preventDefault();
link = $(this);
$.ajax({
type: 'GET',
url: $(this).attr('href'),
dataType: 'json',
data: '',
success: function(data) {
$('.activate_link').removeClass('active');
//$('li').removeClass('activeline');
link.addClass('active');
},
error: function () {
alert("Ajax Error");
}
});
});
// filter to show/hide closed items
$('#hide_closed_items').click(function(event) {
// show all items

View File

@ -10,16 +10,3 @@ a.close_link span {
a.close_link.closed span {
background-image: url(../images/icons/task-complete.png);
}
/* agenda item inactive/active */
a.activate_link span {
background-image: url(../images/icons/task-accepted-grey.png);
background-repeat: no-repeat;
background-position: center;
width: 16px;
height: 16px;
display: inline-block;
}
a.activate_link.active span {
background-image: url(../images/icons/task-accepted.png);
}

View File

@ -1,8 +1,6 @@
{% load i18n %}
{% load staticfiles %}
<tr class="draggable{% cycle ' odd' '' %}
{% if item.active %}activeline{% endif %}">
<td>
{% if perms.agenda.can_manage_agenda %}
<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 %}">
@ -24,7 +22,7 @@
{% if perms.agenda.can_manage_agenda %}
<td>
<span style="width: 1px; white-space: nowrap;">
<a class="activate_link {% if item.active %}active{% endif %}" href="{% url projector_activate_slide item.sid %}">
<a class="activate_link {% if item.active %}active{% endif %}" href="{% url projector_activate_slide item.sid %}" title="{% trans 'Activate item' %}">
<span></span>
</a>
<a href="{% url item_edit item.id %}"><img src="{% static 'images/icons/document-edit.png' %}" title="{% trans 'Edit item' %}"></a>
@ -39,4 +37,3 @@
{% endwith %}
</td>
{% endif %}
</tr>

View File

@ -78,7 +78,10 @@
</tr>
{% for item in items %}
<tr class="draggable{% cycle ' odd' '' %}
{% if item.active %}activeline{% endif %}">
{% include "agenda/item_row.html" %}
</tr>
{% endfor %}
{% else %}
<tr>

View File

@ -43,7 +43,7 @@
{% endif %}
{# PDF #}
<li><a href="{% url print_application application.id %}"><img src="{% static 'images/icons/application-pdf.png' %}"> {%trans 'Application as PDF' %}</a></li>
{# application polls #}
{# activate and polls #}
{% if perms.projector.can_manage_projector %}
<li><a href="{% url projector_activate_slide application.sid %}"><img src="{% static 'images/icons/video-projector.png' %}"> {%trans 'Show Application' %}</a></li>
{% if "genpoll" in actions %}

View File

@ -2,6 +2,7 @@
{% load tags %}
{% load i18n %}
{% load staticfiles %}
{% block title %}{{ block.super }} - {%trans "Applications" %}{% endblock %}
@ -39,9 +40,11 @@
<th><a href="?sort=status{% if 'status' in request.GET.sort and 'reverse' not in request.GET %}&reverse{%endif%}">{%trans "Status" %}</a></th>
<th><a href="?sort=submitter{% if 'submitter' in request.GET.sort and 'reverse' not in request.GET %}&reverse{%endif%}">{%trans "Submitter" %}</a></th>
<th><a href="?sort=time{% if 'time' in request.GET.sort and 'reverse' not in request.GET %}&reverse{%endif%}">{%trans "Creation Time" %}<a></th>
<th style="width: 1px;">{% trans "Actions" %}</th>
</tr>
{% for application in applications %}
<tr class="{% cycle '' 'odd' %}">
<tr class="{% cycle '' 'odd' %}
{% if application.active %}activeline{% endif %}">
<td>{% if application.number %}{{ application.number }}{% else %}-{% endif %}</td>
<td><a href="{% url application_view application.id %}">{{ application }}</a></td>
{% if min_supporters > 0 %}
@ -57,10 +60,19 @@
</td>
<td>{{ application.submitter.profile }}</td>
<td>{{ application.creation_time }}</td>
<td>
<span style="width: 1px; white-space: nowrap;">
<a class="activate_link {% if application.active %}active{% endif %}" href="{% url projector_activate_slide application.sid %}" title="{% trans 'Activate item' %}">
<span></span>
</a>
<a href="{% url application_edit application.id %}"><img src="{% static 'images/icons/document-edit.png' %}" title="{% trans 'Edit application' %}"></a>
<a href="#"><img src="{% static 'images/icons/edit-delete.png' %}" title="{% trans 'Delete application' %}"></a>
</span>
</td>
</tr>
{% empty %}
<tr>
<td colspan="6"><i>{%trans "No applications available." %}</i></td>
<td colspan="7"><i>{%trans "No applications available." %}</i></td>
</tr>
{% endfor %}
</table>

View File

@ -50,7 +50,13 @@
</div>
</div>
<h1>{% trans "Application No." %} {{ application.number }}</h1>
<h1>
{% if application.number != None %}
{% trans "Application No." %} {{ application.number }}
{% else %}
{% trans "Application" %} <i>[{% trans "no number" %}]</i>
{% endif %}
</h1>
<h2>{{ application.title }}</h2>
<b>{{ application.title }}</b>
<p>

View File

@ -10,6 +10,26 @@ $(function () {
}, 1000);
}
});
// activate an element to show it on projector
$('.activate_link').click(function(event) {
event.preventDefault();
var link = $(this);
$.ajax({
type: 'GET',
url: $(this).attr('href'),
dataType: 'json',
data: '',
success: function(data) {
$('.activate_link').removeClass('active');
$('tr').removeClass('activeline');
link.parent().parent().parent().addClass('activeline');
link.addClass('active');
},
error: function () {
alert("Ajax Error");
}
});
});
});

View File

@ -230,9 +230,6 @@ table a.table_edit {
.agendatable td.dragcell {
padding: 0px 0 0px 10px;
}
.agendatable tr.activeline td, .activeline {
background-color: #bed4de;
}
.agendatable td img.center {
margin-left: 10px;
}
@ -589,3 +586,20 @@ ul.results {
.poll {
background:url("../images/icons/view-statistics.png") no-repeat 0px 0px;
}
/* inactive/active */
a.activate_link span {
background-image: url(../images/icons/task-accepted-grey.png);
background-repeat: no-repeat;
background-position: center;
width: 16px;
height: 16px;
display: inline-block;
}
a.activate_link.active span {
background-image: url(../images/icons/task-accepted.png);
}
tr.activeline td, .activeline {
background-color: #bed4de !important;
}