From 0046bc39dbcc00d05c17a556eb6ed0fbdc5b8caf Mon Sep 17 00:00:00 2001 From: Johannes Date: Sun, 9 Jul 2023 13:01:01 +0200 Subject: [PATCH 1/3] code-style: centralize CSS styling into stylesheet file --- controllers/timetable.go | 6 +++--- static/officeHours.css | 17 +++++++++++++++++ templating/templates/addMask.html | 11 ----------- templating/templates/base.html | 3 ++- templating/templates/officeHourTable.html | 14 +++++++------- templating/templates/td.html | 2 +- 6 files changed, 30 insertions(+), 23 deletions(-) create mode 100644 static/officeHours.css diff --git a/controllers/timetable.go b/controllers/timetable.go index b1d5eb1..58267dd 100644 --- a/controllers/timetable.go +++ b/controllers/timetable.go @@ -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 { tableBody += "" if minute == 0 { - tableBody += fmt.Sprintf("%d Uhr\n", hour) + tableBody += fmt.Sprintf("%d Uhr\n", hour) } else { - tableBody += "\n" + tableBody += "\n" } for day := 0; day < 5; day += 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 { if slot+1 == slots[day] { - tableBody += "\n" + tableBody += "\n" } else { tableBody += "\n" } diff --git a/static/officeHours.css b/static/officeHours.css new file mode 100644 index 0000000..3945a59 --- /dev/null +++ b/static/officeHours.css @@ -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; +} diff --git a/templating/templates/addMask.html b/templating/templates/addMask.html index 2e55602..00a9d6b 100644 --- a/templating/templates/addMask.html +++ b/templating/templates/addMask.html @@ -14,17 +14,6 @@ {{end}} -
diff --git a/templating/templates/base.html b/templating/templates/base.html index 411898c..93aba65 100644 --- a/templating/templates/base.html +++ b/templating/templates/base.html @@ -6,7 +6,8 @@ - + + {{block "title" .}}Start{{end}} – Sprechstunden diff --git a/templating/templates/officeHourTable.html b/templating/templates/officeHourTable.html index 72e86ed..620b38e 100644 --- a/templating/templates/officeHourTable.html +++ b/templating/templates/officeHourTable.html @@ -1,11 +1,11 @@ - - - - - - + + + + + + {{.TableBody}} -
 MontagDienstagMittwochDonnerstagFreitag MontagDienstagMittwochDonnerstagFreitag
\ No newline at end of file + diff --git a/templating/templates/td.html b/templating/templates/td.html index e9c79ce..89df7de 100644 --- a/templating/templates/td.html +++ b/templating/templates/td.html @@ -1,4 +1,4 @@ - + {{if .DeleteIcons}}
{{end}} {{printf "%02d" .OfficeHour.Date.Hour}}:{{printf "%02d" .OfficeHour.Date.Minute}} - {{printf "%02d" .OfficeHour.EndDate.Hour}}:{{printf "%02d" .OfficeHour.EndDate.Minute}}
{{if eq .OfficeHour.Date.Week 1}}in ungeraden Vorlesungswochen
{{end}}{{if eq .OfficeHour.Date.Week 2}}in geraden Vorlesungswochen
{{end}} From 2c8528d743fcfc0a7157ce37c3d8abb03e2d5368 Mon Sep 17 00:00:00 2001 From: Johannes Date: Sun, 9 Jul 2023 15:18:02 +0200 Subject: [PATCH 2/3] ui: center offichourTable to fit nicer into layout --- templating/templates/officeHourTable.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templating/templates/officeHourTable.html b/templating/templates/officeHourTable.html index 620b38e..21e68e9 100644 --- a/templating/templates/officeHourTable.html +++ b/templating/templates/officeHourTable.html @@ -1,4 +1,4 @@ - +
From c21f42975bf839a4a407adcd25a3ace62391570f Mon Sep 17 00:00:00 2001 From: Johannes Date: Sun, 9 Jul 2023 15:40:25 +0200 Subject: [PATCH 3/3] ui: style deletion form Had forgotten this page before... --- templating/templates/deleteMailForm.html | 40 +++++++++++++++--------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/templating/templates/deleteMailForm.html b/templating/templates/deleteMailForm.html index af4b8ff..378e6e7 100644 --- a/templating/templates/deleteMailForm.html +++ b/templating/templates/deleteMailForm.html @@ -1,19 +1,31 @@ {{define "title"}}Sprechstunde löschen{{end}} {{define "content"}} -{{.Error}} +
+ {{ if .Error }} +
+ Fehler: {{.Error}} +
+ {{ end }} -Willst du die Sprechstunde
- {{printf "%02d" .OfficeHour.Date.Hour}}:{{printf "%02d" .OfficeHour.Date.Minute}} - {{printf "%02d" .OfficeHour.EndDate.Hour}}:{{printf "%02d" .OfficeHour.EndDate.Minute}}
- {{if eq .OfficeHour.Date.Week 1}}in ungeraden Vorlesungswochen
{{end}}{{if eq .OfficeHour.Date.Week 2}}in geraden Vorlesungswochen
{{end}} - {{.OfficeHour.Course.Name}}
- {{.OfficeHour.Tutor.Name}}
- {{.OfficeHour.Room.Name}}
-wirklich löschen? Bitte bestätige dies durch Angabe der Mailadresse, mit der die Sprechstunde angelegt wurde:
- - -: -
- - +

+ Willst du die Sprechstunde
+ {{printf "%02d" .OfficeHour.Date.Hour}}:{{printf "%02d" .OfficeHour.Date.Minute}} - {{printf "%02d" .OfficeHour.EndDate.Hour}}:{{printf "%02d" .OfficeHour.EndDate.Minute}}
+ {{if eq .OfficeHour.Date.Week 1}}in ungeraden Vorlesungswochen
{{end}}{{if eq .OfficeHour.Date.Week 2}}in geraden Vorlesungswochen
{{end}} + {{.OfficeHour.Course.Name}}
+ {{.OfficeHour.Tutor.Name}}
+ {{.OfficeHour.Room.Name}}
+ wirklich löschen? Bitte bestätige dies durch Angabe der Mailadresse, mit der die Sprechstunde angelegt wurde: +

+
+ +
+
+ + +
+ +
+ +
{{end}}
  Montag