-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #966 from ricval/Exhortos-Estados-y-municipios-vistas
Exhortos - estados y municipios vistas
- Loading branch information
Showing
6 changed files
with
241 additions
and
2 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
plataforma_web/blueprints/estados/templates/estados/detail.jinja2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{% extends 'layouts/app.jinja2' %} | ||
{% import 'macros/detail.jinja2' as detail %} | ||
{% import 'macros/modals.jinja2' as modals %} | ||
{% import 'macros/topbar.jinja2' as topbar %} | ||
|
||
{% block title %}Estado{% endblock %} | ||
|
||
{% block topbar_actions %} | ||
{% call topbar.page_buttons(estado.nombre) %} | ||
{{ topbar.button_previous('Estados', url_for('estados.list_active')) }} | ||
{% endcall %} | ||
{% endblock %} | ||
|
||
{% block content %} | ||
{% call detail.card(estatus=estado.estatus) %} | ||
{{ detail.label_value('Clave', estado.clave) }} | ||
{{ detail.label_value('Nombre', estado.nombre) }} | ||
{{ detail.label_value('Fecha de creación', estado.creado.strftime('%Y-%m-%d %H:%M')) }} | ||
{% endcall %} | ||
{% endblock %} | ||
|
||
{% block custom_javascript %} | ||
{% endblock %} |
78 changes: 78 additions & 0 deletions
78
plataforma_web/blueprints/estados/templates/estados/list.jinja2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
{% extends 'layouts/app.jinja2' %} | ||
{% import 'macros/list.jinja2' as list %} | ||
{% import 'macros/topbar.jinja2' as topbar %} | ||
|
||
{% block title %}Estados{% endblock %} | ||
|
||
{% block topbar_actions %} | ||
{% call topbar.page_buttons(titulo) %} | ||
{% endcall %} | ||
{% endblock %} | ||
|
||
{% block content %} | ||
{% call list.card() %} | ||
<!-- Filtros CidFormatos --> | ||
<div class="row"> | ||
<div class="col"> | ||
<form class="row g-1 mb-3" id="filtradorForm" onsubmit="filtrosEstados.buscar(); return false;"> | ||
<div class="col-2"> | ||
<div class="form-floating"> | ||
<input id="filtroClave" type="text" class="form-control" aria-label="Clave"> | ||
<label for="filtroClave">Clave</label> | ||
</div> | ||
</div> | ||
<div class="col-8"> | ||
<div class="form-floating"> | ||
<input id="filtroNombre" type="text" class="form-control" aria-label="Nombre" style="text-transform: uppercase;"> | ||
<label for="filtroNombre">Nombre</label> | ||
</div> | ||
</div> | ||
<div class="col-2 text-end"> | ||
<button title="Buscar" class="btn btn-primary btn-lg" onclick="filtrosEstados.buscar(); return false;" id="button-buscar"><span class="iconify" data-icon="mdi:magnify"></span></button> | ||
<button title="Limpiar" class="btn btn-warning btn-lg" type="reset" onclick="filtrosEstados.limpiar();" id="button-limpiar"><span class="iconify" data-icon="mdi:broom"></span></button> | ||
</div> | ||
</form> | ||
</div> | ||
</div> | ||
<!-- Datatable de estados --> | ||
<table id="estados_datatable" class="table {% if estatus == 'B'%}table-dark{% endif %} display nowrap" style="width:100%"> | ||
<thead> | ||
<tr> | ||
<th>Claves</th> | ||
<th>Nombres</th> | ||
</tr> | ||
</thead> | ||
</table> | ||
{% endcall %} | ||
{% endblock %} | ||
|
||
{% block custom_javascript %} | ||
<script src="/static/js/datatables-constructor.js"></script> | ||
<script src="/static/js/datatables-filtros.js"></script> | ||
<script> | ||
// DataTable Estados | ||
const constructorDataTable = new ConfigDataTable( '{{ csrf_token() }}' ); | ||
let configDTEstados = constructorDataTable.config(); | ||
configDTEstados['ajax']['url'] = '/estados/datatable_json'; | ||
configDTEstados['ajax']['data'] = {{ filtros }}; | ||
configDTEstados['columns'] = [ | ||
{ data: 'detalle' }, | ||
{ data: 'nombre' }, | ||
]; | ||
configDTEstados['columnDefs'] = [ | ||
{ | ||
targets: 0, // detalle | ||
data: null, | ||
render: function(data, type, row, meta) { | ||
return '<a href="' + data.url + '">' + data.clave + '</a>'; | ||
} | ||
} | ||
]; | ||
// Filtros Cid Procedimientos | ||
const filtrosEstados = new FiltrosDataTable('#estados_datatable', configDTEstados); | ||
filtrosEstados.agregarInput('filtroClave', 'clave'); | ||
filtrosEstados.agregarInput('filtroNombre', 'nombre'); | ||
filtrosEstados.precargar(); | ||
</script> | ||
|
||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
plataforma_web/blueprints/municipios/templates/municipios/detail.jinja2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{% extends 'layouts/app.jinja2' %} | ||
{% import 'macros/detail.jinja2' as detail %} | ||
{% import 'macros/modals.jinja2' as modals %} | ||
{% import 'macros/topbar.jinja2' as topbar %} | ||
|
||
{% block title %}Municipio{% endblock %} | ||
|
||
{% block topbar_actions %} | ||
{% call topbar.page_buttons(municipio.nombre) %} | ||
{{ topbar.button_previous('Municipios', url_for('municipios.list_active')) }} | ||
{% endcall %} | ||
{% endblock %} | ||
|
||
{% block content %} | ||
{% call detail.card(estatus=municipio.estatus) %} | ||
{{ detail.label_value('Clave del Municipio', municipio.clave) }} | ||
{{ detail.label_value('Nombre del Muncipio', municipio.nombre) }} | ||
{{ detail.label_value('Clave del Estado', municipio.estado.clave) }} | ||
{{ detail.label_value('Nombre del Estado', municipio.estado.nombre) }} | ||
{{ detail.label_value('Fecha de creación', municipio.creado.strftime('%Y-%m-%d %H:%M')) }} | ||
{% endcall %} | ||
{% endblock %} | ||
|
||
{% block custom_javascript %} | ||
{% endblock %} |
96 changes: 96 additions & 0 deletions
96
plataforma_web/blueprints/municipios/templates/municipios/list.jinja2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
{% extends 'layouts/app.jinja2' %} | ||
{% import 'macros/list.jinja2' as list %} | ||
{% import 'macros/topbar.jinja2' as topbar %} | ||
|
||
{% block title %}Municipios{% endblock %} | ||
|
||
{% block topbar_actions %} | ||
{% call topbar.page_buttons(titulo) %} | ||
{% endcall %} | ||
{% endblock %} | ||
|
||
{% block content %} | ||
{% call list.card() %} | ||
<!-- Filtros CidFormatos --> | ||
<div class="row"> | ||
<div class="col"> | ||
<form class="row g-1 mb-3" id="filtradorForm" onsubmit="filtrosMunicipios.buscar(); return false;"> | ||
<div class="col-1"> | ||
<div class="form-floating"> | ||
<input id="filtroMunicipioClave" type="text" class="form-control" aria-label="Clave del Municipio"> | ||
<label for="filtroMunicipioClave">Clave Municipio</label> | ||
</div> | ||
</div> | ||
<div class="col-4"> | ||
<div class="form-floating"> | ||
<input id="filtroMunicipioNombre" type="text" class="form-control" aria-label="Nombre del Municipio" style="text-transform: uppercase;"> | ||
<label for="filtroMunicipioNombre">Nombre del Municipio</label> | ||
</div> | ||
</div> | ||
<div class="col-1"> | ||
<div class="form-floating"> | ||
<input id="filtroEstadoClave" type="text" class="form-control" aria-label="Clave del Estado"> | ||
<label for="filtroEstadoClave">Clave Estado</label> | ||
</div> | ||
</div> | ||
<div class="col-4"> | ||
<div class="form-floating"> | ||
<input id="filtroEstadoNombre" type="text" class="form-control" aria-label="Nombre del Estado" style="text-transform: uppercase;"> | ||
<label for="filtroEstadoNombre">Nombre del Estado</label> | ||
</div> | ||
</div> | ||
<div class="col-2 text-end"> | ||
<button title="Buscar" class="btn btn-primary btn-lg" onclick="filtrosMunicipios.buscar(); return false;" id="button-buscar"><span class="iconify" data-icon="mdi:magnify"></span></button> | ||
<button title="Limpiar" class="btn btn-warning btn-lg" type="reset" onclick="filtrosMunicipios.limpiar();" id="button-limpiar"><span class="iconify" data-icon="mdi:broom"></span></button> | ||
</div> | ||
</form> | ||
</div> | ||
</div> | ||
<!-- Datatable de municipios --> | ||
<table id="municipios_datatable" class="table {% if estatus == 'B'%}table-dark{% endif %} display nowrap" style="width:100%"> | ||
<thead> | ||
<tr> | ||
<th>Claves del Municipio</th> | ||
<th>Nombres de los Municipios</th> | ||
<th>Claves de Estados</th> | ||
<th>Estados</th> | ||
</tr> | ||
</thead> | ||
</table> | ||
{% endcall %} | ||
{% endblock %} | ||
|
||
{% block custom_javascript %} | ||
<script src="/static/js/datatables-constructor.js"></script> | ||
<script src="/static/js/datatables-filtros.js"></script> | ||
<script> | ||
// DataTable Municipios | ||
const constructorDataTable = new ConfigDataTable( '{{ csrf_token() }}' ); | ||
let configDTMunicipios = constructorDataTable.config(); | ||
configDTMunicipios['ajax']['url'] = '/municipios/datatable_json'; | ||
configDTMunicipios['ajax']['data'] = {{ filtros }}; | ||
configDTMunicipios['columns'] = [ | ||
{ data: 'detalle' }, | ||
{ data: 'municipio_nombre' }, | ||
{ data: 'estado_clave' }, | ||
{ data: 'estado_nombre' }, | ||
]; | ||
configDTMunicipios['columnDefs'] = [ | ||
{ | ||
targets: 0, // detalle | ||
data: null, | ||
render: function(data, type, row, meta) { | ||
return '<a href="' + data.url + '">' + data.clave + '</a>'; | ||
} | ||
} | ||
]; | ||
// Filtros Cid Procedimientos | ||
const filtrosMunicipios = new FiltrosDataTable('#municipios_datatable', configDTMunicipios); | ||
filtrosMunicipios.agregarInput('filtroEstadoClave', 'estado_clave'); | ||
filtrosMunicipios.agregarInput('filtroEstadoNombre', 'estado_nombre'); | ||
filtrosMunicipios.agregarInput('filtroMunicipioClave', 'municipio_clave'); | ||
filtrosMunicipios.agregarInput('filtroMunicipioNombre', 'municipio_nombre'); | ||
filtrosMunicipios.precargar(); | ||
</script> | ||
|
||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters