-
Notifications
You must be signed in to change notification settings - Fork 0
/
alquerias.xslt
626 lines (579 loc) · 25.1 KB
/
alquerias.xslt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:x="http://panax.io/xdom"
xmlns:js="http://panax.io/xdom/javascript"
xmlns:state="http://panax.io/state"
xmlns:custom="http://panax.io/custom"
exclude-result-prefixes="#default"
>
<xsl:key name="isGeneric" match="*[@custom:code='FD87F7733D4FBDCDF58A0D46545D7E82']" use="@custom:code"/>
<xsl:key name="valid_email" match="cuestionario[contains(@custom:email, '@alquerias.com')]" use="true()"/>
<xsl:key name="missing" match="cuestionario/*/opcion[not(@state:checked)]" use="generate-id(../..)"/>
<xsl:key name="missing" match="cuestionario/*[not(opcion) and string(@x:value)='']" use="generate-id(..)"/>
<xsl:key name="rechazado" match="@custom:result[.='Rechazado']" use="generate-id(/*)" />
<xsl:key name="autorizado" match="@custom:result[.='Autorizado']" use="generate-id(/*)" />
<xsl:key name="expirado" match="@custom:date[.='Positivo']" use="generate-id(/*)" />
<xsl:key name="valid_email" match="cuestionario[contains(@custom:email, '@panax.io')]" use="true()"/>
<xsl:key name="valid_email" match="cuestionario[@custom:email='[email protected]']" use="true()"/>
<xsl:param name="js:fecha_actual"><![CDATA[toIsoString(new Date()).replace(/[^\d]/gi,'').substr(0,14)]]></xsl:param>
<xsl:param name="js:tag"><![CDATA[location.hash.split('#').pop()]]></xsl:param>
<xsl:param name="js:secure"><![CDATA[location.protocol.indexOf('https')!=-1 || location.hostname=='localhost']]></xsl:param>
<xsl:template match="cuestionario">
<div class="container">
<main>
<div class="py-5 text-center">
<img class="mb-4" src="assets/{$js:tag}.png" alt="" width="100"/>
<h2>Filtro de Acceso</h2>
<p class="lead">Formato para llenar antes de visitar las instalaciones.</p>
<h4 class="mb-3 text-center">
<xsl:value-of select="@custom:email"/>
</h4>
</div>
<div class="row g-5">
<div class="col-12">
<form class="needs-validation" novalidate="">
<div class="my-3">
<xsl:apply-templates/>
</div>
<hr class="my-4"/>
<xsl:choose>
<xsl:when test="@custom:code">
<div class="text-center">
<img src="qr/{$js:tag}/{@custom:code}.png" class="img-fluid" alt="Recuerde que debe ingresar con su correo electrónico (nombre.apellido.ap@{$js:tag}.com) para ver el código QR"/>
<br/>
<div class="alert alert-danger text-center" role="alert">Este código tiene una vigencia de un solo uso</div>
</div>
<button class="w-100 btn btn-primary btn-lg btn-danger" type="button">
<!--<xsl:attribute name="onclick">xdom.manifest.sources["#minerva"].fetch('#minerva'); cuestionario.closeSession()</xsl:attribute>-->
<xsl:attribute name="onclick">xdom.session.logout()</xsl:attribute>
<xsl:text/>Cerrar sesión<xsl:text/>
</button>
</xsl:when>
<xsl:otherwise>
<button class="w-100 btn btn-primary btn-lg" type="button">
<xsl:choose>
<xsl:when test="key('missing',generate-id())">
<xsl:attribute name="disabled">disabled</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="onclick">cuestionario.getQR()</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
<xsl:text/>Generar código QR<xsl:text/>
</button>
<br/>
<br/>
<button class="w-100 btn btn-primary btn-lg btn-danger" type="button">
<xsl:attribute name="onclick">xdom.session.logout()</xsl:attribute>
<xsl:text/>Cerrar sesión<xsl:text/>
</button>
</xsl:otherwise>
</xsl:choose>
</form>
</div>
</div>
</main>
<footer class="my-5 pt-5 text-muted text-center text-small">
<p class="mb-1"> 2021 © Panax</p>
<ul class="list-inline">
<li class="list-inline-item">
<a href="#">Privacidad</a>
</li>
</ul>
</footer>
</div>
</xsl:template>
<xsl:template match="@custom:result[.='Positivo']">Autorizado</xsl:template>
<xsl:template match="@custom:result[.='Negativo']">No autorizado</xsl:template>
<xsl:template match="@custom:date">
<xsl:value-of select="substring(.,7,2)"/>
<xsl:text>/</xsl:text>
<xsl:value-of select="substring(.,5,2)"/>
<xsl:text>/</xsl:text>
<xsl:value-of select="substring(.,1,4)"/>
<xsl:text> </xsl:text>
<xsl:value-of select="substring(.,9,2)"/>
<xsl:text>:</xsl:text>
<xsl:value-of select="substring(.,11,2)"/>
<xsl:text>:</xsl:text>
<xsl:value-of select="substring(.,13,2)"/>
<xsl:text> Hrs.</xsl:text>
<!--<xsl:choose>
<xsl:when test="substring(.,9,2)>=12"> P.M.</xsl:when>
<xsl:otherwise> A.M.</xsl:otherwise>
</xsl:choose>-->
</xsl:template>
<xsl:template match="cuestionario[@custom:result]">
<xsl:variable name="caducado">
<xsl:choose>
<xsl:when test="translate(@custom:fecha_vigencia,'/-: ','') = number(translate(@custom:fecha_vigencia,'/-: ',''))">
<xsl:if test="$js:fecha_actual - translate(@custom:fecha_vigencia,'/-: ','') > 0">1</xsl:if>
</xsl:when>
<xsl:otherwise>
<xsl:if test="$js:fecha_actual - translate(@custom:date,'/-: ','') > 880000">1</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="caducidad">
<xsl:if test="$caducado=1">text-danger</xsl:if>
</xsl:variable>
<div class="container">
<main>
<div class="py-5 text-center">
<!--<img class="d-block mx-auto mb-4" src="../assets/brand/bootstrap-logo.svg" alt="" width="72" height="57"/>-->
<h2>Filtro de Acceso</h2>
</div>
<div class="row g-5">
<div class="col-12">
<xsl:choose>
<xsl:when test="key('isGeneric', @custom:code)">
<h1 class="mb-3 text-center">Código válido únicamente hasta el 14 de Junio</h1>
</xsl:when>
<xsl:otherwise>
<h1 class="mb-3 text-center">
<xsl:value-of select="@custom:email"/>
</h1>
<h1 class="mb-3 text-center text-primary {$caducidad}">
<xsl:apply-templates select="@custom:date"/>
</h1>
<h2 class="mb-3 text-center {$caducidad}">
<xsl:choose>
<xsl:when test="$caducado=1">
El código ha caducado
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="@custom:result"/>
</xsl:otherwise>
</xsl:choose>
</h2>
</xsl:otherwise>
</xsl:choose>
<div class="row text-center">
<div class="col-4"/>
<div class="col-4">
<xsl:choose>
<xsl:when test="$caducado=1"></xsl:when>
<xsl:when test="key('autorizado',generate-id())">
<h1>
<xsl:value-of select="visitante/@x:value"/>
</h1>
<svg xmlns="http://www.w3.org/2000/svg" width="100%" fill="currentColor" class="bi bi-check-circle text-success {$caducidad}" viewBox="0 0 16 16" aria-hidden="true" style="margin-left: 2em; margin-top: 1em; cursor: pointer;" xo-target="{@x:id}" id="{@x:id}_no">
<path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"/>
<path d="M10.97 4.97a.235.235 0 0 0-.02.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-1.071-1.05z"/>
</svg>
</xsl:when>
<xsl:otherwise>
<svg xmlns="http://www.w3.org/2000/svg" width="100%" fill="currentColor" class="bi bi-x-circle text-danger" viewBox="0 0 16 16" aria-hidden="true" style="margin-right: 2em; margin-top: 1em; cursor: pointer;" xo-target="{@x:id}" id="{@x:id}_yes">
<path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"/>
<path d="M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z"/>
</svg>
</xsl:otherwise>
</xsl:choose>
</div>
<div class="col-4"/>
</div>
</div>
</div>
</main>
<footer class="my-5 pt-5 text-muted text-center text-small">
<p class="mb-1"> 2021 © Panax</p>
<ul class="list-inline">
<li class="list-inline-item">
<a href="#">Privacidad</a>
</li>
</ul>
</footer>
</div>
</xsl:template>
<xsl:template match="cuestionario[not(key('valid_email',true()))]">
<div class="text-center">
<xsl:if test="$js:secure='true'">
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet" type="text/css"/>
<script src="https://accounts.google.com/gsi/client" async="" defer=""></script>
</xsl:if>
<style>
<![CDATA[
html,
body {
height: 100%;
}
body > div {
display: flex;
align-items: center;
padding-top: 40px;
padding-bottom: 40px;
background-color: #f5f5f5;
}
.form-signin {
width: 100%;
max-width: 400px;
padding: 15px;
margin: auto;
}
.form-signin .checkbox {
font-weight: 400;
}
.form-signin .form-floating:focus-within {
z-index: 2;
}
.form-signin input[type="email"] {
margin-bottom: -1px;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.form-signin input[type="password"] {
margin-bottom: 10px;
border-top-left-radius: 0;
border-top-right-radius: 0;
}
.bd-placeholder-img {
font-size: 1.125rem;
text-anchor: middle;
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
}
@media (min-width: 768px) {
.bd-placeholder-img-lg {
font-size: 3.5rem;
}
}]]>
</style>
<style type="text/css">
<![CDATA[
.signup_button {
display: inline-block;
background: white;
color: #444;
border-radius: 5px;
border: thin solid #888;
box-shadow: 1px 1px 1px grey;
white-space: nowrap;
}
.signup_button:hover {
cursor: pointer;
}
span.label {
font-family: serif;
font-weight: normal;
}
span.icon {
background: url('https://developers-dot-devsite-v2-prod.appspot.com/identity/sign-in/g-normal.png') transparent 5px 50% no-repeat;
display: inline-block;
vertical-align: middle;
width: 42px;
height: 42px;
}
span.icon-app {
background: url('./custom/images/favicon.png') transparent 5px 50% no-repeat;
display: inline-block;
vertical-align: middle;
width: 52px;
height: 42px;
}
.buttonText {
display: inline-block;
vertical-align: middle;
padding-right: 42px;
font-size: 14px;
font-weight: bold;
/* Use the Roboto font that is loaded in the <head> */
font-family: 'Roboto', sans-serif;
}
]]>
</style>
<script>console.log('inicializando')</script>
<main class="form-signin">
<form class="needs-validation" novalidate="">
<img class="mb-4" src="assets/{$js:tag}.png" alt="" width="100"/>
<h1 class="h3 mb-3 fw-normal">Filtro de Acceso</h1>
<br/>
<xsl:variable name="invalid-email">
<xsl:if test="string(@custom:email)!=''">is-invalid</xsl:if>
</xsl:variable>
<div class="form-floating">
<input type="email" class="form-control {$invalid-email}" id="floatingEmail" placeholder="[email protected]" value="{@custom:email}" width="" xo-target="{@x:id}" onfocus="this.value=''"/>
<xsl:if test="string(@custom:email)!=''">
<div class="invalid-feedback">
Por favor introduzca un nombre de usuario válido.
</div>
</xsl:if>
<label for="floatingEmail">Correo autorizado</label>
</div>
<br/>
<!--<div class="form-floating">
<input type="password" class="form-control" id="floatingPassword" placeholder="Password"/>
<label for="floatingPassword">Password</label>
</div>-->
<!--<div class="checkbox mb-3">
<label>
<input type="checkbox" value="remember-me"/> Remember me
</label>
</div>-->
<button class="w-100 btn btn-lg btn-primary" type="button" xo-target="{@x:id}" onclick="let email=document.querySelector('#floatingEmail'); xdom.delay(100).then(_=>{{this.sourceNode.setAttribute('custom:email',[...email.value && email.value.match(/[^@]+/g), email.value && '{$js:tag}'].filter((el,i)=>i<2).join('@'), true)}}); xdom.data.stores['{$js:tag}']">
Continuar
</button>
<xsl:if test="$js:secure='true'">
<br/>
<div id="g_id_onload"
data-client_id="22537666043-58rr4djm4s2un5p37fg3tjn56db3e5m3.apps.googleusercontent.com"
data-callback="onGoogleLogin"
data-auto_prompt="false">
</div>
<div class="g_id_signin signup_button"
data-type="standard"
data-size="large"
data-theme="outline"
data-text="sign_in_with"
data-shape="rectangular"
data-logo_alignment="left">
</div>
</xsl:if>
<p class="mt-5 mb-3 text-muted">2021 © Panax</p>
</form>
</main>
</div>
</xsl:template>
<xsl:template match="cuestionario/*">
<xsl:variable name="invalid-email">
<xsl:if test="string(@custom:email)!=''">is-invalid</xsl:if>
</xsl:variable>
<div class="container">
<div class="row">
<div class="col-4 align-self-start">
<label class="form-label" for="credit">
<h5>
<xsl:value-of select="@label"/>:
</h5>
</label>
</div>
<div class="col-8 align-self-end">
<input type="{name()}" class="form-control {$invalid-email}" value="{@x:value}" size="50" xo-target="{@x:id}" onchange="this.sourceNode.setAttribute('@x:value', this.value)"/>
</div>
</div>
</div>
</xsl:template>
<xsl:template match="cuestionario/*[opcion]">
<div class="container">
<div class="row">
<div class="col-8 align-self-start">
<h3 class="mb-3">
<xsl:value-of select="@title"/>
</h3>
</div>
<div class="col-2 align-self-end">
<h5>NO</h5>
</div>
<div class="col-2 align-self-end">
<h5>SÍ</h5>
</div>
</div>
<xsl:apply-templates/>
</div>
</xsl:template>
<xsl:template match="opcion">
<div class="row">
<div class="col-8 align-self-start">
<label class="form-check-label" for="credit">
<xsl:value-of select="text()"/>
</label>
</div>
<div class="col-2 align-self-end">
<input id="{@x:id}_no" name="{@x:id}" type="radio" class="form-check-input" required="" onclick="this.source.documentElement.removeAttribute('custom:code'); this.sourceNode.setAttribute('@state:checked', 0)">
<xsl:if test="@state:checked=0">
<xsl:attribute name="checked"/>
<xsl:attribute name="onclick">
<xsl:text/>this.source.documentElement.removeAttribute('custom:code'); this.sourceNode.parentNode.setAttribute('@state:active', <xsl:value-of select="position()"/>, false); this.sourceNode.setAttribute('@state:checked',undefined)<xsl:text/>
</xsl:attribute>
</xsl:if>
</input>
</div>
<div class="col-2 align-self-center">
<input id="{@x:id}_yes" name="{@x:id}" type="radio" class="form-check-input" required="" onclick="this.source.documentElement.removeAttribute('custom:code'); this.sourceNode.parentNode.setAttribute('@state:active', {position()}, false); this.sourceNode.setAttribute('@state:checked', 1)">
<xsl:if test="@state:checked=1">
<xsl:attribute name="checked"/>
<xsl:attribute name="onclick">
<xsl:text/>this.source.documentElement.removeAttribute('custom:code'); this.sourceNode.parentNode.setAttribute('@state:active', <xsl:value-of select="position()"/>, false); this.sourceNode.setAttribute('@state:checked', undefined)<xsl:text/>
</xsl:attribute>
</xsl:if>
</input>
</div>
</div>
</xsl:template>
<xsl:template match="opcion" mode="indicator">
<button type="button" data-bs-target="#myCarousel" data-bs-slide-to="{position()-1}" aria-label="Slide {position()}" xo-target="{../@x:id}" onclick="this.sourceNode.setAttribute('@state:active', {position()}, false)">
<xsl:if test="position()=../@state:active or position()=1 and not(../@state:active)">
<xsl:attribute name="class">active</xsl:attribute>
<xsl:attribute name="aria-current">true</xsl:attribute>
</xsl:if>
</button>
</xsl:template>
<xsl:template match="cuestionario/*[opcion[not(@state:checked)]]/opcion">
<xsl:variable name="active">
<xsl:choose>
<xsl:when test="../@state:active">
<xsl:value-of select="../@state:active"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="position()"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<div class="carousel-item" style="background-color: #140c5b">
<xsl:if test="position()=../@state:active or position()=1 and not(../@state:active)">
<xsl:attribute name="class">carousel-item active</xsl:attribute>
<xsl:attribute name="aria-current">true</xsl:attribute>
</xsl:if>
<div class="row flex-nowrap">
<div class="col"></div>
<div class="col-5 text-end">
<svg xmlns="http://www.w3.org/2000/svg" width="100%" fill="currentColor" class="bi bi-x-circle" viewBox="0 0 16 16" aria-hidden="true" style="margin-right: 2em; margin-top: 1em; cursor: pointer;" xo-target="{@x:id}" id="{@x:id}_yes" onclick="[...document.querySelectorAll('#{@x:id}_no')].map(el => el.classList.remove('text-danger')); this.classList.toggle('text-success'); xdom.delay(500).then(_=>{{this.source.documentElement.removeAttribute('custom:code'); this.sourceNode.setAttribute('@state:checked', '0'); this.sourceNode.parentNode.setAttribute('@state:active', {(position() mod 9)+1}, !{(position() mod 9)}, true);}})" data-bs-target="#myCarousel">
<xsl:if test="not(position()=last())">
<xsl:attribute name="data-bs-slide">next</xsl:attribute>
</xsl:if>
<xsl:if test="@state:checked='0'">
<xsl:attribute name="class">bi bi-x-circle text-success</xsl:attribute>
</xsl:if>
<path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"/>
<path d="M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z"/>
</svg>
</div>
<div class="col-5">
<svg xmlns="http://www.w3.org/2000/svg" width="100%" fill="currentColor" class="bi bi-check-circle" viewBox="0 0 16 16" aria-hidden="true" style="margin-left: 2em; margin-top: 1em; cursor: pointer;" xo-target="{@x:id}" id="{@x:id}_no" onclick="[...document.querySelectorAll('#{@x:id}_yes')].map(el => el.classList.remove('text-success')); this.classList.toggle('text-danger'); xdom.delay(500).then(_=>{{this.source.documentElement.removeAttribute('custom:code'); this.sourceNode.setAttribute('@state:checked', 1); this.sourceNode.parentNode.setAttribute('@state:active', {($active mod 9)+1}, true);}})" data-bs-target="#myCarousel">
<xsl:if test="not(position()=last())">
<xsl:attribute name="data-bs-slide">next</xsl:attribute>
</xsl:if>
<xsl:if test="@state:checked='1'">
<xsl:attribute name="class">bi bi-x-circle text-danger</xsl:attribute>
</xsl:if>
<path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"/>
<path d="M10.97 4.97a.235.235 0 0 0-.02.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-1.071-1.05z"/>
</svg>
</div>
<div class="col"></div>
</div>
<div class="container">
<div class="carousel-caption">
<h1>
<xsl:value-of select="text()"/>
</h1>
</div>
</div>
</div>
</xsl:template>
<xsl:template match="cuestionario/*[opcion[not(@state:checked)]]">
<xsl:variable name="active">
<xsl:choose>
<xsl:when test="@state:active">
<xsl:value-of select="@state:active"/>
</xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<div id="myCarousel" class="carousel slide" data-bs-ride="carousel" data-bs-interval="false">
<style>
<![CDATA[/* GLOBAL STYLES
-------------------------------------------------- */
/* Padding below the footer and lighter body text */
body {
padding-top: 3rem;
padding-bottom: 3rem;
color: #5a5a5a;
}
.carousel-control-next-icon, .carousel-control-prev-icon {
margin-bottom: 2em;
}
/* CUSTOMIZE THE CAROUSEL
-------------------------------------------------- */
/* Carousel base class */
.carousel {
margin-bottom: 4rem;
}
/* Since positioning the image, we need to help out the caption */
.carousel-caption {
bottom: 3rem;
z-index: 10;
}
/* Declare heights because of positioning of img element */
.carousel-item {
height: 32rem;
}
.carousel-item > img {
position: absolute;
top: 0;
left: 0;
min-width: 100%;
height: 32rem;
}
/* MARKETING CONTENT
-------------------------------------------------- */
/* Center align the text within the three columns below the carousel */
.marketing .col-lg-4 {
margin-bottom: 1.5rem;
text-align: center;
}
.marketing h2 {
font-weight: 400;
}
/* rtl:begin:ignore */
.marketing .col-lg-4 p {
margin-right: .75rem;
margin-left: .75rem;
}
/* rtl:end:ignore */
/* Featurettes
------------------------- */
.featurette-divider {
margin: 5rem 0; /* Space out the Bootstrap <hr> more */
}
/* Thin out the marketing headings */
.featurette-heading {
font-weight: 300;
line-height: 1;
/* rtl:remove */
letter-spacing: -.05rem;
}
.carousel-control-next, .carousel-control-prev {
align-items: flex-end;
}
/* RESPONSIVE CSS
-------------------------------------------------- */
@media (min-width: 40em) {
/* Bump up size of carousel content */
.carousel-caption p {
margin-bottom: 1.25rem;
font-size: 1.25rem;
line-height: 1.4;
}
.featurette-heading {
font-size: 50px;
}
}
@media (min-width: 62em) {
.featurette-heading {
margin-top: 7rem;
}
}
]]>
</style>
<div class="carousel-indicators">
<xsl:apply-templates select="opcion" mode="indicator"/>
<!--<button type="button" data-bs-target="#myCarousel" data-bs-slide-to="0" class="active" aria-current="true" aria-label="Slide 1"></button>
<button type="button" data-bs-target="#myCarousel" data-bs-slide-to="1" aria-label="Slide 2"></button>
<button type="button" data-bs-target="#myCarousel" data-bs-slide-to="2" aria-label="Slide 3"></button>-->
</div>
<div class="carousel-inner">
<xsl:apply-templates select="opcion"/>
</div>
<button class="carousel-control-prev" type="button" data-bs-target="#myCarousel" data-bs-slide="prev" xo-target="{@x:id}" onclick="xdom.delay(500).then(_=>{{this.sourceNode.setAttribute('@state:active', eval({translate(string(($active mod 9)-1),'-0',' ')}) || 1)}})">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="visually-hidden">No</span>
</button>
<button class="carousel-control-next" type="button" data-bs-target="#myCarousel" data-bs-slide="next" xo-target="{@x:id}" onclick="xdom.delay(500).then(_=>{{this.sourceNode.setAttribute('@state:active', {($active mod 9)+1})}})">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="visually-hidden">Sí</span>
</button>
</div>
</xsl:template>
</xsl:stylesheet>