Skip to content

Commit

Permalink
Merge branch 'numerique-gouv:main' into main_tchap
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcWadai authored Dec 9, 2024
2 parents db9526c + 0118b82 commit 2d21489
Show file tree
Hide file tree
Showing 28 changed files with 8,905 additions and 547 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: 📦 Docker Image Build & Push

on:
push:
branches:
- "**"

jobs:
docker:
runs-on: ubuntu-latest
name: Build and push Docker image
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Inject enhanced GitHub environment variables
uses: rlespinasse/github-slug-action@v5
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Build and push
uses: docker/build-push-action@v6
with:
push: true
tags: |
ghcr.io/${{ env.GITHUB_REPOSITORY_OWNER_PART_SLUG }}/sites-faciles:${{ env.GITHUB_REF_SLUG }}
${{ github.ref_name == 'main' && format('ghcr.io/{0}/sites-faciles:latest', env.GITHUB_REPOSITORY_OWNER_PART_SLUG) || '' }}
cache-from: type=registry,ref=ghcr.io/${{ env.GITHUB_REPOSITORY_OWNER_PART_SLUG }}/sites-faciles:${{ env.GITHUB_REF_SLUG }}
cache-to: type=inline
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.9
rev: v0.8.0
hooks:
- id: ruff
args: [ --fix, --exit-non-zero-on-fix ]
- repo: https://github.com/psf/black
rev: 23.11.0
rev: 24.10.0
hooks:
- id: black
11 changes: 7 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM python:3.10

EXPOSE ${HOST_PORT}
EXPOSE ${CONTAINER_PORT}

ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
Expand All @@ -13,10 +13,13 @@ ENV POETRY_HOME=/opt/poetry
ENV POETRY_VENV=/opt/poetry-venv
ENV POETRY_CACHE_DIR=/opt/.cache

# Needed for docker build to succeed
ENV DATABASE_URL=postgres://user:password@localhost:5432/db

# Add new user to run the whole thing as non-root.
RUN set -ex \
&& addgroup app \
&& adduser --ingroup app --home ${APP_DIR} --disabled-password app;
&& addgroup --gid 1000 app \
&& adduser --uid 1000 --gid 1000 --home ${APP_DIR} --disabled-password app;

# Install poetry separated from system interpreter
RUN python3 -m venv ${POETRY_VENV} \
Expand All @@ -40,4 +43,4 @@ USER app
ENTRYPOINT ["./entrypoint.sh"]

# https://stackoverflow.com/a/40454758/21676629
CMD ["sh", "-c", "poetry run python manage.py runserver 0.0.0.0:$HOST_PORT"]
CMD ["sh", "-c", "poetry run python manage.py runserver 0.0.0.0:$CONTAINER_PORT"]
Binary file modified blog/locale/fr/LC_MESSAGES/django.mo
Binary file not shown.
98 changes: 59 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-09-17 12:04+0200\n"
"PO-Revision-Date: 2024-09-17 12:04+0200\n"
"POT-Creation-Date: 2024-11-27 14:45+0100\n"
"PO-Revision-Date: 2024-11-27 14:47+0100\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:37 blog/models.py:65
#: blog/blocks.py:9 blog/models.py:39 blog/models.py:67
msgid "Name"
msgstr "Nom"

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

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

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

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

#: blog/models.py:93
#: blog/models.py:95
msgid "Person"
msgstr "Personne"

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

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

#: blog/models.py:119
#: blog/models.py:121
msgid "Description"
msgstr "Description"

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

#: blog/models.py:126
#: blog/models.py:128
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:153
#: blog/models.py:155
msgid "Parent category cannot be self."
msgstr "La catégorie ne peut être sa propre parente."

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

#: blog/models.py:164 blog/models.py:183
#: blog/models.py:166 blog/models.py:185
msgid "Category"
msgstr "Catégorie"

#: blog/models.py:165 blog/models.py:273 blog/models.py:390
#: blog/templates/blog/categories_list_page.html:20 blog/views.py:117
#: blog/models.py:167 blog/models.py:279 blog/models.py:460 blog/models.py:467
#: blog/models.py:518
msgid "Categories"
msgstr "Catégories"

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

#: blog/models.py:203 blog/templates/blog/blog_index_page.html:77
#: blog/models.py:207
msgid "Post limit in the RSS/Atom feeds"
msgstr "Nombre d’articles dans les flux RSS/Atom"

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

#: blog/models.py:204 blog/templates/blog/blog_index_page.html:94
#: blog/models.py:212 blog/templates/blog/blog_index_page.html:102
msgid "Filter by tag"
msgstr "Filtrer par étiquette"

#: blog/models.py:205 blog/templates/blog/blog_index_page.html:111
#: blog/models.py:213 blog/templates/blog/blog_index_page.html:119
msgid "Filter by author"
msgstr "Filtrer par auteur"

#: blog/models.py:207 blog/templates/blog/blog_index_page.html:126
#: blog/models.py:215 blog/templates/blog/blog_index_page.html:134
msgid "Filter by source"
msgstr "Filtrer par source"

#: blog/models.py:207
#: blog/models.py:215
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:219
#: blog/models.py:228
msgid "Show filters"
msgstr "Afficher les filtres"

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

#: blog/models.py:255 blog/templates/blog/tags_list_page.html:20
#: blog/views.py:149
#: blog/models.py:262 blog/models.py:483 blog/models.py:497
#: blog/templates/blog/tags_list_page.html:20
msgid "Tags"
msgstr "Étiquettes"

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

#: blog/models.py:278
#: blog/models.py:284
#, python-format
msgid "Posts in category %(category)s"
msgstr "Articles dans la catégorie %(category)s"

#: blog/models.py:289 blog/models.py:291 blog/models.py:302 blog/models.py:305
#: blog/models.py:294 blog/models.py:296 blog/models.py:306 blog/models.py:309
msgid "Posts written by"
msgstr "Articles écrits par"

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

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

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

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

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

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

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

#: blog/templates/blog/blog_entry_page.html:74
#: blog/templates/blog/blocks/feeds.html:10
msgid "Atom feed for the category"
msgstr "Flux Atom pour la catégorie"

#: blog/templates/blog/blocks/feeds.html:12
msgid "Atom feed"
msgstr "Flux Atom"

#: blog/templates/blog/blocks/feeds.html:20
msgid "RSS feed for the category"
msgstr "Flux RSS pour la catégorie"

#: blog/templates/blog/blocks/feeds.html:22
msgid "RSS feed"
msgstr "Flux RSS"

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

#: blog/templates/blog/blog_index_page.html:72
#: blog/templates/blog/blog_index_page.html:74
#: blog/templates/blog/blog_index_page.html:80
#: blog/templates/blog/blog_index_page.html:82
msgid "Filters"
msgstr "Filtres"

Expand Down
25 changes: 25 additions & 0 deletions blog/migrations/0038_blogindexpage_feed_posts_limit.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Generated by Django 5.1.3 on 2024-11-27 10:47

import django.core.validators
from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("blog", "0037_alter_blogentrypage_body_and_more"),
]

operations = [
migrations.AddField(
model_name="blogindexpage",
name="feed_posts_limit",
field=models.PositiveSmallIntegerField(
default=20,
validators=[
django.core.validators.MaxValueValidator(100),
django.core.validators.MinValueValidator(1),
],
verbose_name="Post limit in the RSS/Atom feeds",
),
),
]
Loading

0 comments on commit 2d21489

Please sign in to comment.