source: firmaeventos/eventos/templates/register.event.html @ 33420cd

Last change on this file since 33420cd was a4764f9, checked in by lhernandez <lhernandez@…>, 7 years ago

Optimizado registro de eventos, preparando proyecto para las firmas

  • Property mode set to 100644
File size: 5.0 KB
Line 
1{% extends 'base.template.html' %}
2{% load staticfiles %}
3{% block title %}Registrar Evento{% endblock title %}
4{% block extraJs %}
5    <script src="{% static "js/formset.js" %}"></script>
6    <script type="text/javascript">
7    $(function() {
8        $('#id_orders_table tbody tr').formset({
9            // For inline formsets, be sure to set the prefix, as the default prefix
10            // ('form') isn't correct.
11            // Django appears to generate the prefix from the lowercase plural
12            // name of the related model, with camel-case converted to underscores.
13            prefix: 'form',
14            addText:'<i class="tiny material-icons prefix">add_circle_outline</i>Agregar Participante',
15            deleteText:'<i class="material-icons">delete_forever</i>',
16        })
17
18          $('.datepicker').pickadate({
19            selectMonths: true, // Creates a dropdown to control month
20            selectYears: 15, // Creates a dropdown of 15 years to control year,
21            today: 'Today',
22            clear: 'Clear',
23            close: 'Ok',
24            closeOnSelect: false, // Close upon selecting a date,
25            format: "dd/mm/yyyy",
26            // The title label to use for the month nav buttons
27            labelMonthNext: 'Mes siguiente',
28            labelMonthPrev: 'Mes anterior',
29
30            // The title label to use for the dropdown selectors
31            labelMonthSelect: 'Selecciona un mes',
32            labelYearSelect: 'Selecciona un año',
33
34            // Months and weekdays
35            monthsFull: [ 'Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre' ],
36            monthsShort: [ 'Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic' ],
37            weekdaysFull: [ 'Domingo', 'Lunes', 'Martes', 'Miércoles', 'Jueves', 'Viernes', 'Sábado' ],
38            weekdaysShort: [ 'Dom', 'Lun', 'Mar', 'Mie', 'Jue', 'Vie', 'Sab' ],
39
40            // Materialize modified
41            weekdaysLetter: [ 'D', 'L', 'M', 'Mi', 'J', 'V', 'S' ],
42
43            // Today and clear
44            today: 'Hoy',
45            clear: 'Limpiar',
46            close: 'Ok',
47          });
48    })
49    </script>
50{%endblock%}
51
52{% block content %}
53    <div class="content center">
54        <h5>Datos del Evento</h5><hr/><br>
55        <form id="form" method="post" enctype="multipart/form-data">
56            {% csrf_token %}
57            <div class="input-field {% if form.nombre_evento.errors %}invalid{% endif %}">
58                {{ form.nombre_evento }}
59                <label for="icon_prefix {{ form.nombre_evento.auto_id }}">Nombre</label>
60                {% include 'base.forms.errors.html' with form_errors=form.nombre_evento.errors col_title_error='col s2' col_msg_error='col s10' %}
61            </div>
62           
63            <div class="input-field {% if form.fecha.errors %}invalid{% endif %}">
64                <i class="tiny material-icons prefix">perm_contact_calendar</i>
65                {{ form.fecha }}
66                <label for="icon_prefix {{ form.fecha.auto_id }}">Fecha</label>
67                {% include 'base.forms.errors.html' with form_errors=form.fecha.errors col_title_error='col s2' col_msg_error='col s10' %}
68            </div>
69
70            <div class="file-field input-field {% if form.archivo.errors %}invalid{% endif %}">
71               
72                <div class="btn">
73                <span for="icon_prefix {{ form.archivo.auto_id }}">Archivo</span>
74                    <input type="file" name="file" id="file" accept=".pdf">
75                </div>
76                <div class="file-path-wrapper">
77                    {{ form.archivo }}
78                </div>
79                {% include 'base.forms.errors.html' with form_errors=form.archivo.errors col_title_error='col s2' col_msg_error='col s10' %}
80            </div>
81            <h5>Datos de los Participantes</h5><hr/><br>
82            <table class="striped" id="id_orders_table">
83                <thead>
84                  <tr>
85                      <th scope="col">Nombres</th>
86                      <th scope="col">Apellidos</th>
87                      <th scope="col">Pasaporte</th>
88                      <th scope="col">Correo</th>
89                      <th scope="col">Opcion</th>
90                  </tr>
91                </thead>
92                <tbody>
93                {{ form2.management_form }}
94                {% for form in form2  %}
95                <tr id="{{ form.prefix }}-row">
96                  <td>
97                  {{form.nombres}}
98                  </td>
99                  <td>
100                  {{form.apellidos}}
101                  </td>
102                  <td>
103                  {{form.pasaporte}}
104                  </td>
105                  <td>
106                  {{form.correo}}
107                  </td>
108                  <td></td>
109                </tr>
110                {% endfor %}
111                </tbody>
112            </table>
113            <div>
114                <button type="submit" class="btn waves-effect red darken-1">Registrar</button>
115            </div>
116            </div>
117        </form>
118    </div>
119{% endblock %}
Note: See TracBrowser for help on using the repository browser.