Skip to content

Commit

Permalink
insertar asistente en directo
Browse files Browse the repository at this point in the history
  • Loading branch information
franexposito committed Jun 15, 2015
1 parent f2d2b60 commit 6db62a2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
7 changes: 6 additions & 1 deletion _dt/js/event.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ $(document).ready(function() {

$('.select-asistentes').select2();

$('#delete-href').on('click', function(evt) {
$('.delete-eve').on('click', function(evt) {
evt.preventDefault();
var data = {
'id': $('.event-content').data('id')
Expand All @@ -28,6 +28,7 @@ $(document).ready(function() {
type: 'POST',
url: '/eliminarEvento',
data: data,
type: 'json',
success: function(resp) {
if (resp.response === true) {
window.location = "/miseventos";
Expand Down Expand Up @@ -55,8 +56,12 @@ $(document).ready(function() {
type: 'POST',
url: '/iAsistente',
data: data,
dataType: 'json',
success: function(resp) {
var as = '<tr><th>'+data.nombre+'</th><th>'+data.apellidos+'</th><th>'+data.dni+'</th><th>No ha asistido</th><th><button data-id="" class="btn btn-default delete-button"><i class="fa fa-times"></i></button></th><th><button data-id="" class="btn btn-default pdf-button"><i class="fa fa-file-pdf-o"></i></button></th></tr>';

$('#modalAsistente').modal('hide');
$('.tasistentes').append(as);
}
});
});
Expand Down
10 changes: 7 additions & 3 deletions templates/templateEvents.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ <h1>{{ evento.nombre }} <small>{{ evento.fecha }} - {{ evento.hora }}</small></
{% if userCreador %}
<div class="options-panel pull-right">
<a href="/mEvento?id={{ evento.getKey() }}"><button class="btn btn-option"><i class="fa fa-pencil-square-o"></i> <strong>Modificar</strong></button></a>
<button class="btn btn-option"><i class="fa fa-trash-o"></i> <strong>Eliminar</strong></button>
<button class="btn btn-option delete-eve"><i class="fa fa-trash-o"></i> <strong>Eliminar</strong></button>
</div>
{% endif %}
</div>
Expand Down Expand Up @@ -117,13 +117,17 @@ <h5>Ubicación</h5>
<th></th>
</tr>
</thead>
<tbody>
<tbody class="tasistentes">
{% for a in evento.asistentes %}
<tr>
<th>{{ a.nombre }}</th>
<th>{{ a.apellidos }}</th>
<th>{{ a.dni }}</th>
<th></th>
{% if a.asistido %}
<th>Asistido</th>
{% else %}
<th>No ha asistido</th>
{% endif %}
<th><button data-id="" class="btn btn-default delete-button"><i class="fa fa-times"></i></button></th>
<th><button data-id="" class="btn btn-default pdf-button"><i class="fa fa-file-pdf-o"></i></button></th>
</tr>
Expand Down

0 comments on commit 6db62a2

Please sign in to comment.