From 4491d8d61ff41670b8e7887c53b5ed325604746a Mon Sep 17 00:00:00 2001 From: Vincent Porte Date: Wed, 4 Dec 2024 22:34:53 +0100 Subject: [PATCH] feat: renommage des upvotes (#842) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description 🎸 Renommer les `UpVotes`, de `sauvegardes` en `abonnements`. ## Type de changement 🎨 changement d'UI ### Captures d'écran (optionnel) `/upvotes/` ![image](https://github.com/user-attachments/assets/661b0988-846e-46e3-b52d-73738cdb44b1) `Forum` ![image](https://github.com/user-attachments/assets/b0b01f21-13b1-46ee-9459-fb7dad143a00) ![image](https://github.com/user-attachments/assets/c7378745-e1a7-487a-8707-8670ad612276) `Post` ![image](https://github.com/user-attachments/assets/120ce270-8c67-45da-875a-ee5ea1fb7769) ![image](https://github.com/user-attachments/assets/0a59fc42-84a8-49f3-b3a3-752ce447d75e) `user menu` ![image](https://github.com/user-attachments/assets/cba79d2b-98cb-4b5b-a79f-00559c7e09b0) --- .../tests/__snapshots__/tests_views.ambr | 26 +++++++++---------- .../forum_conversation/tests/tests_views.py | 4 +-- .../tests/tests_views_htmx.py | 6 ++--- .../tests/test_forumupvoteview.py | 8 ++++-- .../forum_upvote/tests/test_postupvoteview.py | 8 ++++-- lacommunaute/templates/partials/header.html | 18 +++++-------- lacommunaute/templates/partials/upvotes.html | 4 +-- locale/fr/LC_MESSAGES/django.po | 13 ++++++++-- 8 files changed, 49 insertions(+), 38 deletions(-) diff --git a/lacommunaute/forum/tests/__snapshots__/tests_views.ambr b/lacommunaute/forum/tests/__snapshots__/tests_views.ambr index 822628d16..d62415036 100644 --- a/lacommunaute/forum/tests/__snapshots__/tests_views.ambr +++ b/lacommunaute/forum/tests/__snapshots__/tests_views.ambr @@ -328,7 +328,7 @@ - 0 + 0 @@ -487,7 +487,7 @@ - 0 + 0 @@ -500,7 +500,7 @@ - 0 + 0 @@ -514,8 +514,8 @@
-
@@ -529,7 +529,7 @@ - 1 + 1 @@ -542,7 +542,7 @@ - 1 + 1 @@ -556,8 +556,8 @@
-
@@ -571,7 +571,7 @@ - 2 + 2 @@ -584,7 +584,7 @@ - 2 + 2 @@ -598,8 +598,8 @@
-
diff --git a/lacommunaute/forum_conversation/tests/tests_views.py b/lacommunaute/forum_conversation/tests/tests_views.py index 4ff4e44e4..3324c3597 100644 --- a/lacommunaute/forum_conversation/tests/tests_views.py +++ b/lacommunaute/forum_conversation/tests/tests_views.py @@ -663,7 +663,7 @@ def test_post_has_no_upvote(self): response = self.client.get(self.url) self.assertContains( - response, '0', status_code=200 + response, '0', status_code=200 ) def test_post_has_upvote_by_user(self): @@ -673,7 +673,7 @@ def test_post_has_upvote_by_user(self): response = self.client.get(self.url) self.assertContains( - response, '1', status_code=200 + response, '1', status_code=200 ) def test_certified_post_is_highlighted(self): diff --git a/lacommunaute/forum_conversation/tests/tests_views_htmx.py b/lacommunaute/forum_conversation/tests/tests_views_htmx.py index 83df2f0c9..ac87dd15c 100644 --- a/lacommunaute/forum_conversation/tests/tests_views_htmx.py +++ b/lacommunaute/forum_conversation/tests/tests_views_htmx.py @@ -189,7 +189,7 @@ def test_upvote_annotations(self): response = view.get(request) self.assertContains( - response, '0', status_code=200 + response, '0', status_code=200 ) UpVoteFactory(content_object=post, voter=UserFactory()) @@ -197,7 +197,7 @@ def test_upvote_annotations(self): response = view.get(request) self.assertContains( - response, '2', status_code=200 + response, '2', status_code=200 ) def test_certified_post_highlight(self): @@ -287,7 +287,7 @@ def test_create_post_as_authenticated_user(self, *args): self.assertContains(response, self.content, status_code=200) self.assertIsInstance(response.context["form"], PostForm) self.assertEqual(1, ForumReadTrack.objects.count()) - self.assertContains(response, '0') + self.assertContains(response, '0') self.topic.refresh_from_db() self.assertEqual(self.topic.posts.count(), 2) self.assertEqual( diff --git a/lacommunaute/forum_upvote/tests/test_forumupvoteview.py b/lacommunaute/forum_upvote/tests/test_forumupvoteview.py index 227274df4..51516fbfb 100644 --- a/lacommunaute/forum_upvote/tests/test_forumupvoteview.py +++ b/lacommunaute/forum_upvote/tests/test_forumupvoteview.py @@ -32,12 +32,16 @@ def test_upvote_downvote_with_permission(client, db): # upvote response = client.post(url, data=form_data) - assertContains(response, '1', status_code=200) + assertContains( + response, '1', status_code=200 + ) assert UpVote.objects.get() # downvote response = client.post(url, data=form_data) - assertContains(response, '0', status_code=200) + assertContains( + response, '0', status_code=200 + ) assert not UpVote.objects.all() diff --git a/lacommunaute/forum_upvote/tests/test_postupvoteview.py b/lacommunaute/forum_upvote/tests/test_postupvoteview.py index ef7e98a24..836a98fec 100644 --- a/lacommunaute/forum_upvote/tests/test_postupvoteview.py +++ b/lacommunaute/forum_upvote/tests/test_postupvoteview.py @@ -34,7 +34,9 @@ def test_upvote_with_permission(client, db): # upvote response = client.post(url, data=form_data) - assertContains(response, '1', status_code=200) + assertContains( + response, '1', status_code=200 + ) assert UpVote.objects.get( voter_id=user.id, object_id=topic.first_post.id, @@ -43,7 +45,9 @@ def test_upvote_with_permission(client, db): # downvote response = client.post(url, data=form_data) - assertContains(response, '0', status_code=200) + assertContains( + response, '0', status_code=200 + ) assert not UpVote.objects.all() diff --git a/lacommunaute/templates/partials/header.html b/lacommunaute/templates/partials/header.html index 849bf078c..074ae9c19 100644 --- a/lacommunaute/templates/partials/header.html +++ b/lacommunaute/templates/partials/header.html @@ -69,16 +69,13 @@
  • - Accéder à mon profil + {% trans "Go to my profile" %}
  • - Accéder à mes sauvegardes + {% trans "Go to my UpVotes" %}
  • - Accéder à mes évènements -
  • -
  • - Accéder à mes thématiques + {% trans "Go to my events" %}
  • {% if user.is_superuser %}
  • @@ -239,16 +236,13 @@

  • - Accéder à mon profil -
  • -
  • - Accéder à mes sauvegardes + {% trans "Go to my profile" %}
  • - Accéder à mes évènements + {% trans "Go to my UpVotes" %}
  • - Accéder à mes thématiques + {% trans "Go to my events" %}
  • {% if user.is_superuser %}
  • diff --git a/lacommunaute/templates/partials/upvotes.html b/lacommunaute/templates/partials/upvotes.html index 1d706e2af..de52a12cd 100644 --- a/lacommunaute/templates/partials/upvotes.html +++ b/lacommunaute/templates/partials/upvotes.html @@ -9,12 +9,12 @@ hx-swap="outerHTML"> {% else %} - {{ counter }} + {{ counter }} {% endif %} {% endwith %} diff --git a/locale/fr/LC_MESSAGES/django.po b/locale/fr/LC_MESSAGES/django.po index dcf5114fd..d3b64aca1 100644 --- a/locale/fr/LC_MESSAGES/django.po +++ b/locale/fr/LC_MESSAGES/django.po @@ -914,10 +914,13 @@ msgid "Topics Engagement" msgstr "Engagement par sujet" msgid "UpVotes" -msgstr "Sauvegarder" +msgstr "S'abonner" msgid "My UpVotes" -msgstr "Mes sauvegardes" +msgstr "Mes abonnements" + +msgid "Go to my UpVotes" +msgstr "Voir mes abonnements" msgid "Likes" msgstr "Ce sujet m'intéresse" @@ -1036,3 +1039,9 @@ msgstr "Partenaire" msgid "Partners" msgstr "Nos partenaires" + +msgid "Go to my profile" +msgstr "Voir mon profil" + +msgid "Go to my events" +msgstr "Voir mes évènements"