OpenSlides/openslides/mediafiles/widgets.py
Emanuel Schuetze 8d638a908d Added new angularjs templates
for agenda, motions, assignments, users and mediafiles apps.

Users app:
- Show permissions in group form (Fixed #1500)
- Added experimental csv import for users.

Agenda:
- new agenda sort view.
- Added experimental angular-xeditable for item-list view.

General:
- Added core.tag templates.
- Added mediafiles templates.
- Remove old template and js files. Remove old views.
- Skip old tests.

Added external angular modules:
- angular-loading-bar (Fixed #1448)
- ui-tree (for sorting agenda tree)
- ng-fab-forms (for better form validation)
- ui-bootstrap (for modal window, dropdown, popover)
- ngBootbox (for confirm delete dialogs in agenda and users app)
2015-05-06 09:19:16 +02:00

31 lines
1005 B
Python

from django.utils.translation import ugettext_lazy
from openslides.utils.widgets import Widget
from openslides.projector.api import get_active_slide
from .models import Mediafile
class PDFPresentationWidget(Widget):
"""
Widget for presentable PDF files.
"""
name = 'presentations'
verbose_name = ugettext_lazy('Presentations')
required_permission = 'core.can_manage_projector'
default_column = 1
default_weight = 75
template_name = 'mediafiles/widget_pdfpresentation.html'
icon_css_class = 'icon-align-left'
# javascript_files = None # TODO: Add pdf.js stuff here.
def get_context_data(self, **context):
pdfs = Mediafile.objects.filter(
filetype__in=Mediafile.PRESENTABLE_FILE_TYPES,
is_presentable=True)
current_page = get_active_slide().get('page_num', 1)
return super(PDFPresentationWidget, self).get_context_data(
pdfs=pdfs,
current_page=current_page,
**context)