blechreiz-website/eventplanner/templates/eventplanner/event_update_form.html

142 lines
3.3 KiB
HTML

{% extends "website/base.html" %}
{% load sekizai_tags staticfiles %}
{% load crispy_forms_tags %}
{% block content %}
{{ form.media }}
<div class="container">
<div class="row">
<div class="span12">
<h3>Termin bearbeiten</h3>
{% crispy form %}
</div>
</div>
</div>
<!-- Datepicker -->
{% addtoblock "css" strip %}<link rel="stylesheet" href="{{STATIC_URL}}/css/datepicker.css" type="text/css" media="screen" /> {% endaddtoblock %}
{% addtoblock "css" strip %}<link rel="stylesheet" href="{{STATIC_URL}}/css/timepicker.css" type="text/css" media="screen" /> {% endaddtoblock %}
{% addtoblock "css" strip %}<link rel="stylesheet" href="{{STATIC_URL}}/css/jquery-ui-1.8.21.custom.css" type="text/css" media="screen" /> {% endaddtoblock %}
{% addtoblock "js" %}
<script src="{{STATIC_URL}}/js/bootstrap-timepicker.js"></script>
<script src="{{STATIC_URL}}/js/bootstrap-datepicker.js"></script>
<script src="{{STATIC_URL}}/js/bootstrap-datepicker.de.js"></script>
<script>
$(document).ready(function(){
$('.dateinput').datepicker({
format: "dd.mm.yyyy",
weekStart: 1,
todayBtn: "linked",
language: "de",
todayHighlight: true,
startDate: "{% now "SHORT_DATE_FORMAT" %}",
});
$('.timeinput').addClass('input-small').wrap('<div class="input-append bootstrap-timepicker">')
$(".input-append").append( '<span class="add-on"><i class="icon-time"></i></span>' )
$('.timeinput').timepicker({
minuteStep: 15,
showMeridian: false,
defaultTime: false
});
$('form').submit(function() {
if ( $("#id_type").val() != "Option" && $("#id_location").val().trim() == "" ) {
alert("Bitte Ort angeben");
return false;
}
else
return true;
});
function onTypeChange( val )
{
if ( val == "Reh") {
$("#div_id_time").show();
$("#div_id_meeting_time").hide();
$("#div_id_map_location").hide();
$("#div_id_end_date").hide();
$("#div_id_location").show();
if ( ! $("#id_time").val() ) {
$("#id_time").val("19:00");
}
if ( ! $("#id_location").val() ) {
$("#id_location").val("Rohr");
}
}
else if ( val == "Conc" ) {
$("#div_id_time").show();
$("#div_id_meeting_time").show();
$("#div_id_location").show();
$("#div_id_map_location").show();
$("#div_id_end_date").hide();
}
else if ( val == "Party") {
$("#div_id_time").show();
$("#div_id_meeting_time").hide();
$("#div_id_location").show();
$("#div_id_map_location").show();
$("#div_id_end_date").hide();
}
else if ( val == "Travel") {
$("#div_id_time").hide();
$("#div_id_meeting_time").hide();
$("#div_id_location").show();
$("#div_id_map_location").show();
$("#div_id_end_date").show();
}
else if ( val == "Option" ) {
$("#div_id_time").hide();
$("#div_id_meeting_time").hide();
$("#div_id_location").hide();
$("#div_id_map_location").hide();
$("#div_id_end_date").show();
}
else
{
$("#div_id_time").show();
$("#div_id_meeting_time").show();
$("#div_id_location").show();
$("#div_id_map_location").show();
$("#div_id_end_date").show();
}
}
$("#id_type").change( function() {
onTypeChange( $(this).val() );
} );
onTypeChange( $("#id_type").val() );
} );
</script>
{% endaddtoblock %}
{% endblock %}