83 lines
2.7 KiB
HTML
83 lines
2.7 KiB
HTML
{% extends 'base.html' %}
|
|
{% block title %}Add Modulos Por cliente {% endblock title %}
|
|
|
|
{% block content %}
|
|
<table class="table">
|
|
<thead class="thead-dark">
|
|
<tr>
|
|
<th scope="col">#</th>
|
|
<th scope="col">Sistema-cliente</th>
|
|
<th><a class="btn btn-info" href="{% url 'permisos-clientesModulos-create' %}">Agregar Modulos por cliente</a></th>
|
|
|
|
</tr>
|
|
</thead>
|
|
|
|
<tbody>
|
|
{% for row in object_list %}
|
|
<tr>
|
|
<th>{{row.id}}</th>
|
|
<th scope="row">{{row.sistema_cliente}}</th>
|
|
<th>
|
|
<div class="row ml-2">
|
|
<div class="row-col mr-1">
|
|
<a class="btn btn-outline-info" href="{% url 'permisos-clientesModulos-update' row.pk %}">Edit</a>
|
|
</div>
|
|
|
|
<div class="row-col">
|
|
<button type="button" class="btn btn-danger" onclick="llamarAction(`{% url 'permisos-clientesModulos-delete' row.pk %}`)">
|
|
Eliminar
|
|
</button>
|
|
|
|
</div>
|
|
</div>
|
|
</th>
|
|
|
|
|
|
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
|
|
<!-- Modal -->
|
|
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
|
|
<div class="modal-dialog" role="document">
|
|
<form id="delete-form" method="post" >
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h5 class="modal-title" id="exampleModalLabel">Modal title</h5>
|
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
|
<span aria-hidden="true">×</span>
|
|
</button>
|
|
</div>
|
|
<div class="modal-body">
|
|
{% csrf_token %}
|
|
<input type="hidden" name="next" value="{% url 'permisos-clientesModulos' %}">
|
|
Seguro que deseas borrar el registro ?
|
|
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
|
<button type="submmit" class="btn btn-danger">Eliminar</button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<script>
|
|
function addAction(url){
|
|
var formulario = document.getElementById('delete-form');
|
|
formulario.setAttribute('action',url);
|
|
}
|
|
function llamarAction(nuevaRuta) {
|
|
console.log(nuevaRuta)
|
|
addAction(nuevaRuta);
|
|
|
|
// Aquí puedes agregar cualquier otra lógica que desees realizar cuando se presiona el botón
|
|
// Por ejemplo, mostrar el modal
|
|
$('#exampleModal').modal('show');
|
|
}
|
|
</script>
|
|
{% endblock content %} |