Admin - Mensajes y footer
This commit is contained in:
@ -24,11 +24,12 @@ class Notificacion {
|
|||||||
if (isset($post['activo'])) {
|
if (isset($post['activo'])) {
|
||||||
$notificacion->activo = json_decode($post['activo']);
|
$notificacion->activo = json_decode($post['activo']);
|
||||||
}
|
}
|
||||||
$filemanager->folder('data')->save($filename, $notificacion);
|
$status = $filemanager->folder('data')->save($filename, $notificacion);
|
||||||
|
|
||||||
$output = [
|
$output = [
|
||||||
'informacion' => $post,
|
'informacion' => $post,
|
||||||
'editado' => $notificacion
|
'editado' => $notificacion,
|
||||||
|
'estado' => ($status !== false) ? 'ok' : 'error'
|
||||||
];
|
];
|
||||||
$response->getBody()->write(json_encode($output));
|
$response->getBody()->write(json_encode($output));
|
||||||
return $response
|
return $response
|
||||||
|
@ -20,11 +20,12 @@ class Transparencia {
|
|||||||
if (isset($post['activo'])) {
|
if (isset($post['activo'])) {
|
||||||
$transparencia->activo = json_decode($post['activo']);
|
$transparencia->activo = json_decode($post['activo']);
|
||||||
}
|
}
|
||||||
$filemanager->folder('data')->save($filename, $transparencia);
|
$status = $filemanager->folder('data')->save($filename, $transparencia);
|
||||||
|
|
||||||
$output = [
|
$output = [
|
||||||
'informacion' => $post,
|
'informacion' => $post,
|
||||||
'editado' => $transparencia
|
'editado' => $transparencia,
|
||||||
|
'estado' => ($status !== false) ? 'ok' : 'error'
|
||||||
];
|
];
|
||||||
$response->getBody()->write(json_encode($output));
|
$response->getBody()->write(json_encode($output));
|
||||||
return $response
|
return $response
|
||||||
|
@ -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:'
|
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:
|
funciones:
|
||||||
- >
|
- >
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
@endif
|
@endif
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
<div id="transparencia_message" class="ui message transition hidden"></div>
|
||||||
<div class="ui basic modal" id="doc_form">
|
<div class="ui basic modal" id="doc_form">
|
||||||
<i class="close icon"></i>
|
<i class="close icon"></i>
|
||||||
<div class="inverted dark-blue header">
|
<div class="inverted dark-blue header">
|
||||||
@ -33,6 +34,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div id="mod" class="field"></div>
|
<div id="mod" class="field"></div>
|
||||||
<button class="ui button">Subir</button>
|
<button class="ui button">Subir</button>
|
||||||
|
<div id="documento_message"></div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -57,10 +59,13 @@
|
|||||||
cache: false,
|
cache: false,
|
||||||
processData: false,
|
processData: false,
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
if (data.estado == true) {
|
if (data.estado != true) {
|
||||||
$('#doc_form').find('.header').html('')
|
$('#doc_form').find('.header').html('')
|
||||||
$('#doc_form').find('form').find("[name='filename']").val('')
|
$('#doc_form').find('form').find("[name='filename']").val('')
|
||||||
$('#doc_form').modal('hide')
|
$('#doc_form').modal('hide')
|
||||||
|
} else {
|
||||||
|
$('#documento_message').html('Error al subir el archivo.')
|
||||||
|
$('#documento_message').show()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -90,16 +95,47 @@
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
$('#transparencia_message').hide()
|
||||||
$('#transparencia').checkbox()
|
$('#transparencia').checkbox()
|
||||||
$('#transparencia').click(function() {
|
$('#transparencia').click(function() {
|
||||||
var status = $(this).checkbox('is checked')
|
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 = ['<i class="close icon"></i>']
|
||||||
|
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({
|
$('#doc_form').modal({
|
||||||
onHidden: function() {
|
onHidden: function() {
|
||||||
$('#mod').html('')
|
$('#mod').html('')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
$('#documento_message').hide()
|
||||||
$('.form_link').click(function() {
|
$('.form_link').click(function() {
|
||||||
var link = $(this).attr('data-link')
|
var link = $(this).attr('data-link')
|
||||||
var title = $(this).attr('data-title')
|
var title = $(this).attr('data-title')
|
||||||
|
@ -23,18 +23,44 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div id="formulario_messages" class="ui message transition hidden">
|
||||||
|
<i class="close icon"></i>
|
||||||
|
<span class="list"></span>
|
||||||
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
@push('scripts')
|
@push('scripts')
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
function addMessage(msg) {
|
||||||
|
$('#formulario_messages').find('.list').append(
|
||||||
|
$('<li></li>').html(msg)
|
||||||
|
)
|
||||||
|
$('#formulario_messages').show()
|
||||||
|
$('#formulario_messages').removeClass('hidden')
|
||||||
|
$('#formulario_messages').find('.close').click(function() {
|
||||||
|
$('#formulario_messages').find('.list').html('')
|
||||||
|
$('#formulario_messages').removeClass('success error')
|
||||||
|
$('#formulario_messages').hide()
|
||||||
|
$('#formulario_messages').addClass('hidden')
|
||||||
|
})
|
||||||
|
}
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
$('#formulario_messages').hide()
|
||||||
$('#formulario').submit(function(e) {
|
$('#formulario').submit(function(e) {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
|
|
||||||
var titulo = $(this).find("[name='titulo']").val()
|
var titulo = $(this).find("[name='titulo']").val()
|
||||||
var contenido = $(this).find("[name='contenido']").val()
|
var contenido = $(this).find("[name='contenido']").val()
|
||||||
$.post('{{$urls->base}}/admin/notificacion', {titulo: titulo, contenido: contenido}, function(data) {
|
$.post('{{$urls->base}}/admin/notificacion', {titulo: titulo, contenido: contenido}, function(data) {
|
||||||
console.debug(data)
|
var msg = ''
|
||||||
|
if (data.estado == 'ok') {
|
||||||
|
msg = 'Editado correctamente.'
|
||||||
|
$('#formulario_messages').addClass('success')
|
||||||
|
} else {
|
||||||
|
msg = 'Error al editar.'
|
||||||
|
$('#formulario_messages').addClass('error')
|
||||||
|
}
|
||||||
|
addMessage(msg)
|
||||||
}, 'json')
|
}, 'json')
|
||||||
|
|
||||||
return false
|
return false
|
||||||
@ -42,7 +68,27 @@
|
|||||||
$('#activar').checkbox()
|
$('#activar').checkbox()
|
||||||
$('#activar').click(function() {
|
$('#activar').click(function() {
|
||||||
var status = $(this).checkbox('is checked')
|
var status = $(this).checkbox('is checked')
|
||||||
$.post('{{$urls->base}}/admin/notificacion', {'activo': status}, function(data) {}, 'json')
|
$.post('{{$urls->base}}/admin/notificacion', {'activo': status}, function(data) {
|
||||||
|
msg = []
|
||||||
|
if (data.estado == 'ok') {
|
||||||
|
if (data.editado.activo) {
|
||||||
|
msg.push('Activado')
|
||||||
|
} else {
|
||||||
|
msg.push('Desactivado')
|
||||||
|
}
|
||||||
|
$('#formulario_messages').addClass('success')
|
||||||
|
} else {
|
||||||
|
msg.push('No se ha podido')
|
||||||
|
if (data.editado.activo) {
|
||||||
|
msg.push('activar')
|
||||||
|
} else {
|
||||||
|
msg.push('desactivar')
|
||||||
|
}
|
||||||
|
$('#formulario_messages').addClass('error')
|
||||||
|
}
|
||||||
|
msg.push('correctamente.')
|
||||||
|
addMessage(msg.join(' '))
|
||||||
|
}, 'json')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
@ -5,6 +5,6 @@
|
|||||||
<br />
|
<br />
|
||||||
@yield('page_content')
|
@yield('page_content')
|
||||||
</div>
|
</div>
|
||||||
@include('layout.footer')
|
@include('admin.layout.footer')
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
12
resources/views/admin/layout/footer.blade.php
Normal file
12
resources/views/admin/layout/footer.blade.php
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<footer class="ui fixed">
|
||||||
|
<div class="inverted dark-blue">
|
||||||
|
<div class="main"></div>
|
||||||
|
</div>
|
||||||
|
<div class="grey">
|
||||||
|
<nav class="ui container attached text stackable menu">
|
||||||
|
<a class="item" href="{{$urls->base}}/admin/clave">Cambiar Clave</a>
|
||||||
|
<a class="item" href="{{$urls->base}}/admin/logout">Salir</a>
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
|
</footer>
|
||||||
|
@include('layout.scripts')
|
@ -14,7 +14,7 @@
|
|||||||
</a>
|
</a>
|
||||||
<div class="right menu">
|
<div class="right menu">
|
||||||
<div class="item">
|
<div class="item">
|
||||||
Copyright© Todos los derechos reservados a Notaría Raby
|
Copyright© Todos los derechos reservados a ProVM
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
BIN
vendor.tar
BIN
vendor.tar
Binary file not shown.
BIN
vendor.tar.gz
BIN
vendor.tar.gz
Binary file not shown.
Reference in New Issue
Block a user