From c6f1e316e2818d1d99f877e1e1b0c75a2779f9fc Mon Sep 17 00:00:00 2001
From: Facundo Tuesca
Date: Fri, 17 Jan 2025 17:38:14 +0100
Subject: [PATCH] Add archived badges to project's settings page
Signed-off-by: Facundo Tuesca
---
warehouse/locale/messages.pot | 33 +++++++++++--------
.../manage/project/manage_project_base.html | 4 +++
warehouse/templates/manage/projects.html | 3 ++
3 files changed, 26 insertions(+), 14 deletions(-)
diff --git a/warehouse/locale/messages.pot b/warehouse/locale/messages.pot
index 1a6081502f95..055af4aaa51b 100644
--- a/warehouse/locale/messages.pot
+++ b/warehouse/locale/messages.pot
@@ -1705,7 +1705,7 @@ msgstr ""
#: warehouse/templates/accounts/profile.html:83
#: warehouse/templates/manage/organization/projects.html:48
#: warehouse/templates/manage/projects.html:37
-#: warehouse/templates/manage/projects.html:84
+#: warehouse/templates/manage/projects.html:87
#: warehouse/templates/manage/team/projects.html:48
#: warehouse/templates/organizations/profile.html:66
#, python-format
@@ -3899,8 +3899,8 @@ msgstr ""
#: warehouse/templates/manage/organizations.html:120
#: warehouse/templates/manage/organizations.html:125
#: warehouse/templates/manage/project/releases.html:88
-#: warehouse/templates/manage/projects.html:103
-#: warehouse/templates/manage/projects.html:107
+#: warehouse/templates/manage/projects.html:106
+#: warehouse/templates/manage/projects.html:110
#: warehouse/templates/manage/team/projects.html:66
#: warehouse/templates/manage/team/projects.html:70
msgid "Manage"
@@ -4209,7 +4209,7 @@ msgstr ""
#: warehouse/templates/manage/organizations.html:35
#: warehouse/templates/manage/organizations.html:96
#: warehouse/templates/manage/projects.html:44
-#: warehouse/templates/manage/projects.html:91
+#: warehouse/templates/manage/projects.html:94
#: warehouse/templates/manage/team/projects.html:55
#, python-format
msgid "Created %(creation_date)s"
@@ -4302,8 +4302,8 @@ msgstr ""
#: warehouse/templates/manage/organization/teams.html:63
#: warehouse/templates/manage/organizations.html:103
#: warehouse/templates/manage/project/releases.html:94
-#: warehouse/templates/manage/projects.html:115
#: warehouse/templates/manage/projects.html:118
+#: warehouse/templates/manage/projects.html:121
#: warehouse/templates/manage/team/projects.html:78
#: warehouse/templates/manage/team/projects.html:81
msgid "View"
@@ -4442,31 +4442,35 @@ msgstr ""
msgid "Sole owner"
msgstr ""
+#: warehouse/templates/manage/projects.html:82
+msgid "Archived"
+msgstr ""
+
#: warehouse/templates/manage/organization/projects.html:66
-#: warehouse/templates/manage/projects.html:102
+#: warehouse/templates/manage/projects.html:105
#: warehouse/templates/manage/team/projects.html:65
msgid "Manage this project"
msgstr ""
#: warehouse/templates/manage/organization/projects.html:70
-#: warehouse/templates/manage/projects.html:106
+#: warehouse/templates/manage/projects.html:109
#: warehouse/templates/manage/team/projects.html:69
msgid "You are not an owner of this project"
msgstr ""
#: warehouse/templates/manage/organization/projects.html:78
-#: warehouse/templates/manage/projects.html:114
+#: warehouse/templates/manage/projects.html:117
#: warehouse/templates/manage/team/projects.html:77
msgid "View this project's public page"
msgstr ""
#: warehouse/templates/manage/organization/projects.html:81
-#: warehouse/templates/manage/projects.html:117
+#: warehouse/templates/manage/projects.html:120
#: warehouse/templates/manage/team/projects.html:80
msgid "This project has no releases"
msgstr ""
-#: warehouse/templates/manage/projects.html:126
+#: warehouse/templates/manage/projects.html:129
#, python-format
msgid ""
"You have not uploaded any projects to PyPI, yet. To learn how to get "
@@ -6113,6 +6117,11 @@ msgid ""
"article."
msgstr ""
+#: warehouse/templates/manage/project/manage_project_base.html:86
+#: warehouse/templates/packaging/detail.html:318
+msgid "This project has been archived."
+msgstr ""
+
#: warehouse/templates/manage/project/publishing.html:26
msgid ""
"Some form fields have been autofilled, please double-check their values "
@@ -7119,10 +7128,6 @@ msgstr ""
msgid "Project details"
msgstr ""
-#: warehouse/templates/packaging/detail.html:318
-msgid "This project has been archived."
-msgstr ""
-
#: warehouse/templates/packaging/detail.html:320
msgid ""
"The maintainers of this project have marked this project as archived. No "
diff --git a/warehouse/templates/manage/project/manage_project_base.html b/warehouse/templates/manage/project/manage_project_base.html
index 30ee07054e3d..7be0c257c8c2 100644
--- a/warehouse/templates/manage/project/manage_project_base.html
+++ b/warehouse/templates/manage/project/manage_project_base.html
@@ -81,6 +81,10 @@
{% endtrans %}
+ {% elif project.lifecycle_status == "archived" %}
+
+
{% trans %}This project has been archived.{% endtrans %}
+
{% endif %}
{% if request.organization_access and project.organization %}
diff --git a/warehouse/templates/manage/projects.html b/warehouse/templates/manage/projects.html
index 1a6e7e64b11a..4ac39d69faf7 100644
--- a/warehouse/templates/manage/projects.html
+++ b/warehouse/templates/manage/projects.html
@@ -78,6 +78,9 @@
{{ project.name }}
{% if project.name in projects_sole_owned %}
{% trans %}Sole owner{% endtrans %}
{% endif %}
+ {% if project.lifecycle_status == "archived" %}
+ {% trans %}Archived{% endtrans %}
+ {% endif %}
{% if release %}