mirror of
https://github.com/lucaspalomodevelop/eventcally.git
synced 2026-03-13 00:07:22 +00:00
288 lines
10 KiB
HTML
288 lines
10 KiB
HTML
{% extends "layout.html" %}
|
|
{% from "_macros.html" import render_widget_styles, render_logo, render_cropper_code, render_crop_image_form, render_jquery_steps_header, render_cropper_header, render_radio_buttons, render_datepicker_js, render_field_with_errors, render_field %}
|
|
{%- block title -%}
|
|
{{ _('Create event suggestion') }}
|
|
{%- endblock -%}
|
|
{% block styles %}
|
|
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='jquery-steps.css')}}" />
|
|
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='widget.css')}}" />
|
|
{{ render_widget_styles(styles) }}
|
|
{% endblock %}
|
|
{% block navbar %}
|
|
{% endblock %}
|
|
{% block header_before_site_js %}
|
|
{{ render_jquery_steps_header() }}
|
|
{{ render_cropper_header() }}
|
|
<script>
|
|
|
|
function stripHTML(dirty) {
|
|
return $("<div/>").html(dirty).text();
|
|
}
|
|
|
|
function update_preview(form) {
|
|
handle_request_start();
|
|
|
|
var container = $("#preview_container");
|
|
container.empty();
|
|
|
|
var req_data = form.serialize();
|
|
$.ajax({
|
|
url: "{{ url_for('event_suggestion_create_for_admin_unit', au_short_name=admin_unit.short_name) }}?preview=true",
|
|
type: "post",
|
|
data: req_data,
|
|
error: function(xhr, status, error) {
|
|
handle_request_error(xhr, status, error);
|
|
},
|
|
success: function (content) {
|
|
container.append(content);
|
|
handle_request_success();
|
|
}
|
|
});
|
|
}
|
|
|
|
$( function() {
|
|
var form = $("#wizard-form");
|
|
var wizard = $("#wizard");
|
|
|
|
form.validate({
|
|
errorElement: 'div',
|
|
errorClass: 'invalid-feedback',
|
|
errorPlacement: function (error, element) {
|
|
element.closest('.input-group').append(error);
|
|
},
|
|
highlight: function (element, errorClass, validClass) {
|
|
$(element).addClass('is-invalid');
|
|
},
|
|
unhighlight: function (element, errorClass, validClass) {
|
|
$(element).removeClass('is-invalid');
|
|
},
|
|
rules: {
|
|
contact_email: {
|
|
require_from_group: [1, ".contact_method_group"]
|
|
},
|
|
contact_phone: {
|
|
require_from_group: [1, ".contact_method_group"]
|
|
}
|
|
}
|
|
});
|
|
|
|
wizard.steps({
|
|
headerTag: "h4",
|
|
bodyTag: "section",
|
|
transitionEffect: "fade",
|
|
enablePagination: false,
|
|
onStepChanging: function (event, currentIndex, newIndex) {
|
|
// Allways allow previous action even if the current form is not valid!
|
|
if (currentIndex > newIndex) {
|
|
return true;
|
|
}
|
|
|
|
//form.validate().settings.ignore = ":disabled,:hidden:not(.datepicker)";
|
|
form.validate().settings.ignore = ":disabled,:hidden";
|
|
var is_valid = form.valid();
|
|
|
|
if (is_valid && (newIndex == 6)) {
|
|
update_preview(form);
|
|
}
|
|
|
|
return is_valid;
|
|
}
|
|
});
|
|
|
|
$('.wizard-next').click(function(){
|
|
wizard.steps('next');
|
|
});
|
|
|
|
$('.wizard-prev').click(function(){
|
|
wizard.steps('previous');
|
|
});
|
|
|
|
{{ render_cropper_code() }}
|
|
|
|
});
|
|
</script>
|
|
{% endblock %}
|
|
{% block content %}
|
|
<div class="w-normal">
|
|
|
|
<h1>{{ _('Create event suggestion') }}</h1>
|
|
|
|
<form id="wizard-form" action="" method="POST" enctype="multipart/form-data">
|
|
<div id="wizard">
|
|
{{ form.hidden_tag() }}
|
|
|
|
<h4></h4>
|
|
<section>
|
|
<div class="card mb-4">
|
|
<div class="card-body">
|
|
{% if admin_unit.logo_id %}
|
|
<div class="mb-4 text-center"><img src="{{ url_for_image(admin_unit.logo, s=100) }}" class="img-fluid" style="max-height:10vmin;" /></div>
|
|
{% endif %}
|
|
<p class="card-text">
|
|
Hier kannst du als Gast eine Veranstaltung vorschlagen, die anschließend durch <strong>{{ admin_unit.name }}</strong> geprüft wird.
|
|
Für mehr Optionen und einen eigenen Veranstaltungskalender, kannst du dich <a href="{{ url_for('security.register') }}">kostenlos registrieren</a>.
|
|
</p>
|
|
<div class="text-center">
|
|
<a class="btn btn-primary my-1 wizard-next" href="#" role="button">{{ _('Continue as guest') }}</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<h4></h4>
|
|
<section>
|
|
<div class="card mb-4">
|
|
<div class="card-header">
|
|
Nutzungsbedingungen
|
|
</div>
|
|
<div class="card-body">
|
|
<p class="card-text">
|
|
Die offene Veranstaltungsdatenbank stellt allen Nutzern Daten sowohl für private als auch kommerzielle Zwecke frei nutzbar zur Verfügung.
|
|
</p>
|
|
{{ render_field_with_errors(form.accept_tos, ri="checkbox") }}
|
|
<div class="d-flex justify-content-between">
|
|
<a class="btn btn-secondary my-1 wizard-prev" href="#" role="button">{{ _('Previous') }}</a>
|
|
<a class="btn btn-primary my-1 wizard-next" href="#" role="button">{{ _('Next') }}</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<h4></h4>
|
|
<section>
|
|
<div class="card mb-4">
|
|
<div class="card-header">
|
|
{{ _('Contact') }}
|
|
</div>
|
|
<div class="card-body">
|
|
<p class="card-text">
|
|
<i class="fa fa-lock"></i> Deine Kontaktdaten werden für etwaige Rückfragen bei der Prüfung durch <strong>{{ admin_unit.name }}</strong> verwendet.
|
|
Die Daten sind nur für die Prüfer:innen sichtbar und werden nicht öffentlich angezeigt.
|
|
</p>
|
|
|
|
{{ render_field_with_errors(form.contact_name) }}
|
|
{{ render_field_with_errors(form.contact_email, class="contact_method_group") }}
|
|
{{ render_field_with_errors(form.contact_phone, class="contact_method_group") }}
|
|
{{ render_field_with_errors(form.contact_email_notice, ri="checkbox") }}
|
|
|
|
<div class="d-flex justify-content-between">
|
|
<a class="btn btn-secondary my-1 wizard-prev" href="#" role="button">{{ _('Previous') }}</a>
|
|
<a class="btn btn-primary my-1 wizard-next" href="#" role="button">{{ _('Next') }}</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<h4></h4>
|
|
<section>
|
|
<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.event_place_id, class="autocomplete-tags w-100") }}
|
|
{{ render_field_with_errors(form.organizer_id, class="autocomplete-tags w-100") }}
|
|
{{ render_field_with_errors(form.start) }}
|
|
{{ render_field_with_errors(form.end) }}
|
|
{{ render_field_with_errors(form.recurrence_rule, ri="rrule") }}
|
|
|
|
<div class="d-flex justify-content-between">
|
|
<a class="btn btn-secondary my-1 wizard-prev" href="#" role="button">{{ _('Previous') }}</a>
|
|
<a class="btn btn-primary my-1 wizard-next" href="#" role="button">{{ _('Next') }}</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<h4></h4>
|
|
<section>
|
|
<div class="card mb-4">
|
|
<div class="card-header">
|
|
{{ _('Photo') }}
|
|
</div>
|
|
<div class="card-body">
|
|
{% if form.photo.description %}
|
|
<p class="card-text">
|
|
{{ form.photo.description }}
|
|
</p>
|
|
{% endif %}
|
|
|
|
{{ render_crop_image_form(form.photo) }}
|
|
|
|
<div class="d-flex justify-content-between mt-3">
|
|
<a class="btn btn-secondary my-1 wizard-prev" href="#" role="button">{{ _('Previous') }}</a>
|
|
<a class="btn btn-primary my-1 wizard-next" href="#" role="button">{{ _('Next') }}</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<h4></h4>
|
|
<section>
|
|
<div class="card mb-4">
|
|
<div class="card-header">
|
|
{{ _('Optional details') }}
|
|
</div>
|
|
<div class="card-body">
|
|
{{ render_field_with_errors(form.description) }}
|
|
<hr />
|
|
{{ render_field_with_errors(form.accessible_for_free, style="width: fit-content; flex: initial;") }}
|
|
{{ render_field_with_errors(form.registration_required, style="width: fit-content; flex: initial;") }}
|
|
{{ render_field_with_errors(form.price_info) }}
|
|
{{ render_field_with_errors(form.ticket_link) }}
|
|
{{ render_field_with_errors(form.booked_up, style="width: fit-content; flex: initial;") }}
|
|
{{ render_field_with_errors(form.attendance_mode, class="autocomplete w-100") }}
|
|
<hr />
|
|
{{ render_field_with_errors(form.target_group_origin, class="autocomplete w-100") }}
|
|
{{ render_field_with_errors(form.kid_friendly, style="width: fit-content; flex: initial;") }}
|
|
{{ render_field_with_errors(form.age_from) }}
|
|
{{ render_field_with_errors(form.age_to) }}
|
|
{{ render_field_with_errors(form.expected_participants) }}
|
|
<hr />
|
|
{{ 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 class="d-flex justify-content-between">
|
|
<a class="btn btn-secondary my-1 wizard-prev" href="#" role="button">{{ _('Previous') }}</a>
|
|
<a class="btn btn-primary my-1 wizard-next" href="#" role="button">{{ _('Next') }}</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<h4></h4>
|
|
<section>
|
|
<div class="card mb-4">
|
|
<div class="card-header">
|
|
{{ _('Preview') }}
|
|
</div>
|
|
<div class="card-body">
|
|
<p class="card-text">
|
|
Bitte prüfe deine Eingaben in der Vorschau. Wenn alles passt, klicke auf den Button <span class="d-inline-block">"{{ form.submit.label() }}".
|
|
</p>
|
|
<div class="card mb-4 shadow">
|
|
<div class="card-body">
|
|
<div id="result_container">
|
|
<div id="preview_container"></div>
|
|
</div>
|
|
<div class="spinner-border m-3" role="status" id="spinner" style="display: none;">
|
|
<span class="sr-only">Loading…</span>
|
|
</div>
|
|
<div class="alert alert-danger m-3" role="alert" id="error_alert" style="display: none;"></div>
|
|
</div>
|
|
</div>
|
|
<div class="d-flex flex-wrap justify-content-between align-items-baseline mt-3">
|
|
<a class="btn btn-secondary my-1 wizard-prev" href="#" role="button">{{ _('Previous') }}</a>
|
|
{{ render_field(form.submit) }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
</div>
|
|
</form>
|
|
|
|
</div>
|
|
{% endblock %}
|