From 65d7a66eb8db2a5b90d804686541dba645217032 Mon Sep 17 00:00:00 2001 From: Evarin Date: Mon, 7 Aug 2017 23:31:27 +0200 Subject: [PATCH 01/30] =?UTF-8?q?D=C3=A9but=20nouveau=20site=20cof?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cof/settings/common.py | 8 +++++ gestioncof/cms/__init__.py | 0 gestioncof/cms/admin.py | 3 ++ gestioncof/cms/migrations/0001_initial.py | 38 +++++++++++++++++++++++ gestioncof/cms/migrations/__init__.py | 0 gestioncof/cms/models.py | 11 +++++++ gestioncof/cms/tests.py | 3 ++ gestioncof/cms/translation.py | 11 +++++++ gestioncof/cms/urls.py | 0 gestioncof/cms/views.py | 3 ++ requirements.txt | 1 + 11 files changed, 78 insertions(+) create mode 100644 gestioncof/cms/__init__.py create mode 100644 gestioncof/cms/admin.py create mode 100644 gestioncof/cms/migrations/0001_initial.py create mode 100644 gestioncof/cms/migrations/__init__.py create mode 100644 gestioncof/cms/models.py create mode 100644 gestioncof/cms/tests.py create mode 100644 gestioncof/cms/translation.py create mode 100644 gestioncof/cms/urls.py create mode 100644 gestioncof/cms/views.py diff --git a/cof/settings/common.py b/cof/settings/common.py index ffcb8ee5..0117c662 100644 --- a/cof/settings/common.py +++ b/cof/settings/common.py @@ -73,7 +73,9 @@ INSTALLED_APPS = [ 'wagtailmenus', 'modelcluster', 'taggit', + 'wagtail_modeltranslation', 'kfet.cms', + 'gestioncof.cms', ] MIDDLEWARE_CLASSES = [ @@ -89,6 +91,7 @@ MIDDLEWARE_CLASSES = [ 'djconfig.middleware.DjConfigMiddleware', 'wagtail.wagtailcore.middleware.SiteMiddleware', 'wagtail.wagtailredirects.middleware.RedirectMiddleware', + 'django.middleware.locale.LocaleMiddleware', ] ROOT_URLCONF = 'cof.urls' @@ -141,6 +144,11 @@ USE_L10N = True USE_TZ = True +LANGUAGES = ( + ('fr', u'Français'), + ('en', u'English'), +) + # Various additional settings SITE_ID = 1 diff --git a/gestioncof/cms/__init__.py b/gestioncof/cms/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/gestioncof/cms/admin.py b/gestioncof/cms/admin.py new file mode 100644 index 00000000..8c38f3f3 --- /dev/null +++ b/gestioncof/cms/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/gestioncof/cms/migrations/0001_initial.py b/gestioncof/cms/migrations/0001_initial.py new file mode 100644 index 00000000..5b48c5ec --- /dev/null +++ b/gestioncof/cms/migrations/0001_initial.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models +import wagtail.wagtailcore.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ('wagtailcore', '0033_remove_golive_expiry_help_text'), + ] + + operations = [ + migrations.CreateModel( + name='COFPage', + fields=[ + ('page_ptr', models.OneToOneField(primary_key=True, to='wagtailcore.Page', parent_link=True, auto_created=True, serialize=False)), + ('title_fr', models.CharField(help_text="The page title as you'd like it to be seen by the public", null=True, max_length=255, verbose_name='title')), + ('title_en', models.CharField(help_text="The page title as you'd like it to be seen by the public", null=True, max_length=255, verbose_name='title')), + ('slug_fr', models.SlugField(help_text='The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/', null=True, max_length=255, verbose_name='slug')), + ('slug_en', models.SlugField(help_text='The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/', null=True, max_length=255, verbose_name='slug')), + ('url_path_fr', models.TextField(blank=True, null=True, editable=False, verbose_name='URL path')), + ('url_path_en', models.TextField(blank=True, null=True, editable=False, verbose_name='URL path')), + ('seo_title_fr', models.CharField(help_text="Optional. 'Search Engine Friendly' title. This will appear at the top of the browser window.", null=True, blank=True, max_length=255, verbose_name='page title')), + ('seo_title_en', models.CharField(help_text="Optional. 'Search Engine Friendly' title. This will appear at the top of the browser window.", null=True, blank=True, max_length=255, 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')), + ('corps', wagtail.wagtailcore.fields.RichTextField()), + ('corps_fr', wagtail.wagtailcore.fields.RichTextField(null=True)), + ('corps_en', wagtail.wagtailcore.fields.RichTextField(null=True)), + ], + options={ + 'abstract': False, + }, + bases=('wagtailcore.page',), + ), + ] diff --git a/gestioncof/cms/migrations/__init__.py b/gestioncof/cms/migrations/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/gestioncof/cms/models.py b/gestioncof/cms/models.py new file mode 100644 index 00000000..17492f08 --- /dev/null +++ b/gestioncof/cms/models.py @@ -0,0 +1,11 @@ +from django.db import models + +# Create your models here. +from wagtail.wagtailcore.models import Page, Orderable + +from wagtail.wagtailcore.fields import RichTextField, StreamField +from wagtail.wagtailcore import blocks + + +class COFPage(Page): + corps = RichTextField() diff --git a/gestioncof/cms/tests.py b/gestioncof/cms/tests.py new file mode 100644 index 00000000..7ce503c2 --- /dev/null +++ b/gestioncof/cms/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/gestioncof/cms/translation.py b/gestioncof/cms/translation.py new file mode 100644 index 00000000..b705f6ed --- /dev/null +++ b/gestioncof/cms/translation.py @@ -0,0 +1,11 @@ +from .models import COFPage + +from wagtail_modeltranslation.translator import WagtailTranslationOptions +from modeltranslation.decorators import register + +@register(COFPage) +class COFPageTr(WagtailTranslationOptions): + fields = ( + 'corps', + ) + diff --git a/gestioncof/cms/urls.py b/gestioncof/cms/urls.py new file mode 100644 index 00000000..e69de29b diff --git a/gestioncof/cms/views.py b/gestioncof/cms/views.py new file mode 100644 index 00000000..91ea44a2 --- /dev/null +++ b/gestioncof/cms/views.py @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here. diff --git a/requirements.txt b/requirements.txt index 1da8c361..91b13db4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -25,3 +25,4 @@ channels==1.1.5 python-dateutil wagtail==1.10.* wagtailmenus==2.2.* +wagtail-modeltranslation==0.6.0rc2 From 6023211ab09a46a8c9c873def0fec847ac46af1e Mon Sep 17 00:00:00 2001 From: Evarin Date: Wed, 9 Aug 2017 00:07:56 +0200 Subject: [PATCH 02/30] Models des pages et traductions --- gestioncof/cms/__init__.py | 1 + gestioncof/cms/apps.py | 7 + gestioncof/cms/migrations/0001_initial.py | 165 ++++++++++++++++++++-- gestioncof/cms/models.py | 101 ++++++++++++- gestioncof/cms/translation.py | 40 +++++- 5 files changed, 296 insertions(+), 18 deletions(-) create mode 100644 gestioncof/cms/apps.py diff --git a/gestioncof/cms/__init__.py b/gestioncof/cms/__init__.py index e69de29b..9892db53 100644 --- a/gestioncof/cms/__init__.py +++ b/gestioncof/cms/__init__.py @@ -0,0 +1 @@ +default_app_config = 'gestioncof.cms.apps.COFCMSAppConfig' diff --git a/gestioncof/cms/apps.py b/gestioncof/cms/apps.py new file mode 100644 index 00000000..cbc58688 --- /dev/null +++ b/gestioncof/cms/apps.py @@ -0,0 +1,7 @@ +from django.apps import AppConfig + + +class COFCMSAppConfig(AppConfig): + name = 'gestioncof.cms' + label = 'cofcms' + verbose_name = 'CMS COF' diff --git a/gestioncof/cms/migrations/0001_initial.py b/gestioncof/cms/migrations/0001_initial.py index 5b48c5ec..19cf61c7 100644 --- a/gestioncof/cms/migrations/0001_initial.py +++ b/gestioncof/cms/migrations/0001_initial.py @@ -2,33 +2,170 @@ from __future__ import unicode_literals from django.db import migrations, models +import django.db.models.deletion +import wagtail.wagtailimages.blocks +import wagtail.wagtailcore.blocks import wagtail.wagtailcore.fields class Migration(migrations.Migration): dependencies = [ + ('wagtailimages', '0019_delete_filter'), ('wagtailcore', '0033_remove_golive_expiry_help_text'), ] operations = [ + migrations.CreateModel( + name='COFActuIndexPage', + fields=[ + ('page_ptr', models.OneToOneField(primary_key=True, parent_link=True, serialize=False, auto_created=True, to='wagtailcore.Page')), + ('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, verbose_name='slug', help_text='The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/', max_length=255)), + ('slug_en', models.SlugField(null=True, verbose_name='slug', help_text='The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/', max_length=255)), + ('url_path_fr', models.TextField(null=True, blank=True, verbose_name='URL path', editable=False)), + ('url_path_en', models.TextField(null=True, blank=True, verbose_name='URL path', editable=False)), + ('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')), + ], + options={ + 'abstract': False, + }, + bases=('wagtailcore.page',), + ), + migrations.CreateModel( + name='COFActuPage', + fields=[ + ('page_ptr', models.OneToOneField(primary_key=True, parent_link=True, serialize=False, auto_created=True, to='wagtailcore.Page')), + ('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, verbose_name='slug', help_text='The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/', max_length=255)), + ('slug_en', models.SlugField(null=True, verbose_name='slug', help_text='The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/', max_length=255)), + ('url_path_fr', models.TextField(null=True, blank=True, verbose_name='URL path', editable=False)), + ('url_path_en', models.TextField(null=True, blank=True, verbose_name='URL path', editable=False)), + ('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')), + ('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 à la Une', models.ForeignKey(null=True, to='wagtailimages.Image', on_delete=django.db.models.deletion.SET_NULL, blank=True, related_name='+')), + ], + options={ + 'abstract': False, + }, + bases=('wagtailcore.page',), + ), + migrations.CreateModel( + name='COFDirectoryEntryPage', + fields=[ + ('page_ptr', models.OneToOneField(primary_key=True, parent_link=True, serialize=False, auto_created=True, to='wagtailcore.Page')), + ('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, verbose_name='slug', help_text='The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/', max_length=255)), + ('slug_en', models.SlugField(null=True, verbose_name='slug', help_text='The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/', max_length=255)), + ('url_path_fr', models.TextField(null=True, blank=True, verbose_name='URL path', editable=False)), + ('url_path_en', models.TextField(null=True, blank=True, verbose_name='URL path', editable=False)), + ('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')), + ('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, to='wagtailimages.Image', on_delete=django.db.models.deletion.SET_NULL, blank=True, related_name='+')), + ], + options={ + 'abstract': False, + }, + bases=('wagtailcore.page',), + ), + migrations.CreateModel( + name='COFDirectoryPage', + fields=[ + ('page_ptr', models.OneToOneField(primary_key=True, parent_link=True, serialize=False, auto_created=True, to='wagtailcore.Page')), + ('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, verbose_name='slug', help_text='The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/', max_length=255)), + ('slug_en', models.SlugField(null=True, verbose_name='slug', help_text='The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/', max_length=255)), + ('url_path_fr', models.TextField(null=True, blank=True, verbose_name='URL path', editable=False)), + ('url_path_en', models.TextField(null=True, blank=True, verbose_name='URL path', editable=False)), + ('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')), + ('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={ + 'abstract': False, + }, + bases=('wagtailcore.page',), + ), + migrations.CreateModel( + name='COFEvent', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('title', models.TextField(verbose_name='Titre')), + ('title_fr', models.TextField(null=True, verbose_name='Titre')), + ('title_en', models.TextField(null=True, verbose_name='Titre')), + ('description', wagtail.wagtailcore.fields.RichTextField(verbose_name='Description (concise)')), + ('description_fr', wagtail.wagtailcore.fields.RichTextField(null=True, verbose_name='Description (concise)')), + ('description_en', wagtail.wagtailcore.fields.RichTextField(null=True, verbose_name='Description (concise)')), + ('date_start', models.DateTimeField(verbose_name='Date et heure de début')), + ('date_end', models.DateTimeField(null=True, verbose_name='Date et heure de fin')), + ('all_day', models.BooleanField(verbose_name='Toute la journée', default=False)), + ], + ), migrations.CreateModel( name='COFPage', fields=[ - ('page_ptr', models.OneToOneField(primary_key=True, to='wagtailcore.Page', parent_link=True, auto_created=True, serialize=False)), - ('title_fr', models.CharField(help_text="The page title as you'd like it to be seen by the public", null=True, max_length=255, verbose_name='title')), - ('title_en', models.CharField(help_text="The page title as you'd like it to be seen by the public", null=True, max_length=255, verbose_name='title')), - ('slug_fr', models.SlugField(help_text='The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/', null=True, max_length=255, verbose_name='slug')), - ('slug_en', models.SlugField(help_text='The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/', null=True, max_length=255, verbose_name='slug')), - ('url_path_fr', models.TextField(blank=True, null=True, editable=False, verbose_name='URL path')), - ('url_path_en', models.TextField(blank=True, null=True, editable=False, verbose_name='URL path')), - ('seo_title_fr', models.CharField(help_text="Optional. 'Search Engine Friendly' title. This will appear at the top of the browser window.", null=True, blank=True, max_length=255, verbose_name='page title')), - ('seo_title_en', models.CharField(help_text="Optional. 'Search Engine Friendly' title. This will appear at the top of the browser window.", null=True, blank=True, max_length=255, 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')), - ('corps', wagtail.wagtailcore.fields.RichTextField()), - ('corps_fr', wagtail.wagtailcore.fields.RichTextField(null=True)), - ('corps_en', wagtail.wagtailcore.fields.RichTextField(null=True)), + ('page_ptr', models.OneToOneField(primary_key=True, parent_link=True, serialize=False, auto_created=True, to='wagtailcore.Page')), + ('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, verbose_name='slug', help_text='The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/', max_length=255)), + ('slug_en', models.SlugField(null=True, verbose_name='slug', help_text='The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/', max_length=255)), + ('url_path_fr', models.TextField(null=True, blank=True, verbose_name='URL path', editable=False)), + ('url_path_en', models.TextField(null=True, blank=True, verbose_name='URL path', editable=False)), + ('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')), + ('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={ + 'abstract': False, + }, + bases=('wagtailcore.page',), + ), + migrations.CreateModel( + name='COFRootPage', + fields=[ + ('page_ptr', models.OneToOneField(primary_key=True, parent_link=True, serialize=False, auto_created=True, to='wagtailcore.Page')), + ('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, verbose_name='slug', help_text='The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/', max_length=255)), + ('slug_en', models.SlugField(null=True, verbose_name='slug', help_text='The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/', max_length=255)), + ('url_path_fr', models.TextField(null=True, blank=True, verbose_name='URL path', editable=False)), + ('url_path_en', models.TextField(null=True, blank=True, verbose_name='URL path', editable=False)), + ('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')), + ('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={ 'abstract': False, diff --git a/gestioncof/cms/models.py b/gestioncof/cms/models.py index 17492f08..eb50df48 100644 --- a/gestioncof/cms/models.py +++ b/gestioncof/cms/models.py @@ -1,11 +1,108 @@ from django.db import models -# Create your models here. from wagtail.wagtailcore.models import Page, Orderable from wagtail.wagtailcore.fields import RichTextField, StreamField from wagtail.wagtailcore import blocks +from wagtail.wagtailimages.edit_handlers import ImageChooserPanel +from wagtail.wagtailimages.blocks import ImageChooserBlock +from wagtail.wagtailadmin.edit_handlers import FieldPanel, StreamFieldPanel +from wagtail.wagtailsnippets.models import register_snippet +# Racine du site du COF +class COFRootPage(Page): + introduction = RichTextField("Introduction") + + content_panels = Page.content_panels + [ + FieldPanel('introduction', classname="full"), + ] + + subpage_types = ['COFActuIndexPage', 'COFPage', 'COFDirectoryPage'] + +# Page lambda du site class COFPage(Page): - corps = RichTextField() + body = StreamField([ + ('heading', blocks.CharBlock(classname="full title")), + ('paragraph', blocks.RichTextBlock()), + ('image', ImageChooserBlock()), + ]) + + content_panels = Page.content_panels + [ + StreamFieldPanel('body'), + ] + + subpages_types = ['COFDirectoryPage', 'COFPage'] + parent_page_types = ['COFPage', 'COFRootPage'] + +# Évènements +@register_snippet +class COFEvent(models.Model): + title = models.TextField("Titre") + description = RichTextField("Description (concise)") + + date_start = models.DateTimeField("Date et heure de début") + date_end = models.DateTimeField("Date et heure de fin", null=True) + all_day = models.BooleanField("Toute la journée", default=False, blank=True) + + panels = [ + FieldPanel("title"), + FieldPanel("description"), + FieldPanel("date_start"), + FieldPanel("date_end"), + FieldPanel("all_day"), + ] + +# Actualités +class COFActuIndexPage(Page): + subpages_types = ['COFActuPage'] + parent_page_types = ['COFRootPage'] + +class COFActuPage(Page): + body = RichTextField("Contenu") + date = models.DateField("Date du post") + image = models.ForeignKey( + 'wagtailimages.Image', name="Image à la Une", + null=True, blank=True, + on_delete=models.SET_NULL, related_name='+' + ) + + content_panels = Page.content_panels + [ + FieldPanel('date'), +# ImageChooserPanel('image'), + FieldPanel('body', classname="full"), + ] + + + subpages_types = [] + parent_page_types = ['COFActuIndexPage'] + +# Annuaires (Clubs, partenaires, bonnes adresses) +class COFDirectoryPage(Page): + introduction = RichTextField("Introduction") + + subpages_types = ['COFActuPage', 'COFDirectoryEntryPage'] + parent_page_types = ['COFRootPage', 'COFPage'] + +class COFDirectoryEntryPage(Page): + body = RichTextField("Description") + links = StreamField([ + ('lien', blocks.StructBlock([ + ('url', blocks.URLBlock(required=True)), + ('texte', blocks.CharBlock()), + ])), + ('contact', blocks.StructBlock([ + ('email', blocks.EmailBlock(required=True)), + ('texte', blocks.CharBlock()), + ])), + ]) + + image = models.ForeignKey( + 'wagtailimages.Image', name="Image", + null=True, blank=True, + on_delete=models.SET_NULL, related_name='+' + ) + + subpages_types = [] + parent_page_types = ['COFDirectoryPage'] + diff --git a/gestioncof/cms/translation.py b/gestioncof/cms/translation.py index b705f6ed..705a9c1f 100644 --- a/gestioncof/cms/translation.py +++ b/gestioncof/cms/translation.py @@ -1,11 +1,47 @@ -from .models import COFPage +from .models import COFRootPage, COFPage, COFEvent, COFActuIndexPage, COFActuPage, COFDirectoryPage, COFDirectoryEntryPage from wagtail_modeltranslation.translator import WagtailTranslationOptions from modeltranslation.decorators import register +@register(COFRootPage) +class COFPageTr(WagtailTranslationOptions): + fields = ( + 'introduction', + ) + @register(COFPage) class COFPageTr(WagtailTranslationOptions): fields = ( - 'corps', + 'body', + ) + +@register(COFEvent) +class COFEventTr(WagtailTranslationOptions): + fields = ( + 'title', + 'description', + ) + +@register(COFActuIndexPage) +class COFActuIndexPageTr(WagtailTranslationOptions): + fields = ( + ) + +@register(COFActuPage) +class COFActuPageTr(WagtailTranslationOptions): + fields = ( + 'body', + ) + +@register(COFDirectoryPage) +class COFDirectoryPageTr(WagtailTranslationOptions): + fields = ( + 'introduction', ) +@register(COFDirectoryEntryPage) +class COFDirectoryEntryPageTr(WagtailTranslationOptions): + fields = ( + 'body', + 'links', + ) From 66fc36473925b27d36e3183d22e88cae2e8b2a43 Mon Sep 17 00:00:00 2001 From: Evarin Date: Sat, 19 Aug 2017 01:29:45 +0200 Subject: [PATCH 03/30] Ignore sass cache --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index f12190af..0e991fe8 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ venv/ /src media/ *.log +.sass-cache/ \ No newline at end of file From f5778fed2a5ecf6115c32b6730d24a00700a289a Mon Sep 17 00:00:00 2001 From: Evarin Date: Sat, 19 Aug 2017 01:32:26 +0200 Subject: [PATCH 04/30] =?UTF-8?q?Mod=C3=A8les=20plus=20cleans=20et=20templ?= =?UTF-8?q?ates=20principaux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gestioncof/cms/migrations/0001_initial.py | 143 ++++++++++-------- gestioncof/cms/models.py | 117 ++++++++++---- gestioncof/cms/static/cofcms/config.rb | 25 +++ gestioncof/cms/static/cofcms/css/ie.css | 5 + gestioncof/cms/static/cofcms/css/print.css | 3 + gestioncof/cms/static/cofcms/css/screen.css | 122 +++++++++++++++ .../cms/static/cofcms/sass/_colors.scss | 4 + gestioncof/cms/static/cofcms/sass/screen.scss | 58 +++++++ gestioncof/cms/templates/cofcms/base.html | 31 ++++ gestioncof/cms/templates/cofcms/base_nav.html | 9 ++ .../templates/cofcms/cof_actu_index_page.html | 18 +++ .../templates/cofcms/cof_directory_page.html | 34 +++++ gestioncof/cms/templates/cofcms/cof_page.html | 23 +++ .../cms/templates/cofcms/cof_root_page.html | 2 + gestioncof/cms/templatetags/__init__.py | 0 gestioncof/cms/templatetags/cofcms_tags.py | 12 ++ gestioncof/cms/translation.py | 10 +- 17 files changed, 522 insertions(+), 94 deletions(-) create mode 100644 gestioncof/cms/static/cofcms/config.rb create mode 100644 gestioncof/cms/static/cofcms/css/ie.css create mode 100644 gestioncof/cms/static/cofcms/css/print.css create mode 100644 gestioncof/cms/static/cofcms/css/screen.css create mode 100644 gestioncof/cms/static/cofcms/sass/_colors.scss create mode 100644 gestioncof/cms/static/cofcms/sass/screen.scss create mode 100644 gestioncof/cms/templates/cofcms/base.html create mode 100644 gestioncof/cms/templates/cofcms/base_nav.html create mode 100644 gestioncof/cms/templates/cofcms/cof_actu_index_page.html create mode 100644 gestioncof/cms/templates/cofcms/cof_directory_page.html create mode 100644 gestioncof/cms/templates/cofcms/cof_page.html create mode 100644 gestioncof/cms/templates/cofcms/cof_root_page.html create mode 100644 gestioncof/cms/templatetags/__init__.py create mode 100644 gestioncof/cms/templatetags/cofcms_tags.py diff --git a/gestioncof/cms/migrations/0001_initial.py b/gestioncof/cms/migrations/0001_initial.py index 19cf61c7..e9abe2fb 100644 --- a/gestioncof/cms/migrations/0001_initial.py +++ b/gestioncof/cms/migrations/0001_initial.py @@ -2,50 +2,83 @@ from __future__ import unicode_literals from django.db import migrations, models -import django.db.models.deletion -import wagtail.wagtailimages.blocks -import wagtail.wagtailcore.blocks import wagtail.wagtailcore.fields +import wagtail.wagtailimages.blocks +import gestioncof.cms.models +import wagtail.wagtailcore.blocks +import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ - ('wagtailimages', '0019_delete_filter'), ('wagtailcore', '0033_remove_golive_expiry_help_text'), + ('wagtailimages', '0019_delete_filter'), ] operations = [ migrations.CreateModel( - name='COFActuIndexPage', + name='COFActuEventPage', fields=[ - ('page_ptr', models.OneToOneField(primary_key=True, parent_link=True, serialize=False, auto_created=True, to='wagtailcore.Page')), + ('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, verbose_name='slug', help_text='The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/', max_length=255)), - ('slug_en', models.SlugField(null=True, verbose_name='slug', help_text='The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/', max_length=255)), - ('url_path_fr', models.TextField(null=True, blank=True, verbose_name='URL path', editable=False)), - ('url_path_en', models.TextField(null=True, blank=True, verbose_name='URL path', editable=False)), + ('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')), ], options={ - 'abstract': False, + 'verbose_name_plural': 'Indexs des actualités', + 'verbose_name': 'Index des actualités', }, - bases=('wagtailcore.page',), + bases=('wagtailcore.page', gestioncof.cms.models.COFActuIndexMixin), ), migrations.CreateModel( name='COFActuPage', fields=[ - ('page_ptr', models.OneToOneField(primary_key=True, parent_link=True, serialize=False, auto_created=True, to='wagtailcore.Page')), + ('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, verbose_name='slug', help_text='The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/', max_length=255)), - ('slug_en', models.SlugField(null=True, verbose_name='slug', help_text='The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/', max_length=255)), - ('url_path_fr', models.TextField(null=True, blank=True, verbose_name='URL path', editable=False)), - ('url_path_en', models.TextField(null=True, blank=True, verbose_name='URL path', editable=False)), + ('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')), @@ -54,23 +87,24 @@ class Migration(migrations.Migration): ('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 à la Une', models.ForeignKey(null=True, to='wagtailimages.Image', on_delete=django.db.models.deletion.SET_NULL, blank=True, related_name='+')), + ('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={ - 'abstract': False, + 'verbose_name_plural': 'Actualités simples', + 'verbose_name': 'Actualité simple', }, bases=('wagtailcore.page',), ), migrations.CreateModel( name='COFDirectoryEntryPage', fields=[ - ('page_ptr', models.OneToOneField(primary_key=True, parent_link=True, serialize=False, auto_created=True, to='wagtailcore.Page')), + ('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, verbose_name='slug', help_text='The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/', max_length=255)), - ('slug_en', models.SlugField(null=True, verbose_name='slug', help_text='The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/', max_length=255)), - ('url_path_fr', models.TextField(null=True, blank=True, verbose_name='URL path', editable=False)), - ('url_path_en', models.TextField(null=True, blank=True, verbose_name='URL path', editable=False)), + ('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')), @@ -81,23 +115,24 @@ class Migration(migrations.Migration): ('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, to='wagtailimages.Image', on_delete=django.db.models.deletion.SET_NULL, blank=True, related_name='+')), + ('image', models.ForeignKey(null=True, blank=True, on_delete=django.db.models.deletion.SET_NULL, to='wagtailimages.Image', related_name='+', verbose_name='Image')), ], options={ - 'abstract': False, + 'verbose_name_plural': "Éntrées d'annuaire", + 'verbose_name': "Éntrée d'annuaire", }, bases=('wagtailcore.page',), ), migrations.CreateModel( name='COFDirectoryPage', fields=[ - ('page_ptr', models.OneToOneField(primary_key=True, parent_link=True, serialize=False, auto_created=True, to='wagtailcore.Page')), + ('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, verbose_name='slug', help_text='The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/', max_length=255)), - ('slug_en', models.SlugField(null=True, verbose_name='slug', help_text='The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/', max_length=255)), - ('url_path_fr', models.TextField(null=True, blank=True, verbose_name='URL path', editable=False)), - ('url_path_en', models.TextField(null=True, blank=True, verbose_name='URL path', editable=False)), + ('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')), @@ -107,35 +142,21 @@ class Migration(migrations.Migration): ('introduction_en', wagtail.wagtailcore.fields.RichTextField(null=True, verbose_name='Introduction')), ], options={ - 'abstract': False, + 'verbose_name_plural': 'Annuaires', + 'verbose_name': 'Annuaire (clubs, partenaires, bons plans...)', }, bases=('wagtailcore.page',), ), - migrations.CreateModel( - name='COFEvent', - fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), - ('title', models.TextField(verbose_name='Titre')), - ('title_fr', models.TextField(null=True, verbose_name='Titre')), - ('title_en', models.TextField(null=True, verbose_name='Titre')), - ('description', wagtail.wagtailcore.fields.RichTextField(verbose_name='Description (concise)')), - ('description_fr', wagtail.wagtailcore.fields.RichTextField(null=True, verbose_name='Description (concise)')), - ('description_en', wagtail.wagtailcore.fields.RichTextField(null=True, verbose_name='Description (concise)')), - ('date_start', models.DateTimeField(verbose_name='Date et heure de début')), - ('date_end', models.DateTimeField(null=True, verbose_name='Date et heure de fin')), - ('all_day', models.BooleanField(verbose_name='Toute la journée', default=False)), - ], - ), migrations.CreateModel( name='COFPage', fields=[ - ('page_ptr', models.OneToOneField(primary_key=True, parent_link=True, serialize=False, auto_created=True, to='wagtailcore.Page')), + ('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, verbose_name='slug', help_text='The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/', max_length=255)), - ('slug_en', models.SlugField(null=True, verbose_name='slug', help_text='The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/', max_length=255)), - ('url_path_fr', models.TextField(null=True, blank=True, verbose_name='URL path', editable=False)), - ('url_path_en', models.TextField(null=True, blank=True, verbose_name='URL path', editable=False)), + ('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')), @@ -145,20 +166,21 @@ class Migration(migrations.Migration): ('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={ - 'abstract': False, + 'verbose_name_plural': 'Pages normales COF', + 'verbose_name': 'Page normale COF', }, bases=('wagtailcore.page',), ), migrations.CreateModel( name='COFRootPage', fields=[ - ('page_ptr', models.OneToOneField(primary_key=True, parent_link=True, serialize=False, auto_created=True, to='wagtailcore.Page')), + ('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, verbose_name='slug', help_text='The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/', max_length=255)), - ('slug_en', models.SlugField(null=True, verbose_name='slug', help_text='The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/', max_length=255)), - ('url_path_fr', models.TextField(null=True, blank=True, verbose_name='URL path', editable=False)), - ('url_path_en', models.TextField(null=True, blank=True, verbose_name='URL path', editable=False)), + ('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')), @@ -168,8 +190,9 @@ class Migration(migrations.Migration): ('introduction_en', wagtail.wagtailcore.fields.RichTextField(null=True, verbose_name='Introduction')), ], options={ - 'abstract': False, + 'verbose_name_plural': 'Racines site du COF', + 'verbose_name': 'Racine site du COF', }, - bases=('wagtailcore.page',), + bases=('wagtailcore.page', gestioncof.cms.models.COFActuIndexMixin), ), ] diff --git a/gestioncof/cms/models.py b/gestioncof/cms/models.py index eb50df48..ef957b5c 100644 --- a/gestioncof/cms/models.py +++ b/gestioncof/cms/models.py @@ -10,8 +10,17 @@ from wagtail.wagtailimages.blocks import ImageChooserBlock from wagtail.wagtailadmin.edit_handlers import FieldPanel, StreamFieldPanel from wagtail.wagtailsnippets.models import register_snippet +# Page pouvant afficher des actualités +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 + # Racine du site du COF -class COFRootPage(Page): +class COFRootPage(Page, COFActuIndexMixin): introduction = RichTextField("Introduction") content_panels = Page.content_panels + [ @@ -19,6 +28,10 @@ class COFRootPage(Page): ] subpage_types = ['COFActuIndexPage', 'COFPage', 'COFDirectoryPage'] + + class Meta: + verbose_name = "Racine site du COF" + verbose_name_plural = "Racines site du COF" # Page lambda du site class COFPage(Page): @@ -32,58 +45,95 @@ class COFPage(Page): StreamFieldPanel('body'), ] - subpages_types = ['COFDirectoryPage', 'COFPage'] + subpage_types = ['COFDirectoryPage', 'COFPage'] parent_page_types = ['COFPage', 'COFRootPage'] - -# Évènements -@register_snippet -class COFEvent(models.Model): - title = models.TextField("Titre") - description = RichTextField("Description (concise)") - date_start = models.DateTimeField("Date et heure de début") - date_end = models.DateTimeField("Date et heure de fin", null=True) - all_day = models.BooleanField("Toute la journée", default=False, blank=True) - - panels = [ - FieldPanel("title"), - FieldPanel("description"), - FieldPanel("date_start"), - FieldPanel("date_end"), - FieldPanel("all_day"), - ] + class Meta: + verbose_name = "Page normale COF" + verbose_name_plural = "Pages normales COF" # Actualités -class COFActuIndexPage(Page): - subpages_types = ['COFActuPage'] +class COFActuIndexPage(Page, COFActuIndexMixin): + subpage_types = ['COFActuPage', 'COFActuEventPage'] parent_page_types = ['COFRootPage'] + + class Meta: + verbose_name = "Index des actualités" + verbose_name_plural = "Indexs des actualités" class COFActuPage(Page): body = RichTextField("Contenu") date = models.DateField("Date du post") image = models.ForeignKey( - 'wagtailimages.Image', name="Image à la Une", + 'wagtailimages.Image', verbose_name="Image à la Une", null=True, blank=True, on_delete=models.SET_NULL, related_name='+' ) content_panels = Page.content_panels + [ FieldPanel('date'), -# ImageChooserPanel('image'), + ImageChooserPanel('image'), FieldPanel('body', classname="full"), ] - - subpages_types = [] + subpage_types = [] parent_page_types = ['COFActuIndexPage'] + class Meta: + 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) + + 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'] + + class Meta: + verbose_name = "Actu liée à un évènement" + verbose_name_plural = "Actus liées à des évènements" + # Annuaires (Clubs, partenaires, bonnes adresses) class COFDirectoryPage(Page): introduction = RichTextField("Introduction") - subpages_types = ['COFActuPage', 'COFDirectoryEntryPage'] + content_panels = Page.content_panels + [ + FieldPanel('introduction'), + ] + + subpage_types = ['COFActuPage', 'COFDirectoryEntryPage'] parent_page_types = ['COFRootPage', 'COFPage'] + @property + def entries(self): + entries = COFDirectoryEntryPage.objects.live().descendant_of(self) + return entries + + class Meta: + verbose_name = "Annuaire (clubs, partenaires, bons plans...)" + verbose_name_plural = "Annuaires" + + class COFDirectoryEntryPage(Page): body = RichTextField("Description") links = StreamField([ @@ -96,13 +146,22 @@ class COFDirectoryEntryPage(Page): ('texte', blocks.CharBlock()), ])), ]) - + image = models.ForeignKey( - 'wagtailimages.Image', name="Image", + 'wagtailimages.Image', verbose_name="Image", null=True, blank=True, on_delete=models.SET_NULL, related_name='+' ) - subpages_types = [] + content_panels = Page.content_panels + [ + ImageChooserPanel('image'), + FieldPanel('body', classname="full"), + StreamFieldPanel("links"), + ] + + subpage_types = [] parent_page_types = ['COFDirectoryPage'] + class Meta: + verbose_name = "Éntrée d'annuaire" + verbose_name_plural = "Éntrées d'annuaire" diff --git a/gestioncof/cms/static/cofcms/config.rb b/gestioncof/cms/static/cofcms/config.rb new file mode 100644 index 00000000..826a3727 --- /dev/null +++ b/gestioncof/cms/static/cofcms/config.rb @@ -0,0 +1,25 @@ +require 'compass/import-once/activate' +# Require any additional compass plugins here. + +# Set this to the root of your project when deployed: +http_path = "/" +css_dir = "css" +sass_dir = "sass" +images_dir = "images" +javascripts_dir = "js" + +# You can select your preferred output style here (can be overridden via the command line): +# output_style = :expanded or :nested or :compact or :compressed + +# To enable relative paths to assets via compass helper functions. Uncomment: +# relative_assets = true + +# To disable debugging comments that display the original location of your selectors. Uncomment: +# line_comments = false + + +# If you prefer the indented syntax, you might want to regenerate this +# project again passing --syntax sass, or you can uncomment this: +# preferred_syntax = :sass +# and then run: +# sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass diff --git a/gestioncof/cms/static/cofcms/css/ie.css b/gestioncof/cms/static/cofcms/css/ie.css new file mode 100644 index 00000000..5cd5b6c5 --- /dev/null +++ b/gestioncof/cms/static/cofcms/css/ie.css @@ -0,0 +1,5 @@ +/* Welcome to Compass. Use this file to write IE specific override styles. + * Import this file using the following HTML or equivalent: + * */ diff --git a/gestioncof/cms/static/cofcms/css/print.css b/gestioncof/cms/static/cofcms/css/print.css new file mode 100644 index 00000000..b0e9e456 --- /dev/null +++ b/gestioncof/cms/static/cofcms/css/print.css @@ -0,0 +1,3 @@ +/* Welcome to Compass. Use this file to define print styles. + * Import this file using the following HTML or equivalent: + * */ diff --git a/gestioncof/cms/static/cofcms/css/screen.css b/gestioncof/cms/static/cofcms/css/screen.css new file mode 100644 index 00000000..a2497901 --- /dev/null +++ b/gestioncof/cms/static/cofcms/css/screen.css @@ -0,0 +1,122 @@ +/* Welcome to Compass. + * In this file you should write your main styles. (or centralize your imports) + * Import this file using the following HTML or equivalent: + * */ +@import url("https://fonts.googleapis.com/css?family=Carter+One|Source+Sans+Pro:300,300i,700"); +/* line 5, ../../../../../../../../../../var/lib/gems/2.3.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */ +html, body, div, span, applet, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +a, abbr, acronym, address, big, cite, code, +del, dfn, em, img, ins, kbd, q, s, samp, +small, strike, strong, sub, sup, tt, var, +b, u, i, center, +dl, dt, dd, ol, ul, li, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td, +article, aside, canvas, details, embed, +figure, figcaption, footer, header, hgroup, +menu, nav, output, ruby, section, summary, +time, mark, audio, video { + margin: 0; + padding: 0; + border: 0; + font: inherit; + font-size: 100%; + vertical-align: baseline; +} + +/* line 22, ../../../../../../../../../../var/lib/gems/2.3.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */ +html { + line-height: 1; +} + +/* line 24, ../../../../../../../../../../var/lib/gems/2.3.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */ +ol, ul { + list-style: none; +} + +/* line 26, ../../../../../../../../../../var/lib/gems/2.3.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */ +table { + border-collapse: collapse; + border-spacing: 0; +} + +/* line 28, ../../../../../../../../../../var/lib/gems/2.3.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */ +caption, th, td { + text-align: left; + font-weight: normal; + vertical-align: middle; +} + +/* line 30, ../../../../../../../../../../var/lib/gems/2.3.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */ +q, blockquote { + quotes: none; +} +/* line 103, ../../../../../../../../../../var/lib/gems/2.3.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */ +q:before, q:after, blockquote:before, blockquote:after { + content: ""; + content: none; +} + +/* line 32, ../../../../../../../../../../var/lib/gems/2.3.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */ +a img { + border: none; +} + +/* line 116, ../../../../../../../../../../var/lib/gems/2.3.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */ +article, aside, details, figcaption, figure, footer, header, hgroup, main, menu, nav, section, summary { + display: block; +} + +/* line 12, ../sass/screen.scss */ +body { + background: #ff7869; + font: 17px "Source Sans Pro", "sans-serif"; +} + +/* line 17, ../sass/screen.scss */ +header { + background: #02c082; +} + +/* line 21, ../sass/screen.scss */ +h1, h2 { + font-family: "Carter One"; +} + +/* line 25, ../sass/screen.scss */ +h1 { + font-size: 2.3em; +} + +/* line 29, ../sass/screen.scss */ +a { + color: #fff; + text-decoration: none; +} + +/* line 36, ../sass/screen.scss */ +header nav ul { + display: flex; +} +/* line 38, ../sass/screen.scss */ +header nav ul li { + display: inline-block; +} +/* line 40, ../sass/screen.scss */ +header nav ul li > * { + display: block; + padding: 10px 15px; + font-weight: bold; +} +/* line 45, ../sass/screen.scss */ +header nav ul li > *:hover { + background: #018e60; +} +/* line 52, ../sass/screen.scss */ +header section { + display: flex; + width: 100%; + justify-content: space-between; + align-items: stretch; +} diff --git a/gestioncof/cms/static/cofcms/sass/_colors.scss b/gestioncof/cms/static/cofcms/sass/_colors.scss new file mode 100644 index 00000000..a2bc8fc2 --- /dev/null +++ b/gestioncof/cms/static/cofcms/sass/_colors.scss @@ -0,0 +1,4 @@ +$fond: #ff7869; +$bandeau: #02c082; +$aside: #ffe896; +$titre: #e23427; diff --git a/gestioncof/cms/static/cofcms/sass/screen.scss b/gestioncof/cms/static/cofcms/sass/screen.scss new file mode 100644 index 00000000..76d2ef20 --- /dev/null +++ b/gestioncof/cms/static/cofcms/sass/screen.scss @@ -0,0 +1,58 @@ +/* Welcome to Compass. + * In this file you should write your main styles. (or centralize your imports) + * Import this file using the following HTML or equivalent: + * */ + +@import url('https://fonts.googleapis.com/css?family=Carter+One|Source+Sans+Pro:300,300i,700'); + +@import "compass/reset"; + +@import "_colors"; + +body { + background: $fond; + font: 17px "Source Sans Pro", "sans-serif"; +} + +header { + background: $bandeau; +} + +h1, h2 { + font-family: "Carter One"; +} + +h1 { + font-size: 2.3em; +} + +a { + color: #fff; + text-decoration: none; +} + +header { + nav { + ul { + display: flex; + li { + display: inline-block; + > * { + display: block; + padding: 10px 15px; + font-weight: bold; + + &:hover { + background: darken($bandeau, 10%); + } + } + } + } + } + section { + display: flex; + width: 100%; + justify-content: space-between; + align-items: stretch; + } +} diff --git a/gestioncof/cms/templates/cofcms/base.html b/gestioncof/cms/templates/cofcms/base.html new file mode 100644 index 00000000..e6aea017 --- /dev/null +++ b/gestioncof/cms/templates/cofcms/base.html @@ -0,0 +1,31 @@ +{% load static menu_tags wagtailuserbar %} + + + + + + {% block title %}Association des élèves de l'ENS Ulm{% endblock %} + + + + +
+
+

COF

+ +
+
+ +
+
+ +
+ {% block content %}{% endblock %} +
+ {% wagtailuserbar %} + + diff --git a/gestioncof/cms/templates/cofcms/base_nav.html b/gestioncof/cms/templates/cofcms/base_nav.html new file mode 100644 index 00000000..6ec8a8ed --- /dev/null +++ b/gestioncof/cms/templates/cofcms/base_nav.html @@ -0,0 +1,9 @@ + diff --git a/gestioncof/cms/templates/cofcms/cof_actu_index_page.html b/gestioncof/cms/templates/cofcms/cof_actu_index_page.html new file mode 100644 index 00000000..3146e6cd --- /dev/null +++ b/gestioncof/cms/templates/cofcms/cof_actu_index_page.html @@ -0,0 +1,18 @@ +{% extends "cofcms/base.html" %} +{% load wagtailimages_tags cofcms_tags %} + +{% block content %} +
+

{{ page.title }}

+
{{ page.introduction|safe }}
+
+ +
+ {% for actu in page.actus %} +
+

{{ actu.title }}

+ {{ actu.body|safe }} +
+ {% endfor %} +
+{% endblock %} diff --git a/gestioncof/cms/templates/cofcms/cof_directory_page.html b/gestioncof/cms/templates/cofcms/cof_directory_page.html new file mode 100644 index 00000000..8f0e6746 --- /dev/null +++ b/gestioncof/cms/templates/cofcms/cof_directory_page.html @@ -0,0 +1,34 @@ +{% extends "cofcms/base.html" %} +{% load wagtailimages_tags cofcms_tags %} + +{% block content %} +
+

{{ page.title }}

+
{{ page.introduction|safe }}
+
+ +
+ {% for entry in page.entries %} +
+

{{ entry.title }}

+ {% if entry.image %} + {% image entry.image width-400 class="entry-img" %} + {% endif %} +
{{ entry.body|safe }}
+ {% if entry.links %} + + {% endif %} +
+ {% endfor %} +
+{% endblock %} diff --git a/gestioncof/cms/templates/cofcms/cof_page.html b/gestioncof/cms/templates/cofcms/cof_page.html new file mode 100644 index 00000000..d6e64e56 --- /dev/null +++ b/gestioncof/cms/templates/cofcms/cof_page.html @@ -0,0 +1,23 @@ +{% extends "cofcms/base.html" %} +{% load wagtailimages_tags cofcms_tags %} + +{% block content %} +
+

{{ page.title }}

+
{{ page.introduction|safe }}
+
+ +
+ {% for block in page.body %} + {% if block.block_type == "heading" %} +

{{ block.value }}

+ {% else %}{% if block.block_type == "paragraph" %} +
+ {{ block.value|safe }} +
+ {% else %}{% if block.block_type == "image" %} + {% image block.value width-400 %} + {% endif %}{% endif %}{% endif %} + {% endfor %} +
+{% endblock %} diff --git a/gestioncof/cms/templates/cofcms/cof_root_page.html b/gestioncof/cms/templates/cofcms/cof_root_page.html new file mode 100644 index 00000000..a730ec7a --- /dev/null +++ b/gestioncof/cms/templates/cofcms/cof_root_page.html @@ -0,0 +1,2 @@ +{% extends "cofcms/base.html" %} + diff --git a/gestioncof/cms/templatetags/__init__.py b/gestioncof/cms/templatetags/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/gestioncof/cms/templatetags/cofcms_tags.py b/gestioncof/cms/templatetags/cofcms_tags.py new file mode 100644 index 00000000..223d9b81 --- /dev/null +++ b/gestioncof/cms/templatetags/cofcms_tags.py @@ -0,0 +1,12 @@ +from datetime import date +from django import template +from django.conf import settings + +import re + +register = template.Library() + +@register.filter() +def obfuscate_mail(value): + val = value.replace('', '/').replace('@', 'arbse').replace('.', 'pnt') + return val diff --git a/gestioncof/cms/translation.py b/gestioncof/cms/translation.py index 705a9c1f..2be97221 100644 --- a/gestioncof/cms/translation.py +++ b/gestioncof/cms/translation.py @@ -1,4 +1,4 @@ -from .models import COFRootPage, COFPage, COFEvent, COFActuIndexPage, COFActuPage, COFDirectoryPage, COFDirectoryEntryPage +from .models import COFRootPage, COFPage, COFActuEventPage, COFActuIndexPage, COFActuPage, COFDirectoryPage, COFDirectoryEntryPage from wagtail_modeltranslation.translator import WagtailTranslationOptions from modeltranslation.decorators import register @@ -15,11 +15,11 @@ class COFPageTr(WagtailTranslationOptions): 'body', ) -@register(COFEvent) -class COFEventTr(WagtailTranslationOptions): +@register(COFActuEventPage) +class COFActuEventPageTr(WagtailTranslationOptions): fields = ( - 'title', - 'description', + 'chapo', + 'body', ) @register(COFActuIndexPage) From 53658589f89e3883567b9ca6c23cdee9cb62eea2 Mon Sep 17 00:00:00 2001 From: Evarin Date: Sun, 20 Aug 2017 00:39:19 +0200 Subject: [PATCH 05/30] Nouvelles couleurs, Plus de templates, Calendrier (sommaire) --- gestioncof/cms/models.py | 5 +- gestioncof/cms/static/cofcms/css/screen.css | 141 ++++++++++++++---- .../cms/static/cofcms/sass/_colors.scss | 10 +- gestioncof/cms/static/cofcms/sass/screen.scss | 103 ++++++++++++- gestioncof/cms/templates/cofcms/base.html | 6 +- .../cms/templates/cofcms/base_aside.html | 9 ++ gestioncof/cms/templates/cofcms/calendar.html | 14 ++ .../templates/cofcms/cof_actu_index_page.html | 6 +- .../templates/cofcms/cof_directory_page.html | 11 +- .../cms/templates/cofcms/cof_root_page.html | 26 +++- gestioncof/cms/templatetags/cofcms_tags.py | 43 +++++- 11 files changed, 330 insertions(+), 44 deletions(-) create mode 100644 gestioncof/cms/templates/cofcms/base_aside.html create mode 100644 gestioncof/cms/templates/cofcms/calendar.html diff --git a/gestioncof/cms/models.py b/gestioncof/cms/models.py index ef957b5c..69f56ae0 100644 --- a/gestioncof/cms/models.py +++ b/gestioncof/cms/models.py @@ -96,6 +96,7 @@ class COFActuEventPage(Page): 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'), @@ -108,11 +109,11 @@ class COFActuEventPage(Page): subpage_types = [] parent_page_types = ['COFActuIndexPage'] - + class Meta: verbose_name = "Actu liée à un évènement" verbose_name_plural = "Actus liées à des évènements" - + # Annuaires (Clubs, partenaires, bonnes adresses) class COFDirectoryPage(Page): introduction = RichTextField("Introduction") diff --git a/gestioncof/cms/static/cofcms/css/screen.css b/gestioncof/cms/static/cofcms/css/screen.css index a2497901..ed2eb06f 100644 --- a/gestioncof/cms/static/cofcms/css/screen.css +++ b/gestioncof/cms/static/cofcms/css/screen.css @@ -69,54 +69,143 @@ article, aside, details, figcaption, figure, footer, header, hgroup, main, menu, } /* line 12, ../sass/screen.scss */ +*, *:after, *:before { + box-sizing: content-box; +} + +/* line 16, ../sass/screen.scss */ body { - background: #ff7869; + background: #ffcc6f; font: 17px "Source Sans Pro", "sans-serif"; } -/* line 17, ../sass/screen.scss */ +/* line 21, ../sass/screen.scss */ header { - background: #02c082; + background: #30355a; } -/* line 21, ../sass/screen.scss */ +/* line 25, ../sass/screen.scss */ h1, h2 { font-family: "Carter One"; } -/* line 25, ../sass/screen.scss */ +/* line 29, ../sass/screen.scss */ h1 { font-size: 2.3em; } -/* line 29, ../sass/screen.scss */ +/* line 33, ../sass/screen.scss */ +h2 { + font-size: 1.6em; +} + +/* line 37, ../sass/screen.scss */ a { - color: #fff; + color: #f9752b; text-decoration: none; } -/* line 36, ../sass/screen.scss */ -header nav ul { - display: flex; -} -/* line 38, ../sass/screen.scss */ -header nav ul li { - display: inline-block; -} -/* line 40, ../sass/screen.scss */ -header nav ul li > * { - display: block; - padding: 10px 15px; - font-weight: bold; -} -/* line 45, ../sass/screen.scss */ -header nav ul li > *:hover { - background: #018e60; -} -/* line 52, ../sass/screen.scss */ +/* line 43, ../sass/screen.scss */ header section { display: flex; width: 100%; justify-content: space-between; align-items: stretch; } +/* line 49, ../sass/screen.scss */ +header section.bottom-menu { + justify-content: space-around; + text-align: center; + background: #47395e; +} +/* line 55, ../sass/screen.scss */ +header h1 { + padding: 0 15px; +} +/* line 59, ../sass/screen.scss */ +header nav ul { + display: flex; +} +/* line 61, ../sass/screen.scss */ +header nav ul li { + display: inline-block; +} +/* line 63, ../sass/screen.scss */ +header nav ul li > * { + display: block; + padding: 10px 15px; + font-weight: bold; +} +/* line 68, ../sass/screen.scss */ +header nav ul li > *:hover { + background: #1e2139; +} + +/* line 77, ../sass/screen.scss */ +.container { + max-width: 1000px; + margin: 0 auto; + position: relative; +} +/* line 82, ../sass/screen.scss */ +.container .aside-wrap { + position: absolute; + top: 30px; + height: 100%; + width: 250px; +} +/* line 88, ../sass/screen.scss */ +.container .aside-wrap .aside { + position: fixed; + position: sticky; + top: 5px; + width: 100%; + background: #7a504c; + padding: 15px; + box-shadow: -4px 4px 1px rgba(0, 0, 0, 0.3); +} +/* line 97, ../sass/screen.scss */ +.container .aside-wrap .aside .calendar { + margin: 0 auto; + display: block; +} +/* line 104, ../sass/screen.scss */ +.container .content { + max-width: 700px; + margin-left: auto; + margin-right: 0; +} +/* line 111, ../sass/screen.scss */ +.container .content section article { + background: #fff; + padding: 30px; + box-shadow: -4px 4px 1px rgba(0, 0, 0, 0.3); +} +/* line 115, ../sass/screen.scss */ +.container .content section article a { + color: #30355a; +} +/* line 120, ../sass/screen.scss */ +.container .content section article + h2 { + margin-top: 15px; +} + +/* line 128, ../sass/screen.scss */ +.calendar td, .calendar th { + text-align: center; + vertical-align: center; + border: 2px solid transparent; + padding: 1px; +} +/* line 135, ../sass/screen.scss */ +.calendar th { + font-weight: bold; +} +/* line 140, ../sass/screen.scss */ +.calendar td.out { + opacity: 0.3; +} +/* line 143, ../sass/screen.scss */ +.calendar td.today { + border-bottom-color: #000; +} diff --git a/gestioncof/cms/static/cofcms/sass/_colors.scss b/gestioncof/cms/static/cofcms/sass/_colors.scss index a2bc8fc2..32e8088c 100644 --- a/gestioncof/cms/static/cofcms/sass/_colors.scss +++ b/gestioncof/cms/static/cofcms/sass/_colors.scss @@ -1,4 +1,6 @@ -$fond: #ff7869; -$bandeau: #02c082; -$aside: #ffe896; -$titre: #e23427; +$fond: #ffcc6f; +$bandeau: #30355a; +$sousbandeau: #47395e; +$aside: #7a504c; +$titre: #31597e; +$lien: #f9752b; diff --git a/gestioncof/cms/static/cofcms/sass/screen.scss b/gestioncof/cms/static/cofcms/sass/screen.scss index 76d2ef20..42373298 100644 --- a/gestioncof/cms/static/cofcms/sass/screen.scss +++ b/gestioncof/cms/static/cofcms/sass/screen.scss @@ -9,6 +9,10 @@ @import "_colors"; +*, *:after, *:before { + box-sizing: content-box; +} + body { background: $fond; font: 17px "Source Sans Pro", "sans-serif"; @@ -26,18 +30,37 @@ h1 { font-size: 2.3em; } +h2 { + font-size: 1.6em; +} + a { - color: #fff; + color: $lien; text-decoration: none; } header { + section { + display: flex; + width: 100%; + justify-content: space-between; + align-items: stretch; + + &.bottom-menu { + justify-content: space-around; + text-align: center; + background: $sousbandeau; + } + } + h1 { + padding: 0 15px; + } nav { ul { display: flex; li { display: inline-block; - > * { + & > * { display: block; padding: 10px 15px; font-weight: bold; @@ -49,10 +72,76 @@ header { } } } - section { - display: flex; - width: 100%; - justify-content: space-between; - align-items: stretch; +} + +.container { + max-width: 1000px; + margin: 0 auto; + position: relative; + + .aside-wrap { + position: absolute; + top: 30px; + height: 100%; + width: 250px; + + .aside { + position: fixed; + position: sticky; + top: 5px; + width: 100%; + background: $aside; + padding: 15px; + box-shadow: -4px 4px 1px rgba(#000, 0.3); + + .calendar { + margin: 0 auto; + display: block; + } + } + } + + .content { + max-width: 700px; + margin-left: auto; + margin-right: 0; + + + section { + article { + background: #fff; + padding: 30px; + box-shadow: -4px 4px 1px rgba(#000, 0.3); + a { + color: $bandeau; + } + } + + article + h2 { + margin-top: 15px; + } + } + } +} + +.calendar { + td, th { + text-align: center; + vertical-align: center; + border: 2px solid transparent; + padding: 1px; + } + + th { + font-weight: bold; + } + + td { + &.out { + opacity: 0.3; + } + &.today { + border-bottom-color: #000; + } } } diff --git a/gestioncof/cms/templates/cofcms/base.html b/gestioncof/cms/templates/cofcms/base.html index e6aea017..dbf0faa4 100644 --- a/gestioncof/cms/templates/cofcms/base.html +++ b/gestioncof/cms/templates/cofcms/base.html @@ -24,7 +24,11 @@
- {% block content %}{% endblock %} + {% block superaside %}{% endblock %} + +
+ {% block content %}{% endblock %} +
{% wagtailuserbar %} diff --git a/gestioncof/cms/templates/cofcms/base_aside.html b/gestioncof/cms/templates/cofcms/base_aside.html new file mode 100644 index 00000000..49404432 --- /dev/null +++ b/gestioncof/cms/templates/cofcms/base_aside.html @@ -0,0 +1,9 @@ +{% extends "cofcms/base.html" %} + +{% block superaside %} +
+
+ {% block aside %}{% endblock %} +
+
+{% endblock %} diff --git a/gestioncof/cms/templates/cofcms/calendar.html b/gestioncof/cms/templates/cofcms/calendar.html new file mode 100644 index 00000000..98eacdab --- /dev/null +++ b/gestioncof/cms/templates/cofcms/calendar.html @@ -0,0 +1,14 @@ + + + + {% for week in weeks %} + + {% for day in week %} + + {% endfor %} + + {% endfor %} + +
LMMJVSD
+ {% if day.events %}{{ day.day }}{% else %}{{ day.day }}{% endif %} +
diff --git a/gestioncof/cms/templates/cofcms/cof_actu_index_page.html b/gestioncof/cms/templates/cofcms/cof_actu_index_page.html index 3146e6cd..d0f15ae4 100644 --- a/gestioncof/cms/templates/cofcms/cof_actu_index_page.html +++ b/gestioncof/cms/templates/cofcms/cof_actu_index_page.html @@ -1,6 +1,10 @@ -{% extends "cofcms/base.html" %} +{% extends "cofcms/base_aside.html" %} {% load wagtailimages_tags cofcms_tags %} +{% block aside %} + {% calendar %} +{% endblock %} + {% block content %}

{{ page.title }}

diff --git a/gestioncof/cms/templates/cofcms/cof_directory_page.html b/gestioncof/cms/templates/cofcms/cof_directory_page.html index 8f0e6746..62d6eff9 100644 --- a/gestioncof/cms/templates/cofcms/cof_directory_page.html +++ b/gestioncof/cms/templates/cofcms/cof_directory_page.html @@ -1,6 +1,15 @@ -{% extends "cofcms/base.html" %} +{% extends "cofcms/base_aside.html" %} {% load wagtailimages_tags cofcms_tags %} +{% block aside %} +

Accès rapide

+ +{% endblock %} + {% block content %}

{{ page.title }}

diff --git a/gestioncof/cms/templates/cofcms/cof_root_page.html b/gestioncof/cms/templates/cofcms/cof_root_page.html index a730ec7a..a734abe0 100644 --- a/gestioncof/cms/templates/cofcms/cof_root_page.html +++ b/gestioncof/cms/templates/cofcms/cof_root_page.html @@ -1,2 +1,26 @@ -{% extends "cofcms/base.html" %} +{% extends "cofcms/base_aside.html" %} +{% load static cofcms_tags wagtailimages_tags %} +{% block aside %} + {% calendar %} +{% endblock %} + +{% block content %} +
+

{{ page.title }}

+
{{ page.introduction|safe }}
+
+ +
+ {% for actu in page.actus %} + {% if actu.is_event %} +
+

{{ actu.title }}

+ {% if actu.image %} + {% image actu.image fill-400x200 class="actu-img" %} + {% endif %} +
+ {% endif %} + {% endfor %} +
+{% endblock %} diff --git a/gestioncof/cms/templatetags/cofcms_tags.py b/gestioncof/cms/templatetags/cofcms_tags.py index 223d9b81..ef8cdd41 100644 --- a/gestioncof/cms/templatetags/cofcms_tags.py +++ b/gestioncof/cms/templatetags/cofcms_tags.py @@ -1,6 +1,9 @@ -from datetime import date +from datetime import timedelta, date from django import template from django.conf import settings +from django.utils import timezone + +from ..models import COFActuEventPage import re @@ -10,3 +13,41 @@ register = template.Library() def obfuscate_mail(value): val = value.replace('', '/').replace('@', 'arbse').replace('.', 'pnt') return val + +@register.inclusion_tag("cofcms/calendar.html") +def calendar(): + now = timezone.now() + month_start = date(now.year, now.month, 1) + next_month = month_start + timedelta(days=32) + next_month = date(next_month.year, next_month.month, 1) + month_prestart = month_start - timedelta(days=(month_start.weekday()+7)%7) + 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 = list(events) + weeks = [] + curday = month_prestart + deltaday = timedelta(days=1) + while curday < next_month and len(weeks)<10: + week = [] + for k in range(7): + curevents = [] + for k in range(len(events)-1, -1, -1): + e = events[k] + if e.date_start.date() > curday: break + if (e.date_start if e.date_end is None else e.date_end).date() < curday: + del events[k] + else: + curevents.append(e) + print(curevents) + day = {'day': curday.day, + 'class': (('today ' if (curday.day == now.day + and curday.month == now.month) else '') + + ('in' if curday.month == now.month else 'out')), + 'events': curevents} + week.append(day) + curday += deltaday + weeks.append(week) + return {"events": events, "weeks": weeks} From 09e63bf00cb0e39bc92f91082d3b5ab3ef37f0fe Mon Sep 17 00:00:00 2001 From: Evarin Date: Tue, 22 Aug 2017 00:58:18 +0200 Subject: [PATCH 06/30] Actus et listes de clubs plus jolies et fonctionnelles, calendriers (beta) --- gestioncof/cms/models.py | 39 ++++++++++- gestioncof/cms/static/cofcms/css/screen.css | 69 +++++++++++++++++-- gestioncof/cms/static/cofcms/js/script.js | 13 ++++ gestioncof/cms/static/cofcms/sass/screen.scss | 68 +++++++++++++++++- gestioncof/cms/templates/cofcms/base.html | 1 + .../templates/cofcms/cof_directory_page.html | 13 ++-- .../cms/templates/cofcms/cof_root_page.html | 15 ++-- .../cms/templates/cofcms/mini_calendar.html | 11 +++ gestioncof/cms/templatetags/cofcms_tags.py | 19 ++++- 9 files changed, 230 insertions(+), 18 deletions(-) create mode 100644 gestioncof/cms/static/cofcms/js/script.js create mode 100644 gestioncof/cms/templates/cofcms/mini_calendar.html diff --git a/gestioncof/cms/models.py b/gestioncof/cms/models.py index 69f56ae0..9b72568e 100644 --- a/gestioncof/cms/models.py +++ b/gestioncof/cms/models.py @@ -109,7 +109,44 @@ class COFActuEventPage(Page): subpage_types = [] parent_page_types = ['COFActuIndexPage'] - + + @property + def dates(self): + if self.date_end: + if self.date_end.date() == self.date_start.date(): + if self.all_day: + return self.date_start.strftime("le %A %w %B %Y") + else: + return "le %s à %s" % \ + (self.date_start.strftime("%A %w %B %Y de %Hh%M"), + self.date_end.strftime("%Hh%M")) + else: + tmpl = "%A %w %B %Y" + diff_i = len(tmpl) + if self.date_end.year != self.date_start.year: + diff_i = len(tmpl) + elif self.date_end.month != self.date_start.month: + 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] + if self.all_day: + return "du %s au %s %s" % (self.date_start.strftime(diff), + self.date_end.strftime(diff), + self.date_end.strftime(common)) + else: + return "du %s %s %s au %s %s" % \ + (self.date_start.strftime(diff), + self.date_start.strftime(common), + self.date_start.strftime("%Hh%M"), + self.date_end.strftime(diff), + self.date_end.strftime("%Hh%M")) + else: + if self.all_day: + return self.date_start.strftime("le %A %w %B %Y") + else: + return self.date_start.strftime("le %A %w %B %Y à %Hh%M") class Meta: verbose_name = "Actu liée à un évènement" verbose_name_plural = "Actus liées à des évènements" diff --git a/gestioncof/cms/static/cofcms/css/screen.css b/gestioncof/cms/static/cofcms/css/screen.css index ed2eb06f..5d41db14 100644 --- a/gestioncof/cms/static/cofcms/css/screen.css +++ b/gestioncof/cms/static/cofcms/css/screen.css @@ -70,7 +70,7 @@ article, aside, details, figcaption, figure, footer, header, hgroup, main, menu, /* line 12, ../sass/screen.scss */ *, *:after, *:before { - box-sizing: content-box; + box-sizing: border-box; } /* line 16, ../sass/screen.scss */ @@ -189,23 +189,82 @@ header nav ul li > *:hover { .container .content section article + h2 { margin-top: 15px; } +/* line 125, ../sass/screen.scss */ +.container .content section.directory article.entry { + width: 80%; + max-width: 600px; + max-height: 100%; + position: relative; + padding-right: 120px; +} +/* line 132, ../sass/screen.scss */ +.container .content section.directory article.entry .entry-image { + display: block; + position: absolute; + width: 150px; + background: #fff; + box-shadow: -4px 4px 1px rgba(0, 0, 0, 0.2); + padding: 1px; + overflow: hidden; + right: 100px; + transform: translateX(90%); + top: -15px; +} +/* line 144, ../sass/screen.scss */ +.container .content section.directory article.entry .entry-image img { + width: auto; + height: auto; + max-width: 100%; + max-height: 100%; +} +/* line 155, ../sass/screen.scss */ +.container .content section.actuhome article.actu { + background: none; + box-shadow: none; + max-width: 400px; +} +/* line 160, ../sass/screen.scss */ +.container .content section.actuhome article.actu .actu-header { + position: relative; + box-shadow: -4px 5px 1px rgba(0, 0, 0, 0.3); + padding: 0; + margin: 0; + overflow: hidden; +} +/* line 167, ../sass/screen.scss */ +.container .content section.actuhome article.actu .actu-header img { + position: absolute; + top: 0; + left: 0; + min-height: 100%; + min-width: 100%; + height: auto; + width: auto; + z-index: -1; +} +/* line 177, ../sass/screen.scss */ +.container .content section.actuhome article.actu .actu-header h2 { + width: 100%; + height: 100%; + padding-top: 150px; +} -/* line 128, ../sass/screen.scss */ +/* line 194, ../sass/screen.scss */ .calendar td, .calendar th { text-align: center; vertical-align: center; border: 2px solid transparent; padding: 1px; } -/* line 135, ../sass/screen.scss */ +/* line 201, ../sass/screen.scss */ .calendar th { font-weight: bold; } -/* line 140, ../sass/screen.scss */ +/* line 206, ../sass/screen.scss */ .calendar td.out { opacity: 0.3; } -/* line 143, ../sass/screen.scss */ +/* line 209, ../sass/screen.scss */ .calendar td.today { border-bottom-color: #000; } diff --git a/gestioncof/cms/static/cofcms/js/script.js b/gestioncof/cms/static/cofcms/js/script.js new file mode 100644 index 00000000..c7693a6d --- /dev/null +++ b/gestioncof/cms/static/cofcms/js/script.js @@ -0,0 +1,13 @@ +$(function() { + $(".facteur").on("click", function(){ + var $this = $(this); + var sticker = $this.attr('data-mref') + .replace('pont', '.') + .replace('arbre', '@') + .replace(/(.)-/g, '$1'); + + var boite = $("", {href:"ma"+"il"+"to:"+sticker}).text(sticker); + $(this).before(boite) + .remove(); + }) +}); diff --git a/gestioncof/cms/static/cofcms/sass/screen.scss b/gestioncof/cms/static/cofcms/sass/screen.scss index 42373298..ab374da7 100644 --- a/gestioncof/cms/static/cofcms/sass/screen.scss +++ b/gestioncof/cms/static/cofcms/sass/screen.scss @@ -10,7 +10,7 @@ @import "_colors"; *, *:after, *:before { - box-sizing: content-box; + box-sizing: border-box; } body { @@ -120,6 +120,72 @@ header { article + h2 { margin-top: 15px; } + + &.directory { + article.entry { + width: 80%; + max-width: 600px; + max-height: 100%; + position: relative; + padding-right: 120px; + + .entry-image { + display: block; + position: absolute; + width: 150px; + background: #fff; + box-shadow: -4px 4px 1px rgba(#000, 0.2); + padding: 1px; + overflow: hidden; + right: 100px; + transform: translateX(90%); + top: -15px; + + img { + width: auto; + height: auto; + max-width: 100%; + max-height: 100%; + } + } + } + } + + &.actuhome { + article.actu { + background: none; + box-shadow: none; + max-width: 400px; + + .actu-header { + position: relative; + box-shadow: -4px 5px 1px rgba(#000, 0.3); + padding: 0; + margin: 0; + overflow: hidden; + + img { + position: absolute; + top: 0; + left: 0; + min-height: 100%; + min-width: 100%; + height: auto; + width: auto; + z-index: -1; + } + h2 { + width: 100%; + height: 100%; + padding-top: 150px; + } + } + + .actu-misc { + + } + } + } } } } diff --git a/gestioncof/cms/templates/cofcms/base.html b/gestioncof/cms/templates/cofcms/base.html index dbf0faa4..05119dbd 100644 --- a/gestioncof/cms/templates/cofcms/base.html +++ b/gestioncof/cms/templates/cofcms/base.html @@ -6,6 +6,7 @@ {% block title %}Association des élèves de l'ENS Ulm{% endblock %} + {% block extra_head %}{% endblock %} diff --git a/gestioncof/cms/templates/cofcms/cof_directory_page.html b/gestioncof/cms/templates/cofcms/cof_directory_page.html index 62d6eff9..0c0b84da 100644 --- a/gestioncof/cms/templates/cofcms/cof_directory_page.html +++ b/gestioncof/cms/templates/cofcms/cof_directory_page.html @@ -1,6 +1,11 @@ {% extends "cofcms/base_aside.html" %} -{% load wagtailimages_tags cofcms_tags %} +{% load wagtailimages_tags cofcms_tags static %} +{% block extra_head %} + {{ block.super }} + + +{% endblock %} {% block aside %}

Accès rapide

    @@ -19,10 +24,10 @@
    {% for entry in page.entries %}
    -

    {{ entry.title }}

    {% if entry.image %} - {% image entry.image width-400 class="entry-img" %} +
    {% image entry.image width-150 class="entry-img" %}
    {% endif %} +

    {{ entry.title }}

    {{ entry.body|safe }}
    {% if entry.links %}
    {% endfor %}
    diff --git a/gestioncof/cms/templatetags/cofcms_tags.py b/gestioncof/cms/templatetags/cofcms_tags.py index 004fd21c..7d426e46 100644 --- a/gestioncof/cms/templatetags/cofcms_tags.py +++ b/gestioncof/cms/templatetags/cofcms_tags.py @@ -42,7 +42,6 @@ def calendar(): del events[k] else: curevents.append(e) - print(curevents) day = {'day': curday.day, 'class': (('today ' if (curday.day == now.day and curday.month == now.month) else '') From 5a22b1cd372c12d447db7610fa591143ead201d6 Mon Sep 17 00:00:00 2001 From: Evarin Date: Tue, 10 Oct 2017 11:22:02 +0200 Subject: [PATCH 10/30] Affichage des actus --- gestioncof/cms/static/cofcms/css/screen.css | 93 ++++++++++++------- gestioncof/cms/static/cofcms/sass/screen.scss | 31 +++++++ .../templates/cofcms/cof_actu_index_page.html | 17 ++-- 3 files changed, 103 insertions(+), 38 deletions(-) diff --git a/gestioncof/cms/static/cofcms/css/screen.css b/gestioncof/cms/static/cofcms/css/screen.css index 5f543bb4..965206c3 100644 --- a/gestioncof/cms/static/cofcms/css/screen.css +++ b/gestioncof/cms/static/cofcms/css/screen.css @@ -169,21 +169,25 @@ article ul { article ul li { list-style: outside; } +/* line 98, ../sass/screen.scss */ +article:last-child { + margin-bottom: 30px; +} -/* line 100, ../sass/screen.scss */ +/* line 103, ../sass/screen.scss */ .container { max-width: 1000px; margin: 0 auto; position: relative; } -/* line 105, ../sass/screen.scss */ +/* line 108, ../sass/screen.scss */ .container .aside-wrap { position: absolute; top: 30px; height: 100%; width: 250px; } -/* line 111, ../sass/screen.scss */ +/* line 114, ../sass/screen.scss */ .container .aside-wrap .aside { color: #fff; position: fixed; @@ -194,43 +198,47 @@ article ul li { padding: 15px; box-shadow: -4px 4px 1px rgba(0, 0, 0, 0.3); } -/* line 121, ../sass/screen.scss */ +/* line 124, ../sass/screen.scss */ +.container .aside-wrap .aside h2 { + color: #fff; +} +/* line 128, ../sass/screen.scss */ .container .aside-wrap .aside .calendar { margin: 0 auto; display: block; } -/* line 128, ../sass/screen.scss */ +/* line 135, ../sass/screen.scss */ .container .content { max-width: 700px; margin-left: auto; margin-right: 0; } -/* line 133, ../sass/screen.scss */ +/* line 140, ../sass/screen.scss */ .container .content .intro { border-bottom: 3px solid #a3d200; margin: 20px -10px; margin-top: 5px; padding: 15px 5px; } -/* line 143, ../sass/screen.scss */ +/* line 150, ../sass/screen.scss */ .container .content section article { background: #fff; padding: 30px; box-shadow: -4px 4px 1px rgba(0, 0, 0, 0.3); } -/* line 147, ../sass/screen.scss */ +/* line 154, ../sass/screen.scss */ .container .content section article a { color: #3cb3a6; } -/* line 152, ../sass/screen.scss */ +/* line 159, ../sass/screen.scss */ .container .content section article + h2 { margin-top: 15px; } -/* line 156, ../sass/screen.scss */ +/* line 163, ../sass/screen.scss */ .container .content section article + article { margin-top: 25px; } -/* line 161, ../sass/screen.scss */ +/* line 168, ../sass/screen.scss */ .container .content section.directory article.entry { width: 80%; max-width: 600px; @@ -238,7 +246,7 @@ article ul li { position: relative; padding-right: 120px; } -/* line 168, ../sass/screen.scss */ +/* line 175, ../sass/screen.scss */ .container .content section.directory article.entry .entry-image { display: block; position: absolute; @@ -251,25 +259,25 @@ article ul li { transform: translateX(90%); top: -15px; } -/* line 180, ../sass/screen.scss */ +/* line 187, ../sass/screen.scss */ .container .content section.directory article.entry .entry-image img { width: auto; height: auto; max-width: 100%; max-height: 100%; } -/* line 190, ../sass/screen.scss */ +/* line 197, ../sass/screen.scss */ .container .content section.actuhome { display: flex; flex-wrap: wrap; justify-content: space-around; align-items: top; } -/* line 196, ../sass/screen.scss */ +/* line 203, ../sass/screen.scss */ .container .content section.actuhome article + article { margin: 0; } -/* line 200, ../sass/screen.scss */ +/* line 207, ../sass/screen.scss */ .container .content section.actuhome article.actu { position: relative; background: none; @@ -278,7 +286,7 @@ article ul li { min-width: 300px; flex: 1; } -/* line 208, ../sass/screen.scss */ +/* line 215, ../sass/screen.scss */ .container .content section.actuhome article.actu .actu-header { position: relative; box-shadow: -4px 5px 1px rgba(0, 0, 0, 0.3); @@ -289,7 +297,7 @@ article ul li { background-size: cover; background-position: center center; } -/* line 218, ../sass/screen.scss */ +/* line 225, ../sass/screen.scss */ .container .content section.actuhome article.actu .actu-header h2 { position: absolute; width: 100%; @@ -299,11 +307,11 @@ article ul li { text-shadow: 0 0 5px rgba(0, 0, 0, 0.8); background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent); } -/* line 226, ../sass/screen.scss */ +/* line 233, ../sass/screen.scss */ .container .content section.actuhome article.actu .actu-header h2 a { color: #fff; } -/* line 232, ../sass/screen.scss */ +/* line 239, ../sass/screen.scss */ .container .content section.actuhome article.actu .actu-misc { background: white; box-shadow: -2px 2px 1px rgba(0, 0, 0, 0.2); @@ -311,17 +319,17 @@ article ul li { padding: 15px; padding-top: 5px; } -/* line 239, ../sass/screen.scss */ +/* line 246, ../sass/screen.scss */ .container .content section.actuhome article.actu .actu-misc .actu-minical { display: block; } -/* line 242, ../sass/screen.scss */ +/* line 249, ../sass/screen.scss */ .container .content section.actuhome article.actu .actu-misc .actu-dates { display: block; text-align: right; font-size: 0.9em; } -/* line 249, ../sass/screen.scss */ +/* line 256, ../sass/screen.scss */ .container .content section.actuhome article.actu .actu-overlay { display: block; background: none; @@ -333,41 +341,64 @@ article ul li { z-index: 5; opacity: 0; } +/* line 272, ../sass/screen.scss */ +.container .content section.actulist article.actu { + display: flex; + width: 100%; + padding: 0; +} +/* line 277, ../sass/screen.scss */ +.container .content section.actulist article.actu .actu-image { + width: 30%; + max-width: 200px; + background-size: cover; + background-position: center center; +} +/* line 283, ../sass/screen.scss */ +.container .content section.actulist article.actu .actu-infos { + padding: 15px; + flex: 1; +} +/* line 287, ../sass/screen.scss */ +.container .content section.actulist article.actu .actu-infos .actu-dates { + font-weight: bold; + font-size: 0.9em; +} -/* line 268, ../sass/screen.scss */ +/* line 299, ../sass/screen.scss */ .calendar td, .calendar th { text-align: center; vertical-align: center; border: 2px solid transparent; padding: 1px; } -/* line 275, ../sass/screen.scss */ +/* line 306, ../sass/screen.scss */ .calendar th { font-weight: bold; } -/* line 279, ../sass/screen.scss */ +/* line 310, ../sass/screen.scss */ .calendar td { font-size: 0.8em; width: 25px; height: 30px; } -/* line 284, ../sass/screen.scss */ +/* line 315, ../sass/screen.scss */ .calendar td.out { opacity: 0.3; } -/* line 287, ../sass/screen.scss */ +/* line 318, ../sass/screen.scss */ .calendar td.today { border-bottom-color: #000; } -/* line 290, ../sass/screen.scss */ +/* line 321, ../sass/screen.scss */ .calendar td:nth-child(7) { background: rgba(0, 0, 0, 0.3); } -/* line 293, ../sass/screen.scss */ +/* line 324, ../sass/screen.scss */ .calendar td:nth-child(6) { background: rgba(0, 0, 0, 0.2); } -/* line 296, ../sass/screen.scss */ +/* line 327, ../sass/screen.scss */ .calendar td.hasevent { font-weight: bold; color: #3cb3a6; diff --git a/gestioncof/cms/static/cofcms/sass/screen.scss b/gestioncof/cms/static/cofcms/sass/screen.scss index aa278464..7a69cf5b 100644 --- a/gestioncof/cms/static/cofcms/sass/screen.scss +++ b/gestioncof/cms/static/cofcms/sass/screen.scss @@ -95,6 +95,9 @@ article { list-style: outside; } } + &:last-child { + margin-bottom: 30px; + } } .container { @@ -118,6 +121,10 @@ article { padding: 15px; box-shadow: -4px 4px 1px rgba(#000, 0.3); + h2 { + color: #fff; + } + .calendar { margin: 0 auto; display: block; @@ -260,6 +267,30 @@ article { } } + + &.actulist { + article.actu { + display:flex; + width: 100%; + padding: 0; + + .actu-image { + width: 30%; + max-width: 200px; + background-size: cover; + background-position: center center; + } + .actu-infos { + padding: 15px; + flex: 1; + + .actu-dates { + font-weight: bold; + font-size: 0.9em; + } + } + } + } } } } diff --git a/gestioncof/cms/templates/cofcms/cof_actu_index_page.html b/gestioncof/cms/templates/cofcms/cof_actu_index_page.html index bc2ecc2a..affd433d 100644 --- a/gestioncof/cms/templates/cofcms/cof_actu_index_page.html +++ b/gestioncof/cms/templates/cofcms/cof_actu_index_page.html @@ -14,13 +14,16 @@
    {% for actu in page.actus %}
    -

    {{ actu.title }}

    - {% if actu.is_event %} -

    {{ actu.chapo }}

    - {% else %} - {{ actu.body|safe|truncatewords_html:25 }} - {% endif %} - Lire plus > +
    +
    +

    {{ actu.title }}

    + {% if actu.is_event %} +

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

    + {% else %} + {{ actu.body|safe|truncatewords_html:25 }} + {% endif %} + Lire plus > +
    {% endfor %}
    From adf43889e1975d9e33f4580d6f19a9c5968ebbf5 Mon Sep 17 00:00:00 2001 From: Evarin Date: Mon, 23 Oct 2017 11:05:49 +0200 Subject: [PATCH 11/30] Fixtures site cof --- gestioncof/cms/fixtures/wagtail_cof_cms.json | 1 + 1 file changed, 1 insertion(+) create mode 100644 gestioncof/cms/fixtures/wagtail_cof_cms.json diff --git a/gestioncof/cms/fixtures/wagtail_cof_cms.json b/gestioncof/cms/fixtures/wagtail_cof_cms.json new file mode 100644 index 00000000..f0d74dcc --- /dev/null +++ b/gestioncof/cms/fixtures/wagtail_cof_cms.json @@ -0,0 +1 @@ +[{"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
    • L\\u2019organisation du week-end d\\u2019int\\u00e9gration, plus connu sous le nom de Mega
    • L\\u2019organisation du Gala : la Nuit de la rue d\\u2019Ulm, h\\u00e9riti\\u00e8re du Bal de l\\u2019\\u00c9cole
    • L\\u2019organisation de grands rendez-vous avec les autres \\u00e9coles comme les InterENS culturelles
    • L\\u2019\\u00e9dition du BOcal, le journal du COF
    • La coordination et le financement des activit\\u00e9s d\\u2019une quarantaine de clubs
    • La gestion d\\u2019un syst\\u00e8me de petits cours dispens\\u00e9s par les \\u00e9l\\u00e8ves de l\\u2019\\u00e9cole
    • L\\u2019organisation des soir\\u00e9es \\u00e9tudiantes, qui ont souvent lieu dans le bar de l\\u2019\\u00e9cole, la \\u2018K-F\\u00eat\\u2018
    • L\\u2019\\u00e9tablissement de nombreux partenariats culturels avec les grandes salles parisiennes (voir le site du Bureau des Arts), l\\u2019organisation de voyages, \\u2026
    \\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
    • L\\u2019organisation du week-end d\\u2019int\\u00e9gration, plus connu sous le nom de Mega
    • L\\u2019organisation du Gala : la Nuit de la rue d\\u2019Ulm, h\\u00e9riti\\u00e8re du Bal de l\\u2019\\u00c9cole
    • L\\u2019organisation de grands rendez-vous avec les autres \\u00e9coles comme les InterENS culturelles
    • L\\u2019\\u00e9dition du BOcal, le journal du COF
    • La coordination et le financement des activit\\u00e9s d\\u2019une quarantaine de clubs
    • La gestion d\\u2019un syst\\u00e8me de petits cours dispens\\u00e9s par les \\u00e9l\\u00e8ves de l\\u2019\\u00e9cole
    • L\\u2019organisation des soir\\u00e9es \\u00e9tudiantes, qui ont souvent lieu dans le bar de l\\u2019\\u00e9cole, la \\u2018K-F\\u00eat\\u2018
    • L\\u2019\\u00e9tablissement de nombreux partenariats culturels avec les grandes salles parisiennes (voir le site du Bureau des Arts), l\\u2019organisation de voyages, \\u2026
    \\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 From ea495e8f290571bb1922b916c6e2a944b720f1d1 Mon Sep 17 00:00:00 2001 From: Evarin Date: Sat, 20 Jan 2018 19:33:50 +0100 Subject: [PATCH 12/30] Archives beta --- gestioncof/cms/models.py | 16 ++++++++++++++++ .../templates/cofcms/cof_actu_index_page.html | 14 ++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/gestioncof/cms/models.py b/gestioncof/cms/models.py index 71e76bb8..e63acde7 100644 --- a/gestioncof/cms/models.py +++ b/gestioncof/cms/models.py @@ -62,6 +62,22 @@ class COFActuIndexPage(Page, COFActuIndexMixin): verbose_name = "Index des actualités" verbose_name_plural = "Indexs des actualités" + def get_context(self, request): + context = super(COFActuIndexPage, self).get_context(request) + actus = COFActuPage.objects.live().descendant_of(self).order_by('-date') + + page = request.GET.get('page') + paginator = Paginator(actus, 5) + try: + actus = paginator.page(page) + except PageNotAnInteger: + actus = paginator.page(1) + except EmptyPage: + actus = paginator.page(paginator.num_pages) + + context['actus'] = actus + return context + class COFActuPage(Page): body = RichTextField("Contenu") date = models.DateField("Date du post") diff --git a/gestioncof/cms/templates/cofcms/cof_actu_index_page.html b/gestioncof/cms/templates/cofcms/cof_actu_index_page.html index affd433d..975e520d 100644 --- a/gestioncof/cms/templates/cofcms/cof_actu_index_page.html +++ b/gestioncof/cms/templates/cofcms/cof_actu_index_page.html @@ -12,6 +12,13 @@
+ {% if actus.has_previous %} + Actualités plus récentes + {% endif %} + {% if actus.has_next %} + Actualités plus anciennes + {% endif %} + {% for actu in page.actus %}
@@ -26,5 +33,12 @@
{% endfor %} + + {% if actus.has_previous %} + Actualités plus récentes + {% endif %} + {% if actus.has_next %} + Actualités plus anciennes + {% endif %}
{% endblock %} From 8488beeb4ef3fefc274bb10735bd2bc3041f7172 Mon Sep 17 00:00:00 2001 From: Evarin Date: Mon, 22 Jan 2018 21:24:20 +0100 Subject: [PATCH 13/30] =?UTF-8?q?Un=20seul=20mod=C3=A8le=20pour=20les=20ac?= =?UTF-8?q?tus?= 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
  • L\\u2019organisation du week-end d\\u2019int\\u00e9gration, plus connu sous le nom de Mega
  • L\\u2019organisation du Gala : la Nuit de la rue d\\u2019Ulm, h\\u00e9riti\\u00e8re du Bal de l\\u2019\\u00c9cole
  • L\\u2019organisation de grands rendez-vous avec les autres \\u00e9coles comme les InterENS culturelles
  • L\\u2019\\u00e9dition du BOcal, le journal du COF
  • La coordination et le financement des activit\\u00e9s d\\u2019une quarantaine de clubs
  • La gestion d\\u2019un syst\\u00e8me de petits cours dispens\\u00e9s par les \\u00e9l\\u00e8ves de l\\u2019\\u00e9cole
  • L\\u2019organisation des soir\\u00e9es \\u00e9tudiantes, qui ont souvent lieu dans le bar de l\\u2019\\u00e9cole, la \\u2018K-F\\u00eat\\u2018
  • L\\u2019\\u00e9tablissement de nombreux partenariats culturels avec les grandes salles parisiennes (voir le site du Bureau des Arts), l\\u2019organisation de voyages, \\u2026
\\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
  • Adresse email : cof (arobase) ens (point) fr
  • T\\u00e9l\\u00e9phone : 01 44 32 28 80
  • Adresse postale :\\u00a0
    \\nCOF
    \\n45 rue d\\u2019Ulm
    \\n75005 Paris
\"}]", "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
  • L\\u2019organisation du week-end d\\u2019int\\u00e9gration, plus connu sous le nom de Mega
  • L\\u2019organisation du Gala : la Nuit de la rue d\\u2019Ulm, h\\u00e9riti\\u00e8re du Bal de l\\u2019\\u00c9cole
  • L\\u2019organisation de grands rendez-vous avec les autres \\u00e9coles comme les InterENS culturelles
  • L\\u2019\\u00e9dition du BOcal, le journal du COF
  • La coordination et le financement des activit\\u00e9s d\\u2019une quarantaine de clubs
  • La gestion d\\u2019un syst\\u00e8me de petits cours dispens\\u00e9s par les \\u00e9l\\u00e8ves de l\\u2019\\u00e9cole
  • L\\u2019organisation des soir\\u00e9es \\u00e9tudiantes, qui ont souvent lieu dans le bar de l\\u2019\\u00e9cole, la \\u2018K-F\\u00eat\\u2018
  • L\\u2019\\u00e9tablissement de nombreux partenariats culturels avec les grandes salles parisiennes (voir le site du Bureau des Arts), l\\u2019organisation de voyages, \\u2026
\\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
  • Adresse email : cof (arobase) ens (point) fr
  • T\\u00e9l\\u00e9phone : 01 44 32 28 80
  • Adresse postale :\\u00a0
    \\nCOF
    \\n45 rue d\\u2019Ulm
    \\n75005 Paris
\"}]", "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
  • L\\u2019organisation du week-end d\\u2019int\\u00e9gration, plus connu sous le nom de Mega
  • L\\u2019organisation du Gala : la Nuit de la rue d\\u2019Ulm, h\\u00e9riti\\u00e8re du Bal de l\\u2019\\u00c9cole
  • L\\u2019organisation de grands rendez-vous avec les autres \\u00e9coles comme les InterENS culturelles
  • L\\u2019\\u00e9dition du BOcal, le journal du COF
  • La coordination et le financement des activit\\u00e9s d\\u2019une quarantaine de clubs
  • La gestion d\\u2019un syst\\u00e8me de petits cours dispens\\u00e9s par les \\u00e9l\\u00e8ves de l\\u2019\\u00e9cole
  • L\\u2019organisation des soir\\u00e9es \\u00e9tudiantes, qui ont souvent lieu dans le bar de l\\u2019\\u00e9cole, la \\u2018K-F\\u00eat\\u2018
  • L\\u2019\\u00e9tablissement de nombreux partenariats culturels avec les grandes salles parisiennes (voir le site du Bureau des Arts), l\\u2019organisation de voyages, \\u2026
\\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
  • L\\u2019organisation du week-end d\\u2019int\\u00e9gration, plus connu sous le nom de Mega
  • L\\u2019organisation du Gala : la Nuit de la rue d\\u2019Ulm, h\\u00e9riti\\u00e8re du Bal de l\\u2019\\u00c9cole
  • L\\u2019organisation de grands rendez-vous avec les autres \\u00e9coles comme les InterENS culturelles
  • L\\u2019\\u00e9dition du BOcal, le journal du COF
  • La coordination et le financement des activit\\u00e9s d\\u2019une quarantaine de clubs
  • La gestion d\\u2019un syst\\u00e8me de petits cours dispens\\u00e9s par les \\u00e9l\\u00e8ves de l\\u2019\\u00e9cole
  • L\\u2019organisation des soir\\u00e9es \\u00e9tudiantes, qui ont souvent lieu dans le bar de l\\u2019\\u00e9cole, la \\u2018K-F\\u00eat\\u2018
  • L\\u2019\\u00e9tablissement de nombreux partenariats culturels avec les grandes salles parisiennes (voir le site du Bureau des Arts), l\\u2019organisation de voyages, \\u2026
\\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', ) From c11ccf2ecc96d09809b30ee3b21c2740e0aaaa96 Mon Sep 17 00:00:00 2001 From: Evarin Date: Sun, 28 Jan 2018 19:09:35 +0100 Subject: [PATCH 14/30] Tri des annuaires --- .../cms/migrations/0002_auto_20180128_1717.py | 25 +++++++++++++++++++ gestioncof/cms/models.py | 12 ++++++--- 2 files changed, 33 insertions(+), 4 deletions(-) create mode 100644 gestioncof/cms/migrations/0002_auto_20180128_1717.py diff --git a/gestioncof/cms/migrations/0002_auto_20180128_1717.py b/gestioncof/cms/migrations/0002_auto_20180128_1717.py new file mode 100644 index 00000000..9b32ab15 --- /dev/null +++ b/gestioncof/cms/migrations/0002_auto_20180128_1717.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.9 on 2018-01-28 16:17 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('cofcms', '0001_initial'), + ] + + operations = [ + migrations.AddField( + model_name='cofdirectoryentrypage', + name='sort_order', + field=models.IntegerField(blank=True, editable=False, null=True), + ), + migrations.AddField( + model_name='cofdirectorypage', + name='alphabetique', + field=models.BooleanField(default=True, verbose_name='Tri par ordre alphabétique ?'), + ), + ] diff --git a/gestioncof/cms/models.py b/gestioncof/cms/models.py index 508c9743..da6f6a8b 100644 --- a/gestioncof/cms/models.py +++ b/gestioncof/cms/models.py @@ -154,9 +154,12 @@ class COFActuPage(Page): # Annuaires (Clubs, partenaires, bonnes adresses) class COFDirectoryPage(Page): introduction = RichTextField("Introduction") - + alphabetique = models.BooleanField("Tri par ordre alphabétique ?", + default=True, blank=True) + content_panels = Page.content_panels + [ FieldPanel('introduction'), + FieldPanel('alphabetique'), ] subpage_types = ['COFActuPage', 'COFDirectoryEntryPage'] @@ -165,8 +168,9 @@ class COFDirectoryPage(Page): @property def entries(self): entries = COFDirectoryEntryPage.objects.live()\ - .descendant_of(self)\ - .order_by("title") + .descendant_of(self) + if self.alphabetique: + entries = entries.order_by("title") return entries class Meta: @@ -174,7 +178,7 @@ class COFDirectoryPage(Page): verbose_name_plural = "Annuaires" -class COFDirectoryEntryPage(Page): +class COFDirectoryEntryPage(Page, Orderable): body = RichTextField("Description") links = StreamField([ ('lien', blocks.StructBlock([ From f8952225d69e70aa348c175b99453687ff10bcc7 Mon Sep 17 00:00:00 2001 From: Evarin Date: Sun, 28 Jan 2018 19:09:56 +0100 Subject: [PATCH 15/30] Apparence et Responsiveness --- gestioncof/cms/static/cofcms/css/screen.css | 297 ++++++++++++++---- .../cms/static/cofcms/images/minimenu.svg | 11 + .../cms/static/cofcms/sass/_colors.scss | 16 +- .../cms/static/cofcms/sass/_responsive.scss | 124 ++++++++ gestioncof/cms/static/cofcms/sass/screen.scss | 84 +++-- gestioncof/cms/templates/cofcms/base.html | 3 +- .../cms/templates/cofcms/base_aside.html | 7 +- .../templates/cofcms/cof_actu_index_page.html | 1 + .../cms/templates/cofcms/cof_actu_page.html | 2 +- .../templates/cofcms/cof_directory_page.html | 2 +- gestioncof/cms/templates/cofcms/cof_page.html | 4 +- .../cms/templates/cofcms/cof_root_page.html | 1 + 12 files changed, 453 insertions(+), 99 deletions(-) create mode 100644 gestioncof/cms/static/cofcms/images/minimenu.svg create mode 100644 gestioncof/cms/static/cofcms/sass/_responsive.scss diff --git a/gestioncof/cms/static/cofcms/css/screen.css b/gestioncof/cms/static/cofcms/css/screen.css index 965206c3..0f82ce97 100644 --- a/gestioncof/cms/static/cofcms/css/screen.css +++ b/gestioncof/cms/static/cofcms/css/screen.css @@ -75,19 +75,19 @@ article, aside, details, figcaption, figure, footer, header, hgroup, main, menu, /* line 16, ../sass/screen.scss */ body { - background: #f5ffd2; + background: #fefefe; font: 17px "Source Sans Pro", "sans-serif"; } /* line 21, ../sass/screen.scss */ header { - background: #400530; + background: #5B0012; } /* line 25, ../sass/screen.scss */ h1, h2 { - font-family: "Carter One"; - color: #2c3900; + font-family: "Carter One", "serif"; + color: #90001C; } /* line 30, ../sass/screen.scss */ @@ -102,7 +102,7 @@ h2 { /* line 38, ../sass/screen.scss */ a { - color: #3cb3a6; + color: #CC9500; text-decoration: none; font-weight: bold; } @@ -115,7 +115,7 @@ h2 a { /* line 50, ../sass/screen.scss */ header a { - color: #f5ffd2; + color: #fefefe; } /* line 53, ../sass/screen.scss */ header section { @@ -128,7 +128,7 @@ header section { header section.bottom-menu { justify-content: space-around; text-align: center; - background: #5a004f; + background: #90001C; } /* line 65, ../sass/screen.scss */ header h1 { @@ -150,7 +150,7 @@ header nav ul li > * { } /* line 78, ../sass/screen.scss */ header nav ul li > *:hover { - background: #11010d; + background: #280008; } /* line 87, ../sass/screen.scss */ @@ -185,151 +185,184 @@ article:last-child { position: absolute; top: 30px; height: 100%; - width: 250px; + width: 25%; + left: 6px; } -/* line 114, ../sass/screen.scss */ +/* line 115, ../sass/screen.scss */ .container .aside-wrap .aside { - color: #fff; + color: #222; position: fixed; position: sticky; top: 5px; width: 100%; - background: #5a004f; + background: #FFC500; padding: 15px; - box-shadow: -4px 4px 1px rgba(0, 0, 0, 0.3); + box-shadow: -4px 4px 1px rgba(153, 118, 0, 0.3); } -/* line 124, ../sass/screen.scss */ +/* line 125, ../sass/screen.scss */ .container .aside-wrap .aside h2 { color: #fff; } -/* line 128, ../sass/screen.scss */ +/* line 129, ../sass/screen.scss */ .container .aside-wrap .aside .calendar { margin: 0 auto; display: block; } -/* line 135, ../sass/screen.scss */ -.container .content { - max-width: 700px; - margin-left: auto; - margin-right: 0; +/* line 134, ../sass/screen.scss */ +.container .aside-wrap .aside a { + color: #997000; } /* line 140, ../sass/screen.scss */ +.container .content { + max-width: 900px; + margin-left: auto; + margin-right: 6px; +} +/* line 145, ../sass/screen.scss */ .container .content .intro { - border-bottom: 3px solid #a3d200; - margin: 20px -10px; + border-bottom: 3px solid #7f7f7f; + margin: 20px 0; margin-top: 5px; padding: 15px 5px; } -/* line 150, ../sass/screen.scss */ +/* line 154, ../sass/screen.scss */ .container .content section article { background: #fff; - padding: 30px; - box-shadow: -4px 4px 1px rgba(0, 0, 0, 0.3); + padding: 20px 30px; + box-shadow: -4px 4px 1px rgba(153, 118, 0, 0.3); + border: 1px solid rgba(153, 118, 0, 0.1); + border-radius: 2px; } -/* line 154, ../sass/screen.scss */ +/* line 160, ../sass/screen.scss */ .container .content section article a { - color: #3cb3a6; + color: #CC9500; } -/* line 159, ../sass/screen.scss */ +/* line 165, ../sass/screen.scss */ .container .content section article + h2 { margin-top: 15px; } -/* line 163, ../sass/screen.scss */ +/* line 169, ../sass/screen.scss */ .container .content section article + article { margin-top: 25px; } -/* line 168, ../sass/screen.scss */ +/* line 173, ../sass/screen.scss */ +.container .content section .image { + margin: 15px 0; + text-align: center; + padding: 20px; +} +/* line 178, ../sass/screen.scss */ +.container .content section .image img { + max-width: 100%; + height: auto; + box-shadow: -7px 7px 1px rgba(153, 118, 0, 0.2); +} +/* line 186, ../sass/screen.scss */ .container .content section.directory article.entry { width: 80%; max-width: 600px; max-height: 100%; position: relative; - padding-right: 120px; + margin-left: 6%; } -/* line 175, ../sass/screen.scss */ +/* line 193, ../sass/screen.scss */ .container .content section.directory article.entry .entry-image { display: block; - position: absolute; + float: right; width: 150px; background: #fff; - box-shadow: -4px 4px 1px rgba(0, 0, 0, 0.2); + box-shadow: -4px 4px 1px rgba(153, 118, 0, 0.2); + border-right: 1px solid rgba(153, 118, 0, 0.2); + border-top: 1px solid rgba(153, 118, 0, 0.2); padding: 1px; overflow: hidden; - right: 100px; - transform: translateX(90%); - top: -15px; + margin-left: 10px; + margin-bottom: 10px; + transform: translateX(10px); } -/* line 187, ../sass/screen.scss */ +/* line 207, ../sass/screen.scss */ .container .content section.directory article.entry .entry-image img { width: auto; height: auto; max-width: 100%; max-height: 100%; } -/* line 197, ../sass/screen.scss */ +/* line 215, ../sass/screen.scss */ +.container .content section.directory article.entry ul.links { + margin-top: 10px; + border-top: 1px solid #90001C; + padding-top: 10px; +} +/* line 223, ../sass/screen.scss */ .container .content section.actuhome { display: flex; flex-wrap: wrap; justify-content: space-around; align-items: top; } -/* line 203, ../sass/screen.scss */ +/* line 229, ../sass/screen.scss */ .container .content section.actuhome article + article { margin: 0; } -/* line 207, ../sass/screen.scss */ +/* line 233, ../sass/screen.scss */ .container .content section.actuhome article.actu { position: relative; background: none; box-shadow: none; + border: none; max-width: 400px; min-width: 300px; flex: 1; } -/* line 215, ../sass/screen.scss */ +/* line 242, ../sass/screen.scss */ .container .content section.actuhome article.actu .actu-header { position: relative; - box-shadow: -4px 5px 1px rgba(0, 0, 0, 0.3); + box-shadow: -4px 5px 1px rgba(153, 118, 0, 0.3); + border-right: 1px solid rgba(153, 118, 0, 0.2); + border-top: 1px solid rgba(153, 118, 0, 0.2); min-height: 180px; padding: 0; margin: 0; overflow: hidden; background-size: cover; background-position: center center; + background-repeat: no-repeat; } -/* line 225, ../sass/screen.scss */ +/* line 255, ../sass/screen.scss */ .container .content section.actuhome article.actu .actu-header h2 { position: absolute; width: 100%; bottom: 0; left: 0; padding: 5px; - text-shadow: 0 0 5px rgba(0, 0, 0, 0.8); + text-shadow: 0 0 5px rgba(153, 118, 0, 0.8); background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent); } -/* line 233, ../sass/screen.scss */ +/* line 263, ../sass/screen.scss */ .container .content section.actuhome article.actu .actu-header h2 a { color: #fff; } -/* line 239, ../sass/screen.scss */ +/* line 269, ../sass/screen.scss */ .container .content section.actuhome article.actu .actu-misc { background: white; - box-shadow: -2px 2px 1px rgba(0, 0, 0, 0.2); + box-shadow: -2px 2px 1px rgba(153, 118, 0, 0.2); + border: 1px solid rgba(153, 118, 0, 0.2); + border-radius: 2px; margin: 0 10px; padding: 15px; padding-top: 5px; } -/* line 246, ../sass/screen.scss */ +/* line 278, ../sass/screen.scss */ .container .content section.actuhome article.actu .actu-misc .actu-minical { display: block; } -/* line 249, ../sass/screen.scss */ +/* line 281, ../sass/screen.scss */ .container .content section.actuhome article.actu .actu-misc .actu-dates { display: block; text-align: right; font-size: 0.9em; } -/* line 256, ../sass/screen.scss */ +/* line 288, ../sass/screen.scss */ .container .content section.actuhome article.actu .actu-overlay { display: block; background: none; @@ -341,66 +374,202 @@ article:last-child { z-index: 5; opacity: 0; } -/* line 272, ../sass/screen.scss */ +/* line 304, ../sass/screen.scss */ .container .content section.actulist article.actu { display: flex; width: 100%; padding: 0; } -/* line 277, ../sass/screen.scss */ +/* line 309, ../sass/screen.scss */ .container .content section.actulist article.actu .actu-image { width: 30%; max-width: 200px; background-size: cover; background-position: center center; } -/* line 283, ../sass/screen.scss */ +/* line 315, ../sass/screen.scss */ .container .content section.actulist article.actu .actu-infos { padding: 15px; flex: 1; } -/* line 287, ../sass/screen.scss */ +/* line 319, ../sass/screen.scss */ .container .content section.actulist article.actu .actu-infos .actu-dates { font-weight: bold; font-size: 0.9em; } +/* line 329, ../sass/screen.scss */ +.container .aside-wrap + .content { + max-width: 70%; +} -/* line 299, ../sass/screen.scss */ +/* line 335, ../sass/screen.scss */ .calendar td, .calendar th { text-align: center; vertical-align: center; border: 2px solid transparent; padding: 1px; } -/* line 306, ../sass/screen.scss */ +/* line 342, ../sass/screen.scss */ .calendar th { font-weight: bold; } -/* line 310, ../sass/screen.scss */ +/* line 346, ../sass/screen.scss */ .calendar td { font-size: 0.8em; width: 25px; height: 30px; } -/* line 315, ../sass/screen.scss */ +/* line 351, ../sass/screen.scss */ .calendar td.out { opacity: 0.3; } -/* line 318, ../sass/screen.scss */ +/* line 354, ../sass/screen.scss */ .calendar td.today { border-bottom-color: #000; } -/* line 321, ../sass/screen.scss */ +/* line 357, ../sass/screen.scss */ .calendar td:nth-child(7) { background: rgba(0, 0, 0, 0.3); } -/* line 324, ../sass/screen.scss */ +/* line 360, ../sass/screen.scss */ .calendar td:nth-child(6) { background: rgba(0, 0, 0, 0.2); } -/* line 327, ../sass/screen.scss */ +/* line 363, ../sass/screen.scss */ .calendar td.hasevent { font-weight: bold; - color: #3cb3a6; + color: #997000; font-size: 1em; } + +/* line 1, ../sass/_responsive.scss */ +header .minimenu { + display: none; +} + +@media only screen and (max-width: 600px) { + /* line 6, ../sass/_responsive.scss */ + header { + position: fixed; + top: 0; + left: 0; + z-index: 10; + width: 100%; + max-height: 100vh; + height: 60px; + overflow: hidden; + } + /* line 16, ../sass/_responsive.scss */ + header .minimenu { + display: block; + position: absolute; + right: 3px; + top: 3px; + } + /* line 23, ../sass/_responsive.scss */ + header section { + display: block; + } + /* line 25, ../sass/_responsive.scss */ + header section nav { + display: none; + } + + /* line 31, ../sass/_responsive.scss */ + header.expanded { + overflow: auto; + height: auto; + } + /* line 35, ../sass/_responsive.scss */ + header.expanded nav { + display: block; + text-align: center; + } + /* line 38, ../sass/_responsive.scss */ + header.expanded nav ul { + flex-wrap: wrap; + justify-content: right; + } + /* line 41, ../sass/_responsive.scss */ + header.expanded nav ul li > * { + padding: 18px; + } + + /* line 48, ../sass/_responsive.scss */ + .container { + margin-top: 65px; + } + /* line 51, ../sass/_responsive.scss */ + .container .content { + max-width: unset; + margin: 6px; + } + /* line 56, ../sass/_responsive.scss */ + .container .content section article { + padding: 10px; + } + /* line 60, ../sass/_responsive.scss */ + .container .content section .image { + padding: 0; + margin: 10px -6px; + } + /* line 65, ../sass/_responsive.scss */ + .container .content section.directory article.entry { + width: 100%; + margin-left: 0; + } + /* line 72, ../sass/_responsive.scss */ + .container .aside-wrap + .content { + max-width: unset; + margin-top: 120px; + } + /* line 77, ../sass/_responsive.scss */ + .container .aside-wrap { + z-index: 3; + top: 60px; + position: fixed; + width: 100%; + margin: 0; + height: auto; + left: 0; + } + /* line 86, ../sass/_responsive.scss */ + .container .aside-wrap .aside { + margin: 0; + padding: 0; + top: 0; + position: absolute; + } + /* line 92, ../sass/_responsive.scss */ + .container .aside-wrap .aside > h2 { + position: relative; + cursor: pointer; + padding: 5px 10px; + } + /* line 96, ../sass/_responsive.scss */ + .container .aside-wrap .aside > h2:after { + content: "v"; + font-family: "Source Sans Pro", "sans-serif"; + font-weight: bold; + color: #CC9500; + position: absolute; + right: 10px; + } + /* line 106, ../sass/_responsive.scss */ + .container .aside-wrap .aside:not(.expanded) .aside-content { + display: none; + } + /* line 111, ../sass/_responsive.scss */ + .container .aside-wrap .aside ul { + text-align: center; + } + /* line 113, ../sass/_responsive.scss */ + .container .aside-wrap .aside ul li { + display: inline-block; + } + /* line 115, ../sass/_responsive.scss */ + .container .aside-wrap .aside ul li > * { + display: block; + padding: 15px; + } +} diff --git a/gestioncof/cms/static/cofcms/images/minimenu.svg b/gestioncof/cms/static/cofcms/images/minimenu.svg new file mode 100644 index 00000000..46a31695 --- /dev/null +++ b/gestioncof/cms/static/cofcms/images/minimenu.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/gestioncof/cms/static/cofcms/sass/_colors.scss b/gestioncof/cms/static/cofcms/sass/_colors.scss index bd93019b..2d295b98 100644 --- a/gestioncof/cms/static/cofcms/sass/_colors.scss +++ b/gestioncof/cms/static/cofcms/sass/_colors.scss @@ -1,7 +1,11 @@ -$fond: #f5ffd2; -$bandeau: #400530; -$sousbandeau: #5a004f; -$aside: $sousbandeau; -$titre: darken($fond, 80%); -$lien: #3cb3a6; +$fond: #fefefe; +$bandeau: #5B0012; +$sousbandeau: #90001C; +$aside: #FFC500; +$titre: $sousbandeau; +$lien: #CC9500; $headerlien: $fond; +$ombres: darken($aside, 20%); + +$bodyfont: "Source Sans Pro", "sans-serif"; +$headfont: "Carter One", "serif"; diff --git a/gestioncof/cms/static/cofcms/sass/_responsive.scss b/gestioncof/cms/static/cofcms/sass/_responsive.scss new file mode 100644 index 00000000..26e835fd --- /dev/null +++ b/gestioncof/cms/static/cofcms/sass/_responsive.scss @@ -0,0 +1,124 @@ +header .minimenu { + display: none; +} + +@media only screen and (max-width: 600px) { + header { + position: fixed; + top: 0; + left: 0; + z-index: 10; + width: 100%; + max-height: 100vh; + height: 60px; + overflow: hidden; + + .minimenu { + display: block; + position: absolute; + right: 3px; + top: 3px; + } + + section { + display: block; + nav { + display: none; + } + } + } + + header.expanded { + overflow: auto; + height: auto; + + nav { + display: block; + text-align: center; + ul { + flex-wrap: wrap; + justify-content: right; + li > * { + padding: 18px; + } + } + } + } + + .container { + margin-top: 65px; + + .content { + max-width: unset; + margin: 6px; + + section { + article { + padding: 10px; + } + + .image { + padding: 0; + margin: 10px -6px; + } + + &.directory article.entry { + width: 100%; + margin-left: 0; + } + } + } + + .aside-wrap + .content { + max-width: unset; + margin-top: 120px; + } + + .aside-wrap { + z-index: 3; + top: 60px; + position: fixed; + width: 100%; + margin: 0; + height: auto; + left: 0; + + .aside { + margin: 0; + padding: 0; + top: 0; + position: absolute; + + & > h2 { + position: relative; + cursor: pointer; + padding: 5px 10px; + &:after { + content: "v"; + font-family: $bodyfont; + font-weight: bold; + color: $lien; + position: absolute; + right: 10px; + } + } + &:not(.expanded) { + .aside-content { + display: none; + } + } + + ul { + text-align: center; + li { + display: inline-block; + & > * { + display: block; + padding: 15px; + } + } + } + } + } + } +} diff --git a/gestioncof/cms/static/cofcms/sass/screen.scss b/gestioncof/cms/static/cofcms/sass/screen.scss index 7a69cf5b..a389822b 100644 --- a/gestioncof/cms/static/cofcms/sass/screen.scss +++ b/gestioncof/cms/static/cofcms/sass/screen.scss @@ -15,7 +15,7 @@ body { background: $fond; - font: 17px "Source Sans Pro", "sans-serif"; + font: 17px $bodyfont; } header { @@ -23,7 +23,7 @@ header { } h1, h2 { - font-family: "Carter One"; + font-family: $headfont; color: $titre; } @@ -109,17 +109,18 @@ article { position: absolute; top: 30px; height: 100%; - width: 250px; + width: 25%; + left: 6px; .aside { - color: #fff; + color: #222; position: fixed; position: sticky; top: 5px; width: 100%; background: $aside; padding: 15px; - box-shadow: -4px 4px 1px rgba(#000, 0.3); + box-shadow: -4px 4px 1px rgba($ombres, 0.3); h2 { color: #fff; @@ -129,28 +130,33 @@ article { margin: 0 auto; display: block; } + + a { + color: darken($lien, 10%); + } } } - + .content { - max-width: 700px; + max-width: 900px; margin-left: auto; - margin-right: 0; + margin-right: 6px; .intro { border-bottom: 3px solid darken($fond, 50%); - margin: 20px -10px; + margin: 20px 0; margin-top: 5px; padding: 15px 5px; - } section { article { background: #fff; - padding: 30px; - box-shadow: -4px 4px 1px rgba(#000, 0.3); + padding: 20px 30px;; + box-shadow: -4px 4px 1px rgba($ombres, 0.3); + border: 1px solid rgba($ombres, 0.1); + border-radius: 2px; a { color: $lien; } @@ -164,25 +170,39 @@ article { margin-top: 25px; } + .image { + margin: 15px 0; + text-align: center; + padding: 20px; + + img { + max-width: 100%; + height: auto; + box-shadow: -7px 7px 1px rgba($ombres, 0.2); + } + } + &.directory { article.entry { width: 80%; max-width: 600px; max-height: 100%; position: relative; - padding-right: 120px; - + margin-left: 6%; + .entry-image { display: block; - position: absolute; + float: right; width: 150px; background: #fff; - box-shadow: -4px 4px 1px rgba(#000, 0.2); + box-shadow: -4px 4px 1px rgba($ombres, 0.2); + border-right: 1px solid rgba($ombres, 0.2); + border-top: 1px solid rgba($ombres, 0.2); padding: 1px; overflow: hidden; - right: 100px; - transform: translateX(90%); - top: -15px; + margin-left: 10px; + margin-bottom: 10px; + transform: translateX(10px); img { width: auto; @@ -191,6 +211,12 @@ article { max-height: 100%; } } + + ul.links { + margin-top: 10px; + border-top: 1px solid $sousbandeau; + padding-top: 10px; + } } } @@ -208,19 +234,23 @@ article { position: relative; background: none; box-shadow: none; + border: none; max-width: 400px; min-width: 300px; flex: 1; .actu-header { position: relative; - box-shadow: -4px 5px 1px rgba(#000, 0.3); + box-shadow: -4px 5px 1px rgba($ombres, 0.3); + border-right: 1px solid rgba($ombres, 0.2); + border-top: 1px solid rgba($ombres, 0.2); min-height: 180px; padding: 0; margin: 0; overflow: hidden; background-size: cover; background-position: center center; + background-repeat: no-repeat; h2 { position: absolute; @@ -228,7 +258,7 @@ article { bottom: 0; left: 0; padding: 5px; - text-shadow: 0 0 5px rgba(#000, 0.8); + text-shadow: 0 0 5px rgba($ombres, 0.8); background: linear-gradient(to top, rgba(#000, 0.7), rgba(#000, 0)); a { color: #fff; @@ -238,7 +268,9 @@ article { .actu-misc { background: lighten($fond, 15%); - box-shadow: -2px 2px 1px rgba(#000, 0.2); + box-shadow: -2px 2px 1px rgba($ombres, 0.2); + border: 1px solid rgba($ombres, 0.2); + border-radius: 2px; margin: 0 10px; padding: 15px; padding-top: 5px; @@ -293,6 +325,10 @@ article { } } } + + .aside-wrap + .content { + max-width: 70%; + } } .calendar { @@ -326,8 +362,10 @@ article { } &.hasevent { font-weight: bold; - color: $lien; + color: darken($lien, 10%); font-size: 1em; } } } + +@import "_responsive"; diff --git a/gestioncof/cms/templates/cofcms/base.html b/gestioncof/cms/templates/cofcms/base.html index 05119dbd..056e37ec 100644 --- a/gestioncof/cms/templates/cofcms/base.html +++ b/gestioncof/cms/templates/cofcms/base.html @@ -10,9 +10,10 @@ -
+