From 8488beeb4ef3fefc274bb10735bd2bc3041f7172 Mon Sep 17 00:00:00 2001 From: Evarin Date: Mon, 22 Jan 2018 21:24:20 +0100 Subject: [PATCH] =?UTF-8?q?Un=20seul=20mod=C3=A8le=20pour=20les=20actus?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gestioncof/cms/fixtures/cofcms.json | 1 + gestioncof/cms/fixtures/wagtail_cof_cms.json | 1 - gestioncof/cms/migrations/0001_initial.py | 198 ++++++++---------- gestioncof/cms/models.py | 59 ++---- .../templates/cofcms/cof_actu_event_page.html | 17 -- .../templates/cofcms/cof_actu_index_page.html | 2 +- .../cms/templates/cofcms/cof_actu_page.html | 3 +- .../cms/templates/cofcms/cof_root_page.html | 2 +- gestioncof/cms/templatetags/cofcms_tags.py | 10 +- gestioncof/cms/translation.py | 10 +- 10 files changed, 120 insertions(+), 183 deletions(-) create mode 100644 gestioncof/cms/fixtures/cofcms.json delete mode 100644 gestioncof/cms/fixtures/wagtail_cof_cms.json delete mode 100644 gestioncof/cms/templates/cofcms/cof_actu_event_page.html diff --git a/gestioncof/cms/fixtures/cofcms.json b/gestioncof/cms/fixtures/cofcms.json new file mode 100644 index 00000000..82114ff3 --- /dev/null +++ b/gestioncof/cms/fixtures/cofcms.json @@ -0,0 +1 @@ +[{"model": "cofcms.cofrootpage", "pk": 11, "fields": {"title_fr": "Site du COF", "title_en": "COF's website", "slug_fr": "site", "slug_en": "news", "url_path_fr": "/global/site/", "url_path_en": "/global/news/", "seo_title_fr": "Accueil", "seo_title_en": "Home", "search_description_fr": "", "search_description_en": "", "introduction": "

Bienvenue sur le site du COF

", "introduction_fr": "

Bienvenue sur le site du COF

", "introduction_en": "

Welcome to the COF's website

"}}, {"model": "cofcms.cofpage", "pk": 13, "fields": {"title_fr": "Pr\u00e9sentation", "title_en": "Presentation", "slug_fr": "pr\u00e9sentation", "slug_en": "presentation", "url_path_fr": "/global/site/pr\u00e9sentation/", "url_path_en": "/global/news/presentation/", "seo_title_fr": null, "seo_title_en": null, "search_description_fr": "", "search_description_en": "", "body": "[{\"type\": \"heading\", \"value\": \"Quoi ?\"}, {\"type\": \"paragraph\", \"value\": \"

Le COF (Comit\\u00e9 d\\u2019Organisation des F\\u00eates), c\\u2019est le petit nom de \\nl\\u2019AEENS, l\\u2019Association des \\u00c9l\\u00e8ves de l\\u2019ENS (association de loi 1901). \\nC\\u2019est lui qui organise les\\u00a0\\u00e9v\\u00e8nements\\u00a0culturels, associatifs et bien s\\u00fbr\\n festifs, de l\\u2019\\u00c9cole normale.

\\n

Ses principales responsabilit\\u00e9s sont entre autres :

\\n\\n

Il est bien s\\u00fbr tr\\u00e8s li\\u00e9 au BDS (Bureau des Sports) avec qui il pr\\u00e9pare les InterENS sportives, mais qui est\\u00a0n\\u00e9anmoins\\u00a0une entit\\u00e9 distincte du COF.

\"}, {\"type\": \"heading\", \"value\": \"Qui ?\"}, {\"type\": \"paragraph\", \"value\": \"

Le COF c\\u2019est avant tout ses membres (environ 700 chaque ann\\u00e9e) et ses\\n clubs (entre 20 et 40 selon les ann\\u00e9es). Chaque club est g\\u00e9r\\u00e9 par un \\nresponsable (voir les pages des clubs).

\\n

Comme dans toute association il y a un bureau \\u2013 compos\\u00e9 de 12 personnes r\\u00e9\\u00e9lues tous les 6 mois.

\\n

Le COF organise au moins 3 Assembl\\u00e9es G\\u00e9n\\u00e9rales par an, une en \\noctobre pour attribuer les budgets annuels, une en f\\u00e9vrier pour \\nr\\u00e9ajuster les budgets, discuter des projets, des affaires courantes ; et\\n la derni\\u00e8re en juin pour faire un bilan de l\\u2019ann\\u00e9e, voter les \\ncotisations et les partenariats. C\\u2019est l\\u2019occasion pour tous les membres \\nde se rassembler et de faire entendre leur voix, pour les clubs de se \\npr\\u00e9senter et pour le Bur\\u00f4\\u2026 et de vous rendre des comptes ! Il y en a \\naussi une avant chaque \\u00e9lection afin d\\u2019\\u00e9couter la pr\\u00e9sentation des \\ncandidats au Bur\\u00f4.

\"}, {\"type\": \"image\", \"value\": 33}, {\"type\": \"paragraph\", \"value\": \"Poste / Nom\\n\\n\\n\\n\\n\\t
Pr\\u00e9sident : Valentin Cocco
Vice-pr\\u00e9sident : Th\\u00e9o Mathevet
Tr\\u00e9sorier : Mathias Penot\\n\\n\\n\\t
Sous-tr\\u00e9sorier : Octave Tessiot
Secr\\u00e9taire : L\\u00e9na Gurriaran
Charg\\u00e9 de comm' : Cl\\u00e9ment de Mecquenem
Charg\\u00e9 de comm' adjoint : Charles Giroudot
Pr\\u00e9sidente du Bureau des Arts : Caroline Delattre
Bureau des Arts : Bryan Rimbault
Bureau des Arts : Philippe Danr\\u00e9
Bureau des Arts : Louise Garrigou
Bureau des Arts : Emile Laymand

Bureau des Arts : Cl\\u00e9mence Elmira

\"}, {\"type\": \"heading\", \"value\": \"O\\u00f9 ?\"}, {\"type\": \"paragraph\", \"value\": \"

Le COF dispose d\\u2019un local dans l\\u2019\\u00e9cole, au 45 rue d\\u2019Ulm. Il suffit de\\n traverser la cour aux Ernest puis de tourner tout de suite \\u00e0 gauche.

\"}, {\"type\": \"heading\", \"value\": \"Quand ?\"}, {\"type\": \"paragraph\", \"value\": \"

Le COF assure deux permanences tous les jours (sauf samedi et dimanche) : une de 12h \\u00e0 14h, et une de 18h \\u00e0 20h.

\"}, {\"type\": \"heading\", \"value\": \"Des questions ?\"}, {\"type\": \"paragraph\", \"value\": \"

Vous pouvez nous contacter facilement !

\\n\"}]", "body_fr": "[{\"type\": \"heading\", \"value\": \"Quoi ?\"}, {\"type\": \"paragraph\", \"value\": \"

Le COF (Comit\\u00e9 d\\u2019Organisation des F\\u00eates), c\\u2019est le petit nom de \\nl\\u2019AEENS, l\\u2019Association des \\u00c9l\\u00e8ves de l\\u2019ENS (association de loi 1901). \\nC\\u2019est lui qui organise les\\u00a0\\u00e9v\\u00e8nements\\u00a0culturels, associatifs et bien s\\u00fbr\\n festifs, de l\\u2019\\u00c9cole normale.

\\n

Ses principales responsabilit\\u00e9s sont entre autres :

\\n\\n

Il est bien s\\u00fbr tr\\u00e8s li\\u00e9 au BDS (Bureau des Sports) avec qui il pr\\u00e9pare les InterENS sportives, mais qui est\\u00a0n\\u00e9anmoins\\u00a0une entit\\u00e9 distincte du COF.

\"}, {\"type\": \"heading\", \"value\": \"Qui ?\"}, {\"type\": \"paragraph\", \"value\": \"

Le COF c\\u2019est avant tout ses membres (environ 700 chaque ann\\u00e9e) et ses\\n clubs (entre 20 et 40 selon les ann\\u00e9es). Chaque club est g\\u00e9r\\u00e9 par un \\nresponsable (voir les pages des clubs).

\\n

Comme dans toute association il y a un bureau \\u2013 compos\\u00e9 de 12 personnes r\\u00e9\\u00e9lues tous les 6 mois.

\\n

Le COF organise au moins 3 Assembl\\u00e9es G\\u00e9n\\u00e9rales par an, une en \\noctobre pour attribuer les budgets annuels, une en f\\u00e9vrier pour \\nr\\u00e9ajuster les budgets, discuter des projets, des affaires courantes ; et\\n la derni\\u00e8re en juin pour faire un bilan de l\\u2019ann\\u00e9e, voter les \\ncotisations et les partenariats. C\\u2019est l\\u2019occasion pour tous les membres \\nde se rassembler et de faire entendre leur voix, pour les clubs de se \\npr\\u00e9senter et pour le Bur\\u00f4\\u2026 et de vous rendre des comptes ! Il y en a \\naussi une avant chaque \\u00e9lection afin d\\u2019\\u00e9couter la pr\\u00e9sentation des \\ncandidats au Bur\\u00f4.

\"}, {\"type\": \"image\", \"value\": 33}, {\"type\": \"paragraph\", \"value\": \"Poste / Nom\\n\\n\\n\\n\\n\\t
Pr\\u00e9sident : Valentin Cocco
Vice-pr\\u00e9sident : Th\\u00e9o Mathevet
Tr\\u00e9sorier : Mathias Penot\\n\\n\\n\\t
Sous-tr\\u00e9sorier : Octave Tessiot
Secr\\u00e9taire : L\\u00e9na Gurriaran
Charg\\u00e9 de comm' : Cl\\u00e9ment de Mecquenem
Charg\\u00e9 de comm' adjoint : Charles Giroudot
Pr\\u00e9sidente du Bureau des Arts : Caroline Delattre
Bureau des Arts : Bryan Rimbault
Bureau des Arts : Philippe Danr\\u00e9
Bureau des Arts : Louise Garrigou
Bureau des Arts : Emile Laymand

Bureau des Arts : Cl\\u00e9mence Elmira

\"}, {\"type\": \"heading\", \"value\": \"O\\u00f9 ?\"}, {\"type\": \"paragraph\", \"value\": \"

Le COF dispose d\\u2019un local dans l\\u2019\\u00e9cole, au 45 rue d\\u2019Ulm. Il suffit de\\n traverser la cour aux Ernest puis de tourner tout de suite \\u00e0 gauche.

\"}, {\"type\": \"heading\", \"value\": \"Quand ?\"}, {\"type\": \"paragraph\", \"value\": \"

Le COF assure deux permanences tous les jours (sauf samedi et dimanche) : une de 12h \\u00e0 14h, et une de 18h \\u00e0 20h.

\"}, {\"type\": \"heading\", \"value\": \"Des questions ?\"}, {\"type\": \"paragraph\", \"value\": \"

Vous pouvez nous contacter facilement !

\\n\"}]", "body_en": "[]"}}, {"model": "cofcms.cofpage", "pk": 16, "fields": {"title_fr": "Cours Particuliers", "title_en": null, "slug_fr": "cours-particuliers", "slug_en": null, "url_path_fr": "/global/site/cours-particuliers/", "url_path_en": "/global/news/cours-particuliers/", "seo_title_fr": null, "seo_title_en": null, "search_description_fr": "", "search_description_en": "", "body": "[{\"type\": \"paragraph\", \"value\": \"

Les \\u00e9l\\u00e8ves de l'ENS peuvent donner des cours particuliers. Si vous \\n\\u00eates int\\u00e9ress\\u00e9 pour en prendre, merci de faire une demande de petits \\ncours sur cette page.

\\n \\n \\n\\t\\n\\t
\\n\\tSi vous \\u00eates \\u00e9l\\u00e8ve de l'\\u00e9cole, vous pouvez g\\u00e9rer vos petits cours sur GestioCOF.\"}]", "body_fr": "[{\"type\": \"paragraph\", \"value\": \"

Les \\u00e9l\\u00e8ves de l'ENS peuvent donner des cours particuliers. Si vous \\n\\u00eates int\\u00e9ress\\u00e9 pour en prendre, merci de faire une demande de petits \\ncours sur cette page.

\\n \\n \\n\\t\\n\\t
\\n\\tSi vous \\u00eates \\u00e9l\\u00e8ve de l'\\u00e9cole, vous pouvez g\\u00e9rer vos petits cours sur GestioCOF.\"}]", "body_en": "[]"}}, {"model": "cofcms.cofactuindexpage", "pk": 12, "fields": {"title_fr": "Actualit\u00e9s", "title_en": "News", "slug_fr": "actualites", "slug_en": "news", "url_path_fr": "/global/site/actualites/", "url_path_en": "/global/news/news/", "seo_title_fr": null, "seo_title_en": null, "search_description_fr": "", "search_description_en": ""}}, {"model": "cofcms.cofactupage", "pk": 17, "fields": {"title_fr": "Singin' in the R'ENS", "title_en": null, "slug_fr": "singin-in-the-rens", "slug_en": null, "url_path_fr": "/global/site/actualites/singin-in-the-rens/", "url_path_en": "/global/news/news/singin-in-the-rens/", "seo_title_fr": null, "seo_title_en": null, "search_description_fr": "", "search_description_en": "", "chapo": "Soir\u00e9e com\u00e9die musicale", "chapo_fr": "Soir\u00e9e com\u00e9die musicale", "chapo_en": "", "body": "Je chante dans l'ENS
Je chante dans l'ENS
Cette glorieuse soir\u00e9e
Me rendra le sourire
Je tournoie sur la piste
Lumi\u00e8re noire au plafond
Vibrations dans mon coeur
Et j'suis pr\u00eat\u00b7e \u00e0 chanter
Que la foule endiabl\u00e9e
Chasse tous mes tracassins
Viens \u00e0 notre soir\u00e9e
On va bien s'amuser
Oui descends en K-F\u00eat
Avec le sourire aux l\u00e8vres
Et puis chante
Chante dans l'ENS !

\n Une ambiance de com\u00e9die musicale, de la danse, du chant, et beaucoup de\n bonne humeur : venez nombreux\u00b7ses jeudi 25 janvier pour notre soir\u00e9e \nSingin' in the R'ENS, qui aura lieu en K-F\u00eat d\u00e8s 23h !

", "body_fr": "Je chante dans l'ENS
Je chante dans l'ENS
Cette glorieuse soir\u00e9e
Me rendra le sourire
Je tournoie sur la piste
Lumi\u00e8re noire au plafond
Vibrations dans mon coeur
Et j'suis pr\u00eat\u00b7e \u00e0 chanter
Que la foule endiabl\u00e9e
Chasse tous mes tracassins
Viens \u00e0 notre soir\u00e9e
On va bien s'amuser
Oui descends en K-F\u00eat
Avec le sourire aux l\u00e8vres
Et puis chante
Chante dans l'ENS !

\n Une ambiance de com\u00e9die musicale, de la danse, du chant, et beaucoup de\n bonne humeur : venez nombreux\u00b7ses jeudi 25 janvier pour notre soir\u00e9e \nSingin' in the R'ENS, qui aura lieu en K-F\u00eat d\u00e8s 23h !

", "body_en": "", "image": 34, "is_event": true, "date_start": "2018-01-25T21:00:00Z", "date_end": null, "all_day": false}}, {"model": "cofcms.cofactupage", "pk": 18, "fields": {"title_fr": "Le Retour du Bur\u00f4", "title_en": null, "slug_fr": "le-retour-du-bur\u00f4", "slug_en": null, "url_path_fr": "/global/site/actualites/le-retour-du-bur\u00f4/", "url_path_en": "/global/news/news/le-retour-du-bur\u00f4/", "seo_title_fr": null, "seo_title_en": null, "search_description_fr": "", "search_description_en": "", "chapo": "Premi\u00e8re soir\u00e9e du nouveau COF", "chapo_fr": "Premi\u00e8re soir\u00e9e du nouveau COF", "chapo_en": "", "body": "Le Retour du \nBur\u00f4, qu'est-ce que c'est donc ? La premi\u00e8re soir\u00e9e du nouveau COF pardi\n ! Le th\u00e8me ? Top : je suis une saga cin\u00e9matographique \u00e0 grand succ\u00e8s, \nje compte actuellement huit \u00e9pisodes (et demi) \u00e0 mon actif, j'ai fait \nr\u00eaver des g\u00e9n\u00e9rations enti\u00e8res depuis 1977, m\u00eame sans m'avoir vu vous me\n connaissez sans doute pour une c\u00e9l\u00e8bre r\u00e9plique, je suis, je suis... Je\n suis ton p\u00e8re ! Hum hum, je suis : Star Wars !
Au programme, bracelets-lasers, \u00e9toiles dans les yeux, et voyage musical interstellaire.

Rendez-vous jeudi 18 janvier en K-F\u00eat, \u00e0 partir de 22h ! Venez du COFt\u00e9 obscur, on a des cookies !

", "body_fr": "Le Retour du \nBur\u00f4, qu'est-ce que c'est donc ? La premi\u00e8re soir\u00e9e du nouveau COF pardi\n ! Le th\u00e8me ? Top : je suis une saga cin\u00e9matographique \u00e0 grand succ\u00e8s, \nje compte actuellement huit \u00e9pisodes (et demi) \u00e0 mon actif, j'ai fait \nr\u00eaver des g\u00e9n\u00e9rations enti\u00e8res depuis 1977, m\u00eame sans m'avoir vu vous me\n connaissez sans doute pour une c\u00e9l\u00e8bre r\u00e9plique, je suis, je suis... Je\n suis ton p\u00e8re ! Hum hum, je suis : Star Wars !
Au programme, bracelets-lasers, \u00e9toiles dans les yeux, et voyage musical interstellaire.

Rendez-vous jeudi 18 janvier en K-F\u00eat, \u00e0 partir de 22h ! Venez du COFt\u00e9 obscur, on a des cookies !

", "body_en": "", "image": 35, "is_event": true, "date_start": "2018-01-18T21:00:00Z", "date_end": null, "all_day": false}}, {"model": "cofcms.cofactupage", "pk": 19, "fields": {"title_fr": "\u00c9lection du Bur\u00f4 2018", "title_en": null, "slug_fr": "\u00e9lection-du-bur\u00f4-2018", "slug_en": null, "url_path_fr": "/global/site/actualites/\u00e9lection-du-bur\u00f4-2018/", "url_path_en": "/global/news/news/\u00e9lection-du-bur\u00f4-2018/", "seo_title_fr": null, "seo_title_en": null, "search_description_fr": "", "search_description_en": "", "chapo": "", "chapo_fr": "", "chapo_en": "", "body": "Les campagnes battent leurs pleins rythm\u00e9es par de nombreux petits \nd\u00e9jeuners, soir\u00e9es et autres \u00e9v\u00e9nements organis\u00e9s par les diff\u00e9rentes \nlistes et ces deux semaines se finiront par l\u2019\u00e9lection du nouveau Bur\u00f4.\n

\u00a0

\n

\u00a0

\n

Passez donc en aquarium pour le premier tour des \u00e9lections du Bur\u00f4 du\n COF 2018 ! Si vous ne pouvez pas venir en personne, un vote \n\u00e9lectronique sera mis en place !

", "body_fr": "Les campagnes battent leurs pleins rythm\u00e9es par de nombreux petits \nd\u00e9jeuners, soir\u00e9es et autres \u00e9v\u00e9nements organis\u00e9s par les diff\u00e9rentes \nlistes et ces deux semaines se finiront par l\u2019\u00e9lection du nouveau Bur\u00f4.\n

\u00a0

\n

\u00a0

\n

Passez donc en aquarium pour le premier tour des \u00e9lections du Bur\u00f4 du\n COF 2018 ! Si vous ne pouvez pas venir en personne, un vote \n\u00e9lectronique sera mis en place !

", "body_en": "", "image": 36, "is_event": false, "date_start": "2017-12-18T19:22:00Z", "date_end": "2018-01-25T19:22:00Z", "all_day": true}}, {"model": "cofcms.cofdirectorypage", "pk": 14, "fields": {"title_fr": "Clubs", "title_en": null, "slug_fr": "clubs", "slug_en": null, "url_path_fr": "/global/site/clubs/", "url_path_en": "/global/news/clubs/", "seo_title_fr": null, "seo_title_en": null, "search_description_fr": "", "search_description_en": "", "introduction": "
\nVoici tous les clubs du COF !\n

La plupart de ces clubs ont des mailing lists, auxquelles il est souvent possible de s\u2019inscrire via le serveur mail sympa.

", "introduction_fr": "
\nVoici tous les clubs du COF !\n

La plupart de ces clubs ont des mailing lists, auxquelles il est souvent possible de s\u2019inscrire via le serveur mail sympa.

", "introduction_en": ""}}, {"model": "cofcms.cofdirectorypage", "pk": 15, "fields": {"title_fr": "Partenaires", "title_en": null, "slug_fr": "partenaires", "slug_en": null, "url_path_fr": "/global/site/partenaires/", "url_path_en": "/global/news/partenaires/", "seo_title_fr": null, "seo_title_en": null, "search_description_fr": "", "search_description_en": "", "introduction": "

Le COF a n\u00e9goci\u00e9 pour vous de nombreux partenariats ! Bien s\u00fbr, il faut \u00eatre membre du COF pour en b\u00e9n\u00e9ficier.

", "introduction_fr": "

Le COF a n\u00e9goci\u00e9 pour vous de nombreux partenariats ! Bien s\u00fbr, il faut \u00eatre membre du COF pour en b\u00e9n\u00e9ficier.

", "introduction_en": ""}}, {"model": "cofcms.cofdirectoryentrypage", "pk": 20, "fields": {"title_fr": "Arts Plastiques", "title_en": null, "slug_fr": "arts-plastiques", "slug_en": null, "url_path_fr": "/global/site/clubs/arts-plastiques/", "url_path_en": "/global/news/clubs/arts-plastiques/", "seo_title_fr": null, "seo_title_en": null, "search_description_fr": "", "search_description_en": "", "body": "Le club Arts Plastiques te propose un lieu de rencontre entre \npersonnes int\u00e9ress\u00e9es par les arts plastiques, le dessin ou la peinture.
\nMais, que faisons-nous au club Arts Plastiques ? D\u2019abord, des s\u00e9ances \nd\u2019initiation; et puis des s\u00e9ances \u00e0 th\u00e8me, avec des intervenants; des \nprojets communs; des sorties croquis\u2026

\nQue tu n\u2019aies jamais touch\u00e9 \u00e0 un pinceau, ou que tu sois d\u00e9j\u00e0 un-e grand-e artiste, n\u2019h\u00e9site pas \u00e0 venir nous rejoindre !

", "body_fr": "Le club Arts Plastiques te propose un lieu de rencontre entre \npersonnes int\u00e9ress\u00e9es par les arts plastiques, le dessin ou la peinture.
\nMais, que faisons-nous au club Arts Plastiques ? D\u2019abord, des s\u00e9ances \nd\u2019initiation; et puis des s\u00e9ances \u00e0 th\u00e8me, avec des intervenants; des \nprojets communs; des sorties croquis\u2026

\nQue tu n\u2019aies jamais touch\u00e9 \u00e0 un pinceau, ou que tu sois d\u00e9j\u00e0 un-e grand-e artiste, n\u2019h\u00e9site pas \u00e0 venir nous rejoindre !

", "body_en": "", "links": "[{\"type\": \"contact\", \"value\": {\"texte\": \"Mailing-liste\", \"email\": \"artsplastiques@ens.fr\"}}]", "links_fr": "[{\"type\": \"contact\", \"value\": {\"texte\": \"Mailing-liste\", \"email\": \"artsplastiques@ens.fr\"}}]", "links_en": "[]", "image": 37}}, {"model": "cofcms.cofdirectoryentrypage", "pk": 21, "fields": {"title_fr": "B\u00e9d\u00e9th\u00e8que", "title_en": null, "slug_fr": "b\u00e9d\u00e9th\u00e8que", "slug_en": null, "url_path_fr": "/global/site/clubs/b\u00e9d\u00e9th\u00e8que/", "url_path_en": "/global/news/clubs/b\u00e9d\u00e9th\u00e8que/", "seo_title_fr": null, "seo_title_en": null, "search_description_fr": "", "search_description_en": "", "body": "De Riad Sattouf \u00e0 Katsuhiro Otomo, en passant par Andr\u00e9 Franquin, \nJacques Tardi, Didier Tarquin et Georges Wolinski, la BDth\u00e8que poss\u00e8de \nune collection de quatre mille bandes dessin\u00e9es sur une cinquantaine \nd\u2019\u00e9tag\u00e8res, en constante croissance. Class\u00e9es par dessinateur et \ncatalogu\u00e9es, toutes ces oeuvres offrent un large panorama du XXe si\u00e8cle \net sont librement consultables sur place sans mod\u00e9ration ! \u00c0 cela \ns\u2019ajoutent des milliers de p\u00e9riodiques sp\u00e9cialis\u00e9s datant de l\u2019\u00e2ge d\u2019or \nde la BD franco-belge, un Enfer cach\u00e9, et quelques conseils de lecture \n\u00e9crits par des fans.

\nLe club organise ausis des \u00e9v\u00e9nements divers par exemple un s\u00e9minaire \nsur la bande dessin\u00e9e, qui ne demande qu\u2019\u00e0 \u00eatre relanc\u00e9. \u00c0 l\u2019ordre du \njour, la mise en place d\u2019une exp\u00e9dition \u00e0 Angoul\u00eame avec le BDA en \njanvier 2017 pourrait m\u00eame se faire avec ton aide. Tous les \ndons et suggestions d\u2019achats sont les bienvenus. Pour participer aux \nd\u00e9cisions d\u2019achats, \u00e9crire des suggesions de lecture dans le BOcal, \nchoisir les bandes dessin\u00e9es \u00e0 mettre en valeur, n\u2019h\u00e9site pas \u00e0 \nrejoindre le club!

", "body_fr": "De Riad Sattouf \u00e0 Katsuhiro Otomo, en passant par Andr\u00e9 Franquin, \nJacques Tardi, Didier Tarquin et Georges Wolinski, la BDth\u00e8que poss\u00e8de \nune collection de quatre mille bandes dessin\u00e9es sur une cinquantaine \nd\u2019\u00e9tag\u00e8res, en constante croissance. Class\u00e9es par dessinateur et \ncatalogu\u00e9es, toutes ces oeuvres offrent un large panorama du XXe si\u00e8cle \net sont librement consultables sur place sans mod\u00e9ration ! \u00c0 cela \ns\u2019ajoutent des milliers de p\u00e9riodiques sp\u00e9cialis\u00e9s datant de l\u2019\u00e2ge d\u2019or \nde la BD franco-belge, un Enfer cach\u00e9, et quelques conseils de lecture \n\u00e9crits par des fans.

\nLe club organise ausis des \u00e9v\u00e9nements divers par exemple un s\u00e9minaire \nsur la bande dessin\u00e9e, qui ne demande qu\u2019\u00e0 \u00eatre relanc\u00e9. \u00c0 l\u2019ordre du \njour, la mise en place d\u2019une exp\u00e9dition \u00e0 Angoul\u00eame avec le BDA en \njanvier 2017 pourrait m\u00eame se faire avec ton aide. Tous les \ndons et suggestions d\u2019achats sont les bienvenus. Pour participer aux \nd\u00e9cisions d\u2019achats, \u00e9crire des suggesions de lecture dans le BOcal, \nchoisir les bandes dessin\u00e9es \u00e0 mettre en valeur, n\u2019h\u00e9site pas \u00e0 \nrejoindre le club!

", "body_en": "", "links": "[{\"type\": \"contact\", \"value\": {\"texte\": \"Mailing-liste\", \"email\": \"bdtheque@ens.fr\"}}]", "links_fr": "[{\"type\": \"contact\", \"value\": {\"texte\": \"Mailing-liste\", \"email\": \"bdtheque@ens.fr\"}}]", "links_en": "[]", "image": null}}, {"model": "cofcms.cofdirectoryentrypage", "pk": 22, "fields": {"title_fr": "MGEN", "title_en": null, "slug_fr": "mgen", "slug_en": null, "url_path_fr": "/global/site/partenaires/mgen/", "url_path_en": "/global/news/partenaires/mgen/", "seo_title_fr": null, "seo_title_en": null, "search_description_fr": "", "search_description_en": "", "body": "

La MGEN est un des \nprincipaux partenaires du COF. Elle\u00a0participe au financement des \nprincipaux \u00e9v\u00e9nements (Jour le plus court, 48h des Arts) et \u00e0 \nl\u2019impression de la Plakette Alpha.

\n

Elle dispose \u00e9galement d\u2019un stand chaque ann\u00e9e au moment de la \nrentr\u00e9e, afin de proposer ses prestations aux pensionnaires de l\u2019Ecole.

", "body_fr": "

La MGEN est un des \nprincipaux partenaires du COF. Elle\u00a0participe au financement des \nprincipaux \u00e9v\u00e9nements (Jour le plus court, 48h des Arts) et \u00e0 \nl\u2019impression de la Plakette Alpha.

\n

Elle dispose \u00e9galement d\u2019un stand chaque ann\u00e9e au moment de la \nrentr\u00e9e, afin de proposer ses prestations aux pensionnaires de l\u2019Ecole.

", "body_en": "", "links": "[{\"type\": \"lien\", \"value\": {\"texte\": \"Site internet\", \"url\": \"https://www.mgen.fr/accueil/\"}}]", "links_fr": "[{\"type\": \"lien\", \"value\": {\"texte\": \"Site internet\", \"url\": \"https://www.mgen.fr/accueil/\"}}]", "links_en": "[]", "image": 38}}, {"model": "cofcms.cofdirectoryentrypage", "pk": 23, "fields": {"title_fr": "Soci\u00e9t\u00e9 G\u00e9n\u00e9rale", "title_en": null, "slug_fr": "soci\u00e9t\u00e9-g\u00e9n\u00e9rale", "slug_en": null, "url_path_fr": "/global/site/partenaires/soci\u00e9t\u00e9-g\u00e9n\u00e9rale/", "url_path_en": "/global/news/partenaires/soci\u00e9t\u00e9-g\u00e9n\u00e9rale/", "seo_title_fr": null, "seo_title_en": null, "search_description_fr": "", "search_description_en": "", "body": "

Si vous ouvrez un compte \u00e0 la SoG\u00e9, ils vous versent 140\u20ac et versent \naussi une somme au bureau, nous permettant de financer vos clubs et \n\u00e9v\u00e8nements. Vous pouvez donc rembourser votre cotisation au COF (voire \nplus) rien qu\u2019en ouvrant un compte !

\n

Vous devez ouvrir ce compte lors des journ\u00e9es de rentr\u00e9e, lorsque la \nSoG\u00e9 a un stand \u00e0 l\u2019Ecole, ou toute l\u2019ann\u00e9e \u00e0 leur agence au 38 rue \nGay-Lussac.

", "body_fr": "

Si vous ouvrez un compte \u00e0 la SoG\u00e9, ils vous versent 140\u20ac et versent \naussi une somme au bureau, nous permettant de financer vos clubs et \n\u00e9v\u00e8nements. Vous pouvez donc rembourser votre cotisation au COF (voire \nplus) rien qu\u2019en ouvrant un compte !

\n

Vous devez ouvrir ce compte lors des journ\u00e9es de rentr\u00e9e, lorsque la \nSoG\u00e9 a un stand \u00e0 l\u2019Ecole, ou toute l\u2019ann\u00e9e \u00e0 leur agence au 38 rue \nGay-Lussac.

", "body_en": "", "links": "[]", "links_fr": "[]", "links_en": "[]", "image": null}}] \ No newline at end of file diff --git a/gestioncof/cms/fixtures/wagtail_cof_cms.json b/gestioncof/cms/fixtures/wagtail_cof_cms.json deleted file mode 100644 index f0d74dcc..00000000 --- a/gestioncof/cms/fixtures/wagtail_cof_cms.json +++ /dev/null @@ -1 +0,0 @@ -[{"pk": 11, "fields": {"url_path_fr": "/global/site-du-cof/", "title_fr": "Site du COF", "url_path_en": "/global/site-du-cof/", "seo_title_fr": "", "introduction_fr": "

Bienvenue sur le site du COF

", "search_description_en": "", "title_en": "", "seo_title_en": "", "introduction_en": "", "search_description_fr": "", "slug_fr": "site-du-cof", "slug_en": "", "introduction": "

Bienvenue sur le site du COF

"}, "model": "cofcms.cofrootpage"}, {"pk": 15, "fields": {"body_fr": "[{\"type\": \"heading\", \"value\": \"Quoi ?\"}, {\"type\": \"paragraph\", \"value\": \"

Le COF (Comit\\u00e9 d\\u2019Organisation des F\\u00eates), c\\u2019est le petit nom de \\nl\\u2019AEENS, l\\u2019Association des \\u00c9l\\u00e8ves de l\\u2019ENS (association de loi 1901). \\nC\\u2019est lui qui organise les\\u00a0\\u00e9v\\u00e8nements\\u00a0culturels, associatifs et bien s\\u00fbr\\n festifs, de l\\u2019\\u00c9cole normale.

\\n

Ses principales responsabilit\\u00e9s sont entre autres :

\\n\\n

Il est bien s\\u00fbr tr\\u00e8s li\\u00e9 au BDS (Bureau des Sports) avec qui il pr\\u00e9pare les InterENS sportives, mais qui est\\u00a0n\\u00e9anmoins\\u00a0une entit\\u00e9 distincte du COF.

\"}, {\"type\": \"heading\", \"value\": \"Qui ?\"}, {\"type\": \"paragraph\", \"value\": \"

Le COF c\\u2019est avant tout ses membres (environ 700 chaque ann\\u00e9e) et ses\\n clubs (entre 20 et 40 selon les ann\\u00e9es). Chaque club est g\\u00e9r\\u00e9 par un \\nresponsable (voir les pages des clubs).

\\n

Comme dans toute association il y a un bureau \\u2013 compos\\u00e9 de 12 personnes r\\u00e9\\u00e9lues tous les 6 mois.

\\n

Le COF organise au moins 3 Assembl\\u00e9es G\\u00e9n\\u00e9rales par an, une en \\noctobre pour attribuer les budgets annuels, une en f\\u00e9vrier pour \\nr\\u00e9ajuster les budgets, discuter des projets, des affaires courantes ; et\\n la derni\\u00e8re en juin pour faire un bilan de l\\u2019ann\\u00e9e, voter les \\ncotisations et les partenariats. C\\u2019est l\\u2019occasion pour tous les membres \\nde se rassembler et de faire entendre leur voix, pour les clubs de se \\npr\\u00e9senter et pour le Bur\\u00f4\\u2026 et de vous rendre des comptes ! Il y en a \\naussi une avant chaque \\u00e9lection afin d\\u2019\\u00e9couter la pr\\u00e9sentation des \\ncandidats au Bur\\u00f4.

\"}]", "url_path_fr": "/global/site-du-cof/prsentation/", "title_fr": "Pr\u00e9sentation", "url_path_en": "/global/site-du-cof/presentation/", "seo_title_fr": "", "search_description_en": "", "title_en": "Presentation", "seo_title_en": "", "body_en": "[]", "search_description_fr": "", "slug_fr": "prsentation", "slug_en": "presentation", "body": "[{\"type\": \"heading\", \"value\": \"Quoi ?\"}, {\"type\": \"paragraph\", \"value\": \"

Le COF (Comit\\u00e9 d\\u2019Organisation des F\\u00eates), c\\u2019est le petit nom de \\nl\\u2019AEENS, l\\u2019Association des \\u00c9l\\u00e8ves de l\\u2019ENS (association de loi 1901). \\nC\\u2019est lui qui organise les\\u00a0\\u00e9v\\u00e8nements\\u00a0culturels, associatifs et bien s\\u00fbr\\n festifs, de l\\u2019\\u00c9cole normale.

\\n

Ses principales responsabilit\\u00e9s sont entre autres :

\\n\\n

Il est bien s\\u00fbr tr\\u00e8s li\\u00e9 au BDS (Bureau des Sports) avec qui il pr\\u00e9pare les InterENS sportives, mais qui est\\u00a0n\\u00e9anmoins\\u00a0une entit\\u00e9 distincte du COF.

\"}, {\"type\": \"heading\", \"value\": \"Qui ?\"}, {\"type\": \"paragraph\", \"value\": \"

Le COF c\\u2019est avant tout ses membres (environ 700 chaque ann\\u00e9e) et ses\\n clubs (entre 20 et 40 selon les ann\\u00e9es). Chaque club est g\\u00e9r\\u00e9 par un \\nresponsable (voir les pages des clubs).

\\n

Comme dans toute association il y a un bureau \\u2013 compos\\u00e9 de 12 personnes r\\u00e9\\u00e9lues tous les 6 mois.

\\n

Le COF organise au moins 3 Assembl\\u00e9es G\\u00e9n\\u00e9rales par an, une en \\noctobre pour attribuer les budgets annuels, une en f\\u00e9vrier pour \\nr\\u00e9ajuster les budgets, discuter des projets, des affaires courantes ; et\\n la derni\\u00e8re en juin pour faire un bilan de l\\u2019ann\\u00e9e, voter les \\ncotisations et les partenariats. C\\u2019est l\\u2019occasion pour tous les membres \\nde se rassembler et de faire entendre leur voix, pour les clubs de se \\npr\\u00e9senter et pour le Bur\\u00f4\\u2026 et de vous rendre des comptes ! Il y en a \\naussi une avant chaque \\u00e9lection afin d\\u2019\\u00e9couter la pr\\u00e9sentation des \\ncandidats au Bur\\u00f4.

\"}]"}, "model": "cofcms.cofpage"}, {"pk": 12, "fields": {"search_description_fr": "", "title_en": "News", "url_path_fr": "/global/site-du-cof/actualites/", "title_fr": "Actualit\u00e9s", "url_path_en": "/global/site-du-cof/news/", "seo_title_fr": "", "slug_fr": "actualites", "slug_en": "news", "search_description_en": "", "seo_title_en": ""}, "model": "cofcms.cofactuindexpage"}, {"pk": 18, "fields": {"date": "2017-08-26", "body_fr": "

Venez faire la f\u00eate en K-F\u00eat.

C'est une bonne id\u00e9e pour r\u00e9ussir ses oraux !

", "url_path_fr": "/global/site-du-cof/actualites/accueil-des-admissibles/", "title_fr": "Accueil des admissibles", "url_path_en": "/global/site-du-cof/news/accueil-des-admissibles/", "image": 36, "seo_title_fr": "", "search_description_en": "", "title_en": "Welcoming the conscrits-to-come", "seo_title_en": "", "body_en": "", "search_description_fr": "", "slug_fr": "accueil-des-admissibles", "slug_en": "", "body": "

Venez faire la f\u00eate en K-F\u00eat.

C'est une bonne id\u00e9e pour r\u00e9ussir ses oraux !

"}, "model": "cofcms.cofactupage"}, {"pk": 13, "fields": {"body_fr": "

H\u00e9 les gars viendez on va se tr\u00e9mousser en K-F\u00eat !

", "url_path_fr": "/global/site-du-cof/actualites/soire-en-k-ft/", "title_fr": "Soir\u00e9e en K-F\u00eat", "date_start": "2017-08-18T20:00:00Z", "url_path_en": "/global/site-du-cof/news/party-in-k-ft/", "chapo_en": "Big party", "seo_title_fr": "", "chapo_fr": "Grosse soir\u00e9e", "image": 34, "all_day": false, "chapo": "Grosse soir\u00e9e", "search_description_en": "", "title_en": "Party in K-F\u00eat", "seo_title_en": "", "body_en": "

Hey guys come on, let's be wasted in K-F\u00eat!

", "search_description_fr": "", "slug_fr": "soire-en-k-ft", "slug_en": "party-in-k-ft", "body": "

H\u00e9 les gars viendez on va se tr\u00e9mousser en K-F\u00eat !

", "date_end": null}, "model": "cofcms.cofactueventpage"}, {"pk": 17, "fields": {"body_fr": "

Rendez vous au 45 rue d'Ulm pour la plus grosse soir\u00e9e de l'ann\u00e9e.

", "url_path_fr": "/global/site-du-cof/actualites/soire-de-nol/", "title_fr": "Soir\u00e9e de No\u00ebl", "date_start": "2017-08-30T15:00:00Z", "url_path_en": "/global/site-du-cof/news/soire-de-nol/", "chapo_en": "", "seo_title_fr": "", "chapo_fr": "Grosse soir\u00e9e en bo\u00eete pour f\u00eater la fin de l'ann\u00e9e !", "image": 35, "all_day": false, "chapo": "Grosse soir\u00e9e en bo\u00eete pour f\u00eater la fin de l'ann\u00e9e !", "search_description_en": "", "title_en": "", "seo_title_en": "", "body_en": "", "search_description_fr": "", "slug_fr": "soire-de-nol", "slug_en": "", "body": "

Rendez vous au 45 rue d'Ulm pour la plus grosse soir\u00e9e de l'ann\u00e9e.

", "date_end": "2017-08-31T16:00:00Z"}, "model": "cofcms.cofactueventpage"}, {"pk": 14, "fields": {"url_path_fr": "/global/site-du-cof/clubs/", "title_fr": "Clubs", "url_path_en": "/global/site-du-cof/clubs/", "seo_title_fr": "", "introduction_fr": "

Tous les clubs de l'ENS

", "search_description_en": "", "title_en": "", "seo_title_en": "", "introduction_en": "

All the clubs in the ENS

", "search_description_fr": "", "slug_fr": "clubs", "slug_en": "", "introduction": "

Tous les clubs de l'ENS

"}, "model": "cofcms.cofdirectorypage"}, {"pk": 16, "fields": {"body_fr": "

Des jolies affiches dans l'ENS

", "url_path_fr": "/global/site-du-cof/clubs/graphiche/", "title_fr": "Graph'iche", "url_path_en": "/global/site-du-cof/clubs/graphiche/", "links_en": "[]", "seo_title_fr": "", "links_fr": "[{\"type\": \"lien\", \"value\": {\"url\": \"http://evarin.fr\", \"texte\": \"Site\"}}, {\"type\": \"contact\", \"value\": {\"email\": \"graphiche@ens.fr\", \"texte\": \"Mailing-list\"}}]", "image": 33, "search_description_en": "", "title_en": "", "links": "[{\"type\": \"lien\", \"value\": {\"url\": \"http://evarin.fr\", \"texte\": \"Site\"}}, {\"type\": \"contact\", \"value\": {\"email\": \"graphiche@ens.fr\", \"texte\": \"Mailing-list\"}}]", "seo_title_en": "", "body_en": "", "search_description_fr": "", "slug_fr": "graphiche", "slug_en": "", "body": "

Des jolies affiches dans l'ENS

"}, "model": "cofcms.cofdirectoryentrypage"}, {"pk": 19, "fields": {"body_fr": "

Le club de d\u00e9bat

", "url_path_fr": "/global/site-du-cof/clubs/eloquens/", "title_fr": "Eloqu'ENS", "url_path_en": "/global/site-du-cof/clubs/eloquens/", "links_en": "[]", "seo_title_fr": "", "links_fr": "[{\"type\": \"contact\", \"value\": {\"email\": \"eloquens@ens.fr\", \"texte\": \"Mailing-liste\"}}]", "image": 37, "search_description_en": "", "title_en": "", "links": "[{\"type\": \"contact\", \"value\": {\"email\": \"eloquens@ens.fr\", \"texte\": \"Mailing-liste\"}}]", "seo_title_en": "", "body_en": "", "search_description_fr": "", "slug_fr": "eloquens", "slug_en": "", "body": "

Le club de d\u00e9bat

"}, "model": "cofcms.cofdirectoryentrypage"}] \ No newline at end of file diff --git a/gestioncof/cms/migrations/0001_initial.py b/gestioncof/cms/migrations/0001_initial.py index e9abe2fb..77b6d4a5 100644 --- a/gestioncof/cms/migrations/0001_initial.py +++ b/gestioncof/cms/migrations/0001_initial.py @@ -1,197 +1,175 @@ # -*- coding: utf-8 -*- +# Generated by Django 1.11.9 on 2018-01-20 19:10 from __future__ import unicode_literals from django.db import migrations, models -import wagtail.wagtailcore.fields -import wagtail.wagtailimages.blocks +import django.db.models.deletion import gestioncof.cms.models import wagtail.wagtailcore.blocks -import django.db.models.deletion +import wagtail.wagtailcore.fields +import wagtail.wagtailimages.blocks class Migration(migrations.Migration): + initial = True + dependencies = [ ('wagtailcore', '0033_remove_golive_expiry_help_text'), ('wagtailimages', '0019_delete_filter'), ] operations = [ - migrations.CreateModel( - name='COFActuEventPage', - fields=[ - ('page_ptr', models.OneToOneField(serialize=False, parent_link=True, to='wagtailcore.Page', primary_key=True, auto_created=True)), - ('title_fr', models.CharField(null=True, verbose_name='title', help_text="The page title as you'd like it to be seen by the public", max_length=255)), - ('title_en', models.CharField(null=True, verbose_name='title', help_text="The page title as you'd like it to be seen by the public", max_length=255)), - ('slug_fr', models.SlugField(null=True, help_text='The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/', verbose_name='slug', max_length=255)), - ('slug_en', models.SlugField(null=True, help_text='The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/', verbose_name='slug', max_length=255)), - ('url_path_fr', models.TextField(null=True, blank=True, editable=False, verbose_name='URL path')), - ('url_path_en', models.TextField(null=True, blank=True, editable=False, verbose_name='URL path')), - ('seo_title_fr', models.CharField(null=True, blank=True, verbose_name='page title', help_text="Optional. 'Search Engine Friendly' title. This will appear at the top of the browser window.", max_length=255)), - ('seo_title_en', models.CharField(null=True, blank=True, verbose_name='page title', help_text="Optional. 'Search Engine Friendly' title. This will appear at the top of the browser window.", max_length=255)), - ('search_description_fr', models.TextField(null=True, blank=True, verbose_name='search description')), - ('search_description_en', models.TextField(null=True, blank=True, verbose_name='search description')), - ('chapo', models.TextField(verbose_name='Description rapide')), - ('chapo_fr', models.TextField(null=True, verbose_name='Description rapide')), - ('chapo_en', models.TextField(null=True, verbose_name='Description rapide')), - ('body', wagtail.wagtailcore.fields.RichTextField(verbose_name='Description longue')), - ('body_fr', wagtail.wagtailcore.fields.RichTextField(null=True, verbose_name='Description longue')), - ('body_en', wagtail.wagtailcore.fields.RichTextField(null=True, verbose_name='Description longue')), - ('date_start', models.DateTimeField(verbose_name='Date et heure de début')), - ('date_end', models.DateTimeField(null=True, blank=True, default=None, verbose_name='Date et heure de fin')), - ('all_day', models.BooleanField(default=False, verbose_name='Toute la journée')), - ('image', models.ForeignKey(null=True, blank=True, on_delete=django.db.models.deletion.SET_NULL, to='wagtailimages.Image', related_name='+', verbose_name='Image à la Une')), - ], - options={ - 'verbose_name_plural': 'Actus liées à des évènements', - 'verbose_name': 'Actu liée à un évènement', - }, - bases=('wagtailcore.page',), - ), migrations.CreateModel( name='COFActuIndexPage', fields=[ - ('page_ptr', models.OneToOneField(serialize=False, parent_link=True, to='wagtailcore.Page', primary_key=True, auto_created=True)), - ('title_fr', models.CharField(null=True, verbose_name='title', help_text="The page title as you'd like it to be seen by the public", max_length=255)), - ('title_en', models.CharField(null=True, verbose_name='title', help_text="The page title as you'd like it to be seen by the public", max_length=255)), - ('slug_fr', models.SlugField(null=True, help_text='The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/', verbose_name='slug', max_length=255)), - ('slug_en', models.SlugField(null=True, help_text='The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/', verbose_name='slug', max_length=255)), - ('url_path_fr', models.TextField(null=True, blank=True, editable=False, verbose_name='URL path')), - ('url_path_en', models.TextField(null=True, blank=True, editable=False, verbose_name='URL path')), - ('seo_title_fr', models.CharField(null=True, blank=True, verbose_name='page title', help_text="Optional. 'Search Engine Friendly' title. This will appear at the top of the browser window.", max_length=255)), - ('seo_title_en', models.CharField(null=True, blank=True, verbose_name='page title', help_text="Optional. 'Search Engine Friendly' title. This will appear at the top of the browser window.", max_length=255)), - ('search_description_fr', models.TextField(null=True, blank=True, verbose_name='search description')), - ('search_description_en', models.TextField(null=True, blank=True, verbose_name='search description')), + ('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.Page')), + ('title_fr', models.CharField(help_text="The page title as you'd like it to be seen by the public", max_length=255, null=True, verbose_name='title')), + ('title_en', models.CharField(help_text="The page title as you'd like it to be seen by the public", max_length=255, null=True, verbose_name='title')), + ('slug_fr', models.SlugField(allow_unicode=True, help_text='The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/', max_length=255, null=True, verbose_name='slug')), + ('slug_en', models.SlugField(allow_unicode=True, help_text='The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/', max_length=255, null=True, verbose_name='slug')), + ('url_path_fr', models.TextField(blank=True, editable=False, null=True, verbose_name='URL path')), + ('url_path_en', models.TextField(blank=True, editable=False, null=True, verbose_name='URL path')), + ('seo_title_fr', models.CharField(blank=True, help_text="Optional. 'Search Engine Friendly' title. This will appear at the top of the browser window.", max_length=255, null=True, verbose_name='page title')), + ('seo_title_en', models.CharField(blank=True, help_text="Optional. 'Search Engine Friendly' title. This will appear at the top of the browser window.", max_length=255, null=True, verbose_name='page title')), + ('search_description_fr', models.TextField(blank=True, null=True, verbose_name='search description')), + ('search_description_en', models.TextField(blank=True, null=True, verbose_name='search description')), ], options={ - 'verbose_name_plural': 'Indexs des actualités', 'verbose_name': 'Index des actualités', + 'verbose_name_plural': 'Indexs des actualités', }, bases=('wagtailcore.page', gestioncof.cms.models.COFActuIndexMixin), ), migrations.CreateModel( name='COFActuPage', fields=[ - ('page_ptr', models.OneToOneField(serialize=False, parent_link=True, to='wagtailcore.Page', primary_key=True, auto_created=True)), - ('title_fr', models.CharField(null=True, verbose_name='title', help_text="The page title as you'd like it to be seen by the public", max_length=255)), - ('title_en', models.CharField(null=True, verbose_name='title', help_text="The page title as you'd like it to be seen by the public", max_length=255)), - ('slug_fr', models.SlugField(null=True, help_text='The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/', verbose_name='slug', max_length=255)), - ('slug_en', models.SlugField(null=True, help_text='The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/', verbose_name='slug', max_length=255)), - ('url_path_fr', models.TextField(null=True, blank=True, editable=False, verbose_name='URL path')), - ('url_path_en', models.TextField(null=True, blank=True, editable=False, verbose_name='URL path')), - ('seo_title_fr', models.CharField(null=True, blank=True, verbose_name='page title', help_text="Optional. 'Search Engine Friendly' title. This will appear at the top of the browser window.", max_length=255)), - ('seo_title_en', models.CharField(null=True, blank=True, verbose_name='page title', help_text="Optional. 'Search Engine Friendly' title. This will appear at the top of the browser window.", max_length=255)), - ('search_description_fr', models.TextField(null=True, blank=True, verbose_name='search description')), - ('search_description_en', models.TextField(null=True, blank=True, verbose_name='search description')), + ('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.Page')), + ('title_fr', models.CharField(help_text="The page title as you'd like it to be seen by the public", max_length=255, null=True, verbose_name='title')), + ('title_en', models.CharField(help_text="The page title as you'd like it to be seen by the public", max_length=255, null=True, verbose_name='title')), + ('slug_fr', models.SlugField(allow_unicode=True, help_text='The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/', max_length=255, null=True, verbose_name='slug')), + ('slug_en', models.SlugField(allow_unicode=True, help_text='The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/', max_length=255, null=True, verbose_name='slug')), + ('url_path_fr', models.TextField(blank=True, editable=False, null=True, verbose_name='URL path')), + ('url_path_en', models.TextField(blank=True, editable=False, null=True, verbose_name='URL path')), + ('seo_title_fr', models.CharField(blank=True, help_text="Optional. 'Search Engine Friendly' title. This will appear at the top of the browser window.", max_length=255, null=True, verbose_name='page title')), + ('seo_title_en', models.CharField(blank=True, help_text="Optional. 'Search Engine Friendly' title. This will appear at the top of the browser window.", max_length=255, null=True, verbose_name='page title')), + ('search_description_fr', models.TextField(blank=True, null=True, verbose_name='search description')), + ('search_description_en', models.TextField(blank=True, null=True, verbose_name='search description')), + ('chapo', models.TextField(blank=True, verbose_name='Description rapide')), + ('chapo_fr', models.TextField(blank=True, null=True, verbose_name='Description rapide')), + ('chapo_en', models.TextField(blank=True, null=True, verbose_name='Description rapide')), ('body', wagtail.wagtailcore.fields.RichTextField(verbose_name='Contenu')), ('body_fr', wagtail.wagtailcore.fields.RichTextField(null=True, verbose_name='Contenu')), ('body_en', wagtail.wagtailcore.fields.RichTextField(null=True, verbose_name='Contenu')), - ('date', models.DateField(verbose_name='Date du post')), - ('image', models.ForeignKey(null=True, blank=True, on_delete=django.db.models.deletion.SET_NULL, to='wagtailimages.Image', related_name='+', verbose_name='Image à la Une')), + ('is_event', models.BooleanField(default=True, verbose_name='Évènement')), + ('date_start', models.DateTimeField(verbose_name='Date et heure de début')), + ('date_end', models.DateTimeField(blank=True, default=None, null=True, verbose_name='Date et heure de fin')), + ('all_day', models.BooleanField(default=False, verbose_name='Toute la journée')), + ('image', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.Image', verbose_name='Image à la Une')), ], options={ - 'verbose_name_plural': 'Actualités simples', - 'verbose_name': 'Actualité simple', + 'verbose_name': 'Actualité', + 'verbose_name_plural': 'Actualités', }, bases=('wagtailcore.page',), ), migrations.CreateModel( name='COFDirectoryEntryPage', fields=[ - ('page_ptr', models.OneToOneField(serialize=False, parent_link=True, to='wagtailcore.Page', primary_key=True, auto_created=True)), - ('title_fr', models.CharField(null=True, verbose_name='title', help_text="The page title as you'd like it to be seen by the public", max_length=255)), - ('title_en', models.CharField(null=True, verbose_name='title', help_text="The page title as you'd like it to be seen by the public", max_length=255)), - ('slug_fr', models.SlugField(null=True, help_text='The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/', verbose_name='slug', max_length=255)), - ('slug_en', models.SlugField(null=True, help_text='The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/', verbose_name='slug', max_length=255)), - ('url_path_fr', models.TextField(null=True, blank=True, editable=False, verbose_name='URL path')), - ('url_path_en', models.TextField(null=True, blank=True, editable=False, verbose_name='URL path')), - ('seo_title_fr', models.CharField(null=True, blank=True, verbose_name='page title', help_text="Optional. 'Search Engine Friendly' title. This will appear at the top of the browser window.", max_length=255)), - ('seo_title_en', models.CharField(null=True, blank=True, verbose_name='page title', help_text="Optional. 'Search Engine Friendly' title. This will appear at the top of the browser window.", max_length=255)), - ('search_description_fr', models.TextField(null=True, blank=True, verbose_name='search description')), - ('search_description_en', models.TextField(null=True, blank=True, verbose_name='search description')), + ('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.Page')), + ('title_fr', models.CharField(help_text="The page title as you'd like it to be seen by the public", max_length=255, null=True, verbose_name='title')), + ('title_en', models.CharField(help_text="The page title as you'd like it to be seen by the public", max_length=255, null=True, verbose_name='title')), + ('slug_fr', models.SlugField(allow_unicode=True, help_text='The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/', max_length=255, null=True, verbose_name='slug')), + ('slug_en', models.SlugField(allow_unicode=True, help_text='The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/', max_length=255, null=True, verbose_name='slug')), + ('url_path_fr', models.TextField(blank=True, editable=False, null=True, verbose_name='URL path')), + ('url_path_en', models.TextField(blank=True, editable=False, null=True, verbose_name='URL path')), + ('seo_title_fr', models.CharField(blank=True, help_text="Optional. 'Search Engine Friendly' title. This will appear at the top of the browser window.", max_length=255, null=True, verbose_name='page title')), + ('seo_title_en', models.CharField(blank=True, help_text="Optional. 'Search Engine Friendly' title. This will appear at the top of the browser window.", max_length=255, null=True, verbose_name='page title')), + ('search_description_fr', models.TextField(blank=True, null=True, verbose_name='search description')), + ('search_description_en', models.TextField(blank=True, null=True, verbose_name='search description')), ('body', wagtail.wagtailcore.fields.RichTextField(verbose_name='Description')), ('body_fr', wagtail.wagtailcore.fields.RichTextField(null=True, verbose_name='Description')), ('body_en', wagtail.wagtailcore.fields.RichTextField(null=True, verbose_name='Description')), ('links', wagtail.wagtailcore.fields.StreamField((('lien', wagtail.wagtailcore.blocks.StructBlock((('url', wagtail.wagtailcore.blocks.URLBlock(required=True)), ('texte', wagtail.wagtailcore.blocks.CharBlock())))), ('contact', wagtail.wagtailcore.blocks.StructBlock((('email', wagtail.wagtailcore.blocks.EmailBlock(required=True)), ('texte', wagtail.wagtailcore.blocks.CharBlock()))))))), ('links_fr', wagtail.wagtailcore.fields.StreamField((('lien', wagtail.wagtailcore.blocks.StructBlock((('url', wagtail.wagtailcore.blocks.URLBlock(required=True)), ('texte', wagtail.wagtailcore.blocks.CharBlock())))), ('contact', wagtail.wagtailcore.blocks.StructBlock((('email', wagtail.wagtailcore.blocks.EmailBlock(required=True)), ('texte', wagtail.wagtailcore.blocks.CharBlock()))))), null=True)), ('links_en', wagtail.wagtailcore.fields.StreamField((('lien', wagtail.wagtailcore.blocks.StructBlock((('url', wagtail.wagtailcore.blocks.URLBlock(required=True)), ('texte', wagtail.wagtailcore.blocks.CharBlock())))), ('contact', wagtail.wagtailcore.blocks.StructBlock((('email', wagtail.wagtailcore.blocks.EmailBlock(required=True)), ('texte', wagtail.wagtailcore.blocks.CharBlock()))))), null=True)), - ('image', models.ForeignKey(null=True, blank=True, on_delete=django.db.models.deletion.SET_NULL, to='wagtailimages.Image', related_name='+', verbose_name='Image')), + ('image', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.Image', verbose_name='Image')), ], options={ - 'verbose_name_plural': "Éntrées d'annuaire", 'verbose_name': "Éntrée d'annuaire", + 'verbose_name_plural': "Éntrées d'annuaire", }, bases=('wagtailcore.page',), ), migrations.CreateModel( name='COFDirectoryPage', fields=[ - ('page_ptr', models.OneToOneField(serialize=False, parent_link=True, to='wagtailcore.Page', primary_key=True, auto_created=True)), - ('title_fr', models.CharField(null=True, verbose_name='title', help_text="The page title as you'd like it to be seen by the public", max_length=255)), - ('title_en', models.CharField(null=True, verbose_name='title', help_text="The page title as you'd like it to be seen by the public", max_length=255)), - ('slug_fr', models.SlugField(null=True, help_text='The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/', verbose_name='slug', max_length=255)), - ('slug_en', models.SlugField(null=True, help_text='The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/', verbose_name='slug', max_length=255)), - ('url_path_fr', models.TextField(null=True, blank=True, editable=False, verbose_name='URL path')), - ('url_path_en', models.TextField(null=True, blank=True, editable=False, verbose_name='URL path')), - ('seo_title_fr', models.CharField(null=True, blank=True, verbose_name='page title', help_text="Optional. 'Search Engine Friendly' title. This will appear at the top of the browser window.", max_length=255)), - ('seo_title_en', models.CharField(null=True, blank=True, verbose_name='page title', help_text="Optional. 'Search Engine Friendly' title. This will appear at the top of the browser window.", max_length=255)), - ('search_description_fr', models.TextField(null=True, blank=True, verbose_name='search description')), - ('search_description_en', models.TextField(null=True, blank=True, verbose_name='search description')), + ('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.Page')), + ('title_fr', models.CharField(help_text="The page title as you'd like it to be seen by the public", max_length=255, null=True, verbose_name='title')), + ('title_en', models.CharField(help_text="The page title as you'd like it to be seen by the public", max_length=255, null=True, verbose_name='title')), + ('slug_fr', models.SlugField(allow_unicode=True, help_text='The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/', max_length=255, null=True, verbose_name='slug')), + ('slug_en', models.SlugField(allow_unicode=True, help_text='The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/', max_length=255, null=True, verbose_name='slug')), + ('url_path_fr', models.TextField(blank=True, editable=False, null=True, verbose_name='URL path')), + ('url_path_en', models.TextField(blank=True, editable=False, null=True, verbose_name='URL path')), + ('seo_title_fr', models.CharField(blank=True, help_text="Optional. 'Search Engine Friendly' title. This will appear at the top of the browser window.", max_length=255, null=True, verbose_name='page title')), + ('seo_title_en', models.CharField(blank=True, help_text="Optional. 'Search Engine Friendly' title. This will appear at the top of the browser window.", max_length=255, null=True, verbose_name='page title')), + ('search_description_fr', models.TextField(blank=True, null=True, verbose_name='search description')), + ('search_description_en', models.TextField(blank=True, null=True, verbose_name='search description')), ('introduction', wagtail.wagtailcore.fields.RichTextField(verbose_name='Introduction')), ('introduction_fr', wagtail.wagtailcore.fields.RichTextField(null=True, verbose_name='Introduction')), ('introduction_en', wagtail.wagtailcore.fields.RichTextField(null=True, verbose_name='Introduction')), ], options={ - 'verbose_name_plural': 'Annuaires', 'verbose_name': 'Annuaire (clubs, partenaires, bons plans...)', + 'verbose_name_plural': 'Annuaires', }, bases=('wagtailcore.page',), ), migrations.CreateModel( name='COFPage', fields=[ - ('page_ptr', models.OneToOneField(serialize=False, parent_link=True, to='wagtailcore.Page', primary_key=True, auto_created=True)), - ('title_fr', models.CharField(null=True, verbose_name='title', help_text="The page title as you'd like it to be seen by the public", max_length=255)), - ('title_en', models.CharField(null=True, verbose_name='title', help_text="The page title as you'd like it to be seen by the public", max_length=255)), - ('slug_fr', models.SlugField(null=True, help_text='The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/', verbose_name='slug', max_length=255)), - ('slug_en', models.SlugField(null=True, help_text='The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/', verbose_name='slug', max_length=255)), - ('url_path_fr', models.TextField(null=True, blank=True, editable=False, verbose_name='URL path')), - ('url_path_en', models.TextField(null=True, blank=True, editable=False, verbose_name='URL path')), - ('seo_title_fr', models.CharField(null=True, blank=True, verbose_name='page title', help_text="Optional. 'Search Engine Friendly' title. This will appear at the top of the browser window.", max_length=255)), - ('seo_title_en', models.CharField(null=True, blank=True, verbose_name='page title', help_text="Optional. 'Search Engine Friendly' title. This will appear at the top of the browser window.", max_length=255)), - ('search_description_fr', models.TextField(null=True, blank=True, verbose_name='search description')), - ('search_description_en', models.TextField(null=True, blank=True, verbose_name='search description')), + ('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.Page')), + ('title_fr', models.CharField(help_text="The page title as you'd like it to be seen by the public", max_length=255, null=True, verbose_name='title')), + ('title_en', models.CharField(help_text="The page title as you'd like it to be seen by the public", max_length=255, null=True, verbose_name='title')), + ('slug_fr', models.SlugField(allow_unicode=True, help_text='The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/', max_length=255, null=True, verbose_name='slug')), + ('slug_en', models.SlugField(allow_unicode=True, help_text='The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/', max_length=255, null=True, verbose_name='slug')), + ('url_path_fr', models.TextField(blank=True, editable=False, null=True, verbose_name='URL path')), + ('url_path_en', models.TextField(blank=True, editable=False, null=True, verbose_name='URL path')), + ('seo_title_fr', models.CharField(blank=True, help_text="Optional. 'Search Engine Friendly' title. This will appear at the top of the browser window.", max_length=255, null=True, verbose_name='page title')), + ('seo_title_en', models.CharField(blank=True, help_text="Optional. 'Search Engine Friendly' title. This will appear at the top of the browser window.", max_length=255, null=True, verbose_name='page title')), + ('search_description_fr', models.TextField(blank=True, null=True, verbose_name='search description')), + ('search_description_en', models.TextField(blank=True, null=True, verbose_name='search description')), ('body', wagtail.wagtailcore.fields.StreamField((('heading', wagtail.wagtailcore.blocks.CharBlock(classname='full title')), ('paragraph', wagtail.wagtailcore.blocks.RichTextBlock()), ('image', wagtail.wagtailimages.blocks.ImageChooserBlock())))), ('body_fr', wagtail.wagtailcore.fields.StreamField((('heading', wagtail.wagtailcore.blocks.CharBlock(classname='full title')), ('paragraph', wagtail.wagtailcore.blocks.RichTextBlock()), ('image', wagtail.wagtailimages.blocks.ImageChooserBlock())), null=True)), ('body_en', wagtail.wagtailcore.fields.StreamField((('heading', wagtail.wagtailcore.blocks.CharBlock(classname='full title')), ('paragraph', wagtail.wagtailcore.blocks.RichTextBlock()), ('image', wagtail.wagtailimages.blocks.ImageChooserBlock())), null=True)), ], options={ - 'verbose_name_plural': 'Pages normales COF', 'verbose_name': 'Page normale COF', + 'verbose_name_plural': 'Pages normales COF', }, bases=('wagtailcore.page',), ), migrations.CreateModel( name='COFRootPage', fields=[ - ('page_ptr', models.OneToOneField(serialize=False, parent_link=True, to='wagtailcore.Page', primary_key=True, auto_created=True)), - ('title_fr', models.CharField(null=True, verbose_name='title', help_text="The page title as you'd like it to be seen by the public", max_length=255)), - ('title_en', models.CharField(null=True, verbose_name='title', help_text="The page title as you'd like it to be seen by the public", max_length=255)), - ('slug_fr', models.SlugField(null=True, help_text='The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/', verbose_name='slug', max_length=255)), - ('slug_en', models.SlugField(null=True, help_text='The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/', verbose_name='slug', max_length=255)), - ('url_path_fr', models.TextField(null=True, blank=True, editable=False, verbose_name='URL path')), - ('url_path_en', models.TextField(null=True, blank=True, editable=False, verbose_name='URL path')), - ('seo_title_fr', models.CharField(null=True, blank=True, verbose_name='page title', help_text="Optional. 'Search Engine Friendly' title. This will appear at the top of the browser window.", max_length=255)), - ('seo_title_en', models.CharField(null=True, blank=True, verbose_name='page title', help_text="Optional. 'Search Engine Friendly' title. This will appear at the top of the browser window.", max_length=255)), - ('search_description_fr', models.TextField(null=True, blank=True, verbose_name='search description')), - ('search_description_en', models.TextField(null=True, blank=True, verbose_name='search description')), + ('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.Page')), + ('title_fr', models.CharField(help_text="The page title as you'd like it to be seen by the public", max_length=255, null=True, verbose_name='title')), + ('title_en', models.CharField(help_text="The page title as you'd like it to be seen by the public", max_length=255, null=True, verbose_name='title')), + ('slug_fr', models.SlugField(allow_unicode=True, help_text='The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/', max_length=255, null=True, verbose_name='slug')), + ('slug_en', models.SlugField(allow_unicode=True, help_text='The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/', max_length=255, null=True, verbose_name='slug')), + ('url_path_fr', models.TextField(blank=True, editable=False, null=True, verbose_name='URL path')), + ('url_path_en', models.TextField(blank=True, editable=False, null=True, verbose_name='URL path')), + ('seo_title_fr', models.CharField(blank=True, help_text="Optional. 'Search Engine Friendly' title. This will appear at the top of the browser window.", max_length=255, null=True, verbose_name='page title')), + ('seo_title_en', models.CharField(blank=True, help_text="Optional. 'Search Engine Friendly' title. This will appear at the top of the browser window.", max_length=255, null=True, verbose_name='page title')), + ('search_description_fr', models.TextField(blank=True, null=True, verbose_name='search description')), + ('search_description_en', models.TextField(blank=True, null=True, verbose_name='search description')), ('introduction', wagtail.wagtailcore.fields.RichTextField(verbose_name='Introduction')), ('introduction_fr', wagtail.wagtailcore.fields.RichTextField(null=True, verbose_name='Introduction')), ('introduction_en', wagtail.wagtailcore.fields.RichTextField(null=True, verbose_name='Introduction')), ], options={ - 'verbose_name_plural': 'Racines site du COF', 'verbose_name': 'Racine site du COF', + 'verbose_name_plural': 'Racines site du COF', }, bases=('wagtailcore.page', gestioncof.cms.models.COFActuIndexMixin), ), diff --git a/gestioncof/cms/models.py b/gestioncof/cms/models.py index e63acde7..508c9743 100644 --- a/gestioncof/cms/models.py +++ b/gestioncof/cms/models.py @@ -2,6 +2,7 @@ from django.db import models from wagtail.wagtailcore.models import Page, Orderable +from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from wagtail.wagtailcore.fields import RichTextField, StreamField from wagtail.wagtailcore import blocks from wagtail.wagtailimages.edit_handlers import ImageChooserPanel @@ -15,10 +16,8 @@ from wagtail.wagtailsnippets.models import register_snippet class COFActuIndexMixin(): @property def actus(self): - actus = COFActuPage.objects.live().descendant_of(self) - events = COFActuEventPage.objects.live().descendant_of(self) - genactus = list(actus) + list(events) - return genactus + actus = COFActuPage.objects.live().order_by('-date_start').descendant_of(self) + return actus # Racine du site du COF class COFRootPage(Page, COFActuIndexMixin): @@ -55,7 +54,7 @@ class COFPage(Page): # Actualités class COFActuIndexPage(Page, COFActuIndexMixin): - subpage_types = ['COFActuPage', 'COFActuEventPage'] + subpage_types = ['COFActuPage'] parent_page_types = ['COFRootPage'] class Meta: @@ -64,7 +63,7 @@ class COFActuIndexPage(Page, COFActuIndexMixin): def get_context(self, request): context = super(COFActuIndexPage, self).get_context(request) - actus = COFActuPage.objects.live().descendant_of(self).order_by('-date') + actus = COFActuPage.objects.live().descendant_of(self).order_by('-date_end') page = request.GET.get('page') paginator = Paginator(actus, 5) @@ -79,18 +78,27 @@ class COFActuIndexPage(Page, COFActuIndexMixin): return context class COFActuPage(Page): + chapo = models.TextField("Description rapide", blank=True) body = RichTextField("Contenu") - date = models.DateField("Date du post") image = models.ForeignKey( 'wagtailimages.Image', verbose_name="Image à la Une", null=True, blank=True, on_delete=models.SET_NULL, related_name='+' ) + is_event = models.BooleanField("Évènement", default=True, blank=True) + date_start = models.DateTimeField("Date et heure de début") + date_end = models.DateTimeField("Date et heure de fin", blank=True, default=None, null=True) + all_day = models.BooleanField("Toute la journée", default=False, blank=True) + content_panels = Page.content_panels + [ - FieldPanel('date'), ImageChooserPanel('image'), + FieldPanel('chapo'), FieldPanel('body', classname="full"), + FieldPanel("is_event"), + FieldPanel("date_start"), + FieldPanel("date_end"), + FieldPanel("all_day"), ] subpage_types = [] @@ -100,33 +108,6 @@ class COFActuPage(Page): verbose_name = "Actualité simple" verbose_name_plural = "Actualités simples" -# Évènements -class COFActuEventPage(Page): - chapo = models.TextField("Description rapide") - body = RichTextField("Description longue") - image = models.ForeignKey( - 'wagtailimages.Image', verbose_name="Image à la Une", - null=True, blank=True, - on_delete=models.SET_NULL, related_name='+' - ) - - date_start = models.DateTimeField("Date et heure de début") - date_end = models.DateTimeField("Date et heure de fin", blank=True, default=None, null=True) - all_day = models.BooleanField("Toute la journée", default=False, blank=True) - is_event = True - - content_panels = Page.content_panels + [ - ImageChooserPanel('image'), - FieldPanel('chapo'), - FieldPanel('body', classname="full"), - FieldPanel("date_start"), - FieldPanel("date_end"), - FieldPanel("all_day"), - ] - - subpage_types = [] - parent_page_types = ['COFActuIndexPage'] - @property def dates(self): if self.date_end: @@ -147,8 +128,8 @@ class COFActuEventPage(Page): diff_i = len(tmpl) - 3 elif self.date_end.day != self.date_start.day: diff_i = len(tmpl) - 6 - common = tmpl[diff_i:] - diff = tmpl[:diff_i] + common = tmpl[diff_i:] + diff = tmpl[:diff_i] if self.all_day: return _("du %s au %s %s") % \ (self.date_start.strftime(diff), @@ -167,8 +148,8 @@ class COFActuEventPage(Page): else: return self.date_start.strftime(_("le %A %d %B %Y à %Hh%M")) class Meta: - verbose_name = "Actu liée à un évènement" - verbose_name_plural = "Actus liées à des évènements" + verbose_name = "Actualité" + verbose_name_plural = "Actualités" # Annuaires (Clubs, partenaires, bonnes adresses) class COFDirectoryPage(Page): diff --git a/gestioncof/cms/templates/cofcms/cof_actu_event_page.html b/gestioncof/cms/templates/cofcms/cof_actu_event_page.html deleted file mode 100644 index 3640ece8..00000000 --- a/gestioncof/cms/templates/cofcms/cof_actu_event_page.html +++ /dev/null @@ -1,17 +0,0 @@ -{% extends "cofcms/base.html" %} -{% load wagtailimages_tags cofcms_tags %} - -{% block content %} -
-

{{ page.title }}

-

A lieu {{ page.dates }}

-

{{ page.chapo }}

-
- -
- {% image page.image width-700 %} -
- {{ page.body|safe }} -
-
-{% endblock %} diff --git a/gestioncof/cms/templates/cofcms/cof_actu_index_page.html b/gestioncof/cms/templates/cofcms/cof_actu_index_page.html index 975e520d..ae1a6f8a 100644 --- a/gestioncof/cms/templates/cofcms/cof_actu_index_page.html +++ b/gestioncof/cms/templates/cofcms/cof_actu_index_page.html @@ -27,7 +27,7 @@ {% if actu.is_event %}

{{ actu.dates|capfirst }}
{{ actu.chapo }}

{% else %} - {{ actu.body|safe|truncatewords_html:25 }} + {{ actu.body|safe|truncatewords_html:15 }} {% endif %} Lire plus > diff --git a/gestioncof/cms/templates/cofcms/cof_actu_page.html b/gestioncof/cms/templates/cofcms/cof_actu_page.html index ef4830be..3640ece8 100644 --- a/gestioncof/cms/templates/cofcms/cof_actu_page.html +++ b/gestioncof/cms/templates/cofcms/cof_actu_page.html @@ -4,7 +4,8 @@ {% block content %}

{{ page.title }}

-

Publié le {{ page.date }}

+

A lieu {{ page.dates }}

+

{{ page.chapo }}

diff --git a/gestioncof/cms/templates/cofcms/cof_root_page.html b/gestioncof/cms/templates/cofcms/cof_root_page.html index 84b60b80..75acc2fa 100644 --- a/gestioncof/cms/templates/cofcms/cof_root_page.html +++ b/gestioncof/cms/templates/cofcms/cof_root_page.html @@ -22,7 +22,7 @@ {% get_current_language as curlang %} {% mini_calendar actu curlang %}{{ actu.dates }} {% else %} - {{ actu.body|safe|truncatewords_html:25 }} + {{ actu.body|safe|truncatewords_html:10 }} {% endif %} diff --git a/gestioncof/cms/templatetags/cofcms_tags.py b/gestioncof/cms/templatetags/cofcms_tags.py index 7d426e46..e226d33b 100644 --- a/gestioncof/cms/templatetags/cofcms_tags.py +++ b/gestioncof/cms/templatetags/cofcms_tags.py @@ -4,7 +4,7 @@ from django.conf import settings from django.utils import timezone import locale -from ..models import COFActuEventPage +from ..models import COFActuPage import re @@ -23,10 +23,10 @@ def calendar(): next_month = date(next_month.year, next_month.month, 1) month_prestart = month_start - timedelta(days=month_start.weekday()) month_postend = next_month + timedelta(days=(next_month.weekday()+6)%7) - events = COFActuEventPage.objects.live()\ - .filter(date_start__range=[month_prestart, - month_postend])\ - .order_by('-date_start') + events = COFActuPage.objects.live()\ + .filter(date_start__range=[month_prestart, + month_postend])\ + .order_by('-date_start') events = list(events) weeks = [] curday = month_prestart diff --git a/gestioncof/cms/translation.py b/gestioncof/cms/translation.py index 2be97221..ef7bd77d 100644 --- a/gestioncof/cms/translation.py +++ b/gestioncof/cms/translation.py @@ -1,4 +1,4 @@ -from .models import COFRootPage, COFPage, COFActuEventPage, COFActuIndexPage, COFActuPage, COFDirectoryPage, COFDirectoryEntryPage +from .models import COFRootPage, COFPage, COFActuIndexPage, COFActuPage, COFDirectoryPage, COFDirectoryEntryPage from wagtail_modeltranslation.translator import WagtailTranslationOptions from modeltranslation.decorators import register @@ -15,13 +15,6 @@ class COFPageTr(WagtailTranslationOptions): 'body', ) -@register(COFActuEventPage) -class COFActuEventPageTr(WagtailTranslationOptions): - fields = ( - 'chapo', - 'body', - ) - @register(COFActuIndexPage) class COFActuIndexPageTr(WagtailTranslationOptions): fields = ( @@ -30,6 +23,7 @@ class COFActuIndexPageTr(WagtailTranslationOptions): @register(COFActuPage) class COFActuPageTr(WagtailTranslationOptions): fields = ( + 'chapo', 'body', )