Skip to content

Commit

Permalink
create new home page
Browse files Browse the repository at this point in the history
  • Loading branch information
madjid-asa committed Jul 15, 2024
1 parent dae975a commit e09f1ff
Show file tree
Hide file tree
Showing 152 changed files with 280,273 additions and 818 deletions.
Empty file added blog/__init__.py
Empty file.
4 changes: 4 additions & 0 deletions blog/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# from django.contrib import admin


# Register your models here.
6 changes: 6 additions & 0 deletions blog/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.apps import AppConfig


class BlogConfig(AppConfig):
default_auto_field = "django.db.models.BigAutoField"
name = "blog"
29 changes: 29 additions & 0 deletions blog/blocks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
from django.utils.translation import gettext_lazy as _
from wagtail import blocks
from wagtail.images.blocks import ImageChooserBlock

from content_manager.blocks import ImageAndTextBlock, MultiColumnsWithTitleBlock, QuoteBlock


class ContactCardBlock(blocks.StructBlock):
name = blocks.CharBlock(label=_("Name"), max_length=255)
role = blocks.CharBlock(label=_("Role"), max_length=255)
organization = blocks.CharBlock(label=_("Organization"), max_length=255)
contact_info = blocks.CharBlock(label=_("Contact info"), max_length=500, required=False)
image = ImageChooserBlock(label="Image")

class Meta:
icon = "user"
template = ("blog/blocks/contact_card.html",)


COLOPHON_BLOCKS = [
("paragraph", blocks.RichTextBlock(label=_("Rich text"))),
(
"imageandtext",
ImageAndTextBlock(label="Bloc image et texte"),
),
("quote", QuoteBlock(label="Citation")),
("multicolumns", MultiColumnsWithTitleBlock(label="Multi-colonnes")),
("contact_card", ContactCardBlock(label=_("Contact card"))),
]
191 changes: 191 additions & 0 deletions blog/locale/fr/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \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"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
"X-Generator: Poedit 3.4.2\n"

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

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

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

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

#: blog/blocks.py:21
msgid "Rich text"
msgstr "Texte riche"

#: blog/blocks.py:28
msgid "Contact card"
msgstr "Carte contact"

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

#: 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:92 blog/templates/blog/tags_list_page.html:20
#: blog/views.py:149
msgid "Tags"
msgstr "Étiquettes"

#: 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: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: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:231
msgid "Author entries can be created in Snippets > Persons"
msgstr "Les auteurs peuvent être créés via Fragments > Personnes"

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

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

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

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

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

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

#: 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: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:303
msgid "Parent category cannot be self."
msgstr "La catégorie ne peut être sa propre parente."

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

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

#: 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:71
#: blog/templates/blog/blog_index_page.html:73
msgid "Filters"
msgstr "Filtres"

#, python-format
#~ msgid "Posts written by %(first_name)s %(last_name)s"
#~ msgstr "Articles publiés par %(first_name)s %(last_name)s"

#, fuzzy
#~| msgid "Author"
#~ msgid "Authors"
#~ msgstr "Auteur"

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

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

#~ msgid "body"
#~ msgstr "corps"
7 changes: 7 additions & 0 deletions blog/managers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from django.db import models


class CategoryManager(models.Manager):
def with_uses(self, blog_page):
entries = blog_page.get_entries()
return self.filter(entrypage__in=entries).distinct()
Loading

0 comments on commit e09f1ff

Please sign in to comment.