Ajout d'une page à propos et d'un groupe éditeur contenu statique
This commit is contained in:
parent
5ba5732019
commit
4aed4889a7
29
src/agenda_culturel/migrations/0048_auto_20240417_1212.py
Normal file
29
src/agenda_culturel/migrations/0048_auto_20240417_1212.py
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
# Generated by Django 4.2.7 on 2024-04-17 10:12
|
||||||
|
|
||||||
|
from django.db import migrations
|
||||||
|
from django.contrib.auth.management import create_permissions
|
||||||
|
from django.contrib.auth.models import Group, Permission
|
||||||
|
|
||||||
|
def update_groups_permissions(apps, schema_editor):
|
||||||
|
# first add a missing role
|
||||||
|
user_roles = ["Static content editor"]
|
||||||
|
|
||||||
|
for name in user_roles:
|
||||||
|
Group.objects.create(name=name)
|
||||||
|
|
||||||
|
all_perms = Permission.objects.all()
|
||||||
|
|
||||||
|
# set permissions for moderators
|
||||||
|
editor_perms = [i for i in all_perms if i.content_type.app_label == 'agenda_culturel' and i.content_type.model in ['event', 'staticcontent']]
|
||||||
|
Group.objects.get(name="Static content editor").permissions.add(*editor_perms)
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('agenda_culturel', '0047_categorisationrule_loc_exact_and_more'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.RunPython(update_groups_permissions),
|
||||||
|
]
|
@ -45,6 +45,10 @@ $enable-responsive-typography: true;
|
|||||||
|
|
||||||
body>footer {
|
body>footer {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
font-size: 90%;
|
||||||
|
p {
|
||||||
|
font-size: 80%;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.cat,
|
.cat,
|
||||||
|
@ -78,6 +78,9 @@
|
|||||||
<div>
|
<div>
|
||||||
<a href="{% url 'mentions_legales' %}">Mentions légales</a>
|
<a href="{% url 'mentions_legales' %}">Mentions légales</a>
|
||||||
</div>
|
</div>
|
||||||
|
<div>
|
||||||
|
<a href="{% url 'about' %}">À propos</a>
|
||||||
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<a href="{% url 'contact' %}">Contact</a>
|
<a href="{% url 'contact' %}">Contact</a>
|
||||||
</div>
|
</div>
|
||||||
|
@ -35,6 +35,7 @@ urlpatterns = [
|
|||||||
path('rechercher', event_search, name='event_search'),
|
path('rechercher', event_search, name='event_search'),
|
||||||
path('rechercher/complet/', event_search_full, name='event_search_full'),
|
path('rechercher/complet/', event_search_full, name='event_search_full'),
|
||||||
path('mentions-legales', mentions_legales, name='mentions_legales'),
|
path('mentions-legales', mentions_legales, name='mentions_legales'),
|
||||||
|
path('a-propos', about, name='about'),
|
||||||
path('contact', ContactMessageCreateView.as_view(), name='contact'),
|
path('contact', ContactMessageCreateView.as_view(), name='contact'),
|
||||||
path('contactmessages', contactmessages, name='contactmessages'),
|
path('contactmessages', contactmessages, name='contactmessages'),
|
||||||
path('contactmessage/<int:pk>', ContactMessageUpdateView.as_view(), name='contactmessage'),
|
path('contactmessage/<int:pk>', ContactMessageUpdateView.as_view(), name='contactmessage'),
|
||||||
|
@ -141,10 +141,13 @@ class EventFilter(django_filters.FilterSet):
|
|||||||
|
|
||||||
|
|
||||||
def mentions_legales(request):
|
def mentions_legales(request):
|
||||||
|
|
||||||
context = { "title": "Mentions légales", "static_content": "mentions_legales", "url_path": reverse_lazy("mentions_legales") }
|
context = { "title": "Mentions légales", "static_content": "mentions_legales", "url_path": reverse_lazy("mentions_legales") }
|
||||||
return render(request, 'agenda_culturel/page-single.html', context)
|
return render(request, 'agenda_culturel/page-single.html', context)
|
||||||
|
|
||||||
|
def about(request):
|
||||||
|
context = { "title": "À propos", "static_content": "about", "url_path": reverse_lazy("about") }
|
||||||
|
return render(request, 'agenda_culturel/page-single.html', context)
|
||||||
|
|
||||||
|
|
||||||
def home(request):
|
def home(request):
|
||||||
return week_view(request, home=True)
|
return week_view(request, home=True)
|
||||||
|
Loading…
Reference in New Issue
Block a user