Si vous constatez la perte de tickets, de commentaires ou de projets, veuillez consulter la page https://status.framasoft.org/incident/626.

...
 
Commits (5)
Wagtail Person
==============
Add a person and a persons index pages to Wagtail as well as a person
block for StreamFields. This app provide a basic CSS and templates, feel
free to customize it.
On a CMS, we regularly need to represent an author, a speaker, a
person. To avoid repetition and duplication of datas about this, this
app add a person model to Wagtail, with admin UI. Do not hesitate to
use it on your blog or lectures appilaciton.
This model is accompanied by a Person page model and a Persons index
page model. Each Person page is linked to a Person model to see it on
your website.
This app also provide a basic CSS and templates, feel free to
customize it.
Important
---------
Since version 0.9.8, the Person Page model has been split in 2 models:
- A Person model
- A Person page model, with a many2one to a Person model
Install
......@@ -22,6 +38,8 @@ INSTALLED_APPS = [
# …
'wagtailperson',
# …
'wagtail.contrib.modeladmin',
# …
]
```
......@@ -35,26 +53,33 @@ Then, finally, apply migration scripts:
Use
---
This application provide 2 pages models:
This application add a new entry to the administration menu, called
"Author or Person". From this menu, you can add a new author or
person.
If you want to link one of your wagtail page models, or django models,
to a person: Simply add a many2one field linked to
`wagtailperson.models.Person`.
This application also provide 2 pages models:
- A person page: Represent someone, can be used mostly everywhere in
the pages tree
- A person index page: A root page for persons pages, it list each of
person it had as children pages and can only have person pages as
children
- A Person page: Show puplicly someone, can be used mostly
everywhere in the pages tree
- A Persons index page: A root page for Persons pages, it list each
of Persons pages it had as children pages and can only have Person
pages as children
The person index page can be useful to group persons, globally or per
group.
A person page got multiple fields:
- Name
A person got multiple fields:
- Picture
- Titles
- Name
- Tags
- Introduction
- Abstract
- Extra informations
This application also provide a person block for StreamField at
This application also provide a person block for StreamField, at
`wagtailperson.blocks.PersonBlock`. Feel free to use it on your models
StreamField.
......
......@@ -39,6 +39,7 @@ INSTALLED_APPS = [
'wagtail.search',
'wagtail.admin',
'wagtail.core',
'wagtail.contrib.modeladmin',
'modelcluster',
'taggit',
......
# Generated by Django 2.2.4 on 2020-02-25 15:46
import django.core.validators
from django.db import migrations
import wagtail.core.blocks
import wagtail.core.fields
class Migration(migrations.Migration):
dependencies = [
('home', '0003_homepage_body'),
]
operations = [
migrations.AlterField(
model_name='homepage',
name='body',
field=wagtail.core.fields.StreamField([('heading', wagtail.core.blocks.StructBlock([('header_level', wagtail.core.blocks.ChoiceBlock(choices=[('h1', 'H1'), ('h2', 'H2'), ('h3', 'H3'), ('h4', 'H4'), ('h5', 'H5'), ('h6', 'H6')], label='Header level')), ('text', wagtail.core.blocks.CharBlock(label='Text'))])), ('link', wagtail.core.blocks.StructBlock([('description', wagtail.core.blocks.CharBlock(label='Description')), ('url', wagtail.core.blocks.URLBlock(label='URL', validators=[django.core.validators.URLValidator(['http', 'https', 'ftp', 'ftps', 'mailto', 'xmpp', 'tel'])]))])), ('person', wagtail.core.blocks.StructBlock([('person_page', wagtail.core.blocks.PageChooserBlock(label='Person or author page', page_type=['wagtailperson.PersonPage']))])), ('paragraph', wagtail.core.blocks.RichTextBlock())], blank=True),
),
]
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-08-21 23:41+0200\n"
"POT-Creation-Date: 2020-02-26 21:54+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......@@ -20,7 +20,7 @@ msgstr ""
#: apps.py:7
msgid "Wagtail Person"
msgstr "Wagtail Persone"
msgstr "Wagtail Personne"
#: blocks.py:24
msgid "Header level"
......@@ -28,100 +28,90 @@ msgstr "Niveau d'en-tête"
#: blocks.py:27
msgid "Text"
msgstr "Text"
msgstr "Texte"
#: blocks.py:33
msgid "Header"
msgstr "Header"
msgstr "En-tête"
#: blocks.py:39
msgid "Description"
msgstr "Description"
#: blocks.py:42
#: blocks.py:42 models.py:52
msgid "URL"
msgstr "URL"
#: blocks.py:61
msgid "Link"
msgstr "Link"
msgstr "Lien"
#: blocks.py:67
msgid "Person page"
#: blocks.py:67 models.py:131
#, fuzzy
#| msgid "Person page"
msgid "Person or author page"
msgstr "Page de personne"
#: blocks.py:74 models.py:83
#: blocks.py:74 models.py:44 models.py:121
msgid "Person"
msgstr "Persone"
msgstr "Personne"
#: models.py:48
msgid "Label"
msgstr "Label"
#: models.py:35
#: models.py:62
msgid "Person's extrernal link"
msgstr "Lien externe d'une personne"
#: models.py:63
msgid "Person's extrernal links"
msgstr "Liens externes d'une personne"
#: models.py:77
msgid "Picture"
msgstr "Photo"
#: models.py:38
#: models.py:80
msgid "Name"
msgstr "Nom"
#: models.py:42
msgid "Custom titles"
msgstr "Titres personnalisés"
#: models.py:45
msgid "Some custom titles, separated by commas"
msgstr "Quelques titres personnalisés, séparés par des virgules"
#: models.py:48
#: models.py:85
msgid "Introduction"
msgstr "Introduction"
#: models.py:51
#: models.py:88
msgid "Shown on the short descriptions"
msgstr "Montré sur les descriptions courtes"
#: models.py:55
#: models.py:92
msgid "Abstract"
msgstr "Résumé"
#: models.py:68
msgid "Extra informations"
msgstr "Informations supplémentaires"
#: models.py:75
msgid "Titles"
msgstr "Titres"
#: models.py:84
msgid "Persons"
msgstr "Personnes"
#: models.py:108
msgid "Title"
msgstr "Title"
#: models.py:113
msgid "Person title"
msgstr "Titre de la personne"
#: models.py:101
msgid "link"
msgstr "lien"
#: models.py:114
msgid "Person titles"
msgstr "Titres de personne"
#: models.py:105
msgid "Person or author"
msgstr "Personne ou auteur"
#: models.py:138
msgid "Person Title Page"
msgstr "Page de titre de personne"
#: models.py:106 wagtail_hooks.py:15
msgid "Persons or authors"
msgstr "Personnes ou auteurs"
#: models.py:139
msgid "Person Title Pages"
msgstr "Pages de titre de personne"
#: models.py:132
msgid "Person or author pages"
msgstr "Pages de personne ou auteur"
#: models.py:149
#: models.py:143
msgid "Intro"
msgstr "Intro"
#: models.py:159
msgid "Person Index Page"
msgstr "Page d'index des personnes"
#: models.py:153
msgid "Persons or authors Index Page"
msgstr "Page d'index des personnes ou auteurs"
#: models.py:160
msgid "Person Index Pages"
msgstr "Pages d'index des personnes"
#: models.py:154
msgid "Persons or authors Index Pages"
msgstr "Pages d'index des personnes ou auteurs"
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-08-21 23:41+0200\n"
"POT-Creation-Date: 2020-02-26 21:54+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......@@ -20,7 +20,7 @@ msgstr ""
#: apps.py:7
msgid "Wagtail Person"
msgstr "Wagtail Persone"
msgstr "Wagtail Personne"
#: blocks.py:24
msgid "Header level"
......@@ -28,100 +28,90 @@ msgstr "Niveau d'en-tête"
#: blocks.py:27
msgid "Text"
msgstr "Text"
msgstr "Texte"
#: blocks.py:33
msgid "Header"
msgstr "Header"
msgstr "En-tête"
#: blocks.py:39
msgid "Description"
msgstr "Description"
#: blocks.py:42
#: blocks.py:42 models.py:52
msgid "URL"
msgstr "URL"
#: blocks.py:61
msgid "Link"
msgstr "Link"
msgstr "Lien"
#: blocks.py:67
msgid "Person page"
#: blocks.py:67 models.py:131
#, fuzzy
#| msgid "Person page"
msgid "Person or author page"
msgstr "Page de personne"
#: blocks.py:74 models.py:83
#: blocks.py:74 models.py:44 models.py:121
msgid "Person"
msgstr "Persone"
msgstr "Personne"
#: models.py:48
msgid "Label"
msgstr "Label"
#: models.py:35
#: models.py:62
msgid "Person's extrernal link"
msgstr "Lien externe d'une personne"
#: models.py:63
msgid "Person's extrernal links"
msgstr "Liens externes d'une personne"
#: models.py:77
msgid "Picture"
msgstr "Photo"
#: models.py:38
#: models.py:80
msgid "Name"
msgstr "Nom"
#: models.py:42
msgid "Custom titles"
msgstr "Titres personnalisés"
#: models.py:45
msgid "Some custom titles, separated by commas"
msgstr "Quelques titres personnalisés, séparés par des virgules"
#: models.py:48
#: models.py:85
msgid "Introduction"
msgstr "Introduction"
#: models.py:51
#: models.py:88
msgid "Shown on the short descriptions"
msgstr "Montré sur les descriptions courtes"
#: models.py:55
#: models.py:92
msgid "Abstract"
msgstr "Résumé"
#: models.py:68
msgid "Extra informations"
msgstr "Informations supplémentaires"
#: models.py:75
msgid "Titles"
msgstr "Titres"
#: models.py:84
msgid "Persons"
msgstr "Personnes"
#: models.py:108
msgid "Title"
msgstr "Title"
#: models.py:113
msgid "Person title"
msgstr "Titre de la personne"
#: models.py:101
msgid "link"
msgstr "lien"
#: models.py:114
msgid "Person titles"
msgstr "Titres de personne"
#: models.py:105
msgid "Person or author"
msgstr "Personne ou auteur"
#: models.py:138
msgid "Person Title Page"
msgstr "Page de titre de personne"
#: models.py:106 wagtail_hooks.py:15
msgid "Persons or authors"
msgstr "Personnes ou auteurs"
#: models.py:139
msgid "Person Title Pages"
msgstr "Pages de titre de personne"
#: models.py:132
msgid "Person or author pages"
msgstr "Pages de personne ou auteur"
#: models.py:149
#: models.py:143
msgid "Intro"
msgstr "Intro"
#: models.py:159
msgid "Person Index Page"
msgstr "Page d'index des personnes"
#: models.py:153
msgid "Persons or authors Index Page"
msgstr "Page d'index des personnes ou auteurs"
#: models.py:160
msgid "Person Index Pages"
msgstr "Pages d'index des personnes"
#: models.py:154
msgid "Persons or authors Index Pages"
msgstr "Pages d'index des personnes ou auteurs"
# Generated by Django 2.2.4 on 2020-02-20 18:54
from django.db import migrations, models
import django.db.models.deletion
import modelcluster.fields
import taggit.managers
import wagtail.core.fields
class Migration(migrations.Migration):
dependencies = [
('taggit', '0003_taggeditem_add_unique_index'),
('wagtailimages', '0001_squashed_0021'),
('wagtailperson', '0004_auto_20190821_2153'),
]
operations = [
migrations.CreateModel(
name='Person',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=250, verbose_name='Name')),
('intro', models.CharField(blank=True, help_text='Shown on the short descriptions', max_length=250, verbose_name='Introduction')),
('abstract', wagtail.core.fields.RichTextField(blank=True, verbose_name='Abstract')),
('picture', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.Image', verbose_name='Picture')),
],
options={
'verbose_name': 'Person or author',
'verbose_name_plural': 'Persons or authors',
'ordering': ['name'],
},
),
migrations.CreateModel(
name='PersonExtrernalLink',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('sort_order', models.IntegerField(blank=True, editable=False, null=True)),
('label', models.CharField(max_length=255, verbose_name='Label')),
('url', models.URLField(max_length=255, verbose_name='URL')),
('person', modelcluster.fields.ParentalKey(on_delete=django.db.models.deletion.CASCADE, related_name='external_links', to='wagtailperson.Person', verbose_name='Person')),
],
options={
'verbose_name': "Person's extrernal link",
'verbose_name_plural': "Person's extrernal links",
},
),
migrations.CreateModel(
name='PersonTag',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('content_object', modelcluster.fields.ParentalKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='tagged_items', to='wagtailperson.Person')),
('tag', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='wagtailperson_persontag_items', to='taggit.Tag')),
],
options={
'abstract': False,
},
),
migrations.DeleteModel(
name='PersonTitle',
),
migrations.AlterModelOptions(
name='personindexpage',
options={'verbose_name': 'Persons or authors Index Page', 'verbose_name_plural': 'Persons or authors Index Pages'},
),
migrations.AlterModelOptions(
name='personpage',
options={'ordering': ['title'], 'verbose_name': 'Person or author page', 'verbose_name_plural': 'Person or author pagess'},
),
migrations.RemoveField(
model_name='personpage',
name='abstract',
),
migrations.RemoveField(
model_name='personpage',
name='custom_titles',
),
migrations.RemoveField(
model_name='personpage',
name='extra_infos',
),
migrations.RemoveField(
model_name='personpage',
name='intro',
),
migrations.RemoveField(
model_name='personpage',
name='name',
),
migrations.RemoveField(
model_name='personpage',
name='picture',
),
migrations.DeleteModel(
name='PersonTitlePage',
),
migrations.AddField(
model_name='person',
name='tags',
field=taggit.managers.TaggableManager(blank=True, help_text='A comma-separated list of tags.', through='wagtailperson.PersonTag', to='taggit.Tag', verbose_name='Tags'),
),
migrations.AddField(
model_name='personpage',
name='person',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='wagtailperson.Person', verbose_name='Person'),
),
]