Add a label "shared with others" for export shared with other peoples

This commit is contained in:
Julien Fastré 2025-07-02 10:12:01 +02:00
parent a4884eb3a0
commit 73bae475bd
Signed by: julienfastre
GPG Key ID: BDE2190974723FCB
3 changed files with 10 additions and 0 deletions

View File

@ -176,6 +176,14 @@ class SavedExport implements TrackCreationInterface, TrackUpdateInterface
]); ]);
} }
/**
* Return true if shared with at least one user or one group
*/
public function isShared(): bool
{
return $this->sharedWithUsers->count() > 0 || $this->sharedWithGroups->count() > 0;
}
/** /**
* Determines if the user is shared with either directly or through a group. * Determines if the user is shared with either directly or through a group.
* *

View File

@ -30,6 +30,7 @@
{% if app.user is same as saved.user %} {% if app.user is same as saved.user %}
<p class="card-text tags"> <p class="card-text tags">
{% if app.user is same as saved.user %}<span class="badge bg-primary">{{ 'saved_export.Owner'|trans }}</span>{% endif %} {% if app.user is same as saved.user %}<span class="badge bg-primary">{{ 'saved_export.Owner'|trans }}</span>{% endif %}
{% if saved.isShared() %}<span class="badge bg-info">{{ 'saved_export.Shared with others'|trans }}</span>{% endif %}
</p> </p>
{% else %} {% else %}
<p class="card-text tags"> <p class="card-text tags">

View File

@ -803,6 +803,7 @@ saved_export:
execute: Générer execute: Générer
Update existing: Mettre à jour le rapport enregistré existant Update existing: Mettre à jour le rapport enregistré existant
Owner: Propriétaire Owner: Propriétaire
Shared with others: Partagé
Save to new saved export: Créer un nouvel export enregistré Save to new saved export: Créer un nouvel export enregistré
Update current saved export: Modifier la configuration de l'export existant Update current saved export: Modifier la configuration de l'export existant
Duplicate: Dupliquer Duplicate: Dupliquer