replace media, shared state, better category options

This commit is contained in:
Markos Gogoulos
2025-12-24 12:14:01 +02:00
committed by GitHub
parent 872571350f
commit fa67ffffb4
46 changed files with 383 additions and 35 deletions

View File

@@ -4,12 +4,16 @@
<style>
/* Form group styling */
.form-group {
margin-bottom: 1.5rem;
margin-bottom: 1rem;
padding: 1.25rem 1.25rem 0.75rem 1.25rem;
background: #f8f9fa;
border: 1px solid #e9ecef;
border-radius: 6px;
}
/* Control label container styling */
.control-label-container {
margin-bottom: 0.5rem;
margin-bottom: 0.75rem;
}
/* Label styling */
@@ -56,6 +60,24 @@
border-color: #1e7e34;
}
/* Better input field styling */
.controls input:not([type="checkbox"]):not([type="radio"]),
.controls select,
.controls textarea {
background: white;
border: 1px solid #ced4da;
border-radius: 4px;
padding: 0.5rem 0.75rem;
}
.controls input:not([type="checkbox"]):not([type="radio"]):focus,
.controls select:focus,
.controls textarea:focus {
outline: none;
border-color: #80bdff;
box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}
</style>
<div class="form-group{% if field.errors %} has-error{% endif %}">

View File

@@ -43,6 +43,14 @@
</li>
{% endcomment %}
{% endif %}
{% if ALLOW_MEDIA_REPLACEMENT %}
<li style="display: inline-block;">
<a href="{% url 'replace_media' %}?m={{media_object.friendly_token}}"
style="text-decoration: none; {% if active_tab == 'replace' %}font-weight: bold; color: #333; padding-bottom: 3px; border-bottom: 2px solid #333;{% else %}color: #666;{% endif %}">
{{ "Replace" | custom_translate:LANGUAGE_CODE}}
</a>
</li>
{% endif %}
<li style="display: inline-block;">
<a href="{% url 'publish_media' %}?m={{media_object.friendly_token}}"
style="text-decoration: none; {% if active_tab == 'publish' %}font-weight: bold; color: #333; padding-bottom: 3px; border-bottom: 2px solid #333;{% else %}color: #666;{% endif %}">

View File

@@ -0,0 +1,24 @@
{% extends "base.html" %}
{% load crispy_forms_tags %}
{% load static %}
{% block headtitle %}Replace media - {{PORTAL_NAME}}{% endblock headtitle %}
{% block headermeta %}{% endblock headermeta %}
{% block innercontent %}
<div class="user-action-form-wrap">
{% include "cms/media_nav.html" with active_tab="replace" %}
<div style="max-width: 900px; margin: 0 auto; padding: 20px; border-radius: 8px; box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);">
<div style="margin-bottom: 20px; padding: 15px; background-color: #fff3cd; border: 1px solid #ffc107; border-radius: 4px;">
<h4 style="margin-top: 0; color: #856404;">⚠️ Important Information</h4>
<p style="margin-bottom: 0; color: #856404;">The new file will be processed but all metadata is preserved</p>
</div>
{% csrf_token %}
{% crispy form %}
</div>
</div>
{% endblock innercontent %}