Add the actual links to each event detailed page (in the detail popup).

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!
This commit is contained in:
Daru13 2018-11-24 03:52:09 +01:00
parent 3c848fe47c
commit aa06036968
2 changed files with 9 additions and 1 deletions

View file

@ -33,6 +33,9 @@ class Calendar {
this.events = [];
this.eventDetailURLFormat = calendarParameters.eventDetailURLFormat !== undefined
? calendarParameters.eventDetailURLFormat
: "";
this.subscriptionURLFormat = calendarParameters.subscriptionURLFormat !== undefined
? calendarParameters.subscriptionURLFormat
: "";
@ -703,8 +706,12 @@ class EventDetails {
}
createAndAppendTitle () {
let eventDetailURL = this.event.calendar.eventDetailURLFormat
.replace("999999", this.event.id);
let linkToEventPageNode = $("<a>")
.attr("href", "TODO") // TODO
.attr("href", eventDetailURL)
.attr("target", "_blank")
.addClass("cal-detail-name")
.appendTo(this.node);

View file

@ -15,6 +15,7 @@
let cal = new Calendar({
startDate: new Date(2018, 10, 30, 8),
endDate: new Date(2018, 11, 2, 6),
eventDetailURLFormat: "https://cof.ens.fr/poulpe/event/activity/999999",
subscriptionURLFormat: "{% url "event:enrol_activity" 999999 %}?ajax=json",
csrfToken: $(".planning [name=csrfmiddlewaretoken]").val()
});