Erstelle Maske, um Sprechstunden hinzuzufügen
This commit is contained in:
parent
c7a9522c2c
commit
369f4ebcec
15 changed files with 357 additions and 50 deletions
10
templates/addFailure.html
Normal file
10
templates/addFailure.html
Normal file
|
@ -0,0 +1,10 @@
|
|||
<html>
|
||||
<head>
|
||||
<title>Sprechstunde anlegen</title>
|
||||
</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.
|
||||
<br />
|
||||
{{.}}
|
||||
</body>
|
||||
</html>
|
49
templates/addMask.html
Normal file
49
templates/addMask.html
Normal file
|
@ -0,0 +1,49 @@
|
|||
<html>
|
||||
<head>
|
||||
<title>Sprechstunde anlegen</title>
|
||||
</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 $.Week}} selected{{end}}>Jede</option>
|
||||
<option value="1"{{if eq 1 $.Week}} selected{{end}}>Gerade</option>
|
||||
<option value="2"{{if eq 2 $.Week}} selected{{end}}>Ungerade</option>
|
||||
</select><br />
|
||||
<label for="tag">Tag</label>: <select name="tag">
|
||||
<option value="0"{{if eq 0 $.Day}} selected{{end}}>Montag</option>
|
||||
<option value="1"{{if eq 1 $.Day}} selected{{end}}>Dienstag</option>
|
||||
<option value="2"{{if eq 2 $.Day}} selected{{end}}>Mittwoch</option>
|
||||
<option value="3"{{if eq 3 $.Day}} selected{{end}}>Donnerstag</option>
|
||||
<option value="4"{{if eq 4 $.Day}} selected{{end}}>Freitag</option>
|
||||
</select><br />
|
||||
<label for="startzeit">Startzeit</label>: <input type="time" name="startzeit" min="08:00" max="17:30" /><br />
|
||||
<label for="dauer">Dauer in Minuten</label>: <input name="dauer" type="number" min="{{.MinuteGranularity}}" max="120" step="{{.MinuteGranularity}}" value="{{.Duration}}"/><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}}"/><br />
|
||||
<label for="email">Email-Adresse</label>:
|
||||
<input name="email" type="email" size="50" value="{{.Email}}"/><br />
|
||||
<label for="info">Info</label>: <input name="info" type="text" size="50" value="{{.Info}}"/><br />
|
||||
<input type="submit">
|
||||
</form>
|
||||
</p>
|
||||
Du musst hier eine Email-Adresse angeben, die auf „tu-darmstadt.de“ endet.<br />
|
||||
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}}
|
||||
</dl>
|
||||
</body>
|
||||
</html>
|
|
@ -10,18 +10,18 @@
|
|||
{{range $course := .Courses}}
|
||||
<option value="{{$course.Id}}"{{if eq $course.Id $.SelectedCourse}} selected{{end}}>{{$course.Name}}</option>{{end}}
|
||||
</select>
|
||||
<input type="submit" value="Auswählen" />
|
||||
<input type="submit" value="Auswählen" />
|
||||
</form>
|
||||
<form method="GET" action="/getByRoom">
|
||||
<label for="raum">Raum: </label>
|
||||
<select name="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}}
|
||||
<option value="{{$room.Id}}"{{if eq $room.Id $.SelectedRoom}} selected{{end}}>{{$room.Name}}</option>{{end}}
|
||||
</select>
|
||||
<input type="submit" value="Auswählen" />
|
||||
</form>
|
||||
{{.Timetable}}
|
||||
Technische Fragen an <a href="mailto:sprechstundentool@mathebau.de">sprechstundentool@mathebau.de</a>
|
||||
</body>
|
||||
<input type="submit" value="Auswählen" />
|
||||
</form>
|
||||
{{.Timetable}}
|
||||
Technische Fragen an <a href="mailto:sprechstundentool@mathebau.de">sprechstundentool@mathebau.de</a>
|
||||
</body>
|
||||
</html>
|
|
@ -7,5 +7,5 @@
|
|||
<th colspan="{{.ColspanThu}}" style="padding-left: 10px; padding-right: 10px; border-right: 1px dotted">Donnerstag</th>
|
||||
<th colspan="{{.ColspanFri}}" style="padding-left: 10px; padding-right: 10px; border-right: 1px dotted">Freitag</th>
|
||||
</tr>
|
||||
{{.TableBody}}
|
||||
{{.TableBody}}
|
||||
</table>
|
Loading…
Add table
Add a link
Reference in a new issue