mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-17 05:22:16 +00:00
Fix associated events being discarded on subhire edit
This commit is contained in:
@@ -48,7 +48,7 @@
|
||||
<h4>Event Items</h4>
|
||||
</div>
|
||||
{% include 'partials/item_table.html' %}
|
||||
{% if event.subhire_set %}
|
||||
{% if event.subhire_set.count > 0 %}
|
||||
<div class="card-body"><h4>Associated Subhires</h4></div>
|
||||
{% with event.subhire_set.all as events %}
|
||||
{% include 'partials/event_table.html' %}
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
<!---Details-->
|
||||
<td id="event_details" class="w-100">
|
||||
<h4>
|
||||
<a href="{% url 'event_detail' event.pk %}">
|
||||
<a href="{{event.get_absolute_url}}">
|
||||
{{ event.name }}
|
||||
</a>
|
||||
{% if event.venue %}
|
||||
|
||||
@@ -98,7 +98,13 @@
|
||||
<div class="card-header">Associated Event(s)</div>
|
||||
<div class="card-body">
|
||||
<div class="form-group">
|
||||
<select multiple name="events" id="events_id" class="selectpicker" data-live-search="true" data-sourceurl="{% url 'api_secure' model='event' %}"></select>
|
||||
<select multiple name="events" id="events_id" class="selectpicker" data-live-search="true" data-sourceurl="{% url 'api_secure' model='event' %}">
|
||||
{% if object.events.count > 0 %}
|
||||
{% for event in object.events.all %}
|
||||
<option value="{{event.id}}" selected>{{ event }}</option>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user