parent
a3b20bc3f6
commit
0d4d6b5e9b
@ -885,6 +885,9 @@ class EventAddPlaceForm(Form):
|
|||||||
).format(self.instance.location)
|
).format(self.instance.location)
|
||||||
else:
|
else:
|
||||||
self.fields.pop("add_alias")
|
self.fields.pop("add_alias")
|
||||||
|
if self.instance.exact_location:
|
||||||
|
self.fields["place"].initial = self.instance.exact_location
|
||||||
|
self.fields["add_alias"].initial = False
|
||||||
|
|
||||||
def modified_event(self):
|
def modified_event(self):
|
||||||
return self.cleaned_data.get("place")
|
return self.cleaned_data.get("place")
|
||||||
|
@ -1,7 +1,14 @@
|
|||||||
{% extends "agenda_culturel/page.html" %}
|
{% extends "agenda_culturel/page.html" %}
|
||||||
{% load static %}
|
{% load static %}
|
||||||
{% block title %}
|
{% block title %}
|
||||||
{% block og_title %}Ajouter un lieu à {{ object.title }}{% endblock %}
|
{% block og_title %}
|
||||||
|
{% if object.exact_location %}
|
||||||
|
Modifier le lieu de
|
||||||
|
{% else %}
|
||||||
|
Ajouter un lieu à
|
||||||
|
{% endif %}
|
||||||
|
{{ object.title }}
|
||||||
|
{% endblock %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% load cat_extra %}
|
{% load cat_extra %}
|
||||||
{% block entete_header %}
|
{% block entete_header %}
|
||||||
@ -26,7 +33,14 @@
|
|||||||
{% load static_content_extra %}
|
{% load static_content_extra %}
|
||||||
<article>
|
<article>
|
||||||
<header>
|
<header>
|
||||||
<h1>Ajouter un lieu à {{ object.title }} ({{ object.start_day }})</h1>
|
<h1>
|
||||||
|
{% if object.exact_location %}
|
||||||
|
Modifier le lieu de
|
||||||
|
{% else %}
|
||||||
|
Ajouter un lieu à
|
||||||
|
{% endif %}
|
||||||
|
{{ object.title }} ({{ object.start_day }})
|
||||||
|
</h1>
|
||||||
</header>
|
</header>
|
||||||
<p>
|
<p>
|
||||||
Si le lieu est disponible dans la liste déroulante, sélectionne-le. S'il n'est pas disponible, utilise
|
Si le lieu est disponible dans la liste déroulante, sélectionne-le. S'il n'est pas disponible, utilise
|
@ -168,7 +168,7 @@
|
|||||||
{{ event.exact_location.name }}, {{ event.exact_location.city }}
|
{{ event.exact_location.name }}, {{ event.exact_location.city }}
|
||||||
{% else %}
|
{% else %}
|
||||||
{% if perms.agenda_culturel.change_event and perms.agenda_culturel.change_place %}
|
{% if perms.agenda_culturel.change_event and perms.agenda_culturel.change_place %}
|
||||||
<a href="{% url 'add_place_to_event' event.pk %}" class="missing-data">{{ event.location }}</a>
|
<a href="{% url 'set_place_to_event' event.pk %}" class="missing-data">{{ event.location }}</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ event.location }}
|
{{ event.location }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -40,7 +40,7 @@
|
|||||||
<a href="{{ event.exact_location.get_absolute_url }}">{{ event.exact_location.name }}, {{ event.exact_location.city }}</a>
|
<a href="{{ event.exact_location.get_absolute_url }}">{{ event.exact_location.name }}, {{ event.exact_location.city }}</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
{% if perms.agenda_culturel.change_event and perms.agenda_culturel.change_place %}
|
{% if perms.agenda_culturel.change_event and perms.agenda_culturel.change_place %}
|
||||||
<a href="{% url 'add_place_to_event' event.pk %}" class="missing-data">{{ event.location }}</a>
|
<a href="{% url 'set_place_to_event' event.pk %}" class="missing-data">{{ event.location }}</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ event.location }}
|
{{ event.location }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -50,7 +50,7 @@
|
|||||||
<a href="{{ event.exact_location.get_absolute_url }}">{{ event.exact_location.name }}, {{ event.exact_location.city }}</a>
|
<a href="{{ event.exact_location.get_absolute_url }}">{{ event.exact_location.name }}, {{ event.exact_location.city }}</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
{% if perms.agenda_culturel.change_event and perms.agenda_culturel.change_place %}
|
{% if perms.agenda_culturel.change_event and perms.agenda_culturel.change_place %}
|
||||||
<a href="{% url 'add_place_to_event' event.pk %}" class="missing-data">{{ event.location }}</a>
|
<a href="{% url 'set_place_to_event' event.pk %}" class="missing-data">{{ event.location }}</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ event.location }}
|
{{ event.location }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<header>
|
<header>
|
||||||
<div class="slide-buttons">
|
<div class="slide-buttons">
|
||||||
<div class="buttons">
|
<div class="buttons">
|
||||||
<a href="{% url 'add_place_to_event' event.pk %}" role="button">Ajouter le lieu {% picto_from_name "map-pin" %}</a>
|
<a href="{% url 'set_place_to_event' event.pk %}" role="button">Ajouter le lieu {% picto_from_name "map-pin" %}</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<h3>
|
<h3>
|
||||||
@ -20,7 +20,7 @@
|
|||||||
<a href="{{ event.exact_location.get_absolute_url }}">{{ event.exact_location.name }}, {{ event.exact_location.city }}</a>
|
<a href="{{ event.exact_location.get_absolute_url }}">{{ event.exact_location.name }}, {{ event.exact_location.city }}</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
{% if perms.agenda_culturel.change_event and perms.agenda_culturel.change_place %}
|
{% if perms.agenda_culturel.change_event and perms.agenda_culturel.change_place %}
|
||||||
<a href="{% url 'add_place_to_event' event.pk %}" class="missing-data">{{ event.location }}</a>
|
<a href="{% url 'set_place_to_event' event.pk %}" class="missing-data">{{ event.location }}</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ event.location }}
|
{{ event.location }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -87,12 +87,15 @@
|
|||||||
<p>
|
<p>
|
||||||
{% picto_from_name "map-pin" %}
|
{% picto_from_name "map-pin" %}
|
||||||
<a href="{{ event.exact_location.get_absolute_url }}">{{ event.exact_location.name }}, {{ event.exact_location.city }}</a>
|
<a href="{{ event.exact_location.get_absolute_url }}">{{ event.exact_location.name }}, {{ event.exact_location.city }}</a>
|
||||||
|
{% if user.is_authenticated %}
|
||||||
|
(<a href="{% url 'set_place_to_event' event.pk %}">modifier</a>)
|
||||||
|
{% endif %}
|
||||||
</p>
|
</p>
|
||||||
{% else %}
|
{% else %}
|
||||||
{% if perms.agenda_culturel.change_event and perms.agenda_culturel.change_place %}
|
{% if perms.agenda_culturel.change_event and perms.agenda_culturel.change_place %}
|
||||||
<p>
|
<p>
|
||||||
{% picto_from_name "map-pin" %}
|
{% picto_from_name "map-pin" %}
|
||||||
<a href="{% url 'add_place_to_event' event.pk %}" class="missing-data">
|
<a href="{% url 'set_place_to_event' event.pk %}" class="missing-data">
|
||||||
{% if event.location %}
|
{% if event.location %}
|
||||||
{{ event.location }}
|
{{ event.location }}
|
||||||
{% else %}
|
{% else %}
|
||||||
|
@ -473,9 +473,9 @@ urlpatterns = [
|
|||||||
path("places/", PlaceListView.as_view(), name="view_places"),
|
path("places/", PlaceListView.as_view(), name="view_places"),
|
||||||
path("place/<int:pk>/edit", PlaceUpdateView.as_view(), name="edit_place"),
|
path("place/<int:pk>/edit", PlaceUpdateView.as_view(), name="edit_place"),
|
||||||
path(
|
path(
|
||||||
"event/<int:pk>/addplace",
|
"event/<int:pk>/setplace",
|
||||||
UnknownPlaceAddView.as_view(),
|
UnknownPlaceAddView.as_view(),
|
||||||
name="add_place_to_event",
|
name="set_place_to_event",
|
||||||
),
|
),
|
||||||
path(
|
path(
|
||||||
"events/unknown-places",
|
"events/unknown-places",
|
||||||
|
@ -181,7 +181,7 @@ class UnknownPlaceAddView(PermissionRequiredMixin, SuccessMessageMixin, UpdateVi
|
|||||||
"agenda_culturel.change_event",
|
"agenda_culturel.change_event",
|
||||||
)
|
)
|
||||||
form_class = EventAddPlaceForm
|
form_class = EventAddPlaceForm
|
||||||
template_name = "agenda_culturel/place_unknown_form.html"
|
template_name = "agenda_culturel/event_set_place_form.html"
|
||||||
|
|
||||||
def form_valid(self, form):
|
def form_valid(self, form):
|
||||||
self.modified_event = form.cleaned_data.get("place")
|
self.modified_event = form.cleaned_data.get("place")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user