Nikola auto commit.

Nikola version: 8.3.3
src
Patricio García 2025-08-24 23:43:46 +01:00
parent 723b4018c7
commit 506c7ab5fa
4 changed files with 27 additions and 7 deletions

Binary file not shown.

View File

@ -30,8 +30,16 @@ function ActivePastEvents(tab_next, tab_past) {
}
}
function ActivePastEventsIfNotNexts(ge_id, tab_next, tab_past) {
function ShowElement(id) {
const element = document.getElementById(id);
if (element) {
element.style.display = "block";
}
}
function ActivePastEventsIfNotNexts(ge_id, tab_next, tab_past, msg_id) {
if (GetNextEventsCount(ge_id) == 0) {
ActivePastEvents(tab_next, tab_past);
}
ShowElement(msg_id);
}

View File

@ -12,14 +12,20 @@
{{% tabpannel active='1' %}}
Próximos
<gancio-events baseurl='https://eventos.txs.es' title='Próximos eventos' theme='light' sidebar='false' id='nextevents'></gancio-events><p>No existen mas próximos eventos programados actualmente.</p>
<gancio-events baseurl='https://eventos.txs.es' title='Próximos eventos' theme='light' sidebar='false' id='nextevents'></gancio-events>
<div id="msg_non_nexts" style="display:none">
<p>No existen próximos eventos programados actualmente.</p>
</div>
Pasados
<gancio-events baseurl='https://eventos.txs.es' title='Eventos pasados' theme='light' sidebar='false' past='true'></gancio-events>
{{% /tabpannel %}}
Si quieres organizar un evento con nosotros {{% doc %}}contáctanos <contact>{{% /doc %}}.
<script src='/assets/js/gancio-events.es.js'></script>
{{% gancio-events-detect ge_id='nextevents' tab_next='0' tab_past='1' %}}
{{% gancio-events-detect ge_id='nextevents' tab_next='0' tab_past='1' msg_id='msg_non_nexts' %}}

View File

@ -4,10 +4,10 @@ Load gancio-events-detect.js and call ActivePastEventsIfNotNexts() when page is
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
{{% gancio-events-detect ge_id=<ge_id> [tab_next=<tab_next>] [tab_past=<tab_past>] [msg_id=<msg_id>] %}}
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, and <msg_id> is the ID of a element to show
</%doc>
% if tab_next is UNDEFINED:
@ -20,9 +20,15 @@ where <id_ge> is the ID of past gancio-events HTML tag, tab_next and tab_past ar
% else:
<% tp = tab_past %>
% endif
% if msg_id is UNDEFINED:
<% mid = 'none' %>
% else:
<% mid = msg_id %>
% endif
<% site.template_hooks['body_end'].append('<script src="/assets/js/gancio-events-detect.js"></script>') %>
<% params = '\"' + ge_id + '\", \"' + tn + '\", \"' + tp + '\"' %>
<% params = '\"' + ge_id + '\", \"' + tn + '\", \"' + tp + '\", \"' + mid + '\"' %>
<% site.template_hooks['body_end'].append('<script> $(document).ready(function(){ ActivePastEventsIfNotNexts(' + params + '); });</script>') %>