Skip to content

Commit d41d25d

Browse files
committed
Polish document moderation history wording
1 parent 2630c88 commit d41d25d

5 files changed

Lines changed: 31 additions & 13 deletions

File tree

documents/templates/documents/document_edit.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ <h5 class="card-header">Modération</h5>
3939
Staff pick
4040
</label>
4141
<div class="form-text">
42-
En tant que modérateur, tu peux marquer ce document comme un "staff pick".<br/>
42+
En tant que modérateur, tu peux marquer ce document comme staff pick.<br/>
4343
Cela signifie que l'équipe de modération de DocHub considère ce document comme
4444
étant d'une grande qualité et méritant d'être mis en avant.<br/>
45-
Il apparaitra dans la liste des documents avec cette icône :
45+
Il apparaîtra dans la liste des documents avec cette icône :
4646
<svg title="Staff pick" xmlns="http://www.w3.org/2000/svg"
4747
width="16" height="16" fill="currentColor"
4848
class="bi bi-patch-check-fill" viewBox="0 0 16 16">

documents/templates/documents/viewer.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ <h1 class="fs-4 mb-0 d-flex align-items-center gap-1">
7676
{% endif %}
7777
{% if has_moderation_history %}
7878
<a class="btn btn-outline-secondary btn-sm d-inline-flex align-items-center gap-1"
79-
href="{% url 'moderation_document' document.pk %}">
79+
href="{% url 'moderation_document_history' document.pk %}">
8080
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
8181
class="bi bi-clock-history" viewBox="0 0 16 16">
8282
<path d="M8.515 1.019A7 7 0 0 0 8 1V0a8 8 0 0 1 .589.022zm2.004.45a7 7 0 0 0-.985-.299l.219-.976q.576.129 1.126.342zm1.37.71a7 7 0 0 0-.439-.27l.493-.87a8 8 0 0 1 .979.654l-.615.789a7 7 0 0 0-.418-.302zm1.834 1.79a7 7 0 0 0-.653-.796l.724-.69q.406.429.747.91zm.744 1.352a7 7 0 0 0-.214-.468l.893-.45a8 8 0 0 1 .45 1.088l-.95.313a7 7 0 0 0-.179-.483m.53 2.507a7 7 0 0 0-.1-1.025l.985-.17q.1.58.116 1.17zm-.131 1.538q.05-.254.081-.51l.993.123a8 8 0 0 1-.23 1.155l-.964-.267q.069-.247.12-.501m-.952 2.379q.276-.436.486-.908l.914.405q-.24.54-.555 1.038zm-.964 1.205q.183-.183.35-.378l.758.653a8 8 0 0 1-.401.432z"/>

moderation/models.py

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,25 +88,39 @@ def action_text(self):
8888
elif self.target_field == "action_rejeter":
8989
return "a refusé la demande de"
9090
elif self.target_field == "reupload":
91-
return "a re-uploadé"
91+
return "a remplacé le fichier de"
92+
elif self.target_field == "staff_pick":
93+
return (
94+
"a ajouté un staff pick sur"
95+
if str(self.new_value) == "True"
96+
else "a retiré le staff pick de"
97+
)
9298
label = self.FIELD_LABELS.get(self.target_field, self.target_field)
9399
return f"a modifié '{label}' sur"
94100

95101
@property
96102
def document_action_text(self):
97103
"""Action text for document history context (no trailing 'sur')."""
98104
if self.target_field == "reupload":
99-
return "re-upload"
105+
return "fichier remplacé"
100106
if self.target_field == "hidden":
101-
return "caché" if str(self.new_value) == "True" else "rendu visible"
107+
return (
108+
"document caché"
109+
if str(self.new_value) == "True"
110+
else "document rendu visible"
111+
)
102112
if self.target_field == "staff_pick":
103113
return (
104-
"ajouté staff pick"
114+
"staff pick ajouté"
105115
if str(self.new_value) == "True"
106-
else "retiré staff pick"
116+
else "staff pick retiré"
107117
)
108-
label = self.FIELD_LABELS.get(self.target_field, self.target_field)
109-
return f"modifié {label}"
118+
field_actions = {
119+
"name": "titre modifié",
120+
"description": "description modifiée",
121+
"tags": "tags modifiés",
122+
}
123+
return field_actions.get(self.target_field, f"{self.target_field} modifié")
110124

111125
@property
112126
def action_color(self):

moderation/templates/moderation/about.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ <h2 id="role">Que peuvent faire les modérateur·trices ?</h2>
1414
<ul class="mb-4">
1515
<li>Modifier le titre, la description et les tags de n'importe quel document</li>
1616
<li>Cacher ou rendre visible un document (par exemple si le contenu n'est pas approprié)</li>
17-
<li>Re-uploader une nouvelle version d'un document</li>
18-
<li>Marquer un document comme "Staff pick"</li>
17+
<li>Remplacer le fichier d'un document</li>
18+
<li>Marquer un document de qualité comme staff pick</li>
1919
</ul>
2020

2121
<h2 id="transparence">Transparence</h2>

moderation/urls.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,9 @@
3030
path("tree/", views.moderation_tree, name="moderation_tree"),
3131
path("profile/<str:netid>/", views.moderation_profile, name="moderation_profile"),
3232
# --- Document History ---
33-
path("document/<int:pk>/", views.document_history, name="moderation_document"),
33+
path(
34+
"document/<int:pk>/",
35+
views.document_history,
36+
name="moderation_document_history",
37+
),
3438
]

0 commit comments

Comments
 (0)