Numbering of agenda items, part 2.
Config item agenda_agenda_fixed removed'. Config items agenda_agenda_fixed and agenda_enable_auto_numbering removed. FixAgendaView and ResetAgendaView removed. AgendaNumberingView added. Old two fix- and reset numbering buttons replaced by 'Number agenda items'.
This commit is contained in:
parent
5254cc83a6
commit
f8bd4b0d86
@ -164,10 +164,8 @@ class Item(SlideMixin, AbsoluteUrlMixin, MPTTModel):
|
|||||||
Return the title of this item.
|
Return the title of this item.
|
||||||
"""
|
"""
|
||||||
if not self.content_object:
|
if not self.content_object:
|
||||||
if config['agenda_enable_auto_numbering']:
|
item_no = self.item_no
|
||||||
item_no = self.item_no
|
return '%s %s' % (item_no, self.title) if item_no else self.title
|
||||||
return '%s %s' % (item_no, self.title) if item_no else self.title
|
|
||||||
return self.title
|
|
||||||
try:
|
try:
|
||||||
return self.content_object.get_agenda_title()
|
return self.content_object.get_agenda_title()
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
@ -306,12 +304,8 @@ class Item(SlideMixin, AbsoluteUrlMixin, MPTTModel):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def item_no(self):
|
def item_no(self):
|
||||||
if config['agenda_agenda_fixed']:
|
if self.item_number:
|
||||||
item_number = self.item_number
|
item_no = '%s %s' % (config['agenda_number_prefix'], self.item_number)
|
||||||
else:
|
|
||||||
item_number = self.calc_item_no()
|
|
||||||
if item_number:
|
|
||||||
item_no = '%s %s' % (config['agenda_number_prefix'], item_number)
|
|
||||||
else:
|
else:
|
||||||
item_no = None
|
item_no = None
|
||||||
return item_no
|
return item_no
|
||||||
|
@ -60,13 +60,6 @@ def setup_agenda_config(sender, **kwargs):
|
|||||||
help_text=ugettext_lazy('[Begin speach] starts the countdown, [End speach] stops the countdown.'),
|
help_text=ugettext_lazy('[Begin speach] starts the countdown, [End speach] stops the countdown.'),
|
||||||
required=False))
|
required=False))
|
||||||
|
|
||||||
agenda_enable_auto_numbering = ConfigVariable(
|
|
||||||
name='agenda_enable_auto_numbering',
|
|
||||||
default_value=False,
|
|
||||||
form_field=forms.BooleanField(
|
|
||||||
label=ugettext_lazy('Enable automatic numbering of agenda items'),
|
|
||||||
required=False))
|
|
||||||
|
|
||||||
agenda_number_prefix = ConfigVariable(
|
agenda_number_prefix = ConfigVariable(
|
||||||
name='agenda_number_prefix',
|
name='agenda_number_prefix',
|
||||||
default_value='',
|
default_value='',
|
||||||
@ -86,10 +79,6 @@ def setup_agenda_config(sender, **kwargs):
|
|||||||
('roman', ugettext_lazy('Roman'))),
|
('roman', ugettext_lazy('Roman'))),
|
||||||
required=False))
|
required=False))
|
||||||
|
|
||||||
agenda_agenda_fixed = ConfigVariable(
|
|
||||||
name='agenda_agenda_fixed',
|
|
||||||
default_value=False)
|
|
||||||
|
|
||||||
extra_stylefiles = ['css/jquery-ui-timepicker.css']
|
extra_stylefiles = ['css/jquery-ui-timepicker.css']
|
||||||
extra_javascript = ['js/jquery/jquery-ui-timepicker-addon.min.js',
|
extra_javascript = ['js/jquery/jquery-ui-timepicker-addon.min.js',
|
||||||
'js/jquery/jquery-ui-sliderAccess.min.js',
|
'js/jquery/jquery-ui-sliderAccess.min.js',
|
||||||
@ -102,10 +91,8 @@ def setup_agenda_config(sender, **kwargs):
|
|||||||
variables=(agenda_start_event_date_time,
|
variables=(agenda_start_event_date_time,
|
||||||
agenda_show_last_speakers,
|
agenda_show_last_speakers,
|
||||||
agenda_couple_countdown_and_speakers,
|
agenda_couple_countdown_and_speakers,
|
||||||
agenda_enable_auto_numbering,
|
|
||||||
agenda_number_prefix,
|
agenda_number_prefix,
|
||||||
agenda_numeral_system,
|
agenda_numeral_system),
|
||||||
agenda_agenda_fixed),
|
|
||||||
extra_context={'extra_stylefiles': extra_stylefiles,
|
extra_context={'extra_stylefiles': extra_stylefiles,
|
||||||
'extra_javascript': extra_javascript})
|
'extra_javascript': extra_javascript})
|
||||||
|
|
||||||
|
@ -70,11 +70,9 @@
|
|||||||
{% else %}
|
{% else %}
|
||||||
<a href="{% url 'config_agenda' %}" class="btn btn-mini pull-right">{% trans 'Set start time of event' %}</a>
|
<a href="{% url 'config_agenda' %}" class="btn btn-mini pull-right">{% trans 'Set start time of event' %}</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if perms.agenda.can_manage_agenda and agenda_enable_auto_numbering %}
|
{% if perms.agenda.can_manage_agenda %}
|
||||||
<a href="{% url 'fix_agenda' %}"
|
<a href="{% url 'agenda_numbering' %}"
|
||||||
class="btn btn-mini pull-left" {% if agenda_numbering_fixed %}disabled="disabled"{% endif %}>{% trans 'Fix numbering' %}</a>
|
class="btn btn-mini pull-left">{% trans 'Number agenda items' %}</a>
|
||||||
<a href="{% url 'reset_agenda' %}"
|
|
||||||
class="btn btn-mini pull-left" {% if not agenda_numbering_fixed %}disabled="disabled"{% endif %}>{% trans 'Reset numbering' %}</a>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
@ -40,13 +40,9 @@ urlpatterns = patterns(
|
|||||||
views.AgendaPDF.as_view(),
|
views.AgendaPDF.as_view(),
|
||||||
name='print_agenda'),
|
name='print_agenda'),
|
||||||
|
|
||||||
url(r'^fix/$',
|
url(r'^numbering/$',
|
||||||
views.FixAgendaView.as_view(),
|
views.AgendaNumberingView.as_view(),
|
||||||
name='fix_agenda'),
|
name='agenda_numbering'),
|
||||||
|
|
||||||
url(r'^reset/$',
|
|
||||||
views.ResetAgendaView.as_view(),
|
|
||||||
name='reset_agenda'),
|
|
||||||
|
|
||||||
# List of speakers
|
# List of speakers
|
||||||
url(r'^(?P<pk>\d+)/speaker/$',
|
url(r'^(?P<pk>\d+)/speaker/$',
|
||||||
|
@ -112,8 +112,6 @@ class Overview(TemplateView):
|
|||||||
context.update({
|
context.update({
|
||||||
'items': items,
|
'items': items,
|
||||||
'agenda_is_active': agenda_is_active,
|
'agenda_is_active': agenda_is_active,
|
||||||
'agenda_enable_auto_numbering': config['agenda_enable_auto_numbering'],
|
|
||||||
'agenda_numbering_fixed': config['agenda_agenda_fixed'],
|
|
||||||
'duration': duration,
|
'duration': duration,
|
||||||
'start': start,
|
'start': start,
|
||||||
'end': end,
|
'end': end,
|
||||||
@ -345,38 +343,20 @@ class CreateRelatedAgendaItemView(SingleObjectMixin, RedirectView):
|
|||||||
self.item = Item.objects.create(content_object=self.object)
|
self.item = Item.objects.create(content_object=self.object)
|
||||||
|
|
||||||
|
|
||||||
class FixAgendaView(QuestionView):
|
class AgendaNumberingView(QuestionView):
|
||||||
permission_required = 'agenda.can_manage_agenda'
|
permission_required = 'agenda.can_manage_agenda'
|
||||||
question_url_name = 'item_overview'
|
question_url_name = 'item_overview'
|
||||||
url_name = 'item_overview'
|
url_name = 'item_overview'
|
||||||
question_message = ugettext_lazy('Do you really want to fix the agenda numbering?')
|
question_message = ugettext_lazy('Do you really want to generate agenda numbering? Manually added item numbers will be overwritten!')
|
||||||
url_name_args = []
|
url_name_args = []
|
||||||
|
|
||||||
def on_clicked_yes(self):
|
def on_clicked_yes(self):
|
||||||
config['agenda_agenda_fixed'] = True
|
|
||||||
for item in Item.objects.all():
|
for item in Item.objects.all():
|
||||||
item.item_number = item.calc_item_no()
|
item.item_number = item.calc_item_no()
|
||||||
item.save()
|
item.save()
|
||||||
|
|
||||||
def get_final_message(self):
|
def get_final_message(self):
|
||||||
return ugettext_lazy('The agenda has been fixed.')
|
return ugettext_lazy('The agenda has been numbered.')
|
||||||
|
|
||||||
|
|
||||||
class ResetAgendaView(QuestionView):
|
|
||||||
permission_required = 'agenda.can_manage_agenda'
|
|
||||||
question_url_name = 'item_overview'
|
|
||||||
url_name = 'item_overview'
|
|
||||||
question_message = ugettext_lazy('Do you really want to reset the agenda numbering?')
|
|
||||||
url_name_args = []
|
|
||||||
|
|
||||||
def on_clicked_yes(self):
|
|
||||||
config['agenda_agenda_fixed'] = False
|
|
||||||
for item in Item.objects.all():
|
|
||||||
item.item_number = ''
|
|
||||||
item.save()
|
|
||||||
|
|
||||||
def get_final_message(self):
|
|
||||||
return ugettext_lazy('The agenda has been reset.')
|
|
||||||
|
|
||||||
|
|
||||||
class AgendaPDF(PDFView):
|
class AgendaPDF(PDFView):
|
||||||
|
Loading…
Reference in New Issue
Block a user