Remove static folders
This commit is contained in:
parent
5de4fbe80c
commit
1b16cdf9ae
6 changed files with 15 additions and 20 deletions
|
|
@ -1,2 +1,3 @@
|
|||
# V2.0
|
||||
- Ajout de la possibilité de supprimer un utilisateur
|
||||
- Ajout de la possibilité de supprimer un utilisateur
|
||||
- Ajout de la possibilité de modifier toute l'arborescence des dossiers
|
||||
|
|
@ -3,14 +3,13 @@
|
|||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Directories;
|
||||
use App\Models\Document;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class FoldersController extends Controller
|
||||
{
|
||||
public function index(Request $request) {
|
||||
$folders = Directories::all();
|
||||
return view('folders', ['folders' => $folders, 'static_folders' => config('app.STATIC_FOLDERS')]);
|
||||
return view('folder.index', ['folders' => $folders]);
|
||||
}
|
||||
|
||||
public function toggleAuthorization(Request $request) {
|
||||
|
|
|
|||
|
|
@ -2,8 +2,6 @@
|
|||
|
||||
return [
|
||||
|
||||
/* APP STATIC FOLDERS */
|
||||
'STATIC_FOLDERS' => env('STATIC_FOLDERS'),
|
||||
'BRAND' => env('BRAND'),
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -18,13 +18,13 @@
|
|||
<span>
|
||||
<i v-if="item.children.length" @click="hideChildren(item)" class="fas fa-minus-circle"></i>
|
||||
<i @click="showChildren(item)" class="fas fa-plus-circle" style="display:none;"></i>
|
||||
<i v-if="!staticFolders.includes(item.id)" class="fas fa-arrows-alt"></i>
|
||||
<i v-if="item.id !== 1" class="fas fa-arrows-alt"></i>
|
||||
{{ item.name.fr }}
|
||||
</span>
|
||||
<span>
|
||||
<span v-if="!staticFolders.includes(item.id)">Autorisation : <input type="checkbox" v-model="item.needAuthorization" @change="toggleAuthorization(item)"></span>
|
||||
<i v-if="!staticFolders.includes(item.id)" @click="modifyName(item)" class="fas fa-pencil-alt"></i>
|
||||
<i v-if="!staticFolders.includes(item.id)" @click="AskDeleteFolder(item)" class="fas fa-trash-alt"></i>
|
||||
<span v-if="item.id !== 1">Autorisation : <input type="checkbox" v-model="item.needAuthorization" @change="toggleAuthorization(item)"></span>
|
||||
<i v-if="item.id !== 1" @click="modifyName(item)" class="fas fa-pencil-alt"></i>
|
||||
<i v-if="item.id !== 1" @click="AskDeleteFolder(item)" class="fas fa-trash-alt"></i>
|
||||
</span>
|
||||
</VueNestableHandle>
|
||||
</VueNestable>
|
||||
|
|
@ -86,8 +86,7 @@
|
|||
<script>
|
||||
export default {
|
||||
props: [
|
||||
'folders',
|
||||
'static_folders'
|
||||
'folders'
|
||||
],
|
||||
computed: {
|
||||
test: {
|
||||
|
|
@ -107,7 +106,6 @@
|
|||
},
|
||||
mounted() {
|
||||
console.log('Folders Component mounted.');
|
||||
this.staticFolders = this.static_folders.split(',').map(Number);
|
||||
let parseDirectories = JSON.parse(this.folders);
|
||||
this.directories = this.recursiveDir(parseDirectories);
|
||||
if(this.test){
|
||||
|
|
@ -134,8 +132,7 @@
|
|||
folderId: "",
|
||||
alertMsg: '',
|
||||
alertVisible: false,
|
||||
alertErrorVisible: false,
|
||||
staticFolders: []
|
||||
alertErrorVisible: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
|
@ -260,8 +257,8 @@
|
|||
return childs;
|
||||
},
|
||||
beforeMove({dragItem, pathFrom, pathTo}) {
|
||||
// Item 4 can not be nested more than one level
|
||||
if (this.staticFolders.includes(dragItem.id)) {
|
||||
// "Salon" folder can not be nested more than one level
|
||||
if (dragItem.id === 1) {
|
||||
return pathTo.length === 1
|
||||
}
|
||||
// All other items can be
|
||||
|
|
|
|||
4
resources/views/folder/index.blade.php
Normal file
4
resources/views/folder/index.blade.php
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
@extends('layouts.app')
|
||||
@section('content')
|
||||
<folders-component folders='@json($folders)'></folders-component>
|
||||
@endsection
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
@extends('layouts.app')
|
||||
@section('content')
|
||||
<folders-component folders='@json($folders)' static_folders="{{$static_folders}}"></folders-component>
|
||||
@endsection
|
||||
Loading…
Add table
Reference in a new issue