diff --git a/common/Controller/Web/Admin/Notificacion.php b/common/Controller/Web/Admin/Notificacion.php
index b116960..ca58f0f 100644
--- a/common/Controller/Web/Admin/Notificacion.php
+++ b/common/Controller/Web/Admin/Notificacion.php
@@ -24,11 +24,12 @@ class Notificacion {
if (isset($post['activo'])) {
$notificacion->activo = json_decode($post['activo']);
}
- $filemanager->folder('data')->save($filename, $notificacion);
+ $status = $filemanager->folder('data')->save($filename, $notificacion);
$output = [
'informacion' => $post,
- 'editado' => $notificacion
+ 'editado' => $notificacion,
+ 'estado' => ($status !== false) ? 'ok' : 'error'
];
$response->getBody()->write(json_encode($output));
return $response
diff --git a/common/Controller/Web/Admin/Transparencia.php b/common/Controller/Web/Admin/Transparencia.php
index f8ac9c5..1f0d926 100644
--- a/common/Controller/Web/Admin/Transparencia.php
+++ b/common/Controller/Web/Admin/Transparencia.php
@@ -20,11 +20,12 @@ class Transparencia {
if (isset($post['activo'])) {
$transparencia->activo = json_decode($post['activo']);
}
- $filemanager->folder('data')->save($filename, $transparencia);
+ $status = $filemanager->folder('data')->save($filename, $transparencia);
$output = [
'informacion' => $post,
- 'editado' => $transparencia
+ 'editado' => $transparencia,
+ 'estado' => ($status !== false) ? 'ok' : 'error'
];
$response->getBody()->write(json_encode($output));
return $response
diff --git a/resources/data/transparencia.yml b/resources/data/transparencia.yml
index cf91c10..2b5a998 100644
--- a/resources/data/transparencia.yml
+++ b/resources/data/transparencia.yml
@@ -1,4 +1,4 @@
-activo: true
+activo: false
descripcion: 'La función del notario Público se encuentra regida por las normas establecidas en el Título XI párrafo 7 artículo 399 al 445 del Código Orgánico de tribunales. Son funciones del Notario, entre otras, las contenidas en el artículo 401 del código señalado y que se expresan a continuación:'
funciones:
- >
diff --git a/resources/views/admin/documentos.blade.php b/resources/views/admin/documentos.blade.php
index 0cc272e..b6a50b5 100644
--- a/resources/views/admin/documentos.blade.php
+++ b/resources/views/admin/documentos.blade.php
@@ -21,6 +21,7 @@
@endif
/>
+
@@ -57,10 +59,13 @@
cache: false,
processData: false,
success: function(data) {
- if (data.estado == true) {
+ if (data.estado != true) {
$('#doc_form').find('.header').html('')
$('#doc_form').find('form').find("[name='filename']").val('')
$('#doc_form').modal('hide')
+ } else {
+ $('#documento_message').html('Error al subir el archivo.')
+ $('#documento_message').show()
}
}
})
@@ -90,16 +95,47 @@
})
}
$(document).ready(function() {
+ $('#transparencia_message').hide()
$('#transparencia').checkbox()
$('#transparencia').click(function() {
var status = $(this).checkbox('is checked')
- $.post('{{$urls->base}}/admin/transparencia', {'activo': status}, function(data) {}, 'json')
+ $.post('{{$urls->base}}/admin/transparencia', {'activo': status}, function(data) {
+ var msg = ['']
+ if (data.estado == 'ok') {
+ if (data.informacion.activo == 'true') {
+ msg.push('Activado')
+ } else {
+ msg.push('Desactivado')
+ }
+ $('#transparencia_message').addClass('success')
+ } else {
+ msg.push('No se ha podido')
+ if (data.informacion.activo == 'true') {
+ msg.push('activar')
+ } else {
+ msg.push('desactivar')
+ }
+ $('#transparencia_message').addClass('error')
+ }
+ msg.push('correctamente.')
+ $('#transparencia_message').html(msg.join(' '))
+ $('#transparencia_message').removeClass('hidden')
+ $('#transparencia_message').show()
+ $('#transparencia_message').find('.close').click(function() {
+ $('#transparencia_message').html('')
+ $('#transparencia_message').addClass('hidden')
+ $('#transparencia_message').removeClass('success error')
+ $('#transparencia_message').hide()
+ })
+ }, 'json')
})
+
$('#doc_form').modal({
onHidden: function() {
$('#mod').html('')
}
})
+ $('#documento_message').hide()
$('.form_link').click(function() {
var link = $(this).attr('data-link')
var title = $(this).attr('data-title')
diff --git a/resources/views/admin/formulario.blade.php b/resources/views/admin/formulario.blade.php
index cb59dee..208a3cd 100644
--- a/resources/views/admin/formulario.blade.php
+++ b/resources/views/admin/formulario.blade.php
@@ -23,18 +23,44 @@
/>
+
+
+
+
@push('scripts')
diff --git a/resources/views/admin/layout/body.blade.php b/resources/views/admin/layout/body.blade.php
index c824271..e7e3d2a 100644
--- a/resources/views/admin/layout/body.blade.php
+++ b/resources/views/admin/layout/body.blade.php
@@ -5,6 +5,6 @@
@yield('page_content')
- @include('layout.footer')
+ @include('admin.layout.footer')