2013-11-14 01:16:14 +01:00
|
|
|
from django.utils.translation import ugettext_lazy
|
|
|
|
|
|
|
|
from openslides.utils.widgets import Widget
|
|
|
|
|
|
|
|
from .models import Assignment
|
|
|
|
|
|
|
|
|
|
|
|
class AssignmentWidget(Widget):
|
|
|
|
"""
|
|
|
|
Assignment widget.
|
|
|
|
"""
|
|
|
|
name = 'assignment'
|
|
|
|
verbose_name = ugettext_lazy('Elections')
|
2014-05-15 20:07:09 +02:00
|
|
|
required_permission = 'core.can_manage_projector'
|
2013-11-14 01:16:14 +01:00
|
|
|
default_column = 1
|
|
|
|
default_weight = 50
|
2015-03-26 05:36:10 +01:00
|
|
|
template_name = 'assignments/widget_assignment.html'
|
2013-11-14 01:16:14 +01:00
|
|
|
more_link_pattern_name = 'assignment_list'
|
|
|
|
|
|
|
|
def get_context_data(self, **context):
|
|
|
|
return super(AssignmentWidget, self).get_context_data(
|
|
|
|
assignments=Assignment.objects.all(),
|
|
|
|
**context)
|