[8fa24c3] | 1 | {% extends 'base.template.html' %} |
---|
| 2 | {% load staticfiles %} |
---|
| 3 | {% block title %}Registrar Evento{% endblock title %} |
---|
[94b3e3f] | 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 | }) |
---|
| 15 | $('.datepicker').pickadate({ |
---|
| 16 | selectMonths: true, // Creates a dropdown to control month |
---|
| 17 | selectYears: 15, // Creates a dropdown of 15 years to control year, |
---|
| 18 | today: 'Today', |
---|
| 19 | clear: 'Clear', |
---|
| 20 | close: 'Ok', |
---|
| 21 | closeOnSelect: false, // Close upon selecting a date, |
---|
| 22 | format: "dd/mm/yyyy", |
---|
| 23 | }); |
---|
| 24 | }) |
---|
| 25 | </script> |
---|
| 26 | {%endblock%} |
---|
| 27 | |
---|
[8fa24c3] | 28 | {% block content %} |
---|
| 29 | <div class="content center"> |
---|
[94b3e3f] | 30 | <h5>Datos del Evento</h5><hr/><br> |
---|
[8fa24c3] | 31 | <form id="form" method="post"> |
---|
| 32 | {% csrf_token %} |
---|
[94b3e3f] | 33 | <div class="input-field {% if form.nombre_evento.errors %}invalid{% endif %}"> |
---|
| 34 | {{ form.nombre_evento }} |
---|
| 35 | <label for="icon_prefix {{ form.nombre_evento.auto_id }}">Nombre</label> |
---|
| 36 | {% include 'base.forms.errors.html' with form_errors=form.nombre_evento.errors col_title_error='col s2' col_msg_error='col s10' %} |
---|
[8fa24c3] | 37 | </div> |
---|
| 38 | |
---|
[94b3e3f] | 39 | <div class="input-field {% if form.fecha.errors %}invalid{% endif %}"> |
---|
| 40 | <i class="tiny material-icons prefix">perm_contact_calendar</i> |
---|
| 41 | {{ form.fecha }} |
---|
| 42 | <label for="icon_prefix {{ form.fecha.auto_id }}">Fecha</label> |
---|
| 43 | {% include 'base.forms.errors.html' with form_errors=form.fecha.errors col_title_error='col s2' col_msg_error='col s10' %} |
---|
[8fa24c3] | 44 | </div> |
---|
| 45 | |
---|
[94b3e3f] | 46 | <div class="file-field input-field {% if form.archivo.errors %}invalid{% endif %}"> |
---|
| 47 | |
---|
| 48 | <div class="btn"> |
---|
| 49 | <span for="icon_prefix {{ form.archivo.auto_id }}">Archivo</span> |
---|
| 50 | <input type="file"> |
---|
| 51 | </div> |
---|
[8fa24c3] | 52 | <div class="file-path-wrapper"> |
---|
[94b3e3f] | 53 | {{ form.archivo }} |
---|
[8fa24c3] | 54 | </div> |
---|
[94b3e3f] | 55 | {% include 'base.forms.errors.html' with form_errors=form.archivo.errors col_title_error='col s2' col_msg_error='col s10' %} |
---|
[8fa24c3] | 56 | </div> |
---|
[94b3e3f] | 57 | <h5>Datos de los Participantes</h5><hr/><br> |
---|
| 58 | <table class="striped" id="id_orders_table"> |
---|
| 59 | <thead> |
---|
| 60 | <tr> |
---|
| 61 | <th scope="col">Nombres</th> |
---|
| 62 | <th scope="col">Apellidos</th> |
---|
| 63 | <th scope="col">Pasaporte</th> |
---|
| 64 | <th scope="col">Correo</th> |
---|
| 65 | <th scope="col">Opcion</th> |
---|
| 66 | </tr> |
---|
| 67 | </thead> |
---|
| 68 | <tbody> |
---|
| 69 | {{ form2.management_form }} |
---|
| 70 | {% for form in form2 %} |
---|
| 71 | <tr id="{{ form.prefix }}-row"> |
---|
| 72 | <td> |
---|
| 73 | {{form.nombres}} |
---|
| 74 | </td> |
---|
| 75 | <td> |
---|
| 76 | {{form.apellidos}} |
---|
| 77 | </td> |
---|
| 78 | <td> |
---|
| 79 | {{form.pasaporte}} |
---|
| 80 | </td> |
---|
| 81 | <td> |
---|
| 82 | {{form.correo}} |
---|
| 83 | </td> |
---|
| 84 | <td></td> |
---|
| 85 | </tr> |
---|
| 86 | {% endfor %} |
---|
| 87 | </tbody> |
---|
| 88 | </table> |
---|
[8fa24c3] | 89 | <div> |
---|
| 90 | <button type="submit" class="btn waves-effect red darken-1">Registrar</button> |
---|
| 91 | </div> |
---|
| 92 | </div> |
---|
| 93 | </form> |
---|
| 94 | </div> |
---|
| 95 | {% endblock %} |
---|