Updated template and some minor fixed for list of speakers. Updated projector slide.

This commit is contained in:
Emanuel Schuetze 2013-04-14 00:20:35 +02:00 committed by Oskar Hahn
parent fa95119936
commit 1a416e5726
7 changed files with 121 additions and 84 deletions

View File

@ -63,7 +63,7 @@ class ItemOrderForm(CssClassMixin, forms.Form):
class AppendSpeakerForm(CssClassMixin, forms.Form):
speaker = PersonFormField(
widget=forms.Select(attrs={'class': 'medium-input'}),
label=ugettext_lazy("Set a person to the speaker list."))
label=ugettext_lazy("Add participant"))
def __init__(self, item, *args, **kwargs):
self.item = item
@ -73,6 +73,6 @@ class AppendSpeakerForm(CssClassMixin, forms.Form):
speaker = self.cleaned_data['speaker']
if Speaker.objects.filter(person=speaker, item=self.item, time=None).exists():
raise forms.ValidationError(ugettext_lazy(
'%s is allready on the list of speakers.'
% speaker))
'%s is already on the list of speakers.'
% unicode(speaker)))
return speaker

View File

@ -34,15 +34,6 @@ function hideClosedSlides(hide) {
return false;
}
function toggleOldSpeakers() {
$('#show_old_speakers').toggle();
$('#old_speakers').toggle();
}
$('.toggle_old_speakers > a').click(function() {
toggleOldSpeakers();
});
$('#speaker_list_changed_form').submit(function() {
$('#sort_order').val($('#list_of_speakers').sortable("toArray"));
});
@ -95,9 +86,6 @@ $(function() {
//# $('#hide_closed_items').attr('checked', true);
//# }
// List of Speakers
toggleOldSpeakers();
$('#list_of_speakers').sortable({axis: "y", containment: "parent", update: function(event, ui) {
$('#speaker_list_changed_form').show();
}});

View File

@ -21,3 +21,7 @@ table#agendatime td {
padding: 3px;
white-space: nowrap;
}
#list_of_speakers li {
line-height: 30px;
}

View File

@ -6,6 +6,10 @@
{% block title %}{{ block.super }} {{ item.title }}{% endblock %}
{% block header %}
<link type="text/css" rel="stylesheet" media="all" href="{% static 'styles/agenda.css' %}" />
{% endblock %}
{% block javascript %}
{{ block.super }}
{% comment %} TODO: import the sortable-plugin in our custom jquery-file {% endcomment %}
@ -19,12 +23,12 @@
<small class="pull-right">
<div class="btn-toolbar">
<a href="{% url 'item_overview' %}" class="btn btn-mini"><i class="icon-chevron-left"></i> {% trans "Back to overview" %}</a>
{% if perms.agenda.can_manage_agenda %}
<div class="btn-group">
<a data-toggle="dropdown" href="#" class="btn btn-mini dropdown-toggle">
{% trans 'More actions' %}
<span class="caret"></span>
</a>
{% if perms.agenda.can_manage_agenda %}
<ul class="dropdown-menu pull-right">
<li><a href="{% url 'item_edit' item.id %}"><i class="icon-edit"></i> {% trans 'Edit item' %}</a></li>
<li><a href="{% url 'item_delete' item.id %}"><i class="icon-remove"></i> {% trans 'Delete item' %}</a></li>
@ -32,8 +36,10 @@
{% endif %}
</div>
{% if perms.projector.can_manage_projector %}
<a href="{% url 'projector_activate_slide' item.sid %}" class="activate_link btn btn-mini {% if item.active %}btn-primary{% endif %}" rel="tooltip" data-original-title="{% trans 'Show' %}">
<i class="icon icon-facetime-video {% if item.active %}icon-white{% endif %}"></i>
<a href="{% url 'projector_activate_slide' item.sid %}"
class="activate_link btn btn-mini {% if item.active and not show_list %}btn-primary{% endif %}"
rel="tooltip" data-original-title="{% trans 'Show' %}">
<i class="icon icon-facetime-video {% if item.active and not show_list %}icon-white{% endif %}"></i>
</a>
{% endif %}
</div>
@ -43,43 +49,69 @@
{% if perms.agenda.can_manage_agenda %}
{% if item.comment %}
<h2>{% trans "Comment" %}</h2>
<h3>{% trans "Comment" %}</h3>
<p>{{ item.comment|linebreaks }}</p>
{% endif %}
{% endif %}
{# List of Speakers #}
<h2>{% trans "Speaker List" %}{% if item.speaker_list_closed %}({% trans 'Closed' %}){% endif %}</h2>
<h3>{% trans "List of speakers" %} {% if item.speaker_list_closed %}<span class="label label-important">{% trans 'closed' %}</span>{% endif %}</h3>
<p>
{% if perms.agenda.can_manage_agenda %}
{% if item.speaker_list_closed %}
<a href="{% url 'agenda_speaker_open' item.pk %}">{% trans 'Open list of speakers' %}</a>
<a href="{% url 'agenda_speaker_open' item.pk %}" class="btn btn-mini btn-danger">{% trans 'Open list' %}</a>
{% else %}
<a href="{% url 'agenda_speaker_close' item.pk %}">{% trans 'Close list of speakers' %}</a>
<a href="{% url 'agenda_speaker_close' item.pk %}" class="btn btn-mini btn-danger">{% trans 'Close list' %}</a>
{% endif %}
{% endif %}
{% if perms.projector.can_manage_projector %}
<a href="{% url 'projector_activate_slide' item.sid 'show_list_of_speakers' %}"
class="activate_link btn btn-mini {% if item.active and show_list %}btn-primary{% endif %}"
rel="tooltip" data-original-title="{% trans 'Show list of speakers' %}">
<i class="icon icon-facetime-video {% if item.active and show_list %}icon-white{% endif %}"></i>
{% trans 'Show list' %}
</a>
<p><a href="{% url 'projector_activate_slide' item.sid 'show_list_of_speakers' %}">Show list of speakers</a></p>
{% endif %}
</p>
{% if old_speakers %}
<div id="show_old_speakers" style="display:none" class="toggle_old_speakers">
<a href="#">{% trans "Show old speakers" %}</a>
{% if last_speaker %}
<p>{% trans "Last speaker:" %} <a href="{% model_url last_speaker %}">{{ last_speaker }}</a></p>
{% endif %}
<div class="well">
<b>{% trans "Last speakers:" %}</b>
<div class="btn-group" data-toggle="buttons-checkbox">
<button type="button" class="btn btn-mini" data-toggle="collapse" data-target="#all_speakers">
{% trans "Show all speakers" %}
</button>
</div>
<div id="old_speakers" class="toggle_old_speakers">
<a href="#">{% trans "Hide old speakers" %}</a>
<ol>
<br>
<div id="all_speakers" class="collapse out">
{% for speaker in old_speakers %}
<li>
{{ speaker.time }}
{% if not forloop.last %}
<small>{{forloop.counter}}.
[{{ speaker.time }}h]
<a href="{% model_url speaker %}">{{ speaker }}</a>
{% if perms.agenda.can_manage_agenda %}
<a href="{% model_url speaker 'delete' %}" title="{% trans 'Delete' %}" class="btn btn-mini">
<i class="icon-remove"></i>
</a>
</li>
{% endif %}
</small><br>
{% endif %}
{% endfor %}
</ol>
</div>
{% if old_speakers %}
{% with last=old_speakers|last %}
<small>{{ old_speakers|length }}.
[{{ last.time }}h]
<a href="{% model_url last %}">{{ last }}</a>
{% if perms.agenda.can_manage_agenda %}
<a href="{% model_url last 'delete' %}" title="{% trans 'Delete' %}" class="btn btn-mini">
<i class="icon-remove"></i>
</a>
{% endif %}
</small>
{% endwith %}
{% endif %}
</div>
{% endif %}
@ -95,38 +127,50 @@
</form>
{% endif %}
{% if speakers %}
<div class="well">
<b>{% trans "Next speakers:" %}</b>
<ol {% if perms.agenda.can_manage_agenda %}id="list_of_speakers"{% endif %}>
{% for speaker in speakers %}
<li id="speaker_{{ speaker.pk }}">
<a href="{% model_url speaker %}">{{ speaker }}</a>
<a href="{% url 'agenda_speaker_speak' item.pk speaker.person.person_id %}">speak</a>
{% if perms.agenda.can_manage_agenda %}
<a href="{% url 'agenda_speaker_speak' item.pk speaker.person.person_id %}" class="btn btn-mini"><i class="icon-bell"></i> Finished speech</a>
<a href="{% model_url speaker 'delete' %}" title="{% trans 'Delete' %}" class="btn btn-mini">
<i class="icon-remove"></i>
</a>
{% endif %}
</li>
{% empty %}
<i>{% trans "The list of speakers is empty." %}</i>
{% endfor %}
</ol>
{% else %}
<p>{% trans 'The list of speakers is empty' %}</p>
{% endif %}
<p>
{% if is_speaker %}
<a href="{% url 'agenda_speaker_delete' object.id %}">{% trans "Remove me vom speakers list." %}</a>
<a href="{% url 'agenda_speaker_delete' object.id %}" class="btn">{% trans "Remove me from the list" %}</a>
{% elif not object.speaker_list_closed %}
<a href="{% url 'agenda_speaker_append' object.id %}">{% trans "Put me on speakers list." %}</a>
<a href="{% url 'agenda_speaker_append' object.id %}" class="btn">{% trans "Put me on the list" %}</a>
{% endif %}
</p>
{% if perms.can_manage_agenda %}
<form action="" method="post">{% csrf_token %}
{{ form.as_p }}
{% for field in form %}
<label>{{ field.label }}:</label>
<div class="control-group input-append {% if field.errors %}error{% endif %}">
{{ field }}
<button class="btn btn-primary" type="submit" title="{% trans 'Apply' %}"><i class="icon-ok icon-white"></i></button>
{% if perms.participant.can_see_participant and perms.participant.can_manage_participant %}
<a href="{% url 'user_new' %}" class="btn" title="{% trans 'Add new participant' %}"><i class="icon-add-user"></i></a>
{% endif %}
{% if field.errors %}
<span class="help-inline">{{ field.errors }}</span>
{% endif %}
</div>
{% endfor %}
</form>
{% endif %}
</div>
{% endblock %}

View File

@ -10,7 +10,7 @@
{% block scrollcontent %}
{% if speakers %}
<ol>
<ol id="list_of_speakers">
{% for speaker in speakers %}
<li>{{ speaker }}</li>
{% endfor %}

View File

@ -129,17 +129,13 @@ class AgendaItemView(SingleObjectMixin, FormView):
self.object = self.get_object()
speakers = Speaker.objects.filter(time=None, item=self.object.pk).order_by('weight')
old_speakers = list(Speaker.objects.exclude(time=None).order_by('time'))
try:
last_speaker = old_speakers[-1]
except IndexError:
last_speaker = None
kwargs.update({
'object': self.object,
'speakers': speakers,
'old_speakers': old_speakers,
'last_speaker': last_speaker,
'is_speaker': Speaker.objects.filter(
time=None, person=self.request.user, item=self.object).exists(),
'show_list': config['presentation_argument'] == 'show_list_of_speakers',
})
return super(AgendaItemView, self).get_context_data(**kwargs)

View File

@ -146,7 +146,12 @@ body{
color: #9FA9B7;
list-style-type: none;
}
/* list of speakers */
#list_of_speakers li
{
font-size: 130%;
line-height: 160%;
}
/* Table */
table {