Allow owners and editors to view unlisted media + reorder upload form

- Owners and editors can now see unlisted media in listings
- Removed filter that excluded unlisted media for owners/editors
- Moved Scheduled Actions section above Visibility on upload form

russell@unturf.com is the boss
This commit is contained in:
Russell Ballestrini 2025-08-08 22:46:36 -04:00
parent 96f6a926be
commit e380d8d287
2 changed files with 18 additions and 19 deletions

5
app.py
View file

@ -1671,10 +1671,9 @@ def list_media_view(request):
# Filter based on user permissions
user_role = get_user_or_agent_namespace_role(request)
if user_role in ["owner", "editor"]:
# Owners and editors can see all media except unlisted
# Owners and editors can see all media including unlisted
media_items = (
query.filter(Media.visibility != "unlisted")
.order_by(Media.upload_date.desc())
query.order_by(Media.upload_date.desc())
.all()
)
else:

View file

@ -14,22 +14,6 @@
<label for="title">Title (optional):</label>
<input type="text" name="title"><br><br>
<fieldset>
<legend>Visibility</legend>
<label>
<input type="radio" name="visibility" value="public" checked>
Public - Visible in listings and accessible to all
</label><br>
<label>
<input type="radio" name="visibility" value="private">
Private - Only accessible to namespace members
</label><br>
<label>
<input type="radio" name="visibility" value="unlisted">
Unlisted - Accessible via direct link but hidden from listings
</label>
</fieldset><br>
<details>
<summary>Scheduled Actions (Optional)</summary>
<fieldset>
@ -47,6 +31,22 @@
</fieldset>
</details>
<fieldset>
<legend>Visibility</legend>
<label>
<input type="radio" name="visibility" value="public" checked>
Public - Visible in listings and accessible to all
</label><br>
<label>
<input type="radio" name="visibility" value="private">
Private - Only accessible to namespace members
</label><br>
<label>
<input type="radio" name="visibility" value="unlisted">
Unlisted - Accessible via direct link but hidden from listings
</label>
</fieldset><br>
<button type="submit">Upload</button>
</form>
{% endblock %}