Début nouveau site cof
This commit is contained in:
parent
878c617cc7
commit
65d7a66eb8
11 changed files with 78 additions and 0 deletions
|
@ -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
|
||||
|
||||
|
|
0
gestioncof/cms/__init__.py
Normal file
0
gestioncof/cms/__init__.py
Normal file
3
gestioncof/cms/admin.py
Normal file
3
gestioncof/cms/admin.py
Normal file
|
@ -0,0 +1,3 @@
|
|||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
38
gestioncof/cms/migrations/0001_initial.py
Normal file
38
gestioncof/cms/migrations/0001_initial.py
Normal file
|
@ -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',),
|
||||
),
|
||||
]
|
0
gestioncof/cms/migrations/__init__.py
Normal file
0
gestioncof/cms/migrations/__init__.py
Normal file
11
gestioncof/cms/models.py
Normal file
11
gestioncof/cms/models.py
Normal file
|
@ -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()
|
3
gestioncof/cms/tests.py
Normal file
3
gestioncof/cms/tests.py
Normal file
|
@ -0,0 +1,3 @@
|
|||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
11
gestioncof/cms/translation.py
Normal file
11
gestioncof/cms/translation.py
Normal file
|
@ -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',
|
||||
)
|
||||
|
0
gestioncof/cms/urls.py
Normal file
0
gestioncof/cms/urls.py
Normal file
3
gestioncof/cms/views.py
Normal file
3
gestioncof/cms/views.py
Normal file
|
@ -0,0 +1,3 @@
|
|||
from django.shortcuts import render
|
||||
|
||||
# Create your views here.
|
|
@ -25,3 +25,4 @@ channels==1.1.5
|
|||
python-dateutil
|
||||
wagtail==1.10.*
|
||||
wagtailmenus==2.2.*
|
||||
wagtail-modeltranslation==0.6.0rc2
|
||||
|
|
Loading…
Reference in a new issue