some bug fixes

This commit is contained in:
Oskar Hahn 2012-02-20 20:35:12 +01:00
parent e85822ebc9
commit c55f240e84
8 changed files with 135 additions and 108 deletions

View File

@ -10,28 +10,28 @@
<link type="text/css" rel="stylesheet" media="all" href="/static/styles/tabledrag.css" />
<link type="text/css" rel="stylesheet" media="all" href="/static/styles/agenda.css" />
{% if perms.agenda.can_manage_agenda %}
<script type="text/javascript" src="/static/javascript/jquery.once.js"></script>
<script type="text/javascript" src="/static/javascript/jquery.cookie.js"></script>
<script type="text/javascript" src="/static/javascript/jquery.tmpl.js"></script>
<script type="text/javascript" src="/static/javascript/tabledrag.js"></script>
<script type="text/javascript" src="/static/javascript/agenda.js"></script>
<script type="text/javascript" src="/static/javascript/jquery.once.js"></script>
<script type="text/javascript" src="/static/javascript/jquery.cookie.js"></script>
<script type="text/javascript" src="/static/javascript/jquery.tmpl.js"></script>
<script type="text/javascript" src="/static/javascript/tabledrag.js"></script>
<script type="text/javascript" src="/static/javascript/agenda.js"></script>
<script type="text/javascript">
<!--//--><![CDATA[//><!--
//This is Drupal Code
jQuery.extend(
Drupal.settings,
{
"tableDrag":
{ "menu-overview":
{ "menu-plid":
[ { "target": "menu-plid", "source": "menu-mlid", "relationship": "parent", "action": "match", "hidden": true, "limit": 8 } ],
"menu-weight":
[ { "target": "menu-weight", "source": "menu-weight", "relationship": "sibling", "action": "order", "hidden": true, "limit": 0 } ]
}
}
});
//--><!]]>
<script type="text/javascript">
<!--//--><![CDATA[//><!--
//This is Drupal Code
jQuery.extend(
Drupal.settings,
{
"tableDrag":
{ "menu-overview":
{ "menu-plid":
[ { "target": "menu-plid", "source": "menu-mlid", "relationship": "parent", "action": "match", "hidden": true, "limit": 8 } ],
"menu-weight":
[ { "target": "menu-weight", "source": "menu-weight", "relationship": "sibling", "action": "order", "hidden": true, "limit": 0 } ]
}
}
});
//--><!]]>
</script>
{% endif %}
{% endblock %}
@ -41,44 +41,60 @@
{% if items %}
<form action="/agenda/" method="post">{% csrf_token %}
{% if perms.agenda.can_manage_agenda %}
<div id="changed-order-message" style="display:none" class="notification warning">
<em>{% trans "Do you want to save the changed order of agenda items?" %}<br>
<input type="submit" value="{% trans 'Yes' %}">
<input type="button" onclick="window.location.href='{% url item_overview %}';" value="{%trans 'No' %}">
</em>
</div>
<div id="changed-order-message" style="display:none" class="notification warning">
<em>{% trans "Do you want to save the changed order of agenda items?" %}<br>
<input type="submit" value="{% trans 'Yes' %}">
<input type="button" onclick="window.location.href='{% url item_overview %}';" value="{%trans 'No' %}">
</em>
</div>
<div style="text-align: right; padding: 0 5px 5px 0; margin-top:-20px;">
<!-- countdown -->
<input type="checkbox" name="countdown" onchange="document.location='{% if countdown_visible == "True" %}{% url countdown_close %}{% else %}{% url countdown_open %}{% endif %}'"
{% if countdown_visible == "True" %}checked{% endif %}>
{% trans "Countdown" %} (<a href="{% url config_agenda %}">{{countdown_time}}{% trans "sec" %}</a>){% if countdown_visible == "True" %}:
<a class="projector_countdown" href="{% url countdown_reset countdown_time %}" title="{% trans 'Reset countdown' %}"><img src="/static/images/icons/media-skip-backward.png"></a>
<a class="projector_countdown" href="{% url countdown_start %}" title="{% trans 'Start countdown' %}"><img src="/static/images/icons/media-playback-start.png"></a>
<a class="projector_countdown" href="{% url countdown_stop %}" title="{% trans 'Stop countdown' %}"><img src="/static/images/icons/media-playback-pause.png"></a>
{% endif %}
<p></p>
<!-- projector control -->
{% trans "Adjust projector view" %}:
<a class="projector_edit" href="{% url projector_bigger %}" title="{% trans 'Zoom in' %}"><img src="/static/images/icons/zoom-in.png"></a>
<a class="projector_edit" href="{% url projector_smaller %}" title="{% trans 'Zoom out' %}"><img src="/static/images/icons/zoom-out.png"></a>
<a class="projector_edit" href="{% url projector_up %}" title="{% trans 'Scroll text up' %}"><img src="/static/images/icons/go-up.png"></a>
<a class="projector_edit" href="{% url projector_down %}" title="{% trans 'Scroll text down' %}"><img src="/static/images/icons/go-down.png"></a>
<a class="projector_edit" href="{% url projector_clean %}" title="{% trans 'Reset projector view' %}"><img src="/static/images/icons/view-restore.png"></a>
</div>
<div style="text-align: right; padding: 0 5px 5px 0; margin-top:-20px;">
<!-- countdown -->
<input type="checkbox" name="countdown" onchange="document.location='{% if countdown_visible %}{% url countdown_close %}{% else %}{% url countdown_open %}{% endif %}'"{% if countdown_visible %} checked{% endif %}>
{% trans "Countdown" %} (<a href="{% url config_agenda %}">{{countdown_time}}{% trans "sec" %}</a>)
{% if countdown_visible == "True" %}:
<a class="projector_countdown" href="{% url countdown_reset countdown_time %}" title="{% trans 'Reset countdown' %}">
<img src="/static/images/icons/media-skip-backward.png" />
</a>
<a class="projector_countdown" href="{% url countdown_start %}" title="{% trans 'Start countdown' %}">
<img src="/static/images/icons/media-playback-start.png" />
</a>
<a class="projector_countdown" href="{% url countdown_stop %}" title="{% trans 'Stop countdown' %}">
<img src="/static/images/icons/media-playback-pause.png" />
</a>
{% endif %}
<p></p>
<!-- projector control -->
{% trans "Adjust projector view" %}:
<a class="projector_edit" href="{% url projector_bigger %}" title="{% trans 'Zoom in' %}">
<img src="/static/images/icons/zoom-in.png" />
</a>
<a class="projector_edit" href="{% url projector_smaller %}" title="{% trans 'Zoom out' %}">
<img src="/static/images/icons/zoom-out.png" />
</a>
<a class="projector_edit" href="{% url projector_up %}" title="{% trans 'Scroll text up' %}">
<img src="/static/images/icons/go-up.png" />
</a>
<a class="projector_edit" href="{% url projector_down %}" title="{% trans 'Scroll text down' %}">
<img src="/static/images/icons/go-down.png" />
</a>
<a class="projector_edit" href="{% url projector_clean %}" title="{% trans 'Reset projector view' %}">
<img src="/static/images/icons/view-restore.png" />
</a>
</div>
{% endif %}
<table id="menu-overview" class="agendatable">
<tr>
{% if perms.agenda.can_manage_agenda %}
<th style="width: 1px;">{% trans "Projector" %}</th>
<th style="width: 1px;">{% trans "Projector" %}</th>
{% else %}
<th style="width: 1px;">{% trans "Done" %}</th>
<th style="width: 1px;">{% trans "Done" %}</th>
{% endif %}
<th>{% trans "Item" %}</th>
<th style="width: 1px;">{% if perms.agenda.can_manage_agenda %}{% trans "Actions" %}{% endif %}</th>
{% if perms.agenda.can_manage_agenda %}
<th class="tabledrag-hide">{% trans "Weight" %}</th>
<th class="tabledrag-hide">{% trans "Weight" %}</th>
{% endif %}
</tr>
<tr id="item_row_0" class="topline {% if overview %} activeline {% else %}{% if perms.agenda.can_manage_agenda %} inactiveline {% endif %}{% endif %}">
@ -91,10 +107,13 @@
{% else %}
<td></td>
{% endif %}
<td><b>{% trans "Agenda" %} ({{ items|length }} {% trans "items" %}<span id="hiddencount"></span>)</b></td>
<td><span id="action_field" style="width: 1px;white-space: nowrap;">
<span></span>
<a href="{% url print_agenda %}" title="{%trans 'Print agenda' %}"><img src="/static/images/icons/application-pdf.png"></a>
<td>
<b>{% trans "Agenda" %} ({{ items|length }} {% trans "items" %}<span id="hiddencount"></span>)</b>
</td>
<td>
<span id="action_field" style="width: 1px;white-space: nowrap;">
<span></span>
<a href="{% url print_agenda %}" title="{%trans 'Print agenda' %}"><img src="/static/images/icons/application-pdf.png"></a>
</span>
</td>
</tr>
@ -106,7 +125,7 @@
{% if perms.agenda.can_manage_agenda %}
<td class="select">
<a id="activate_link_{{ item.id }}" class="activate_link" href="{% url item_activate item.id %}">
<div></div>
<div></div>
</a>
</td>
{% else %}
@ -130,19 +149,19 @@
</td>
<td>
<span style="width: 1px;white-space: nowrap;">
<a href="{{ item.get_absolute_url }}"><img src="/static/images/icons/document-preview.png" title="{% trans 'Show projector preview' %}"></a>
<a href="{{ item.get_absolute_url }}"><img src="/static/images/icons/document-preview.png" title="{% trans 'Show projector preview' %}"></a>
{% if perms.agenda.can_manage_agenda %}
<a href="{% url item_edit item.id %}"><img src="/static/images/icons/document-edit.png" title="{% trans 'Edit item' %}"></a>
<a href="{% url item_delete item.id %}"><img src="/static/images/icons/edit-delete.png" title="{% trans 'Delete item' %}"></a>
<a class="close_link {% if item.closed %}closed{% else %}open{% endif %}" href="{% if item.closed %}{% url item_open item.id %}{% else %}{% url item_close item.id %}{% endif %}">
<span></span>
</a>
{% if perms.agenda.can_manage_agenda %}
<a href="{% url item_edit item.id %}"><img src="/static/images/icons/document-edit.png" title="{% trans 'Edit item' %}"></a>
<a href="{% url item_delete item.id %}"><img src="/static/images/icons/edit-delete.png" title="{% trans 'Delete item' %}"></a>
<a class="close_link {% if item.closed %}closed{% else %}open{% endif %}" href="{% if item.closed %}{% url item_open item.id %}{% else %}{% url item_close item.id %}{% endif %}">
<span></span>
</a>
{% if item.children.exists %}
<a href="{% url item_activate_summary item.id %}"><img src="/static/images/icons/view-list-tree.png" title="{% trans 'Select item overview' %}"></a>
{% if item.children.exists %}
<a href="{% url item_activate_summary item.id %}"><img src="/static/images/icons/view-list-tree.png" title="{% trans 'Select item overview' %}"></a>
{% endif %}
{% endif %}
{% endif %}
</span>
</td>
{% if perms.agenda.can_manage_agenda %}
@ -157,7 +176,6 @@
</tr>
{% endfor %}
</table>
</form>
{% else %}
<i>{% trans "No items available." %}</i>

View File

@ -1,4 +1,7 @@
{% extends "base-projector.html" %}
{% load i18n %}
{% block title %}{{ block.super }} -
{% if title %} {{ title }} {% else %} {%trans "Agenda" %} {% endif %}
{% endblock %}

View File

@ -1,5 +1,9 @@
{% extends "base-projector.html" %}
{% load i18n %}
{% block title %}{{ block.super }} - {{ item.title }}{% endblock %}
{% block content %}
{% if item.text %}
<h1>{{ item.title }}</h1>

View File

@ -1,38 +1,39 @@
{% load tags %}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
{% load tags %}
<head>
<link type="text/css" rel="stylesheet" href="/static/styles/projector.css">
<link rel="shortcut icon" href="/static/images/favicon.png" type="image/png" />
<script type="text/javascript" src="/static/javascript/jquery.js"></script>
<script type="text/javascript" src="/static/javascript/projector.js"></script>
<title>{% block title %} {% get_config 'event_name' %} {% endblock %}</title>
{% block header %}
{% endblock %}
</head>
<body>
<div id="config" style="display:none;">
<div id="ajax">{{ ajax }}</div>
</div>
<div id="ajaxswitcher"></div>
<head>
<link type="text/css" rel="stylesheet" href="/static/styles/projector.css">
<link rel="shortcut icon" href="/static/images/favicon.png" type="image/png" />
<script type="text/javascript" src="/static/javascript/jquery.js"></script>
<script type="text/javascript" src="/static/javascript/projector.js"></script>
<title>{% block title %} {% get_config 'event_name' %} {% endblock %}</title>
{% block header %}
{% endblock %}
</head>
<body>
<div id="config" style="display:none;">
<div id="ajax">{{ ajax }}</div>
</div>
<div id="ajaxswitcher"></div>
<div id="header">
<div id="logo"><img src="/static/images/logo-projector.png"></div>
<div class="event_name">{% get_config 'event_name' %}</div>
<div class="event_description">{% get_config 'event_description' %}</div>
</div>
<div id="header">
<div id="logo"><img src="/static/images/logo-projector.png"></div>
<div class="event_name">{% get_config 'event_name' %}</div>
<div class="event_description">{% get_config 'event_description' %}</div>
</div>
<div id="currentTime">
{% now "H:i" %}
</div>
<div id="currentTime">
{% now "H:i" %}
</div>
<div id="countdown">0:00</div>
<div id="countdown">0:00</div>
<div id="content">
{% block content %}
{% endblock %}
</div>
</body>
<div id="content">
{% block content %}
{% endblock %}
</div>
</body>
</html>

View File

@ -16,33 +16,33 @@ urlpatterns = patterns('projector.views',
url(r'^$', 'active_slide',
name='projector_show'),
url(r'^bigger$', 'projector_edit', {'direction': 'bigger'},
url(r'^bigger/$', 'projector_edit', {'direction': 'bigger'},
name='projector_bigger'),
url(r'^smaller$', 'projector_edit', {'direction': 'smaller'},
url(r'^smaller/$', 'projector_edit', {'direction': 'smaller'},
name='projector_smaller'),
url(r'^up$', 'projector_edit', {'direction': 'up'},
url(r'^up/$', 'projector_edit', {'direction': 'up'},
name='projector_up'),
url(r'^projector/down$', 'projector_edit', {'direction': 'down'},
url(r'^down/$', 'projector_edit', {'direction': 'down'},
name='projector_down'),
url(r'^projector/clean$', 'projector_edit', {'direction': 'clean'},
url(r'^clean/$', 'projector_edit', {'direction': 'clean'},
name='projector_clean'),
url(r'^projector/countdown/show$', 'projector_countdown', {'command': 'show'},
url(r'^countdown/show/$', 'projector_countdown', {'command': 'show'},
name='countdown_open'),
url(r'^projector/countdown/hide$', 'projector_countdown', {'command': 'hide'},
url(r'^countdown/hide/$', 'projector_countdown', {'command': 'hide'},
name='countdown_close'),
url(r'^projector/countdown/reset/(?P<time>\d+)$', 'projector_countdown', {'command': 'reset'},
url(r'^countdown/reset/(?P<time>\d+)/$', 'projector_countdown', {'command': 'reset'},
name='countdown_reset'),
url(r'^projector/countdown/start$', 'projector_countdown', {'command': 'start'},
url(r'^countdown/start/$', 'projector_countdown', {'command': 'start'},
name='countdown_start'),
url(r'^projector/countdown/stop$', 'projector_countdown', {'command': 'stop'},
url(r'^countdown/stop/$', 'projector_countdown', {'command': 'stop'},
name='countdown_stop'),
)

View File

@ -2,7 +2,7 @@ function presentation_reload() {
if ($('#config > #ajax').html() == 'on') {
$.ajax({
type: 'GET',
url: '/projector',
url: '/projector/',
dataType: 'json',
data: '',
success: function(data) {
@ -14,9 +14,10 @@ function presentation_reload() {
$('#content li').css({'font-size': data.bigger + '%'}, 200);
$('#content #sidebar').css({'font-size': '16px'}, 0);
$('#content').animate({'margin-top': data.up + 'em'}, 200);
if (data.countdown_visible == "True")
if (data.countdown_visible == true)
$('#countdown').slideDown();
if (data.countdown_visible == "False")
if (data.countdown_visible == false)
$('#countdown').slideUp();
if (data.countdown_control == "reset")
resetTimer(data.countdown_time);

View File

@ -1,3 +1,3 @@
from system.models import Config
# TODO: Test that this is not thead-save
config = Config()

View File

@ -31,7 +31,7 @@ urlpatterns = patterns('',
(r'', include('participant.urls')),
(r'', include('assignment.urls')),
(r'', include('system.urls')),
(r'projector', include('projector.urls')),
(r'projector/', include('projector.urls')),
(r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.STATIC_DOC_ROOT}),
(r'^i18n/', include('django.conf.urls.i18n')),
)