Calendrier dynamique + sympa + jolies dates

This commit is contained in:
Evarin 2018-01-28 23:44:48 +01:00
parent f8952225d6
commit ba87044638
13 changed files with 414 additions and 102 deletions

View file

@ -1,11 +1,25 @@
{% load wagtailcore_tags wagtailroutablepage_tags static %}
<table class="calendar">
<tbody>
<tr>
<th><a href="javascript:void(0);" cal-dest="{{ prev_month }}" class="cal-btn">&lt;</a></th>
<th colspan="5">{{ this_month|date:"F Y" }}</th>
<th><a href="javascript:void(0);" cal-dest="{{ next_month }}" class="cal-btn">&gt;</a></th>
</tr>
<tr><th>L</th><th>M</th><th>M</th><th>J</th><th>V</th><th>S</th><th>D</th></tr>
{% for week in weeks %}
<tr>
{% for day in week %}
<td class="{{ day.class }}">
{% if day.events %}<a href="javascript:void(0)">{{ day.day }}</a>{% else %}{{ day.day }}{% endif %}
{% if day.events %}
<a href="javascript:void(0)">{{ day.day }}</a>
<ul class="cal-events">
<li class="datename">Le {{ day.date|date:"d F Y" }}</li>
{% for event in day.events %}
<li><a href="{% pageurl event %}">{{ event.title }}</a></li>
{% endfor %}
</ul>
{% else %}{{ day.day }}{% endif %}
</td>
{% endfor %}
</tr>

View file

@ -0,0 +1,2 @@
{% load cofcms_tags %}
{% calendar month year %}

View file

@ -1,12 +1,21 @@
{% extends "cofcms/base_aside.html" %}
{% load wagtailimages_tags cofcms_tags wagtailcore_tags %}
{% load wagtailimages_tags cofcms_tags wagtailcore_tags static i18n %}
{% block extra_head %}
{{ block.super }}
<script src="{% static "js/jquery.min.js" %}"></script>
<script src="{% static "cofcms/js/calendar.js" %}"></script>
{% endblock %}
{% block aside_title %}Calendrier{% endblock %}
{% block aside %}
{% calendar %}
<div id="calendar-wrap">
{% calendar %}
</div>
{% endblock %}
{% block content %}
{% get_current_language as curlang %}
<section class="intro">
<h1>{{ page.title }}</h1>
<div>{{ page.introduction|safe }}</div>
@ -26,7 +35,7 @@
<div class="actu-infos">
<h2><a href="{% pageurl actu %}">{{ actu.title }}</a></h2>
{% if actu.is_event %}
<p><span class="actu-dates">{{ actu.dates|capfirst }}</span><br />{{ actu.chapo }}</p>
<p><span class="actu-dates">{{ actu|dates:curlang|capfirst }}</span><br />{{ actu.chapo }}</p>
{% else %}
{{ actu.body|safe|truncatewords_html:15 }}
{% endif %}

View file

@ -1,10 +1,11 @@
{% extends "cofcms/base.html" %}
{% load wagtailimages_tags cofcms_tags %}
{% load wagtailimages_tags cofcms_tags i18n %}
{% block content %}
{% get_current_language as curlang %}
<section class="intro">
<h1>{{ page.title }}</h1>
<p class="date">A lieu {{ page.dates }}</p>
<p class="date">A lieu {{ page|dates:curlang }}</p>
<p>{{ page.chapo }}</p>
</section>

View file

@ -1,12 +1,22 @@
{% extends "cofcms/base_aside.html" %}
{% load static cofcms_tags wagtailimages_tags i18n wagtailcore_tags %}
{% load static cofcms_tags wagtailimages_tags wagtailroutablepage_tags i18n wagtailcore_tags %}
{% block extra_head %}
{{ block.super }}
<script src="{% static "js/jquery.min.js" %}"></script>
<script src="{% static "cofcms/js/calendar.js" %}"></script>
{% endblock %}
{% block aside_title %}Agenda{% endblock %}
{% block aside %}
{% calendar %}
<div id="calendar-wrap">
{% calendar %}
</div>
{% endblock %}
{% block content %}
{% get_current_language as curlang %}
<section class="intro">
<h1>{{ page.title }}</h1>
<div>{{ page.introduction|safe }}</div>
@ -20,8 +30,7 @@
</div>
<div class="actu-misc">
{% if actu.is_event %}
{% get_current_language as curlang %}
<span class="actu-minical">{% mini_calendar actu curlang %}</span><span class="actu-dates">{{ actu.dates }}</span>
<span class="actu-minical">{% mini_calendar actu %}</span><span class="actu-dates">{{ actu|dates:curlang }}</span>
{% else %}
{{ actu.body|safe|truncatewords_html:10 }}
{% endif %}

View file

@ -0,0 +1,26 @@
{% extends "cofcms/base.html" %}
{% load i18n %}
{% block content %}
<section class="intro">
<h1>{% trans "Listes mail" %}</h1>
</section>
<section class="pagecontent">
<article class="paragraph">
{% blocktrans %}
Tous les abonnements aux listes de diffusion de mail à l'ENS se gèrent sur le serveur de mail SYMPA
Pour y accéder : Merci de répondre à cette question anti-robots.
{% endblocktrans %}
</article>
<article class="paragraph">
<form method="POST" action="">
{% csrf_token %}
{% if erreur %}<p class="erreur">{% trans erreur %}</p>{% endif %}
<p>{% blocktrans %}Comment s'appellent les poissons du bassin ?{% endblocktrans %}</p>
<input type="text" name="bassin" />
<input type="submit" />
</article>
</section>
{% endblock %}