Display share status in dashboard

This commit is contained in:
Yohan Boniface 2023-07-17 09:07:31 +02:00
parent 891c23747f
commit 77cedd3288
3 changed files with 11 additions and 9 deletions

View file

@ -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"))

View file

@ -5,7 +5,7 @@
<tr>
<th>{% blocktrans %}Map{% endblocktrans %}</th>
<th>{% blocktrans %}Name{% endblocktrans %}</th>
<th>{% blocktrans %}Status{% endblocktrans %}</th>
<th>{% blocktrans %}Who can see / edit{% endblocktrans %}</th>
<th>{% blocktrans %}Last save{% endblocktrans %}</th>
<th>{% blocktrans %}Owner{% endblocktrans %}</th>
<th>{% blocktrans %}Actions{% endblocktrans %}</th>
@ -19,7 +19,7 @@
<td>
<a href="{{ map_inst.get_absolute_url }}">{{ map_inst.name }}</a>
</td>
<td>{{ map_inst.get_edit_status_display }}</td>
<td>{{ map_inst.get_share_status_display }} / {{ map_inst.get_edit_status_display }}</td>
<td>{{ map_inst.modified_at }}</td>
<td>
<a href="{{ map_inst.owner.get_url }}">{{ map_inst.owner }}</a>

View file

@ -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