OpenSlides/openslides/motion/widgets.py
Norman Jäckel 1fb1f17d15 New API for widgets using a metaclass.
It is now possible to define a default state and to submit extra stylefiles and javascript files when defining a widget in an app. This is done by a new metaclass in openslides.utils.dispatch. Also fixed some other tests.
2013-12-01 21:30:12 +01:00

26 lines
643 B
Python

# -*- coding: utf-8 -*-
from django.utils.translation import ugettext_lazy
from openslides.utils.widgets import Widget
from .models import Motion
class MotionWidget(Widget):
"""
Motion widget.
"""
name = 'motion'
verbose_name = ugettext_lazy('Motions')
permission_required = 'projector.can_manage_projector'
default_column = 1
default_weight = 40
template_name = 'motion/widget_motion.html'
more_link_pattern_name = 'motion_list'
def get_context_data(self, **context):
return super(MotionWidget, self).get_context_data(
motions=Motion.objects.all(),
**context)