Sistemas Clientes modulos permisos finished
This commit is contained in:
39
Templates/IMMEX/modulos/edit_permisos.html
Normal file
39
Templates/IMMEX/modulos/edit_permisos.html
Normal file
@@ -0,0 +1,39 @@
|
||||
{% extends 'base.html' %}
|
||||
{% load widget_tweaks %}
|
||||
|
||||
{% block title %}Add Cliente IMMEX {% endblock title %}
|
||||
|
||||
{% block content %}
|
||||
<h2>Crear Módulo/Permisos</h2>
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
|
||||
<h3>Selecciona Módulo</h3>
|
||||
{{ modulo_formset.management_form }}
|
||||
{% for form in modulo_formset.forms %}
|
||||
<div class="form-group">
|
||||
{{ form}}
|
||||
</div>
|
||||
|
||||
{% endfor %}
|
||||
|
||||
<h3>Selecciona Permisos para modulo</h3>
|
||||
<div class="">
|
||||
|
||||
{{ permiso_formset.management_form }}
|
||||
{% for form in permiso_formset.forms %}
|
||||
<div class="form-group">
|
||||
{{ form }}
|
||||
|
||||
</div>
|
||||
|
||||
{% endfor %}
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<button type="submit" class="btn btn-outline-success">Guardar</button>
|
||||
</form>
|
||||
{% endblock %}
|
||||
36
Templates/IMMEX/modulos/modulo-create.html
Normal file
36
Templates/IMMEX/modulos/modulo-create.html
Normal file
@@ -0,0 +1,36 @@
|
||||
{% extends 'base.html' %}
|
||||
{% load widget_tweaks %}
|
||||
|
||||
{% block title %}Add Cliente IMMEX {% endblock title %}
|
||||
|
||||
{% block content %}
|
||||
<h2>Crear Módulo/Permisos</h2>
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
|
||||
<h3>Selecciona Módulo</h3>
|
||||
{{ modulo_formset.management_form }}
|
||||
{% for form in modulo_formset.forms %}
|
||||
{{ form.as_table }}
|
||||
|
||||
{% endfor %}
|
||||
|
||||
<h3>Selecciona Permisos para modulo</h3>
|
||||
<div class="">
|
||||
|
||||
{{ permiso_formset.management_form }}
|
||||
{% for form in permiso_formset.forms %}
|
||||
<div class="form-group">
|
||||
{{ form }}
|
||||
|
||||
</div>
|
||||
|
||||
{% endfor %}
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<button type="submit" class="btn btn-outline-success">Guardar</button>
|
||||
</form>
|
||||
{% endblock %}
|
||||
83
Templates/IMMEX/modulos/modulos_clientes.html
Normal file
83
Templates/IMMEX/modulos/modulos_clientes.html
Normal file
@@ -0,0 +1,83 @@
|
||||
{% 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 %}
|
||||
Reference in New Issue
Block a user