Compare commits

...

3 commits

Author SHA1 Message Date
c21f42975b ui: style deletion form
Had forgotten this page before...
2023-07-09 15:41:51 +02:00
2c8528d743 ui: center offichourTable to fit nicer into layout 2023-07-09 15:41:51 +02:00
0046bc39db code-style: centralize CSS styling into stylesheet file 2023-07-09 15:41:43 +02:00
7 changed files with 57 additions and 38 deletions

View file

@ -55,9 +55,9 @@ func (b *BaseHandler) printTimetable(timetable map[models.Date]map[int]models.Of
for minute := 0; minute < 60; minute += b.config.Date.MinuteGranularity { for minute := 0; minute < 60; minute += b.config.Date.MinuteGranularity {
tableBody += "<tr>" tableBody += "<tr>"
if minute == 0 { if minute == 0 {
tableBody += fmt.Sprintf("<td>%d Uhr</td>\n", hour) tableBody += fmt.Sprintf("<td class=\"timetableRightBorder\">%d Uhr</td>\n", hour)
} else { } else {
tableBody += "<td></td>\n" tableBody += "<td class=\"timetableRightBorder\"></td>\n"
} }
for day := 0; day < 5; day += 1 { for day := 0; day < 5; day += 1 {
for slot := 0; slot < slots[day]; slot += 1 { for slot := 0; slot < slots[day]; slot += 1 {
@ -96,7 +96,7 @@ func (b *BaseHandler) printTimetable(timetable map[models.Date]map[int]models.Of
} }
} else { } else {
if slot+1 == slots[day] { if slot+1 == slots[day] {
tableBody += "<td style=\"border-right: 1px dotted\"></td>\n" tableBody += "<td class=\"timetableRightBorder\"></td>\n"
} else { } else {
tableBody += "<td></td>\n" tableBody += "<td></td>\n"
} }

17
static/officeHours.css Normal file
View file

@ -0,0 +1,17 @@
/* mark required fields */
input.required ~ label::after, select.required ~ label::after {
content: ' *';
color: red;
}
/* improve indent of help texts below form fields */
.form-control ~ .form-text {
padding-left: 12px;
padding-right: 12px;
}
.timetableRightBorder {
border-right: 1px dotted;
}
td.officeHour {
border: 1px solid;
}

View file

@ -14,17 +14,6 @@
{{end}} {{end}}
</div> </div>
<style>
input.required ~ label::after, select.required ~ label::after {
content: ' *';
color: red;
}
.form-control ~ .form-text {
padding-left: 12px;
padding-right: 12px;
}
</style>
<div class="row"> <div class="row">
<div class="col-lg-8 mb-4"> <div class="col-lg-8 mb-4">
<form method="POST" action="addOfficeHour"> <form method="POST" action="addOfficeHour">

View file

@ -6,7 +6,8 @@
<meta name="description" content="Eine Übersicht der Sprechstunden, die in den offenen Arbeitsräumen der Fachschaft Mathematik, TU Darmstadt, angeboten werden"> <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"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="/static/bootstrap/css/bootstrap.min.css"> <link rel="stylesheet" href="/static/bootstrap/css/bootstrap.min.css" />
<link rel="stylesheet" href="/static/officeHours.css" />
<title>{{block "title" .}}Start{{end}} Sprechstunden</title> <title>{{block "title" .}}Start{{end}} Sprechstunden</title>
</head> </head>

View file

@ -1,19 +1,31 @@
{{define "title"}}Sprechstunde löschen{{end}} {{define "title"}}Sprechstunde löschen{{end}}
{{define "content"}} {{define "content"}}
{{.Error}} <div class="col-md-8 offset-md-2">
{{ if .Error }}
<div class="alert alert-danger">
<strong>Fehler:</strong> {{.Error}}
</div>
{{ end }}
<p>
Willst du die Sprechstunde<br> Willst du die Sprechstunde<br>
{{printf "%02d" .OfficeHour.Date.Hour}}:{{printf "%02d" .OfficeHour.Date.Minute}} - {{printf "%02d" .OfficeHour.EndDate.Hour}}:{{printf "%02d" .OfficeHour.EndDate.Minute}}<br> {{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 Vorlesungswochen<br>{{end}}{{if eq .OfficeHour.Date.Week 2}}in geraden Vorlesungswochen<br>{{end}} {{if eq .OfficeHour.Date.Week 1}}in ungeraden Vorlesungswochen<br>{{end}}{{if eq .OfficeHour.Date.Week 2}}in geraden Vorlesungswochen<br>{{end}}
{{.OfficeHour.Course.Name}}<br> {{.OfficeHour.Course.Name}}<br>
{{.OfficeHour.Tutor.Name}}<br> {{.OfficeHour.Tutor.Name}}<br>
{{.OfficeHour.Room.Name}}<br> {{.OfficeHour.Room.Name}}<br>
wirklich löschen? Bitte bestätige dies durch Angabe der Mailadresse, mit der die Sprechstunde angelegt wurde: <br> wirklich löschen? Bitte bestätige dies durch Angabe der Mailadresse, mit der die Sprechstunde angelegt wurde:
</p>
<form method="POST" action="deleteOfficeHour"> <form method="POST" action="deleteOfficeHour">
<input type="hidden" name="id" value="{{.OfficeHour.Id}}"> <input type="hidden" name="id" value="{{.OfficeHour.Id}}">
<label for="email">Email-Adresse</label>: <div class="input-group">
<input name="email" id="email" type="email" size="50" required><br> <div class="form-floating">
<input type="submit"> <input class="form-control required" name="email" id="email" type="email" size="50" required placeholder="">
<label for="email">Email-Adresse</label>
</div>
<button class="btn btn-outline-primary" type="submit">Bestätigen</button>
</div>
</form> </form>
</div>
{{end}} {{end}}

View file

@ -1,11 +1,11 @@
<table> <table class="mx-auto">
<tr> <tr>
<th>&nbsp;</th> <th class="px-2 text-center timetableRightBorder">&nbsp;</th>
<th colspan="{{.ColspanMon}}" style="padding-left: 10px; padding-right: 10px; border-right: 1px dotted">Montag</th> <th class="px-2 text-center timetableRightBorder" colspan="{{.ColspanMon}}">Montag</th>
<th colspan="{{.ColspanTue}}" style="padding-left: 10px; padding-right: 10px; border-right: 1px dotted">Dienstag</th> <th class="px-2 text-center timetableRightBorder" colspan="{{.ColspanTue}}">Dienstag</th>
<th colspan="{{.ColspanWed}}" style="padding-left: 10px; padding-right: 10px; border-right: 1px dotted">Mittwoch</th> <th class="px-2 text-center timetableRightBorder" colspan="{{.ColspanWed}}">Mittwoch</th>
<th colspan="{{.ColspanThu}}" style="padding-left: 10px; padding-right: 10px; border-right: 1px dotted">Donnerstag</th> <th class="px-2 text-center timetableRightBorder" colspan="{{.ColspanThu}}">Donnerstag</th>
<th colspan="{{.ColspanFri}}" style="padding-left: 10px; padding-right: 10px; border-right: 1px dotted">Freitag</th> <th class="px-2 text-center timetableRightBorder" colspan="{{.ColspanFri}}">Freitag</th>
</tr> </tr>
{{.TableBody}} {{.TableBody}}
</table> </table>

View file

@ -1,4 +1,4 @@
<td rowspan="{{divide .OfficeHour.Duration .MinuteGranularity}}" style="border: 1px solid"> <td class="officeHour" rowspan="{{divide .OfficeHour.Duration .MinuteGranularity}}">
{{if .DeleteIcons}}<div style="text-align: right;"><a href="/deleteOfficeHour?id={{.OfficeHour.Id}}"></a></div>{{end}} {{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> {{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 Vorlesungswochen<br>{{end}}{{if eq .OfficeHour.Date.Week 2}}in geraden Vorlesungswochen<br>{{end}} {{if eq .OfficeHour.Date.Week 1}}in ungeraden Vorlesungswochen<br>{{end}}{{if eq .OfficeHour.Date.Week 2}}in geraden Vorlesungswochen<br>{{end}}