AVersion fixes: Added reject confirm message. Style changes.
This commit is contained in:
parent
3b2763e2dc
commit
30afe96fc0
@ -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 %}
|
||||
|
@ -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))
|
||||
@ -374,10 +373,13 @@ def permit_version(request, aversion_id):
|
||||
@permission_required('application.can_manage_application')
|
||||
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") )
|
||||
application = aversion.application
|
||||
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]))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user