1 | {% extends 'base.template.html' %} |
---|
2 | {% load staticfiles %} |
---|
3 | {% block title %}Participar en Consulta{% endblock %} |
---|
4 | {% block content %} |
---|
5 | <form action="" role="form" method="post" autocomplete="off" id="encuesta_form"> |
---|
6 | {% csrf_token %} |
---|
7 | <div class="swiper-container"> |
---|
8 | <div class="swiper-wrapper"> |
---|
9 | |
---|
10 | {% for key, value in preguntas.items %} |
---|
11 | <div class="swiper-slide"> |
---|
12 | {{ value.label | safe }} |
---|
13 | <div class="input-field"> |
---|
14 | {{ value.field | safe }} |
---|
15 | </div> |
---|
16 | </div> |
---|
17 | {% endfor %} |
---|
18 | <div class="swiper-slide"> |
---|
19 | <div class="center"> |
---|
20 | <a type="button" class="btn submit waves-effect blue lighten-1" onclick="send_poll();">Enviar</a> |
---|
21 | </div> |
---|
22 | </div> |
---|
23 | |
---|
24 | </div> |
---|
25 | <div class="swiper-pagination"></div> |
---|
26 | <div class="swiper-button-next"></div> |
---|
27 | <div class="swiper-button-prev"></div> |
---|
28 | </div> |
---|
29 | <a type="button" class="btn waves-effect blue lighten-1" href="{% url 'participacion_index' %}">Regresar</a> |
---|
30 | </form> |
---|
31 | |
---|
32 | {% endblock %} |
---|
33 | |
---|
34 | {% block extraJs %} |
---|
35 | <script> |
---|
36 | $(document).ready(function(){ |
---|
37 | var swiper = $('.swiper-container').swiper({ |
---|
38 | pagination: '.swiper-pagination', |
---|
39 | effect: 'slide', |
---|
40 | centeredSlides: true, |
---|
41 | paginationType: 'progress', |
---|
42 | nextButton: '.swiper-button-next', |
---|
43 | prevButton: '.swiper-button-prev', |
---|
44 | speed: 800, |
---|
45 | spaceBetween: 80, |
---|
46 | allowSwipeToNext:false |
---|
47 | }); |
---|
48 | swiper.nextButton.click(function(){ |
---|
49 | swiper.unlockSwipeToNext(); |
---|
50 | var progreso = control_progress(); |
---|
51 | if (progreso) { |
---|
52 | swiper.slideNext(); |
---|
53 | } |
---|
54 | swiper.lockSwipeToNext(); |
---|
55 | }); |
---|
56 | }); |
---|
57 | </script> |
---|
58 | {% endblock %} |
---|