Se agrega modo para ver archivos que han sido subidos y poder eliminarlos
This commit is contained in:
@ -22,80 +22,9 @@
|
||||
/>
|
||||
</div>
|
||||
<div id="transparencia_message" class="ui message transition hidden"></div>
|
||||
<div class="ui basic modal" id="doc_form">
|
||||
<i class="close icon"></i>
|
||||
<div class="inverted dark-blue header">
|
||||
</div>
|
||||
<div class="inverted dark-blue content">
|
||||
<form class="ui form" method="post" action="#">
|
||||
<input type="hidden" name="filename" />
|
||||
<div class="field">
|
||||
<input type="file" name="archivo" placeholder="Archivo" />
|
||||
</div>
|
||||
<div id="mod" class="field"></div>
|
||||
<button class="ui button">Subir</button>
|
||||
<div id="documento_message"></div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
function formulario(link, title, mod) {
|
||||
$('#doc_form').find('.header').html(title)
|
||||
$('#doc_form').find('form').find("[name='filename']").val(link)
|
||||
if (mod == 'fecha') {
|
||||
fecha()
|
||||
}
|
||||
$('#doc_form').modal('show')
|
||||
$('#doc_form').find('form').submit(function(e) {
|
||||
e.preventDefault()
|
||||
var form_data = new FormData(this)
|
||||
$.ajax({
|
||||
url: '{{$urls->base}}/admin/documentos',
|
||||
type: 'post',
|
||||
data: form_data,
|
||||
contentType: false,
|
||||
cache: false,
|
||||
processData: false,
|
||||
success: function(data) {
|
||||
if (data.estado == true) {
|
||||
$('#doc_form').find('.header').html('')
|
||||
$('#doc_form').find('form').find("[name='filename']").val('')
|
||||
$('#doc_form').modal('hide')
|
||||
$('#documento_message').html('')
|
||||
$('#documento_message').hide()
|
||||
} else {
|
||||
$('#documento_message').html('Error al subir el archivo.')
|
||||
$('#documento_message').show()
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
return false
|
||||
})
|
||||
}
|
||||
function fecha() {
|
||||
var fecha = $('<div></div>').attr('class', 'ui calendar').append(
|
||||
$('<div></div>').attr('class', 'ui input left icon').append(
|
||||
$('<i></i>').attr('class', 'calendar icon')
|
||||
).append(
|
||||
$('<input />').attr('type', 'text').attr('name', 'month').attr('placeholder', 'Mex / Año')
|
||||
)
|
||||
)
|
||||
$('#mod').append(fecha)
|
||||
$('#mod').find('.ui.calendar').calendar({
|
||||
type: 'month',
|
||||
text: {
|
||||
months: [
|
||||
'{!!implode("', '", $months->full)!!}'
|
||||
],
|
||||
monthsShort: [
|
||||
'{!!implode("', '", $months->short)!!}'
|
||||
]
|
||||
}
|
||||
})
|
||||
}
|
||||
$(document).ready(function() {
|
||||
$('#transparencia_message').hide()
|
||||
$('#transparencia').checkbox()
|
||||
@ -131,19 +60,6 @@
|
||||
})
|
||||
}, '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')
|
||||
var mod = $(this).attr('data-mod')
|
||||
formulario(link, title, mod)
|
||||
})
|
||||
})
|
||||
</script>
|
||||
@endpush
|
||||
|
Reference in New Issue
Block a user