educaweb2/shortcodes/gancio-events-detect.tmpl

29 lines
874 B
Cheetah

<%doc>
Load gancio-events-detect.js and call ActivePastEventsIfNotNexts() when page is load
Template engine: Mako
Usage:
tab_next, tab_past
{{% gancio-events-detect ge_id=<ge_id> [tab_next=<tab_next>] [tab_past=<tab_past>] %}}
where <id_ge> is the ID of past gancio-events HTML tag, tab_next and tab_past are the number of tabs for next and past events
</%doc>
% if tab_next is UNDEFINED:
<% tn = '0' %>
% else:
<% tn = tab_next %>
% endif
% if tab_past is UNDEFINED:
<% tp = '1' %>
% else:
<% tp = tab_past %>
% endif
<% site.template_hooks['body_end'].append('<script src="/assets/js/gancio-events-detect.js"></script>') %>
<% params = '\"' + ge_id + '\", \"' + tn + '\", \"' + tp + '\"' %>
<% site.template_hooks['body_end'].append('<script> $(document).ready(function(){ ActivePastEventsIfNotNexts(' + params + '); });</script>') %>