remove AgendaSummary

This commit is contained in:
Oskar Hahn 2012-04-15 11:33:26 +02:00
parent 1d5455f8f9
commit a46e96841b
5 changed files with 1 additions and 101 deletions

View File

@ -1,22 +0,0 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
openslides.agenda.api
~~~~~~~~~~~~~~~~~~~~~
Useful functions for the agenda app.
:copyright: 2011 by the OpenSlides team, see AUTHORS.
:license: GNU GPL, see LICENSE for more details.
"""
from config.models import config
def is_summary():
"""
True, if a summery shall be displayed
"""
if config['agenda_summary']:
return True
return False

View File

@ -24,7 +24,6 @@ from config.models import config
from projector.projector import SlideMixin from projector.projector import SlideMixin
from projector.api import register_slidemodel from projector.api import register_slidemodel
from agenda.api import is_summary
from utils.translation_ext import ugettext as _ from utils.translation_ext import ugettext as _
@ -53,22 +52,8 @@ class Item(MPTTModel, SlideMixin):
'title': self.title, 'title': self.title,
'template': 'projector/AgendaText.html', 'template': 'projector/AgendaText.html',
} }
if is_summary():
data['items'] = self.children.all()
data['template'] = 'projector/AgendaSummary.html'
return data return data
def set_active(self, summary=False):
"""
Appoint this item as the active one.
"""
super(Item, self).set_active()
if summary:
config["agenda_summary"] = True
else:
config["agenda_summary"] = False
def set_closed(self, closed=True): def set_closed(self, closed=True):
""" """
Changes the closed-status of the item. Changes the closed-status of the item.

View File

@ -1,20 +0,0 @@
{% extends "base-projector.html" %}
{% load i18n %}
{% block title %}{{ block.super }} -
{% if title %} {{ title }} {% else %} {%trans "Agenda" %} {% endif %}
{% endblock %}
{% block content %}
{% if title %}
<h1>{{ title }}</h1>
{% else %}
<h1>{%trans "Agenda" %}</h1>
{% endif %}
<ul class="itemlist">
{% for item in items %}
<li{% if item.closed %} class="closed"{% endif %}>{{ item }}</li>
{% endfor %}
</ul>
{% endblock %}

View File

@ -11,7 +11,7 @@
""" """
from django.conf.urls.defaults import * from django.conf.urls.defaults import *
from agenda.views import Overview, View, SetActive, SetClosed, ItemUpdate, ItemCreate, ItemDelete, AgendaPDF from agenda.views import Overview, View, SetClosed, ItemUpdate, ItemCreate, ItemDelete, AgendaPDF
urlpatterns = patterns('', urlpatterns = patterns('',
url(r'^$', url(r'^$',
@ -24,18 +24,6 @@ urlpatterns = patterns('',
name='item_view', name='item_view',
), ),
url(r'^(?P<pk>\d+)/activate/$',
SetActive.as_view(),
{'summary': False},
name='item_activate',
),
url(r'^(?P<pk>\d+)/activate/summary/$',
SetActive.as_view(),
{'summary': True},
name='item_activate_summary',
),
url(r'^(?P<pk>\d+)/close/$', url(r'^(?P<pk>\d+)/close/$',
SetClosed.as_view(), SetClosed.as_view(),
{'closed': True}, {'closed': True},

View File

@ -27,7 +27,6 @@ from config.models import config
from projector.api import get_active_slide, set_active_slide from projector.api import get_active_slide, set_active_slide
from agenda.models import Item from agenda.models import Item
from agenda.api import is_summary
from agenda.forms import ItemOrderForm, ItemForm, ConfigForm from agenda.forms import ItemOrderForm, ItemForm, ConfigForm
@ -40,7 +39,6 @@ class Overview(TemplateView):
context.update({ context.update({
'items': Item.objects.all(), 'items': Item.objects.all(),
'overview': get_active_slide(only_sid=True) == 'agenda_show', 'overview': get_active_slide(only_sid=True) == 'agenda_show',
'summary': is_summary(),
}) })
return context return context
@ -68,35 +66,6 @@ class View(DetailView):
context_object_name = 'item' context_object_name = 'item'
class SetActive(RedirectView, SingleObjectMixin):
"""
Set an Item as the active one.
"""
url = 'item_overview'
allow_ajax = True
permission_required = 'agenda.can_manage_agenda'
model = Item
def get_ajax_context(self, **kwargs):
context = super(SetActive, self).get_ajax_context(**kwargs)
context.update({
'active': kwargs['pk'],
'summary': is_summary(),
})
return context
def pre_redirect(self, request, *args, **kwargs):
summary = kwargs['summary']
if kwargs['pk'] == "0":
set_active_slide("agenda_show")
else:
self.object = self.get_object()
self.object.set_active(summary)
config["bigger"] = 100
config["up"] = 0
return super(SetActive, self).pre_redirect(request, *args, **kwargs)
class SetClosed(RedirectView, SingleObjectMixin): class SetClosed(RedirectView, SingleObjectMixin):
""" """
Close or open an Item. Close or open an Item.