From 77cedd32883581b89d99c88948ed95d1a5094c4e Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Mon, 17 Jul 2023 09:07:31 +0200 Subject: [PATCH] Display share status in dashboard --- umap/models.py | 14 +++++++------- umap/templates/umap/map_table.html | 4 ++-- umap/tests/test_views.py | 2 ++ 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/umap/models.py b/umap/models.py index 719a6845..5015a5ed 100644 --- a/umap/models.py +++ b/umap/models.py @@ -131,15 +131,15 @@ class Map(NamedModel): PRIVATE = 3 BLOCKED = 9 EDIT_STATUS = ( - (ANONYMOUS, _("Everyone can edit")), - (EDITORS, _("Only editors can edit")), - (OWNER, _("Only owner can edit")), + (ANONYMOUS, _("Everyone")), + (EDITORS, _("Only editors")), + (OWNER, _("Only owner")), ) SHARE_STATUS = ( - (PUBLIC, _("everyone (public)")), - (OPEN, _("anyone with link")), - (PRIVATE, _("editors only")), - (BLOCKED, _("blocked")), + (PUBLIC, _("Everyone (public)")), + (OPEN, _("Anyone with link")), + (PRIVATE, _("Editors only")), + (BLOCKED, _("Blocked")), ) slug = models.SlugField(db_index=True) description = models.TextField(blank=True, null=True, verbose_name=_("description")) diff --git a/umap/templates/umap/map_table.html b/umap/templates/umap/map_table.html index a68040d3..eb8cef5a 100644 --- a/umap/templates/umap/map_table.html +++ b/umap/templates/umap/map_table.html @@ -5,7 +5,7 @@ {% blocktrans %}Map{% endblocktrans %} {% blocktrans %}Name{% endblocktrans %} - {% blocktrans %}Status{% endblocktrans %} + {% blocktrans %}Who can see / edit{% endblocktrans %} {% blocktrans %}Last save{% endblocktrans %} {% blocktrans %}Owner{% endblocktrans %} {% blocktrans %}Actions{% endblocktrans %} @@ -19,7 +19,7 @@ {{ map_inst.name }} - {{ map_inst.get_edit_status_display }} + {{ map_inst.get_share_status_display }} / {{ map_inst.get_edit_status_display }} {{ map_inst.modified_at }} {{ map_inst.owner }} diff --git a/umap/tests/test_views.py b/umap/tests/test_views.py index f8522d39..069b4859 100644 --- a/umap/tests/test_views.py +++ b/umap/tests/test_views.py @@ -259,3 +259,5 @@ def test_user_dashboard_display_user_maps(client, map): assert f"{map.get_absolute_url()}?edit" in body assert f"{map.get_absolute_url()}?share" in body assert f"{map.get_absolute_url()}?download" in body + assert "Everyone (public)" in body + assert "Only owner" in body