fix doc
This commit is contained in:
@@ -234,7 +234,11 @@ $tableColumnsJson = json_encode($tableColumns ?? []);
|
||||
<a href="/documenti/{{ $documento->id }}/edit">{{ $documento->nome_file }}</a>
|
||||
</h6>
|
||||
<div class="text-center py-2" style="font-size: 2.5rem;">
|
||||
<i class="fas {{ $icon }}"></i>
|
||||
@if($documento->isLink())
|
||||
<i class="fas fa-link text-info"></i>
|
||||
@else
|
||||
<i class="fas {{ $icon }}"></i>
|
||||
@endif
|
||||
</div>
|
||||
<div class="text-center mb-2">
|
||||
<span class="badge badge-{{ $documento->tipologia === 'avatar' ? 'primary' : ($documento->tipologia === 'galleria' ? 'success' : 'secondary') }}">
|
||||
@@ -259,7 +263,11 @@ $tableColumnsJson = json_encode($tableColumns ?? []);
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer p-2 text-center">
|
||||
@if($documento->file_path)
|
||||
@if($documento->isLink())
|
||||
<a href="{{ $documento->url }}" target="_blank" class="btn btn-xs btn-info" title="Apri link esterno">
|
||||
<i class="fas fa-external-link-alt"></i>
|
||||
</a>
|
||||
@elseif($documento->file_path)
|
||||
<button type="button" class="btn btn-xs btn-primary" onclick="previewDoc({{ $documento->id }}, '{{ $documento->mime_type }}')" title="Anteprima">
|
||||
<i class="fas fa-eye"></i>
|
||||
</button>
|
||||
@@ -271,9 +279,11 @@ $tableColumnsJson = json_encode($tableColumns ?? []);
|
||||
<a href="/documenti/{{ $documento->id }}/edit" class="btn btn-xs btn-warning" title="Modifica">
|
||||
<i class="fas fa-edit"></i>
|
||||
</a>
|
||||
@if(!$documento->isLink())
|
||||
<button type="button" class="btn btn-xs btn-secondary" onclick="showMoveModal({{ $documento->id }}, '{{ e($documento->nome_file) }}')" title="Sposta in altra cartella">
|
||||
<i class="fas fa-folder-open"></i>
|
||||
</button>
|
||||
@endif
|
||||
<button type="button" class="btn btn-xs btn-info" onclick="showAssociateModal({{ $documento->id }})" title="Associa a...">
|
||||
<i class="fas fa-link"></i>
|
||||
</button>
|
||||
@@ -383,7 +393,11 @@ $tableColumnsJson = json_encode($tableColumns ?? []);
|
||||
</td>
|
||||
@endif
|
||||
<td>
|
||||
<i class="fas {{ $icon }} mr-2"></i>
|
||||
@if($documento->isLink())
|
||||
<i class="fas fa-link text-info mr-2"></i>
|
||||
@else
|
||||
<i class="fas {{ $icon }} mr-2"></i>
|
||||
@endif
|
||||
<span class="font-weight-bold">{{ $documento->nome_file }}</span>
|
||||
<div class="small text-muted">
|
||||
@if($documento->user){{ $documento->user->name }}@endif
|
||||
@@ -460,7 +474,11 @@ $tableColumnsJson = json_encode($tableColumns ?? []);
|
||||
</td>
|
||||
<td class="small">{{ $documento->created_at->format('d/m/Y') }}</td>
|
||||
<td>
|
||||
@if($documento->file_path)
|
||||
@if($documento->isLink())
|
||||
<a href="{{ $documento->url }}" target="_blank" class="btn btn-xs btn-info" title="Apri link esterno">
|
||||
<i class="fas fa-external-link-alt"></i>
|
||||
</a>
|
||||
@elseif($documento->file_path)
|
||||
<button type="button" class="btn btn-xs btn-primary" onclick="previewDoc({{ $documento->id }}, '{{ $documento->mime_type }}')" title="Anteprima">
|
||||
<i class="fas fa-eye"></i>
|
||||
</button>
|
||||
@@ -472,9 +490,11 @@ $tableColumnsJson = json_encode($tableColumns ?? []);
|
||||
<a href="/documenti/{{ $documento->id }}/edit" class="btn btn-xs btn-warning" title="Modifica">
|
||||
<i class="fas fa-edit"></i>
|
||||
</a>
|
||||
@if(!$documento->isLink())
|
||||
<button type="button" class="btn btn-xs btn-secondary" onclick="showMoveModal({{ $documento->id }}, '{{ e($documento->nome_file) }}')" title="Sposta in altra cartella">
|
||||
<i class="fas fa-folder-open"></i>
|
||||
</button>
|
||||
@endif
|
||||
<button type="button" class="btn btn-xs btn-info" onclick="showAssociateModal({{ $documento->id }})" title="Associa a...">
|
||||
<i class="fas fa-link"></i>
|
||||
</button>
|
||||
@@ -631,10 +651,28 @@ $tableColumnsJson = json_encode($tableColumns ?? []);
|
||||
</div>
|
||||
@endif
|
||||
<div class="form-group">
|
||||
<label>Tipo caricamento</label>
|
||||
<div class="btn-group btn-group-toggle d-block" data-toggle="buttons">
|
||||
<label class="btn btn-outline-primary active" id="tipoFileLabel">
|
||||
<input type="radio" name="tipo_caricamento" value="file" checked onchange="toggleTipoCaricamento()">
|
||||
<i class="fas fa-upload mr-1"></i> File
|
||||
</label>
|
||||
<label class="btn btn-outline-info" id="tipoLinkLabel">
|
||||
<input type="radio" name="tipo_caricamento" value="link" onchange="toggleTipoCaricamento()">
|
||||
<i class="fas fa-link mr-1"></i> URL esterno
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="fileUploadGroup">
|
||||
<label>File *</label>
|
||||
<input type="file" name="file" class="form-control" required>
|
||||
<input type="file" name="file" class="form-control" id="fileInput">
|
||||
<small class="text-muted">Max 10MB</small>
|
||||
</div>
|
||||
<div class="form-group" id="urlUploadGroup" style="display:none;">
|
||||
<label>URL esterno *</label>
|
||||
<input type="url" name="url" class="form-control" id="urlInput" placeholder="https://esempio.com/documento.pdf">
|
||||
<small class="text-muted">Inserisci l'indirizzo web del documento</small>
|
||||
</div>
|
||||
<div class="form-group" id="uploadFolderGroup">
|
||||
<label>Cartella</label>
|
||||
<select name="cartella_id" id="uploadCartellaId" class="form-control">
|
||||
@@ -1165,6 +1203,26 @@ function previewDoc(id, mimeType) {
|
||||
$('#previewModal').modal('show');
|
||||
}
|
||||
|
||||
function toggleTipoCaricamento() {
|
||||
var tipo = document.querySelector('input[name="tipo_caricamento"]:checked').value;
|
||||
var fileGroup = document.getElementById('fileUploadGroup');
|
||||
var urlGroup = document.getElementById('urlUploadGroup');
|
||||
var fileInput = document.getElementById('fileInput');
|
||||
var urlInput = document.getElementById('urlInput');
|
||||
|
||||
if (tipo === 'link') {
|
||||
fileGroup.style.display = 'none';
|
||||
urlGroup.style.display = 'block';
|
||||
fileInput.removeAttribute('required');
|
||||
urlInput.setAttribute('required', 'required');
|
||||
} else {
|
||||
fileGroup.style.display = 'block';
|
||||
urlGroup.style.display = 'none';
|
||||
fileInput.setAttribute('required', 'required');
|
||||
urlInput.removeAttribute('required');
|
||||
}
|
||||
}
|
||||
|
||||
function loadUploadTargets() {
|
||||
const visibilita = document.getElementById('uploadVisibilita').value;
|
||||
const group = document.getElementById('uploadTargetGroup');
|
||||
|
||||
Reference in New Issue
Block a user