FIX: no se podia subir los videos

This commit is contained in:
2020-06-18 02:16:32 -04:00
parent 0f26b53546
commit ef453fef56
9 changed files with 317 additions and 79 deletions

View File

@ -169,3 +169,13 @@
incididunt ut labore et dolore magna
aliqua. Ut enim ad minim veniam, quis
nos
-
titulo: 4° Colonia de Invierno 2019
empresa: Dimerc
servicio: Eventos Recreativos
descripcion: >
Lorem ipsum dolor sit amet, consectetur
adipiscing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna
aliqua. Ut enim ad minim veniam, quis
nos

BIN
resources/data/play.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

@ -10,8 +10,14 @@ $app->group('/eventos', function($app) {
});
$app->group('/evento/{evento}', function($app) {
$app->post('/edit', [Eventos::class, 'edit']);
$app->post('/add', [Eventos::class, 'addImage']);
$app->get('/delete', [Eventos::class, 'delete']);
$app->post('/image/delete', [Eventos::class, 'deleteImage']);
$app->group('/image', function($app) {
$app->post('/add', [Eventos::class, 'addImage']);
$app->post('/delete', [Eventos::class, 'deleteImage']);
});
$app->group('/video', function($app) {
$app->post('/add', [Eventos::class, 'addVideo']);
$app->post('/delete', [Eventos::class, 'deleteImage']);
});
$app->get('[/]', [Eventos::class, 'show']);
});

View File

@ -66,38 +66,86 @@
</div>
</form>
<div class="ui header">
Media
Elementos
</div>
<table class="ui collapsing table" id="imagenes">
<thead>
<tr>
<th colspan="2" class="right aligned">
<i class="plus icon" id="agregar_imagen"></i>
</th>
</tr>
<tr>
<th>Archivo</th>
<th>Borrar</th>
</tr>
</thead>
<tbody>
@if ($imagenes)
@foreach (array_values($imagenes) as $i => $imagen)
<div class="ui equal width grid">
<div class="column">
<h4 class="ui header">
Fotos
</h4>
<table class="ui collapsing table" id="imagenes">
<thead>
<tr>
<td>
<div class="ui mini image">
<img src="{{$imagen->thumb->filename}}" />
</div>
{{$imagen->media->n}}</span>
</td>
<td class="center aligned">
<i class="trash icon" data-media="{{$i}}"></i>
</td>
<th colspan="2" class="right aligned">
<i class="plus icon" id="agregar_imagen"></i>
</th>
</tr>
@endforeach
@endif
</tbody>
</table>
<tr>
<th>Archivo</th>
<th>Borrar</th>
</tr>
</thead>
<tbody>
@if ($imagenes)
@foreach (array_values($imagenes) as $i => $imagen)
@if (strpos($imagen->media->html, '<img') === false)
@continue
@endif
<tr>
<td>
<div class="ui mini image">
<img src="{{$imagen->thumb->filename}}" />
</div>
{{$imagen->media->n}}</span>
</td>
<td class="center aligned">
<i class="trash icon" data-media="{{$i}}"></i>
</td>
</tr>
@endforeach
@endif
</tbody>
</table>
</div>
<div class="column">
<h4 class="ui header">
Videos
</h4>
<table class="ui collapsing table" id="videos">
<thead>
<tr>
<th colspan="2" class="right aligned">
<i class="plus icon" id="agregar_video"></i>
</th>
</tr>
<tr>
<th>Archivo</th>
<th>Borrar</th>
</tr>
</thead>
<tbody>
@if ($imagenes)
@foreach (array_values($imagenes) as $i => $imagen)
@if (strpos($imagen->media->html, '<img') !== false)
@continue
@endif
<tr>
<td>
<div class="ui mini image">
<img src="{{$imagen->thumb->filename}}" />
</div>
{{$imagen->media->n}}</span>
</td>
<td class="center aligned">
<i class="trash icon" data-media="{{$i}}"></i>
</td>
</tr>
@endforeach
@endif
</tbody>
</table>
</div>
</div>
</div>
@endsection
@ -106,15 +154,31 @@
@endpush
@push('readyjs')
imagenes.imagenes = [
imagenes.imagenes = {
@if ($imagenes)
@foreach (array_values($imagenes) as $imagen)
'{{$imagen->media->n}}',
@foreach (array_values($imagenes) as $i => $imagen)
@if (strpos($imagen->media->html, '<img') === false)
@continue
@endif
{{$i}}: '{{$imagen->media->n}}',
@endforeach
@endif
]
}
imagenes.url = '{{$urls->admin}}'
imagenes.evento = '{{$evento->id}}'
imagenes.setup()
videos.videos = {
@if ($imagenes)
@foreach (array_values($imagenes) as $i => $imagen)
@if (strpos($imagen->media->html, '<img') !== false)
@continue
@endif
{{$i}}: '{{$imagen->media->n}}',
@endforeach
@endif
}
videos.url = imagenes.url
videos.evento = imagenes.evento
videos.setup()
$('#servicio').dropdown()
@endpush

View File

@ -81,5 +81,11 @@
var id = $(this).attr('data-id')
var src = media[id]
$('#seleccionada').html(src)
if (src.indexOf('<img') < 0) {
$('#seleccionada').removeClass('image').addClass('embed')
$('#seleccionada').find('video').width($('#seleccionada').width())
} else {
$('#seleccionada').removeClass('embed').addClass('image')
}
})
@endpush