HTML in Templates verbessert
This commit is contained in:
parent
4f5dc053a0
commit
e1c5ccab3a
12 changed files with 70 additions and 48 deletions
|
@ -13,6 +13,7 @@ var Templates, _ = template.Must(template.ParseFiles(
|
|||
"templates/executeFailure.html",
|
||||
"templates/executeSuccess.html",
|
||||
"templates/footer.html",
|
||||
"templates/head.html",
|
||||
"templates/index.html",
|
||||
"templates/officeHourTable.html",
|
||||
"templates/requestNotFound.html")).
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
<html>
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<title>Sprechstunde anlegen</title>
|
||||
{{template "head.html" .}}
|
||||
</head>
|
||||
<body>
|
||||
Irgendetwas ist schief gegangen. Bitte sende folgende Daten an <a href="mailto:sprechstundentool@mathebau.de">sprechstundentool@mathebau.de</a> mit einer Beschreibung, was du tun wolltest.
|
||||
|
|
|
@ -1,49 +1,49 @@
|
|||
<html>
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<title>Sprechstunde anlegen</title>
|
||||
{{template "head.html" .}}
|
||||
</head>
|
||||
<body>
|
||||
<p>
|
||||
{{range .Errors}}{{.}}<br />{{end}}
|
||||
</p>
|
||||
<p>
|
||||
<form method="POST" action="addOfficeHour">
|
||||
<label for="veranstaltung">Veranstaltung</label>:
|
||||
<select name="veranstaltung">{{range $course := .Courses}}
|
||||
<option value="{{$course.Id}}"{{if eq $course.Id $.SelectedCourse}} selected{{end}}>{{$course.Name}}</option>{{end}}
|
||||
</select><br />
|
||||
<label for="woche">Woche</label>:
|
||||
<select name="woche">
|
||||
<option value="0"{{if eq 0 $.Date.Week}} selected{{end}}>Jede</option>
|
||||
<option value="1"{{if eq 1 $.Date.Week}} selected{{end}}>Gerade</option>
|
||||
<option value="2"{{if eq 2 $.Date.Week}} selected{{end}}>Ungerade</option>
|
||||
</select><br />
|
||||
<label for="tag">Tag</label>: <select name="tag">
|
||||
<option value="0"{{if eq 0 $.Date.Day}} selected{{end}}>Montag</option>
|
||||
<option value="1"{{if eq 1 $.Date.Day}} selected{{end}}>Dienstag</option>
|
||||
<option value="2"{{if eq 2 $.Date.Day}} selected{{end}}>Mittwoch</option>
|
||||
<option value="3"{{if eq 3 $.Date.Day}} selected{{end}}>Donnerstag</option>
|
||||
<option value="4"{{if eq 4 $.Date.Day}} selected{{end}}>Freitag</option>
|
||||
</select><br />
|
||||
<label for="startzeit">Startzeit</label>: <input type="time" name="startzeit" min="08:00" max="17:30" {{if gt $.Date.Hour 7}}value="{{printf "%02d" $.Date.Hour}}:{{printf "%02d" $.Date.Minute}}"{{end}} required/><br />
|
||||
<label for="dauer">Dauer in Minuten</label>: <input name="dauer" type="number" min="{{.MinuteGranularity}}" max="120" step="{{.MinuteGranularity}}" value="{{.Duration}}" required/><br />
|
||||
<label for="raum">Raum</label>:
|
||||
<select name="raum">{{range $room := .Rooms}}
|
||||
<option value="{{$room.Id}}"{{if eq $room.Id $.SelectedRoom}} selected{{end}}>{{$room.Name}}</option>{{end}}
|
||||
</select><br />
|
||||
<label for="raumname">Raumname (für Sonderräume)</label>: <input type="text" name="raumname" value="{{.Roomname}}"/><br />
|
||||
<label for="name">Name</label>: <input name="name" type="text" size="50" value="{{.Name}}" required/><br />
|
||||
<label for="email">Email-Adresse</label>:
|
||||
<input name="email" type="email" size="50" value="{{.Email}}" required/><br />
|
||||
<label for="info">Info</label>: <input name="info" type="text" size="50" value="{{.Info}}"/><br />
|
||||
<input type="submit">
|
||||
</form>
|
||||
</p>
|
||||
<form method="POST" action="addOfficeHour">
|
||||
<label for="veranstaltung">Veranstaltung</label>:
|
||||
<select name="veranstaltung" id="veranstaltung">{{range $course := .Courses}}
|
||||
<option value="{{$course.Id}}"{{if eq $course.Id $.SelectedCourse}} selected{{end}}>{{$course.Name}}</option>{{end}}
|
||||
</select><br />
|
||||
<label for="woche">Woche</label>:
|
||||
<select name="woche" id="woche">
|
||||
<option value="0"{{if eq 0 $.Date.Week}} selected{{end}}>Jede</option>
|
||||
<option value="1"{{if eq 1 $.Date.Week}} selected{{end}}>Ungerade</option>
|
||||
<option value="2"{{if eq 2 $.Date.Week}} selected{{end}}>Gerade</option>
|
||||
</select><br />
|
||||
<label for="tag">Tag</label>: <select name="tag" id="tag">
|
||||
<option value="0"{{if eq 0 $.Date.Day}} selected{{end}}>Montag</option>
|
||||
<option value="1"{{if eq 1 $.Date.Day}} selected{{end}}>Dienstag</option>
|
||||
<option value="2"{{if eq 2 $.Date.Day}} selected{{end}}>Mittwoch</option>
|
||||
<option value="3"{{if eq 3 $.Date.Day}} selected{{end}}>Donnerstag</option>
|
||||
<option value="4"{{if eq 4 $.Date.Day}} selected{{end}}>Freitag</option>
|
||||
</select><br />
|
||||
<label for="startzeit">Startzeit</label>: <input type="time" name="startzeit" id="startzeit" min="08:00" max="17:30" {{if gt $.Date.Hour 7}}value="{{printf "%02d" $.Date.Hour}}:{{printf "%02d" $.Date.Minute}}"{{end}} required/><br />
|
||||
<label for="dauer">Dauer in Minuten</label>: <input name="dauer" id="dauer" type="number" min="{{.MinuteGranularity}}" max="120" step="{{.MinuteGranularity}}" value="{{.Duration}}" required/><br />
|
||||
<label for="raum">Raum</label>:
|
||||
<select name="raum" id="raum">{{range $room := .Rooms}}
|
||||
<option value="{{$room.Id}}"{{if eq $room.Id $.SelectedRoom}} selected{{end}}>{{$room.Name}}</option>{{end}}
|
||||
</select><br />
|
||||
<label for="raumname">Raumname (für Sonderräume)</label>: <input type="text" name="raumname" id="raumname" value="{{.Roomname}}"/><br />
|
||||
<label for="name">Name</label>: <input name="name" id="name" type="text" size="50" value="{{.Name}}" required/><br />
|
||||
<label for="email">Email-Adresse</label>:
|
||||
<input name="email" id="email" type="email" size="50" value="{{.Email}}" required/><br />
|
||||
<label for="info">Info</label>: <input name="info" id="info" type="text" size="50" value="{{.Info}}"/><br />
|
||||
<input type="submit">
|
||||
</form>
|
||||
{{if ne .Config.Tutor.MailSuffix ""}}Du musst hier eine Email-Adresse angeben, die auf „{{.Config.Tutor.MailSuffix}}“ endet.<br />{{end}}
|
||||
Außerdem dürfen in Räumen nur begrenzt viele Sprechstunden gleichzeitig stattfinden, nämlich
|
||||
<dl>
|
||||
{{range $room := .Rooms}}
|
||||
<dt>{{$room.Name}}</dt><dl>{{$room.MaxOccupy}} Sprechstunde{{if gt $room.MaxOccupy 1}}n{{end}}</dl><br />{{end}}
|
||||
<dt>{{$room.Name}}</dt><dd>{{$room.MaxOccupy}} Sprechstunde{{if gt $room.MaxOccupy 1}}n{{end}}</dd>{{end}}
|
||||
</dl>
|
||||
{{template "footer.html" .}}
|
||||
</body>
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
<html>
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<title>Sprechstunde anlegen</title>
|
||||
{{template "head.html" .}}
|
||||
</head>
|
||||
<body>
|
||||
Die Sprechstunde wurde angelegt. Du solltest eine Mail mit einem Aktivierungslink erhalten haben.
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
<html>
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<title>Sprechstunde löschen</title>
|
||||
{{template "head.html" .}}
|
||||
</head>
|
||||
<body>
|
||||
Du solltest eine Mail mit einem Bestätigungslink erhalten haben.
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
<html>
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<title>Anfrage ausführen fehlgeschlagen</title>
|
||||
{{template "head.html" .}}
|
||||
</head>
|
||||
<body>
|
||||
Irgendetwas ist schief gegangen. Bitte sende folgende Daten an <a href="mailto:sprechstundentool@mathebau.de">sprechstundentool@mathebau.de</a> mit einer Beschreibung, was du tun wolltest.
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
<html>
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<title>Anfrage ausgeführt</title>
|
||||
{{template "head.html" .}}
|
||||
</head>
|
||||
<body>
|
||||
Deine Anfrage wurde ausgeführt.
|
||||
Deine Anfrage wurde ausgeführt. <br />
|
||||
{{template "footer.html" .}}
|
||||
</body>
|
||||
</html>
|
|
@ -1,4 +1,5 @@
|
|||
<footer>
|
||||
<a href="/">Startseite</a><br />
|
||||
<a href="/addOfficeHour">Sprechstunde anlegen</a><br />
|
||||
<a href="/deleteOfficeHour">Sprechstunde löschen</a><br />
|
||||
Technische Fragen an <a href="mailto:sprechstundentool@mathebau.de">sprechstundentool@mathebau.de</a>
|
||||
|
|
4
templates/head.html
Normal file
4
templates/head.html
Normal file
|
@ -0,0 +1,4 @@
|
|||
<meta charset="UTF-8">
|
||||
<meta name="keywords" content="Mathebau, Sprechstunde, Sprechstunden, Mathe, Mathematik, technische, Universität, Darmstadt, TU, Fachschaft">
|
||||
<meta name="description" content="Eine Übersicht der Sprechstunden, die in den offenen Arbeitsräumen der Fachschaft Mathematik, TU Darmstadt, angeboten werden">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
@ -1,11 +1,13 @@
|
|||
<html>
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<title>Sprechstunden</title>
|
||||
{{template "head.html" .}}
|
||||
</head>
|
||||
<body>
|
||||
<form method="GET" action="/getByCourse">
|
||||
<label for="veranstaltung">Veranstaltung: </label>
|
||||
<select name="veranstaltung" size="1" onchange="document.forms[0].submit()">
|
||||
<select name="veranstaltung" id="veranstaltung" size="1" onchange="document.forms[0].submit()">
|
||||
<option value="">Alle</option>
|
||||
{{range $course := .Courses}}
|
||||
<option value="{{$course.Id}}"{{if eq $course.Id $.SelectedCourse}} selected{{end}}>{{$course.Name}}</option>{{end}}
|
||||
|
@ -14,7 +16,7 @@
|
|||
</form>
|
||||
<form method="GET" action="/getByRoom">
|
||||
<label for="raum">Raum: </label>
|
||||
<select name="raum" size="1" onchange="document.forms[1].submit()">
|
||||
<select name="raum" id="raum" size="1" onchange="document.forms[1].submit()">
|
||||
<option value="">Alle</option>
|
||||
{{range $room := .Rooms}}
|
||||
<option value="{{$room.Id}}"{{if eq $room.Id $.SelectedRoom}} selected{{end}}>{{$room.Name}}</option>{{end}}
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
<html>
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<title>Anfrage bestätigen fehlgeschlagen</title>
|
||||
{{template "head.html" .}}
|
||||
</head>
|
||||
<body>
|
||||
<p>
|
||||
|
@ -8,7 +10,7 @@
|
|||
Bitte gib deinen Bestätigungscode hier ein.
|
||||
</p>
|
||||
<form action="/confirmRequest">
|
||||
<label for="code">Bestätigungscode</label>: <input type="text" name="code"/>
|
||||
<label for="code">Bestätigungscode</label>: <input type="text" name="code" id="code"/>
|
||||
<input type="submit" />
|
||||
</form>
|
||||
{{template "footer.html" .}}
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
<td rowspan="{{divide .OfficeHour.Duration .MinuteGranularity}}" style="border: 1px solid">
|
||||
{{if .DeleteIcons}}<div style="text-align: right;"><a href="/deleteOfficeHour?id={{.OfficeHour.Id}}">❌</a></div>{{end}}
|
||||
{{printf "%02d" .OfficeHour.Date.Hour}}:{{printf "%02d" .OfficeHour.Date.Minute}} - {{printf "%02d" .OfficeHour.EndDate.Hour}}:{{printf "%02d" .OfficeHour.EndDate.Minute}}<br />
|
||||
{{if eq .OfficeHour.Date.Week 1}}in ungeraden Wochen<br />{{end}}{{if eq .OfficeHour.Date.Week 2}}in geraden Wochen<br />{{end}}
|
||||
{{.OfficeHour.Course.Name}}<br />
|
||||
{{.OfficeHour.Tutor.Name}}<br />
|
||||
{{.OfficeHour.Room.Name}}
|
||||
{{.OfficeHour.Room.Name}}<br />
|
||||
{{if ne .OfficeHour.Info ""}}{{.OfficeHour.Info}}<br />{{end}}
|
||||
</td>
|
Loading…
Reference in a new issue