]> git.0d.be Git - panikdb.git/blob - panikdb/templates/regie-home.html
8c62fec70ef9fd7c04179c87af18ac11940d1125
[panikdb.git] / panikdb / templates / regie-home.html
1 {% extends "base.html" %}
2 {% load i18n %}
3
4 {% block bodyargs %}{{block.super}} class="regie-home"{% endblock %}
5
6 {% block more-user-links %}{% endblock %}
7
8 {% block content %}
9 <div class="section">
10 {% if not request.user.is_authenticated %}
11 <form method="post" id="login-form" action="{% url 'auth_login' %}">
12   {% csrf_token %}
13   <label for="id_username">Identifiant : </label>
14   {{ login_form.username }}
15   <label for="id_password">Mot de passe : </label>
16   {{ login_form.password }}
17   <button>Se connecter</button>
18   <input type="hidden" name="next" value="/regie/" />
19   <p><a href="{% url 'auth_password_reset' %}">{% trans "Lost password?" %}</a></p>
20 </form>
21 {% else %}
22 <h3>Bonjour {% firstof request.user.first_name request.user %}
23             <a class="icon-signout" href="{% url 'logout' %}?next=/regie/">Déconnexion</a>
24 </h3>
25 {% endif %}
26 </div>
27
28 <div id="clock">
29         <span>{% now "H:i:s" %}</span>
30 </div>
31 <script>
32 function fmt00(t)
33 {
34     if (t < 10) {
35         return '0' + t;
36     } else {
37         return '' + t;
38     }
39 }
40
41 function update_clock()
42 {
43     var d = new Date();
44     $('#clock span').html(fmt00(d.getHours()) + ':' + fmt00(d.getMinutes()) + ':' + fmt00(d.getSeconds()));
45 }
46
47 $(function () {
48   window.setInterval(update_clock, 500);
49 });
50 </script>
51 {% endblock %}
52
53 {% block sidebar %}
54 <aside id="sidebar">
55
56 <div class="block program" data-url="{% url 'nonstop-ajax-program' date='' %}">
57 <h3>Au programme</h3>
58 <div></div>
59 <script>
60 $(function() {
61   $('.block.program').each(function() {
62     var url = $(this).data('url');
63     $(this).find('> div').load(url, function() {
64       {% if not perms.emissions.change_emission and website_url %}
65         $(this).find('a').each(function(idx, link) {
66           $(link).attr('href', "{{website_url}}" + $(link).attr('href'));
67         });
68       {% endif %}
69     });
70   });
71 });
72 </script>
73 </div>
74
75 </aside>
76 {% endblock %}
77