This is required so that an event E1 ending at time T and an event E2
starting at time T _can_ be assigned the same color (i.e. they _can_
appear on the same row).
Note: this only sort the event nodes in a particular, "optimal" order;
but it does not explicitly set the grid row of each node. Therefore, the
result is likely to spread on many more rows than what could be
expected.
This is intended to make it easy to have a glimpse at the content of
an event, when its width is not sufficient for its content to be
displayed (without overflowing its parent).
It uses an external jQuery library to display tooltips: named _tipso_
(https://github.com/object505/tipso).
Note that the URL format is passed to the calendar as a parameter (in
the page template).
It is currently hard-coded, but should be generated by Django instead!
The popup is horizontally aligned with the click location, and
vertically close to event (slightly on top of it, from below).
If the click occurs too much on the left or the right side of the
screen, the horizontal position is shifted accordingly, so that it is
never displayed outside of the screen. Note, however, that the small
arrow supposed to point the related event is not shifted as well as of
now (not as straightforward since it is a CSS pseudo-element).
This commit also removes the ability to display the popup _above_ the
event in case the click occurs too close to the bottom of the screen.
This feature should be reintroduced by a later commit once it will have
been fixed :).
This is the first step to include a visual calendar to Poulpe,
only including a "day view" as of now (i.e. events hour-by-hour from one date to another).
More views may be added at a later time.
It is **NOT WORKING YET**!
The CSS has been broken on this branch, and will have to be fixed before the calendar can work:
* the CSS of the calendar needs to be adapted to the environment and design of Poulpe;
* add actual links to enroll/un-enroll to an activity (cf. `Event` class in `calendar.js`);
* other small tweaks :)?
Finally, this view is likely to require the addition of start and end date change,
so that an user can browse events over several days (cf. `setStartDate` and `setEndDate` methods of `Calendar` class in `calendar.js`).
Note that this code should be better re-written (e.g. in Typescript, split between files, using more/better design patterns) at a later time.
It should nonetheless be easy to fix it and use it right now (see above requirements for this).