Compare commits
No commits in common. "12a50806593e3420d1f0fa167b3d814b146ac9e4" and "6a60d11f1e3ef3c682c3c88801d33938ae02fdd5" have entirely different histories.
12a5080659
...
6a60d11f1e
4 changed files with 5 additions and 7 deletions
|
@ -59,10 +59,10 @@ func (b *BaseHandler) AddOfficeHourHandler(w http.ResponseWriter, req *http.Requ
|
||||||
//Parse date
|
//Parse date
|
||||||
week, err := strconv.Atoi(req.FormValue("woche"))
|
week, err := strconv.Atoi(req.FormValue("woche"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
errors = append(errors, "Die Vorlesungswoche muss eine ganze Zahl sein.")
|
errors = append(errors, "Die Woche muss eine ganze Zahl sein.")
|
||||||
}
|
}
|
||||||
if !(week >= 0 && week <= 2) {
|
if !(week >= 0 && week <= 2) {
|
||||||
errors = append(errors, "Sprechstunden müssen jede, jede gerade oder jede ungerade Vorlesungswoche stattfinden.")
|
errors = append(errors, "Sprechstunden müssen jede, jede gerade oder jede ungerade Woche stattfinden.")
|
||||||
}
|
}
|
||||||
day, err := strconv.Atoi(req.FormValue("tag"))
|
day, err := strconv.Atoi(req.FormValue("tag"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -240,11 +240,9 @@ func (r *OfficeHourRepo) NumberByTimeSpanAndRoom(date models.Date, duration int,
|
||||||
for _, officeHour := range officeHours {
|
for _, officeHour := range officeHours {
|
||||||
// increase count if officehour starts before this point in time and ends later
|
// increase count if officehour starts before this point in time and ends later
|
||||||
if models.DateLess(officeHour.Date, models.GetEndDate(date, minute, false)) && models.DateLess(models.GetEndDate(date, minute, false), models.GetEndDate(officeHour.Date, officeHour.Duration, false)) {
|
if models.DateLess(officeHour.Date, models.GetEndDate(date, minute, false)) && models.DateLess(models.GetEndDate(date, minute, false), models.GetEndDate(officeHour.Date, officeHour.Duration, false)) {
|
||||||
if date.Week == 0 || officeHour.Week == 0 || date.Week == officeHour.Week { // office hours in alternating weeks should not collide
|
|
||||||
minuteCount += 1
|
minuteCount += 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if minuteCount > count {
|
if minuteCount > count {
|
||||||
count = minuteCount
|
count = minuteCount
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
<option value="{{$course.Id}}"{{if eq $course.Id $.SelectedCourse}} selected{{end}}>{{$course.Name}}</option>
|
<option value="{{$course.Id}}"{{if eq $course.Id $.SelectedCourse}} selected{{end}}>{{$course.Name}}</option>
|
||||||
{{end}}
|
{{end}}
|
||||||
</select><br>
|
</select><br>
|
||||||
<label for="woche">Vorlesungswoche</label>:
|
<label for="woche">Woche</label>:
|
||||||
<select name="woche" id="woche">
|
<select name="woche" id="woche">
|
||||||
<option value="0"{{if eq 0 $.Date.Week}} selected{{end}}>Jede</option>
|
<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="1"{{if eq 1 $.Date.Week}} selected{{end}}>Ungerade</option>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<td rowspan="{{divide .OfficeHour.Duration .MinuteGranularity}}" style="border: 1px solid">
|
<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}}
|
{{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 Wochen<br>{{end}}{{if eq .OfficeHour.Date.Week 2}}in geraden Wochen<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>
|
||||||
|
|
Loading…
Reference in a new issue