calendar-webapp/views/createevent.dt

73 lines
2.1 KiB
Text
Raw Normal View History

2017-08-02 01:56:36 +02:00
extends layout
block content
2017-08-07 00:01:02 +02:00
- void showerror(string field = null)
- if (_error.msg && _error.field == field)
td.error= _error.msg
form(action="/createevent", method="post")
2017-08-07 00:01:02 +02:00
fieldset(name="eventFields")
2017-08-02 01:56:36 +02:00
table
tbody#fieldTable
tr
td
label(for="name") Ereignisname
2017-08-02 01:56:36 +02:00
td
input#name(value="", name="name", type="text")
2017-08-07 00:01:02 +02:00
- showerror("name");
2017-08-02 01:56:36 +02:00
tr
td
label(for="description") Beschreibung
2017-08-02 01:56:36 +02:00
td
textarea#description(value="", name="description", cols="40", rows="5")
2017-08-07 00:01:02 +02:00
- showerror("description");
2017-08-02 01:56:36 +02:00
tr
td
label(for="multiday") Mehrtägig
2017-08-02 01:56:36 +02:00
td
input#multiday(name="multiday", type="checkbox")
2017-08-02 01:56:36 +02:00
tr
td
label#beginLabel(for="begin") Datum
2017-08-02 01:56:36 +02:00
td
input#begin(value="", name="begin", type="date")
- showerror("begin");
2017-08-07 00:01:02 +02:00
- showerror("end");
tr
td
label(for="type") Typ
td
select#type(name="type")
option(value="Holiday") Feiertag
option(value="Birthday") Geburtstag
option(value="FSI_Event") FSI Ereignis
option(value="General_University_Event") Allgemeines Universitäts Ereignis
option(value="Any") Sonstiges
2017-08-07 00:01:02 +02:00
- showerror("type");
tr
td
label(for="shout") Shout
td
input#shout(name="shout", type="checkbox")
2017-08-07 00:01:02 +02:00
- showerror("shout");
2017-08-02 01:56:36 +02:00
tfoot
tr
td(colspan="2")
input#submitButton(type="submit", value="Ereignis erstellen")
2017-08-07 00:01:02 +02:00
- if (_error.msg && _error.field == "")
p.error= _error.msg
script(type="text/javascript").
document.getElementById('multiday').onclick = function() {
var table = document.getElementById("fieldTable");
var beginLabel = document.getElementById("beginLabel");
if ( this.checked ) {
var row = table.insertRow(4);
var cell1 = row.insertCell(0);
var cell2 = row.insertCell(1);
cell1.innerHTML = "<label for='end'>Bis</label>";
cell2.innerHTML = "<input id='end' value='' name='end' type='date'>";
beginLabel.innerHTML = "Von";
} else {
table.deleteRow(4);
beginLabel.innerHTML = "Datum";
}
};