mirror of
https://github.com/lucaspalomodevelop/eventcally.git
synced 2026-03-13 00:07:22 +00:00
168 lines
5.4 KiB
HTML
168 lines
5.4 KiB
HTML
{% extends "layout.html" %}
|
|
{% from "_macros.html" import render_jquery_steps_header, render_cropper_code, render_crop_image_form_section, render_radio_buttons, render_field_with_errors, render_field %}
|
|
{%- block title -%}
|
|
{{ _('Update event') }}
|
|
{%- endblock -%}
|
|
{% block header_before_site_js %}
|
|
{{ render_jquery_steps_header() }}
|
|
|
|
<script>
|
|
$( function() {
|
|
|
|
{{ render_cropper_code() }}
|
|
|
|
var form = $("#main-form");
|
|
form.validate({
|
|
rules: {
|
|
start: {
|
|
dateRange: ["#start", "#end"]
|
|
},
|
|
end: {
|
|
dateRangeDay: ["#start", "#end"]
|
|
}
|
|
}
|
|
});
|
|
|
|
// Organizer
|
|
var organizer_select =$('#organizer_id');
|
|
var input_group = organizer_select.parent();
|
|
input_group.append('<button type="button" id="organizer-edit-btn" class="btn btn-outline-secondary my-1"><i class="fa fa-edit"></i></button>');
|
|
input_group.append('<button type="button" id="organizer-add-btn" class="btn btn-outline-secondary m-1"><i class="fa fa-plus"></i></button>');
|
|
$('#organizer-edit-btn').click(function () {
|
|
window.open('/organizer/' + organizer_select.val() + '/update');
|
|
return false;
|
|
});
|
|
$('#organizer-add-btn').click(function () {
|
|
window.open('{{ url_for("manage_admin_unit_organizer_create", id=event.admin_unit_id) }}');
|
|
return false;
|
|
});
|
|
|
|
// Place
|
|
var place_select =$('#event_place_id');
|
|
var input_group = place_select.parent();
|
|
input_group.append('<button type="button" id="place-edit-btn" class="btn btn-outline-secondary my-1"><i class="fa fa-edit"></i></button>');
|
|
input_group.append('<button type="button" id="place-add-btn" class="btn btn-outline-secondary m-1"><i class="fa fa-plus"></i></button>');
|
|
$('#place-edit-btn').click(function () {
|
|
window.open('/event_place/' + place_select.val() + '/update');
|
|
return false;
|
|
});
|
|
$('#place-add-btn').click(function () {
|
|
window.open('{{ url_for("manage_admin_unit_places_create", id=event.admin_unit_id) }}');
|
|
return false;
|
|
});
|
|
});
|
|
</script>
|
|
{% endblock %}
|
|
{% block content %}
|
|
|
|
<h1>{{ _('Update event') }}</h1>
|
|
|
|
<form id="main-form" action="{{ url_for('event_update', event_id=event.id) }}" method="POST" enctype="multipart/form-data">
|
|
{{ form.hidden_tag() }}
|
|
|
|
<div class="card mb-4">
|
|
<div class="card-header">
|
|
{{ _('Event') }}
|
|
</div>
|
|
<div class="card-body">
|
|
{{ render_field_with_errors(form.name) }}
|
|
{{ render_field_with_errors(form.description) }}
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card mb-4">
|
|
<div class="card-header">
|
|
{{ _('Event date') }}
|
|
</div>
|
|
<div class="card-body">
|
|
{{ render_field_with_errors(form.start, **{"data-range-to":"#end", "data-range-max-days": "1"}) }}
|
|
{{ render_field_with_errors(form.end) }}
|
|
{{ render_field_with_errors(form.recurrence_rule, ri="rrule") }}
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card mb-4">
|
|
<div class="card-header">
|
|
{{ _('Status') }}
|
|
</div>
|
|
<div class="card-body">
|
|
{{ render_field_with_errors(form.status, class="autocomplete w-100") }}
|
|
{{ render_field_with_errors(form.previous_start_date) }}
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card mb-4">
|
|
<div class="card-header">
|
|
{{ _('Organizer') }}
|
|
</div>
|
|
<div class="card-body pb-0">
|
|
{{ render_field_with_errors(form.organizer_id, class="autocomplete w-100") }}
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card mb-4">
|
|
<div class="card-header">
|
|
{{ _('Place') }}
|
|
</div>
|
|
<div class="card-body pb-0">
|
|
{{ render_field_with_errors(form.event_place_id, class="autocomplete w-100") }}
|
|
</div>
|
|
</div>
|
|
|
|
{{ render_crop_image_form_section(form.photo) }}
|
|
|
|
<div class="card mb-4">
|
|
<div class="card-header">
|
|
{{ _('Access') }}
|
|
</div>
|
|
<div class="card-body">
|
|
{{ render_field_with_errors(form.accessible_for_free, ri="switch") }}
|
|
{{ render_field_with_errors(form.registration_required, ri="switch") }}
|
|
{{ render_field_with_errors(form.price_info) }}
|
|
{{ render_field_with_errors(form.ticket_link) }}
|
|
{{ render_field_with_errors(form.booked_up, ri="switch") }}
|
|
{{ render_field_with_errors(form.attendance_mode, class="autocomplete w-100") }}
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card mb-4">
|
|
<div class="card-header">
|
|
{{ _('Target group') }}
|
|
</div>
|
|
<div class="card-body">
|
|
{{ render_field_with_errors(form.target_group_origin, class="autocomplete w-100") }}
|
|
{{ render_field_with_errors(form.kid_friendly, ri="switch") }}
|
|
{{ render_field_with_errors(form.age_from) }}
|
|
{{ render_field_with_errors(form.age_to) }}
|
|
{{ render_field_with_errors(form.expected_participants) }}
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card mb-4">
|
|
<div class="card-header">
|
|
{{ _('Additional information') }}
|
|
</div>
|
|
<div class="card-body">
|
|
{{ render_field_with_errors(form.category_ids, class="autocomplete w-100") }}
|
|
{{ render_field_with_errors(form.tags) }}
|
|
{{ render_field_with_errors(form.external_link) }}
|
|
</div>
|
|
</div>
|
|
|
|
{% if form.rating.choices|length > 1 %}
|
|
<div class="card mb-4">
|
|
<div class="card-header">
|
|
{{ _('Rating') }}
|
|
</div>
|
|
<div class="card-body">
|
|
{{ render_field_with_errors(form.rating) }}
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
|
|
{{ render_field(form.submit) }}
|
|
|
|
</form>
|
|
|
|
{% endblock %}
|