1 | {% extends 'explicacion.situacional.html' %} |
---|
2 | {% load staticfiles %} |
---|
3 | {% block titulo %} |
---|
4 | _-=SAPIC-Registrar {{consulta.fk_caracterizacion}} =-_ |
---|
5 | {% endblock titulo%} |
---|
6 | {% block extracss %} |
---|
7 | <link rel="stylesheet" href="{% static 'plugins/bootstrap-fileinput/css/fileinput.min.css' %}"> |
---|
8 | <link rel="stylesheet" type="text/css" href="{% static 'css/ol.css' %}"> |
---|
9 | <link rel="stylesheet" type="text/css" href="{% static 'css/ol3.css' %}"> |
---|
10 | <link rel="stylesheet" type="text/css" href="{% static 'plugins/iCheck/line/_all.css' %}"/> |
---|
11 | {% endblock extracss %} |
---|
12 | |
---|
13 | {% block extrajs %} |
---|
14 | <script type="text/javascript"> |
---|
15 | var USER = "{{ request.user.pk }}"; |
---|
16 | var ENCUESTA = "{{consulta.pk}}"; |
---|
17 | var URL = window.location.pathname; |
---|
18 | </script> |
---|
19 | <script src="{% static 'plugins/bootstrap-fileinput/js/fileinput.min.js' %}"></script> |
---|
20 | <script src="{% static 'js/attrchange.js' %}"></script> |
---|
21 | <script src="{% static 'js/bootbox.min.js' %}"></script> |
---|
22 | <script src="{% static 'js/funciones.js' %}"></script> |
---|
23 | <script src="{% static 'plugins/iCheck/icheck.js' %}"></script> |
---|
24 | <script type="text/javascript" src="{% static 'js/ol.js' %}"></script> |
---|
25 | <script type="text/javascript" src="{% static 'js/OLMapWidget.js' %}"></script> |
---|
26 | <script type="text/javascript"> |
---|
27 | $(document).ready(function(){ |
---|
28 | $('.icheck').each(function(){ |
---|
29 | var self = $(this); |
---|
30 | label = self.prev(), |
---|
31 | label_text = label.text(); |
---|
32 | |
---|
33 | label.remove(); |
---|
34 | self.iCheck({ |
---|
35 | checkboxClass: 'icheckbox_line-blue', |
---|
36 | radioClass: 'iradio_line-blue', |
---|
37 | insert: '<div class="icheck_line-icon"></div>' + label_text |
---|
38 | }); |
---|
39 | }); |
---|
40 | |
---|
41 | // Se chequea el campo de |
---|
42 | $('.iradio_line-blue').attrchange({ |
---|
43 | trackValues: true, // set to true so that the event object is updated with old & new values |
---|
44 | callback: function(evnt) { |
---|
45 | if(evnt.attributeName == "class") { // which attribute you want to watch for changes |
---|
46 | if(evnt.newValue.search("checked") != -1) { // "open" is the class name you search for inside "class" attribute |
---|
47 | var padre = $(this).parent(); |
---|
48 | var just = padre.find('textarea'); |
---|
49 | if (just.length != 0) { |
---|
50 | var option = padre.find('.checked').find('input'); |
---|
51 | if (option.val() == "No") { |
---|
52 | $('#div_justificar_'+option.attr('id')).show(); |
---|
53 | } |
---|
54 | else{ |
---|
55 | $('#div_justificar_'+option.attr('id')).hide(); |
---|
56 | } |
---|
57 | } |
---|
58 | } |
---|
59 | } |
---|
60 | } |
---|
61 | }); |
---|
62 | }); |
---|
63 | </script> |
---|
64 | {% endblock extrajs %} |
---|
65 | {% block contenido_principal %} |
---|
66 | <div class="col-xs-12"> |
---|
67 | <div class="panel-sapic"> |
---|
68 | <section class="content-header"> |
---|
69 | <h2> |
---|
70 | Registrar Ecuesta de la {{consulta.fk_caracterizacion}} |
---|
71 | <small>Muestra el formulario de la encuesta para registra la participacion de la comunidad</small> |
---|
72 | </h2> |
---|
73 | </section> |
---|
74 | <section class="content"> |
---|
75 | <div class="row"> |
---|
76 | <div class="col-md-12"> |
---|
77 | </div> |
---|
78 | </div> |
---|
79 | <button class="btn btn-primary btn-lg center-block" data-toggle="modal" data-target="#consultaModal"> Participar en la encuesta </button> |
---|
80 | |
---|
81 | <div class="modal fade" id="consultaModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> |
---|
82 | <div class="modal-content"> |
---|
83 | <div class="modal-header"> |
---|
84 | <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> |
---|
85 | <h4 class="modal-title" id="myModalLabel"> Encuesta de: {{consulta|title}} </h4> |
---|
86 | </div> |
---|
87 | <div class="modal-body"> |
---|
88 | <form action="" role="form" class="form form-horizontal validate-form" method="post" autocomplete="off" id="encuesta_form"> |
---|
89 | {% csrf_token %} |
---|
90 | <div class="row text-center"> |
---|
91 | <h1>{{consulta|title}}</h1><hr> |
---|
92 | <div class="row center-block" style="width: 90%"> |
---|
93 | <div class="progress non-null" role="progressbar" id="status" > |
---|
94 | <div class="progress-bar progress-bar active" aria-valuemin="0" aria-valuemax="100" style="width: 0%;"> |
---|
95 | <div class="bar" style="width:100%"><span style="color:black;">Progreso de la encuesta</span></div> |
---|
96 | </div> |
---|
97 | </div> |
---|
98 | </div> |
---|
99 | <div id="myCarousel" class="carousel slide" data-ride="carousel" data-interval="false"> |
---|
100 | <!-- Indicators --> |
---|
101 | <ol class="carousel-indicators"> |
---|
102 | {% for key, value in preguntas.items %} |
---|
103 | <li data-target="#myCarousel" class="{% if forloop.counter0 == 0 %}active{%endif%}"></li> |
---|
104 | {% endfor %} |
---|
105 | <li data-target="#myCarousel"></li> |
---|
106 | </ol> |
---|
107 | |
---|
108 | <!-- Wrapper for slides --> |
---|
109 | <div class="carousel-inner" role="listbox"> |
---|
110 | {% for key, value in preguntas.items %} |
---|
111 | <div class="col-md-6 col-sm-6 col-xs-6 col-xs-offset-3 col-md-offset-3 col-sm-offset-3 item {% if forloop.counter == 1 %}active{% endif %}"> |
---|
112 | <div class="row"> |
---|
113 | <label class="control-label"> |
---|
114 | {{ value.label | safe }} |
---|
115 | </label> |
---|
116 | </div> |
---|
117 | <div class="row"> |
---|
118 | {{ value.field | safe }} |
---|
119 | </div> |
---|
120 | </div> |
---|
121 | {% endfor %} |
---|
122 | <div class="col-md-6 col-sm-6 col-xs-6 col-xs-offset-3 col-md-offset-3 col-sm-offset-3 item"> |
---|
123 | <div class="row"> |
---|
124 | <button type="submit" onclick="send_poll(event);" class="btn btn-success"> |
---|
125 | Registrar Participación |
---|
126 | </button> |
---|
127 | </div> |
---|
128 | </div> |
---|
129 | </div> |
---|
130 | |
---|
131 | |
---|
132 | <!-- Left and right controls --> |
---|
133 | <a class="left carousel-control" href="#myCarousel" role="button" onclick="go_back();"> |
---|
134 | <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span> |
---|
135 | <span class="sr-only">Anterior</span> |
---|
136 | </a> |
---|
137 | <a class="right carousel-control" href="#myCarousel" role="button" onclick="control_progress();"> |
---|
138 | <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span> |
---|
139 | <span class="sr-only">Siguiente</span> |
---|
140 | </a> |
---|
141 | </div> |
---|
142 | </div> |
---|
143 | </form> |
---|
144 | <div class="modal-footer"> |
---|
145 | <a type="button" class="btn btn-info pull-left" href="{% url 'explicacion:explicacion_situacional' %}">Regresar</a> |
---|
146 | </div> |
---|
147 | </div> |
---|
148 | </div><!-- /.modal-content --> |
---|
149 | </div><!-- /.modal --> |
---|
150 | </section> |
---|
151 | </div> |
---|
152 | </div> |
---|
153 | {% endblock contenido_principal %} |
---|
154 | |
---|