Fix problème page messages

Fix #305
This commit is contained in:
Jean-Marie Favreau 2025-02-12 12:17:41 +01:00
parent 3acf73623b
commit b25ae9e354
3 changed files with 15 additions and 4 deletions

View File

@ -414,6 +414,9 @@ class MessagesFilterAdmin(django_filters.FilterSet):
model = Message
fields = ["closed", "spam", "message_type"]
def is_contact_messages(self):
return "message_type" in self.form.cleaned_data and "contact_form" in self.form.cleaned_data["message_type"]
class SimpleSearchEventFilter(django_filters.FilterSet):
q = django_filters.CharFilter(method="custom_filter",
@ -478,8 +481,6 @@ class SimpleSearchEventFilter(django_filters.FilterSet):
if not kwargs["request"].user.is_authenticated:
self.form.fields.pop("status")
def is_contact_messages(self):
return "message_type" in self.form.cleaned_data and "contact_form" in self.form.cleaned_data["message_type"]
class SearchEventFilter(django_filters.FilterSet):

View File

@ -641,6 +641,16 @@ header .remarque {
grid-column: 1/3;
}
}
.form.recent.messages {
div:nth-child(2) {
grid-column: 1/2;
}
div:nth-last-child(3) {
grid-column: 2/3;
grid-row: 1/3;
}
}
#search {
form {

View File

@ -65,9 +65,9 @@
</article>
{% if filter.is_contact_messages %}
{% include "agenda_culturel/side-nav.html" with current="messages" %}
{% else %}
{% include "agenda_culturel/side-nav.html" with current="contact_messages" %}
{% else %}
{% include "agenda_culturel/side-nav.html" with current="messages" %}
{% endif %}
</div>