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

@ -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