Improve availability
Availability was introduced in !195 (merged) in the third rewrite. I was never really happy with the UI nor with the implementation. So three years later I wanted to see if we can find something better.
My idea was to look at forms for opening hours as they are more common. I found an old stack exchange question with many interesting proposals. Many of them are similar to the form used at google:
From a more technical perspective I also had a look at the schema.org specification for openingHours. They look something like this: Mo-Fr 10:00-19:00
.
What I find notable is that all of these treat opening hours as spans of time rather than a boolean selection of pre-defined timeslots (which is how our availability works).
The model for a google-like availability could look something like this:
class Availability(models.Model):
subject = models.ForeignKey(Subject, on_delete=models.CASCADE)
day_of_week = models.SmallIntegerField(choices=[
(1, 'Monday'),
(2, 'Tuesday'),
…
])
start = models.TimeField(blank=True)
end = models.TimeField(blank=True)
The migration to such a system could be complicated, but I believe it could be a significant improvement.