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:
parent
96f6a926be
commit
e380d8d287
2 changed files with 18 additions and 19 deletions
5
app.py
5
app.py
|
|
@ -1671,10 +1671,9 @@ def list_media_view(request):
|
||||||
# Filter based on user permissions
|
# Filter based on user permissions
|
||||||
user_role = get_user_or_agent_namespace_role(request)
|
user_role = get_user_or_agent_namespace_role(request)
|
||||||
if user_role in ["owner", "editor"]:
|
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 = (
|
media_items = (
|
||||||
query.filter(Media.visibility != "unlisted")
|
query.order_by(Media.upload_date.desc())
|
||||||
.order_by(Media.upload_date.desc())
|
|
||||||
.all()
|
.all()
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
|
|
@ -14,22 +14,6 @@
|
||||||
<label for="title">Title (optional):</label>
|
<label for="title">Title (optional):</label>
|
||||||
<input type="text" name="title"><br><br>
|
<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>
|
<details>
|
||||||
<summary>Scheduled Actions (Optional)</summary>
|
<summary>Scheduled Actions (Optional)</summary>
|
||||||
<fieldset>
|
<fieldset>
|
||||||
|
|
@ -47,6 +31,22 @@
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</details>
|
</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>
|
<button type="submit">Upload</button>
|
||||||
</form>
|
</form>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue