Added new button in assignment view template to show agenda item of selected assignment (for manager only).
This commit is contained in:
parent
6d7736d10d
commit
f26a19036b
@ -320,16 +320,12 @@ def unsupport(request, application_id):
|
||||
|
||||
|
||||
@permission_required('application.can_manage_application')
|
||||
@template('application/view.html')
|
||||
def set_active(request, application_id):
|
||||
print application_id
|
||||
item = Item.objects.get(itemapplication__application__id=application_id)
|
||||
print item.id
|
||||
item.set_active(False)
|
||||
# if request.is_ajax():
|
||||
# return ajax_request({'active': item.id})
|
||||
return redirect(reverse('application_view', args=[application_id]))
|
||||
|
||||
|
||||
@permission_required('application.can_manage_application')
|
||||
@template('application/view.html')
|
||||
def gen_poll(request, application_id):
|
||||
|
@ -41,6 +41,13 @@
|
||||
<span class="icon item">{%trans 'New agenda item' %}</span>
|
||||
</button>
|
||||
</a>
|
||||
{% else %}
|
||||
<h4></h4>
|
||||
<a href='{% url assignment_activate_item assignment.id %}'>
|
||||
<button>
|
||||
<span class="icon projector">{%trans 'Show agenda item' %}</span>
|
||||
</button>
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
@ -40,6 +40,9 @@ urlpatterns = patterns('assignment.views',
|
||||
url(r'^assignment/(?P<assignment_id>\d+)/delother/(?P<profile_id>\d+)$', 'delother', \
|
||||
name='assignment_delother'),
|
||||
|
||||
url(r'^assignment/(?P<assignment_id>\d+)/set_active/$', 'set_active',
|
||||
name='assignment_activate_item'),
|
||||
|
||||
url(r'^assignment/poll/(?P<poll_id>\d+)/print$', 'print_assignment_poll', \
|
||||
name='print_assignment_poll'),
|
||||
|
||||
|
@ -16,6 +16,7 @@ from django.contrib import messages
|
||||
from django.contrib.auth.decorators import login_required
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
from openslides.agenda.models import Item
|
||||
from poll.models import Poll, Option
|
||||
from poll.forms import OptionResultForm, PollForm
|
||||
from assignment.models import Assignment
|
||||
@ -182,6 +183,12 @@ def delother(request, assignment_id, profile_id):
|
||||
return redirect(reverse('assignment_view', args=assignment_id))
|
||||
|
||||
|
||||
@permission_required('assignment.can_manage_application')
|
||||
def set_active(request, assignment_id):
|
||||
item = Item.objects.get(itemassignment__assignment__id=assignment_id)
|
||||
item.set_active(False)
|
||||
return redirect(reverse('assignment_view', args=[assignment_id]))
|
||||
|
||||
@permission_required('assignment.can_manage_assignment')
|
||||
def gen_poll(request, assignment_id):
|
||||
try:
|
||||
|
Loading…
Reference in New Issue
Block a user