Automated merge with ssh://openslides.org/openslides

This commit is contained in:
Emanuel Schuetze 2011-09-04 00:54:52 +02:00
commit 63c68c9714
6 changed files with 50 additions and 2 deletions

View File

@ -46,6 +46,8 @@
</em> </em>
</div> </div>
{% endif %} {% endif %}
<a class="beamer_edit" href="{% url beamer_bigger %}">+</a> <a class="beamer_edit" href="{% url beamer_smaller %}">-</a> <br>
<a class="beamer_edit" href="{% url beamer_up %}">+</a> <a class="beamer_edit" href="{% url beamer_down %}">-</a> <br>
<table id="menu-overview" class="agendatable"> <table id="menu-overview" class="agendatable">
<tr> <tr>
<th style="width: 1px;">{% trans "Beamer" %}</th> <th style="width: 1px;">{% trans "Beamer" %}</th>
@ -60,9 +62,11 @@
</tr> </tr>
<tr id="item_row_0"{% if overview %} class="activeline"{% else %}{% if perms.agenda.can_manage_agenda %} class="inactiveline"{% endif %}{% endif %}> <tr id="item_row_0"{% if overview %} class="activeline"{% else %}{% if perms.agenda.can_manage_agenda %} class="inactiveline"{% endif %}{% endif %}>
<td class="select"> <td class="select">
{% if perms.agenda.can_manage_agenda %}
<a href="{% url item_activate 0 %}" class="activate_link"> <a href="{% url item_activate 0 %}" class="activate_link">
<div></div> <div></div>
</a> </a>
{% endif %}
</td> </td>
<td><i>{% trans "Agenda" %} ({{ items|length }} {% trans "items" %}<span id="hiddencount"></span>)</i></td> <td><i>{% trans "Agenda" %} ({{ items|length }} {% trans "items" %}<span id="hiddencount"></span>)</i></td>
{% if perms.agenda.can_manage_agenda %} {% if perms.agenda.can_manage_agenda %}
@ -79,7 +83,7 @@
<tr id="item_row_{{ item.id }}" class="draggable{% cycle ' odd' '' %} <tr id="item_row_{{ item.id }}" class="draggable{% cycle ' odd' '' %}
{% if item.active %} activeline{% else %} {% if item.active %} activeline{% else %}
{% if item.parent.active and summary %} activesummarychildline{% endif %} {% if item.parent.active and summary %} activesummarychildline{% endif %}
{% if perms.agenda.can_manage_aenda %} inactiveline{% endif %} {% if perms.agenda.can_manage_agenda %} inactiveline{% endif %}
{% endif %}"> {% endif %}">
<script type="text/javascript">$(function(){ViewModel.slides.push(new Slide({{ item.json|safe }}))});</script> <script type="text/javascript">$(function(){ViewModel.slides.push(new Slide({{ item.json|safe }}))});</script>
<td class="select"> <td class="select">

View File

@ -56,4 +56,12 @@ urlpatterns = patterns('agenda.views',
url(r'^item/print/$', 'print_agenda', url(r'^item/print/$', 'print_agenda',
name='print_agenda'), name='print_agenda'),
url(r'^beamer/bigger$', 'beamer_edit', {'direction': 'bigger'}, name='beamer_bigger'),
url(r'^beamer/smaller$', 'beamer_edit', {'direction': 'smaller'}, name='beamer_smaller'),
url(r'^beamer/up$', 'beamer_edit', {'direction': 'up'}, name='beamer_up'),
url(r'^beamer/down$', 'beamer_edit', {'direction': 'down'}, name='beamer_down'),
) )

View File

@ -78,13 +78,30 @@ def beamer(request):
content = render_block_to_string(template, 'content', data) content = render_block_to_string(template, 'content', data)
jsondata = {'content': content, jsondata = {'content': content,
'title': data['title'], 'title': data['title'],
'time': datetime.now().strftime('%H:%M')} 'time': datetime.now().strftime('%H:%M'),
'bigger': config_get('bigger'),
'up': config_get('up')}
return ajax_request(jsondata) return ajax_request(jsondata)
else: else:
return render_to_response(template, return render_to_response(template,
data, data,
context_instance=RequestContext(request)) context_instance=RequestContext(request))
@permission_required('agenda.can_manage_agenda')
def beamer_edit(request, direction):
if direction == 'bigger':
config_set('bigger', int(config_get('bigger', 100)) + 10)
elif direction == 'smaller':
config_set('bigger', int(config_get('bigger', 100)) - 10)
elif direction == 'up':
config_set('up', int(config_get('up', 0)) - 10)
elif direction == 'down':
config_set('up', int(config_get('up', 0)) + 10)
if request.is_ajax():
return ajax_request({})
return redirect(reverse('item_overview'))
def assignment_votes(item): def assignment_votes(item):
votes = [] votes = []
@ -156,6 +173,8 @@ def set_active(request, item_id, summary=False):
item.set_active(summary) item.set_active(summary)
except Item.DoesNotExist: except Item.DoesNotExist:
messages.error(request, _('Item ID %d does not exist.') % int(item_id)) messages.error(request, _('Item ID %d does not exist.') % int(item_id))
config_set("bigger", 100)
config_set("up", 0)
if request.is_ajax(): if request.is_ajax():
return ajax_request({'active': item_id}) return ajax_request({'active': item_id})

View File

@ -104,5 +104,18 @@ $(function() {
hideClosedSlides(true); hideClosedSlides(true);
} }
// controll beamer
$('.beamer_edit').click(function(event) {
event.preventDefault();
link = $(this);
$.ajax({
type: 'GET',
url: link.attr('href'),
dataType: 'json',
success: function(data) {
}
});
});
ko.applyBindings(ViewModel); ko.applyBindings(ViewModel);
}); });

View File

@ -9,6 +9,9 @@ function presentation_reload() {
$('#content').html(data.content); $('#content').html(data.content);
document.title = data.title; document.title = data.title;
$('#currentTime').html(data.time); $('#currentTime').html(data.time);
$('#content').clearQueue();
$('#content').animate({'font-size': data.bigger + '%'}, 200);
$('#content').animate({'margin-top': data.up + 'em'}, 200);
setTimeout("presentation_reload()", 500); setTimeout("presentation_reload()", 500);
}, },
error: function () { error: function () {

View File

@ -67,6 +67,7 @@ body{
left:100px; left:100px;
top:150px; top:150px;
right:40px; right:40px;
z-index: -1;
} }
.title .title
{ {