mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Make it possible to select favourites events
Make it possible for users to select events which they want to see in the public schedule and in the All events section of the public schedule.
This commit is contained in:
parent
39e05a29fa
commit
c6906675f9
5 changed files with 80 additions and 17 deletions
|
|
@ -1,3 +1,5 @@
|
|||
// ADMIN SCHEDULE
|
||||
|
||||
var url; // Should be initialize in Schedule.initialize
|
||||
var schedule_id; // Should be initialize in Schedule.initialize
|
||||
|
||||
|
|
@ -114,6 +116,34 @@ $(document).ready( function() {
|
|||
});
|
||||
});
|
||||
|
||||
|
||||
// PUBLIC SCHEDULE
|
||||
|
||||
function starClicked(e){
|
||||
// stops the click from propagating
|
||||
if (!e) var e = window.event;
|
||||
e.preventDefault();
|
||||
e.cancelBubble = true;
|
||||
if (e.stopPropagation) e.stopPropagation();
|
||||
|
||||
var callback = function(data) {
|
||||
$(e.target).toggleClass('fa-star fa-star-o');
|
||||
}
|
||||
|
||||
var params = { favourite_user_id: $(e.target).data('user') };
|
||||
if($(e.target).hasClass('fa-star-o')){
|
||||
params['add'] = true;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: $(e.target).data('url'),
|
||||
type: 'PATCH',
|
||||
data: params,
|
||||
success: callback,
|
||||
dataType : 'json'
|
||||
});
|
||||
}
|
||||
|
||||
function eventClicked(e, element){
|
||||
var url = $(element).data('url');
|
||||
if(e.ctrlKey)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue