AVersion fixes: Added reject confirm message. Style changes.

This commit is contained in:
Emanuel Schuetze 2011-09-04 19:07:45 +02:00
parent 3b2763e2dc
commit 30afe96fc0
2 changed files with 12 additions and 8 deletions

View File

@ -229,9 +229,10 @@
{% if application.versions|length > 1 %}
<h2>{% trans "Version History" %}:</h2>
<table class="table valigntop">
<table class="table valigntop" style="width: auto;">
<tr>
<th>#</th>
<th></th>
<th>{% trans "Version" %}</th>
<th>{% trans "Time" %}</th>
<th>{% trans "Title" %}</th>
<th>{% trans "Text" %}</th>
@ -240,7 +241,7 @@
</tr>
{% for revision in application.versions %}
<tr class="{% cycle 'odd' '' %}">
<td>{{ revision.aid }}
<td style="white-space:nowrap;">
{% if application.status != "pub" %}
{% if revision == application.permitted %}
<img title="{%trans 'Version accepted' %}" src="/static/images/icons/task-accepted.png">
@ -257,6 +258,7 @@
{% endif %}
{% endif %}
</td>
<td>{{ revision.aid }}</td>
<td><i>{{ revision.time }}</i></td>
<td>
{% ifchanged %}

View File

@ -362,7 +362,6 @@ def view_poll(request, poll_id):
def permit_version(request, aversion_id):
aversion = AVersion.objects.get(pk=aversion_id)
application = aversion.application
if request.method == 'POST':
application.accept_version(aversion)
messages.success(request, _("Version <b>%s</b> accepted.") % (aversion.aid))
@ -375,9 +374,12 @@ def permit_version(request, aversion_id):
def reject_version(request, aversion_id):
aversion = AVersion.objects.get(pk=aversion_id)
application = aversion.application
if application.reject_version(aversion):
messages.success(request, _("Version rejected") )
if request.method == 'POST':
if application.reject_version(aversion):
messages.success(request, _("Version <b>%s</b> rejected.") % (aversion.aid))
else:
messages.error(request, _("ERROR by rejecting the version.") )
else:
messages.error(request, _("ERROR by rejecting the Version") )
gen_confirm_form(request, _('Do you really want to reject version <b>%s</b>?') % aversion.aid, reverse('application_version_reject', args=[aversion.id]))
return redirect(reverse('application_view', args=[application.id]))