From 3a839b5c68611f419c1032368cf12290f447f49c Mon Sep 17 00:00:00 2001 From: raydeveloppeur-admin Date: Sat, 25 Jul 2026 17:25:40 +0200 Subject: [PATCH 1/9] Update comment rules session register : Comment rules display added above the comment form. The article template now shows five French rules covering links, profanity, duplicates, respectful tone and ban conditions. New `.comment-rules` styles added in `article.css`, using the existing design tokens for surface, radius and spacing so the block fits naturally with the rest of the UI --- frontend/static/css/article.css | 18 ++++++++++++++++++ frontend/templates/article_detail.html | 10 ++++++++++ 2 files changed, 28 insertions(+) diff --git a/frontend/static/css/article.css b/frontend/static/css/article.css index c5f68de..00a963b 100644 --- a/frontend/static/css/article.css +++ b/frontend/static/css/article.css @@ -1838,4 +1838,22 @@ a.comment-author:hover { } } +/* Comment Rules */ +.comment-rules { + font-size: 0.8125rem; + color: var(--on-surface-variant); + background: var(--surface-container); + border: 1px solid var(--outline-variant); + border-radius: var(--radius-lg); + padding: var(--spacing-sm) var(--spacing-md); + margin-bottom: var(--spacing-md); +} +.comment-rules p { + margin: 0 0 var(--spacing-xs); +} +.comment-rules ul { + margin: 0; + padding-left: var(--spacing-lg); +} + diff --git a/frontend/templates/article_detail.html b/frontend/templates/article_detail.html index d0ebe9d..3d47833 100644 --- a/frontend/templates/article_detail.html +++ b/frontend/templates/article_detail.html @@ -195,6 +195,16 @@

{{ _('Comments (%(count)s)', count=comment_count) }}< {% if current_user %}

{{ _('Join the discussion') }}

+
+

Règles des commentaires :

+
    +
  • Ne publiez pas de liens, de publicité ou de spam.
  • +
  • N'utilisez pas de grossièretés, d'insultes ou de propos haineux.
  • +
  • Ne postez pas le même message plusieurs fois.
  • +
  • Restez respectueux et dans le sujet.
  • +
  • Le non-respect de ces règles entraîne le bannissement du compte, sans préavis.
  • +
+
{{ _('Comment must be between 1 and 5000 characters') }}
Date: Sat, 25 Jul 2026 18:47:37 +0200 Subject: [PATCH 2/9] =?UTF-8?q?Update=20comment=20rules=20session=20regist?= =?UTF-8?q?er=20:=20Registration=20validation=20tightened.=20Username=20ge?= =?UTF-8?q?ts=20a=203=E2=80=9330=E2=80=91character=20pattern,=20passwords?= =?UTF-8?q?=20require=208+=20characters=20with=20strength=20checks,=20logi?= =?UTF-8?q?n=20minimum=20raised,=20templates=20updated=20with=20field=20hi?= =?UTF-8?q?nts,=20comment=20rules=20moved=20to=20English,=20hint=20CSS=20u?= =?UTF-8?q?nified,=20French=20translations=20added,=20tests=20expanded=20a?= =?UTF-8?q?nd=20migration=20V18=20introduces=20`session=5Ftoken`=20plus=20?= =?UTF-8?q?a=2030=E2=80=91character=20username=20column?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- blog_exceptions.py | 5 + frontend/core/components/ArticleForm.jsx | 2 +- frontend/static/css/article.css | 7 - frontend/static/css/base.css | 7 + frontend/templates/article_detail.html | 14 +- frontend/templates/login.html | 2 +- frontend/templates/profile.html | 3 +- frontend/templates/registration.html | 21 +- ...__add_session_token_and_username_limit.sql | 5 + src/application/services/login_service.py | 10 + .../input_adapters/dto/login_request.py | 2 +- .../dto/registration_request.py | 31 +- .../flask/flask_account_session_adapter.py | 4 +- .../dto/test_login_request.py | 4 + .../dto/test_registration_request.py | 56 ++- tests/tests_services/test_login_service.py | 4 +- translations/fr/LC_MESSAGES/messages.mo | Bin 12591 -> 13605 bytes translations/fr/LC_MESSAGES/messages.po | 349 ++++++++++-------- translations/messages.pot | 333 ++++++++++------- 19 files changed, 533 insertions(+), 326 deletions(-) create mode 100644 migrations/V18__add_session_token_and_username_limit.sql diff --git a/blog_exceptions.py b/blog_exceptions.py index cc5672e..e78b3ce 100644 --- a/blog_exceptions.py +++ b/blog_exceptions.py @@ -93,6 +93,11 @@ class PasswordsDoNotMatchError(ValueError): pass +class WeakPasswordError(ValueError): + """Raised when password does not meet strength requirements (length, uppercase, lowercase, special char).""" + pass + + class CommentEmptyError(ValueError): """Raised when comment content is empty.""" pass diff --git a/frontend/core/components/ArticleForm.jsx b/frontend/core/components/ArticleForm.jsx index 1ae1c80..1fbebba 100644 --- a/frontend/core/components/ArticleForm.jsx +++ b/frontend/core/components/ArticleForm.jsx @@ -435,7 +435,7 @@ export default function ArticleForm() { {_('Description')}
- {_('Maximum 300 characters')} + {_('Maximum 300 characters')} {description.length}/300