Added new button in application view template to show agenda item of selected appliation (for manager only).
This commit is contained in:
parent
e64e91c52d
commit
6d7736d10d
@ -49,7 +49,7 @@ class ApplicationManagerForm(ModelForm):
|
|||||||
|
|
||||||
users = User.objects.all().exclude(profile=None).order_by("first_name")
|
users = User.objects.all().exclude(profile=None).order_by("first_name")
|
||||||
submitter = UserModelChoiceField(queryset=users, label=_("Submitter"))
|
submitter = UserModelChoiceField(queryset=users, label=_("Submitter"))
|
||||||
supporter = UserModelMultipleChoiceField(queryset=users, label=_("Supporters"))
|
supporter = UserModelMultipleChoiceField(queryset=users, required=False, label=_("Supporters"))
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Application
|
model = Application
|
||||||
|
@ -39,6 +39,7 @@ class Application(models.Model):
|
|||||||
# support
|
# support
|
||||||
# unsupport
|
# unsupport
|
||||||
# createitem
|
# createitem
|
||||||
|
# activateitem
|
||||||
# genpoll
|
# genpoll
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -355,8 +356,11 @@ class Application(models.Model):
|
|||||||
actions.append("permitversion")
|
actions.append("permitversion")
|
||||||
actions.append("rejectversion")
|
actions.append("rejectversion")
|
||||||
|
|
||||||
if self.number and not self.itemapplication_set.all():
|
if self.number:
|
||||||
actions.append("createitem")
|
if self.itemapplication_set.all():
|
||||||
|
actions.append("activateitem")
|
||||||
|
else:
|
||||||
|
actions.append("createitem")
|
||||||
|
|
||||||
return actions
|
return actions
|
||||||
|
|
||||||
|
@ -161,6 +161,13 @@
|
|||||||
</a>
|
</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% if "activateitem" in actions %}
|
||||||
|
<h4></h4>
|
||||||
|
<a href='{% url application_activate_item application.id %}'>
|
||||||
|
<button><span class="icon projector">{%trans 'Show agenda item' %}</span></button>
|
||||||
|
</a>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% if "acc" in actions or "rej" in actions %}
|
{% if "acc" in actions or "rej" in actions %}
|
||||||
<h4>{% trans "Result after vote" %}:</h4>
|
<h4>{% trans "Result after vote" %}:</h4>
|
||||||
{% if "acc" in actions %}
|
{% if "acc" in actions %}
|
||||||
|
@ -59,6 +59,9 @@ urlpatterns = patterns('application.views',
|
|||||||
url(r'^application/(?P<application_id>\d+)/unsupport$', 'unsupport', \
|
url(r'^application/(?P<application_id>\d+)/unsupport$', 'unsupport', \
|
||||||
name='application_unsupport'),
|
name='application_unsupport'),
|
||||||
|
|
||||||
|
url(r'^application/(?P<application_id>\d+)/set_active/$', 'set_active',
|
||||||
|
name='application_activate_item'),
|
||||||
|
|
||||||
url(r'^application/(?P<application_id>\d+)/gen_poll$', 'gen_poll', \
|
url(r'^application/(?P<application_id>\d+)/gen_poll$', 'gen_poll', \
|
||||||
name='application_gen_poll'),
|
name='application_gen_poll'),
|
||||||
|
|
||||||
|
@ -16,6 +16,7 @@ from django.contrib.auth.decorators import login_required
|
|||||||
from django.core.urlresolvers import reverse
|
from django.core.urlresolvers import reverse
|
||||||
from django.utils.translation import ugettext as _
|
from django.utils.translation import ugettext as _
|
||||||
|
|
||||||
|
from openslides.agenda.models import Item
|
||||||
from openslides.application.models import Application, AVersion
|
from openslides.application.models import Application, AVersion
|
||||||
from openslides.application.forms import ApplicationForm, \
|
from openslides.application.forms import ApplicationForm, \
|
||||||
ApplicationManagerForm
|
ApplicationManagerForm
|
||||||
@ -318,6 +319,17 @@ def unsupport(request, application_id):
|
|||||||
return redirect(reverse('application_view', args=[application_id]))
|
return redirect(reverse('application_view', args=[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')
|
@permission_required('application.can_manage_application')
|
||||||
@template('application/view.html')
|
@template('application/view.html')
|
||||||
def gen_poll(request, application_id):
|
def gen_poll(request, application_id):
|
||||||
|
@ -368,6 +368,9 @@ button .undo{
|
|||||||
button .item{
|
button .item{
|
||||||
background:url(../images/icons/view-list-details.png) no-repeat 0px 0px;
|
background:url(../images/icons/view-list-details.png) no-repeat 0px 0px;
|
||||||
}
|
}
|
||||||
|
button .projector{
|
||||||
|
background:url(../images/icons/video-projector.png) no-repeat 0px 0px;
|
||||||
|
}
|
||||||
button .accept{
|
button .accept{
|
||||||
background:url(../images/icons/task-complete.png) no-repeat 0px 0px;
|
background:url(../images/icons/task-complete.png) no-repeat 0px 0px;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user