source: firmaeventos/eventos/templates/evento.update.participantes.html @ a818633

Last change on this file since a818633 was a28e55b, checked in by lhernandez <lhernandez@…>, 7 years ago

Implementado Update para agregar o eliminar participantes del evento

  • Property mode set to 100644
File size: 4.6 KB
Line 
1{% extends 'base.template.html' %}
2{% load staticfiles %}
3{% block title %}Actualizar 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">
54        <h5 class="center">Datos del Evento</h5><hr/><br>
55        <form id="form" method="post" enctype="multipart/form-data">
56            {% csrf_token %}
57            <div class="center">
58                <div class="input-field {% if form.nombre_evento.errors %}invalid{% endif %}">
59                    {{ form.nombre_evento }}
60                    <label for="icon_prefix {{ form.nombre_evento.auto_id }}">Nombre</label>
61                    {% include 'base.forms.errors.html' with form_errors=form.nombre_evento.errors col_title_error='col s2' col_msg_error='col s10' %}
62                </div>
63               
64                <div class="input-field {% if form.fecha.errors %}invalid{% endif %}">
65                    <i class="tiny material-icons prefix">perm_contact_calendar</i>
66                    {{ form.fecha }}
67                    <label for="icon_prefix {{ form.fecha.auto_id }}">Fecha</label>
68                    {% include 'base.forms.errors.html' with form_errors=form.fecha.errors col_title_error='col s2' col_msg_error='col s10' %}
69                </div>
70            </div>
71            <div class="center">
72            <h5>Agregar Participantes</h5><hr/><br>
73            <table class="striped" id="id_orders_table">
74                <thead>
75                  <tr>
76                      <th scope="col">Nombres</th>
77                      <th scope="col">Apellidos</th>
78                      <th scope="col">Pasaporte</th>
79                      <th scope="col">Correo</th>
80                      <th scope="col">Opcion</th>
81                  </tr>
82                </thead>
83                <tbody>
84                {{ form2.management_form }}
85                {% for form in form2  %}
86                <tr id="{{ form.prefix }}-row">
87                {{ form.id }}
88                  <td>
89                  {{form.nombres}}
90                  </td>
91                  <td>
92                  {{form.apellidos}}
93                  </td>
94                  <td>
95                  {{form.pasaporte}}
96                  </td>
97                  <td>
98                  {{form.correo}}
99                  </td>
100                  <td></td>
101                </tr>
102                {% endfor %}
103                </tbody>
104            </table>
105            </div>
106            <div class="center">
107                <button type="submit" class="btn waves-effect blue darken-1">Actualizar Evento</button>
108            </div>
109            </div>
110        </form>
111    </div>
112{% endblock %}
Note: See TracBrowser for help on using the repository browser.