Seccion para editar equipos
This commit is contained in:
@ -30,7 +30,7 @@
|
||||
</a>
|
||||
</td>
|
||||
<td class="center aligned">
|
||||
<i class="trash alternate outline icon" data-file="{{$archivo->getBasename('.' . $archivo->getExtension())}}"></i>
|
||||
<i class="remove icon" data-file="{{$archivo->getBasename('.' . $archivo->getExtension())}}"></i>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@ -117,7 +117,7 @@
|
||||
})
|
||||
}
|
||||
$(document).ready(function() {
|
||||
$('.trash').css('cursor', 'pointer').click(function() {
|
||||
$('.remove.icon').css('cursor', 'pointer').click(function() {
|
||||
var file = $(this).attr('data-file')
|
||||
$.post('{{$urls->admin}}/documentos/delete', {archivo: file}, function(data) {
|
||||
if (data.estado) {
|
||||
|
92
resources/views/admin/equipos.blade.php
Normal file
92
resources/views/admin/equipos.blade.php
Normal file
@ -0,0 +1,92 @@
|
||||
@extends('admin.layout.base')
|
||||
|
||||
@section('page_content')
|
||||
<div id="equipos">
|
||||
<div class="ui container">
|
||||
<div class="ui header">
|
||||
EQUIPOS NOTARÍA
|
||||
</div>
|
||||
<div class="ui grid">
|
||||
@foreach ($equipos as $i => $equipo)
|
||||
<div class="row">
|
||||
<div class="nine wide column">
|
||||
<div class="ui top attached segment">
|
||||
<div class="ui header">
|
||||
{{$equipo->titulo}}
|
||||
</div>
|
||||
</div>
|
||||
<table class="ui bottom attached celled table">
|
||||
<tbody>
|
||||
@foreach ($equipo->miembros as $j => $miembro)
|
||||
<tr>
|
||||
<td>
|
||||
@if (isset($miembro->nombre))
|
||||
{{$miembro->nombre}}
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if (isset($miembro->email))
|
||||
{{$miembro->email}}
|
||||
@endif
|
||||
</td>
|
||||
<td class="center aligned">
|
||||
<i class="remove icon" data-equipo="{{$i}}" data-id="{{$j}}"></i>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
<tfooter>
|
||||
<tr>
|
||||
<td colspan="3">
|
||||
<form class="ui form" data-equipo="{{$i}}">
|
||||
<div class="inline fields">
|
||||
<div class="inline field">
|
||||
<input type="text" name="nombre" placeholder="Nombre" />
|
||||
</div>
|
||||
<div class="inline field">
|
||||
<input type="text" name="email" placeholder="Email" />
|
||||
</div>
|
||||
<button class="ui inverted dark-blue button">CREAR</button>
|
||||
</div>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</tfooter>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
$(document).ready(() => {
|
||||
$('.remove.icon').css('cursor', 'pointer').click(function(e) {
|
||||
var equipo = $(this).attr('data-equipo')
|
||||
var id = $(this).attr('data-id')
|
||||
$.post('{{$urls->admin}}/equipos/remove', {equipo: equipo, id: id}, (data) => {
|
||||
if (data.estado) {
|
||||
window.location.reload()
|
||||
}
|
||||
})
|
||||
})
|
||||
$('form').submit(function(e) {
|
||||
var equipo = $(this).attr('data-equipo')
|
||||
var nombre = $(this).find("input[name='nombre']").val()
|
||||
var email = $(this).find("input[name='email']").val()
|
||||
$.post('{{$urls->admin}}/equipos/add', {equipo: equipo, nombre: nombre, email: email}, (data) => {
|
||||
if (data.estado) {
|
||||
window.location.reload()
|
||||
return
|
||||
}
|
||||
})
|
||||
|
||||
e.preventDefault()
|
||||
return false
|
||||
})
|
||||
})
|
||||
</script>
|
||||
@endpush
|
@ -2,6 +2,7 @@
|
||||
<a class="left aligned item brand" href="{{$urls->admin}}">
|
||||
NOTARÍA PATRICIO RABY BENAVENTE
|
||||
</a>
|
||||
<a class="item" href="{{$urls->admin}}/equipos">Editar Equipos</a>
|
||||
<a class="item" href="{{$urls->admin}}/clave">Cambiar Clave</a>
|
||||
<a class="item" href="{{$urls->admin}}/logout">Salir</a>
|
||||
</nav>
|
||||
|
Reference in New Issue
Block a user