You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
87 lines
3.9 KiB
87 lines
3.9 KiB
{% extends "layout.html" %}
|
|
|
|
{% block title %}Edit Event - DotaNoobs {% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="uk-grid" data-uk-grid-margin>
|
|
<div class="uk-width-1-1">
|
|
{% if event.name == None %}
|
|
<h2 class="uk-float-left"><i class="uk-icon-calendar uk-icon-large"></i> New Event</h2>
|
|
{% else %}
|
|
<h2 class="uk-float-left"><i class="uk-icon-calendar uk-icon-large"></i> {{ event.name }}</h2>
|
|
{% endif %}
|
|
</div>
|
|
<!--Main content area -->
|
|
<div class="uk-width-large-2-3 uk-width-medium-1-1 uk-panel">
|
|
<form class="uk-form uk-form-width-large" action="" method="post" name="settings">
|
|
{{ form.hidden_tag() }}
|
|
<fieldset data-uk-margin>
|
|
<div class="uk-form-row">
|
|
<label class="uk-form-label">Event Name: </label><br/>
|
|
{{ form.name(placeholder="e.g. Tuesday Tango", class="uk-form-width-medium") }}
|
|
</div>
|
|
<div class="uk-form-row">
|
|
<label class="uk-form-label">Type: </label>
|
|
{{ form.type }}
|
|
</div>
|
|
<div class="uk-form-row">
|
|
<label class="uk-form-label">Points: </labeb>
|
|
{{ form.points(placeholder="e.g. 20") }}
|
|
</div>
|
|
<div class="uk-form-row">
|
|
<label class="uk-form-label">Time To Earn: </label>
|
|
{{ form.reward_threshold(placeholder="e.g. 30 (minutes)") }}
|
|
</div>
|
|
<br/>
|
|
<div class="uk-form-row">
|
|
<label class="uk-form-label">Starts</label><br/>
|
|
<input id="start_d" placeholder="01.01.2015" data-uk-datepicker />
|
|
<input id="start_t" placeholder="14:30" data-uk-timepicker />
|
|
{{ form.start_time(class="datepicker uk-hidden") }}
|
|
</div>
|
|
<div class="uk-form-row">
|
|
<label class="uk-form-label">Ends</label><br/>
|
|
<input id="end_d" placeholder="01.01.2015" data-uk-datepicker />
|
|
<input id="end_t" placeholder="09:30" data-uk-timepicker />
|
|
{{ form.end_time(class="datepicker uk-hidden") }}
|
|
</div>
|
|
<div class="uk-form-row">
|
|
<label class="uk-form-label">Description</label><br/>
|
|
{{ form.desc(rows="10", class="uk-width-1-1", placeholder="A brief description of the event your planning; convince people to come!") }}
|
|
</div>
|
|
<div class="uk-form-controls uk-margin-top">
|
|
<button class="uk-button uk-button-success" type="submit">Save</button>
|
|
<a class="uk-button" href="{{ url_for('user_profile', userid=g.user.id) }}">Cancel</a>
|
|
</div>
|
|
</fieldset>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|
|
|
|
{% block pagescripts %}
|
|
<script src="//cdnjs.cloudflare.com/ajax/libs/uikit/2.4.0/addons/datepicker/datepicker.min.js"></script>
|
|
<script src="//cdnjs.cloudflare.com/ajax/libs/uikit/2.4.0/addons/timepicker/timepicker.min.js"></script>
|
|
<link rel=stylesheet href="//cdnjs.cloudflare.com/ajax/libs/uikit/2.4.0/addons/datepicker/datepicker.gradient.css"></link>
|
|
<script>
|
|
$(document).ready(function(){
|
|
var s = $("#start_time").val().split(" ");
|
|
var e = $("#end_time").val().split(" ");
|
|
|
|
$("#start_d").val(s[0]);
|
|
$("#start_t").val(s[1]);
|
|
$("#end_d").val(e[0]);
|
|
$("#end_t").val(e[1]);
|
|
});
|
|
|
|
$(".uk-form").submit(function(event) {
|
|
var s = moment($("#start_d").val() + ' ' + $("#start_t").val(), "DD.MM.YYYY HH:mm");
|
|
var e = moment($("#end_d").val() + ' ' + $("#end_t").val(), "DD.MM.YYYY HH:mm");
|
|
|
|
$("#start_time").val(s.utc().format("DD.MM.YYYY HH:mm"));
|
|
$("#end_time").val(e.utc().format("DD.MM.YYYY HH:mm"));
|
|
|
|
return true;
|
|
});
|
|
</script>
|
|
{% endblock %}
|