Skip to content

Commit

Permalink
[Blog] Filtrage des articles sur l’index et ajout d’un bloc "Derniers…
Browse files Browse the repository at this point in the history
… articles" pour la page d’accueil (#186)

* Start adding filtering capacity

* Filter blog articles

* Progress on filters

* Finish creating filters
  • Loading branch information
Ash-Crow authored Jul 11, 2024
1 parent b7a26b2 commit c3071a2
Show file tree
Hide file tree
Showing 21 changed files with 29,710 additions and 402 deletions.
Binary file modified blog/locale/fr/LC_MESSAGES/django.mo
Binary file not shown.
117 changes: 78 additions & 39 deletions blog/locale/fr/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-06-24 12:44+0200\n"
"PO-Revision-Date: 2024-06-24 12:44+0200\n"
"POT-Creation-Date: 2024-07-11 17:35+0200\n"
"PO-Revision-Date: 2024-07-11 17:36+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: fr\n"
Expand All @@ -18,19 +18,19 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
"X-Generator: Poedit 3.4.2\n"

#: blog/blocks.py:9 blog/models.py:289
#: blog/blocks.py:9 blog/models.py:348 blog/models.py:365
msgid "Name"
msgstr "Nom"

#: blog/blocks.py:10 blog/models.py:290
#: blog/blocks.py:10 blog/models.py:366
msgid "Role"
msgstr "Fonction"

#: blog/blocks.py:11 blog/models.py:291
#: blog/blocks.py:11 blog/models.py:360
msgid "Organization"
msgstr "Organisation"

#: blog/blocks.py:12 blog/models.py:292
#: blog/blocks.py:12 blog/models.py:368
msgid "Contact info"
msgstr "Informations de contact"

Expand All @@ -42,109 +42,148 @@ msgstr "Texte riche"
msgid "Contact card"
msgstr "Carte contact"

#: blog/models.py:35
#: blog/models.py:36
msgid "Posts per page"
msgstr "Articles par page"

#: blog/models.py:45
#: blog/models.py:40 blog/templates/blog/blog_index_page.html:76
msgid "Filter by category"
msgstr "Filtrer par catégorie"

#: blog/models.py:41 blog/templates/blog/blog_index_page.html:93
msgid "Filter by tag"
msgstr "Filtrer par étiquette"

#: blog/models.py:42 blog/templates/blog/blog_index_page.html:110
msgid "Filter by author"
msgstr "Filtrer par auteur"

#: blog/models.py:44 blog/templates/blog/blog_index_page.html:125
msgid "Filter by source"
msgstr "Filtrer par source"

#: blog/models.py:44
msgid "The source is the organization of the post author"
msgstr "La source est l’organisation à laquelle appartient l’auteur de l’article"

#: blog/models.py:56
msgid "Show filters"
msgstr "Afficher les filtres"

#: blog/models.py:63
msgid "Blog index"
msgstr "Index de blog"

#: blog/models.py:73 blog/templates/blog/tags_list_page.html:20
#: blog/models.py:92 blog/templates/blog/tags_list_page.html:20
#: blog/views.py:149
msgid "Tags"
msgstr "Étiquettes"

#: blog/models.py:96 blog/models.py:169 blog/models.py:264
#: blog/models.py:97
#, python-format
msgid "Posts tagged with %(tag)s"
msgstr "Articles avec l’étiquette %(tag)s"

#: blog/models.py:110 blog/models.py:227 blog/models.py:323
#: blog/templates/blog/categories_list_page.html:20 blog/views.py:117
msgid "Categories"
msgstr "Catégories"

#: blog/models.py:108 blog/templates/blog/blog_index_page.html:59
#: blog/models.py:115
#, python-format
msgid "Posts in category %(category)s"
msgstr "Articles dans la catégorie %(category)s"

#: blog/models.py:126 blog/models.py:128 blog/models.py:139 blog/models.py:142
msgid "Posts written by"
msgstr "Articles écrits par"

#: blog/models.py:171
#: blog/models.py:146
#, python-format
msgid "Posts published in %(year)s"
msgstr "Articles publiés en %(year)s"

#: blog/models.py:229
msgid "Post date"
msgstr "Date de publication"

#: blog/models.py:173
#: blog/models.py:231
msgid "Author entries can be created in Snippets > Persons"
msgstr "Les auteurs peuvent être créés via Fragments > Personnes"

#: blog/models.py:192
#: blog/models.py:250
msgid "Scheduled publishing"
msgstr "Publication planifiée"

#: blog/models.py:200
#: blog/models.py:258
msgid "Tags and Categories"
msgstr "Étiquettes et Catégories"

#: blog/models.py:208
#: blog/models.py:266
msgid "Blog page"
msgstr "Page de blog"

#: blog/models.py:213
#: blog/models.py:271
msgid "Category name"
msgstr "Nom de la catégorie"

#: blog/models.py:220
#: blog/models.py:278
msgid "Parent category"
msgstr "Catégorie parente"

#: blog/models.py:226
#: blog/models.py:285
msgid "Description"
msgstr "Description"

#: blog/models.py:227
#: blog/models.py:286
msgid "Displayed on the top of the category page"
msgstr "Affiché en haut de la page de la catégorie"

#: blog/models.py:233
#: blog/models.py:292
msgid "Text displayed at the end of every page in the category"
msgstr "Texte affiché à la fin de chaque page de la catégorie"

#: blog/models.py:244
#: blog/models.py:303
msgid "Parent category cannot be self."
msgstr "La catégorie ne peut être sa propre parente."

#: blog/models.py:246
#: blog/models.py:305
msgid "Cannot have circular Parents."
msgstr "Il est impossible d’avoir des parents circulaires."

#: blog/models.py:263 blog/models.py:275
#: blog/models.py:322 blog/models.py:334
msgid "Category"
msgstr "Catégorie"

#: blog/models.py:309
#: blog/models.py:385
msgid "Person"
msgstr "Personne"

#: blog/templates/blog/blocks/blog_index_posts_list.html:36
msgid "No article found."
msgstr "Aucun article trouvé."

#: blog/templates/blog/blog_entry_page.html:75
msgid "Posted by:"
msgstr "Écrit par :"

#: blog/templates/blog/blog_index_page.html:52
#, python-format
msgid "Posts in category %(category)s"
msgstr "Articles dans la catégorie %(category)s"
#: blog/templates/blog/blog_index_page.html:71
#: blog/templates/blog/blog_index_page.html:73
msgid "Filters"
msgstr "Filtres"

#: blog/templates/blog/blog_index_page.html:56
#, python-format
msgid "Posts tagged with %(tag)s"
msgstr "Articles avec l’étiquette %(tag)s"
#~ msgid "Posts written by %(first_name)s %(last_name)s"
#~ msgstr "Articles publiés par %(first_name)s %(last_name)s"

#: blog/templates/blog/blog_index_page.html:61
#, python-format
msgid "Posts published in %(year)s"
msgstr "Articles publiés en %(year)s"
#, fuzzy
#~| msgid "Author"
#~ msgid "Authors"
#~ msgstr "Auteur"

#~ msgid "Colophon"
#~ msgstr "Colophon"

#~ msgid "Author"
#~ msgstr "Auteur"

#~ msgid "Header image"
#~ msgstr "Image d’en-tête"

Expand Down
47 changes: 47 additions & 0 deletions blog/migrations/0022_blogindexpage_filter_by_author_and_more.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Generated by Django 5.0.6 on 2024-07-04 10:09

import wagtail.fields
from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("blog", "0021_blogentrypage_header_cta_buttons_and_more"),
]

operations = [
migrations.AddField(
model_name="blogindexpage",
name="filter_by_author",
field=models.BooleanField(default=False, verbose_name="Filter by author"),
),
migrations.AddField(
model_name="blogindexpage",
name="filter_by_category",
field=models.BooleanField(default=True, verbose_name="Filter by category"),
),
migrations.AddField(
model_name="blogindexpage",
name="filter_by_source",
field=models.BooleanField(
default=False,
help_text="The source is the organization of the post author",
verbose_name="Filter by source",
),
),
migrations.AddField(
model_name="blogindexpage",
name="filter_by_tag",
field=models.BooleanField(default=True, verbose_name="Filter by tag"),
),
migrations.AlterField(
model_name="category",
name="description",
field=wagtail.fields.RichTextField(
blank=True,
help_text="Displayed on the top of the category page",
max_length=500,
verbose_name="Description",
),
),
]
26 changes: 26 additions & 0 deletions blog/migrations/0023_organization_person_organization_item.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Generated by Django 5.0.6 on 2024-07-08 15:15

import django.db.models.deletion
from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("blog", "0022_blogindexpage_filter_by_author_and_more"),
]

operations = [
migrations.CreateModel(
name="Organization",
fields=[
("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
("name", models.CharField(max_length=255, verbose_name="Name")),
("slug", models.SlugField(max_length=80)),
],
),
migrations.AddField(
model_name="person",
name="organization_item",
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to="blog.organization"),
),
]
26 changes: 26 additions & 0 deletions blog/migrations/0024_transfer_organizations.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Generated by Django 5.0.6 on 2024-07-08 15:17

from django.db import migrations
from django.utils.text import slugify


def link_organizations(apps, schema_editor):
Person = apps.get_model("blog", "Person")
Organization = apps.get_model("blog", "Organization")
for person in Person.objects.all():
if person.organization:
organization, _created = Organization.objects.get_or_create(
name=person.organization, slug=slugify(person.organization)
)
person.organization_item = organization
person.save()


class Migration(migrations.Migration):
dependencies = [
("blog", "0023_organization_person_organization_item"),
]

operations = [
migrations.RunPython(link_organizations),
]
16 changes: 16 additions & 0 deletions blog/migrations/0025_remove_person_organization.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Generated by Django 5.0.6 on 2024-07-08 15:52

from django.db import migrations


class Migration(migrations.Migration):
dependencies = [
("blog", "0024_transfer_organizations"),
]

operations = [
migrations.RemoveField(
model_name="person",
name="organization",
),
]
16 changes: 16 additions & 0 deletions blog/migrations/0026_alter_organization_options.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Generated by Django 5.0.6 on 2024-07-08 15:57

from django.db import migrations


class Migration(migrations.Migration):
dependencies = [
("blog", "0025_remove_person_organization"),
]

operations = [
migrations.AlterModelOptions(
name="organization",
options={"verbose_name": "Organization"},
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by Django 5.0.6 on 2024-07-08 16:16

from django.db import migrations


class Migration(migrations.Migration):
dependencies = [
("blog", "0026_alter_organization_options"),
]

operations = [
migrations.RenameField(
model_name="person",
old_name="organization_item",
new_name="organization",
),
]
Loading

0 comments on commit c3071a2

Please sign in to comment.