From c4c5de1baa9509a4a4cd23d2a7cb6324524d2ada Mon Sep 17 00:00:00 2001 From: davin baragiotta Date: Thu, 7 Oct 2010 15:47:42 -0400 Subject: [PATCH] accueil : actualites --- auf_savoirs_en_partage/media/css/global.css | 2 + auf_savoirs_en_partage/savoirs/globals.py | 4 +- auf_savoirs_en_partage/savoirs/views.py | 6 +- .../templates/savoirs/index.html | 63 ++++++++++---------- .../templates/savoirs/logout.html | 2 +- 5 files changed, 39 insertions(+), 38 deletions(-) diff --git a/auf_savoirs_en_partage/media/css/global.css b/auf_savoirs_en_partage/media/css/global.css index 53fa66d..5e02b3b 100644 --- a/auf_savoirs_en_partage/media/css/global.css +++ b/auf_savoirs_en_partage/media/css/global.css @@ -86,6 +86,8 @@ div.boite-recherche p a:hover { color:#97012c; text-decoration:none;} #contenu { width:744px; margin:100px 0px 50px 0px; padding:0; float:left;background:url(../img/contenu-bkg-middle.png) repeat-y 0 0; } #tabs { margin-left: 8px; margin-right: 8px; } #contenu h4 { padding: 0 25px; margin-bottom:0.4em; font-size:2.2em; font-weight:normal; letter-spacing:-1px; } +#contenu h4 a { text-decoration:none; color:black; } +#contenu h4 a:hover { text-decoration:underline; } #contenu .zone-texte {padding: 0 25px; font-size: 1.2em; min-height: 375px;} #contenu .zone-texte ul li {list-style: disc; margin: 0 0 .25em;} #contenu .zone-texte ol li {list-style: decimal; margin: 0 0 .25em;} diff --git a/auf_savoirs_en_partage/savoirs/globals.py b/auf_savoirs_en_partage/savoirs/globals.py index fe17c71..a7f462c 100644 --- a/auf_savoirs_en_partage/savoirs/globals.py +++ b/auf_savoirs_en_partage/savoirs/globals.py @@ -3,12 +3,12 @@ configuration = { 'max_actualite': 100, - 'accueil_actualite': 5, + 'accueil_actualite': 4, 'accueil_chercheur': 5, + 'accueil_evenement': 4, 'accueil_sites': 5, 'nombre_par_page_actualite': 10, 'resultats_par_page': 8, # pas changeable a cause de google - 'accueil_evenement': 10, 'engin_recherche': 'sep', 'google_xml': "http://www.savoirsenpartage.auf.org/recherche.xml?%s", 'calendrier_publique': 'https://sep-caldav.auf.org/caldav.php/sep/home', diff --git a/auf_savoirs_en_partage/savoirs/views.py b/auf_savoirs_en_partage/savoirs/views.py index 8ae5d5f..82d9948 100644 --- a/auf_savoirs_en_partage/savoirs/views.py +++ b/auf_savoirs_en_partage/savoirs/views.py @@ -22,8 +22,8 @@ def index (request): """Page d'accueil""" delta = datetime.timedelta (days = 90) oldest = datetime.date.today () - delta - articles = Actualite.objects.filter (visible = '1', date__gt = oldest) - articles = articles[0:configuration['accueil_actualite']] + actualites = Actualite.objects.filter (visible = '1', date__gt = oldest) + actualites = actualites[0:configuration['accueil_actualite']] try: erreur_caldav = False events = evenements()[0:configuration['accueil_evenement']] @@ -33,7 +33,7 @@ def index (request): chercheurs = Chercheur.objects.all().order_by('?')[:configuration['accueil_chercheur']] sites = Site.objects.all().order_by('?')[:configuration['accueil_sites']] return render_to_response ("savoirs/index.html", \ - Context ({"articles": articles, + Context ({"actualites": actualites, "events": events, "erreur_caldav": erreur_caldav, "caldav_url": configuration['calendrier_publique'], diff --git a/auf_savoirs_en_partage/templates/savoirs/index.html b/auf_savoirs_en_partage/templates/savoirs/index.html index 232150c..43b4efd 100644 --- a/auf_savoirs_en_partage/templates/savoirs/index.html +++ b/auf_savoirs_en_partage/templates/savoirs/index.html @@ -3,27 +3,29 @@ {% block contenu %}
-

Actualités

+

Actualités

+
    - {% comment %}{% endcomment %} - {% for article in articles %} + {% for actualite in actualites %}
  • - {{ article.date|date:"d F Y" }} - {{ article.titre }} - {% if article.source %} - source: {{ article.source.nom }} + {{ actualite.date|date:"d F Y" }} + {{ actualite.titre }} + {% if actualite.source %} + source: {{ actualite.source.nom }} {% endif %} {% comment %} - {{ article.texte }} - Lire + {{ actualite.texte }} - Lire {% endcomment %}
  • {% endfor %}
-
-

Chercheurs

+
+

Chercheurs

- -
-

Agenda

+

Agenda

{% if not erreur_caldav %} - - -
    - {% for event in events %} -
  • - {{ event.dtstart.value|date:"Y-m-d" }} - {{ event.dtstart.value|date:"H:i" }} - {{ event.summary.value }} - {{ event.description.value }} -
  • - {% endfor %} -
+ + +
    + {% for event in events %} +
  • + {{ event.dtstart.value|date:"d F Y" }} + {{ event.dtstart.value|date:"H:i" }} + {{ event.summary.value }} + {{ event.description.value }} +
  • + {% endfor %} +
{% else %}
  • {{ erreur_caldav }}
{% endif %} -
-
-

Sites

+
+

Sites

diff --git a/auf_savoirs_en_partage/templates/savoirs/logout.html b/auf_savoirs_en_partage/templates/savoirs/logout.html index 7ce5f41..a7cc1fa 100644 --- a/auf_savoirs_en_partage/templates/savoirs/logout.html +++ b/auf_savoirs_en_partage/templates/savoirs/logout.html @@ -4,7 +4,7 @@

Vous êtes maintenant déconnecté.

-

Retour

+

Retour à l'accueil.

{% endblock %} -- 1.7.10.4