source: resources/views/dashboard/departments/index.blade.php@ a8346eb

develop
Last change on this file since a8346eb was b39afb5, checked in by beratkjufliju <kufliju@…>, 3 years ago

minor bug fixes

  • Property mode set to 100644
File size: 13.7 KB
RevLine 
[194a359]1@extends('layouts.app')
2
[d795fa6]3@section("title", "SaveSpace - Departments")
[194a359]4
5@section('head')
6 <!-- Datatable -->
7 <link rel="stylesheet" href="{{ url('vendors/dataTable/dataTables.min.css') }}" type="text/css">
8@endsection
9
10@section('content')
11
12 <div class="page-header justify-content-between">
13 <nav aria-label="breadcrumb" class="d-flex align-items-start">
14 <ol class="breadcrumb">
15 <li class="breadcrumb-item">
[c6b84df]16 <a href="{{ url('/') }}">Dashboard</a>
[194a359]17 </li>
18 <li class="breadcrumb-item active" aria-current="page">Departments</li>
19 </ol>
20 </nav>
21 <div class="dropdown">
[ea7b12a]22 <a href="javascript:void(0)" data-toggle="modal" data-target="#createModal" class="btn btn-primary text-white">
[194a359]23 Add department
24 </a>
[c6b84df]25 <a href="{{ route("dashboard.departments.downloadAll") }}" class="btn btn-danger text-white">
26 <i class="fa fa-download pr-1"></i> Download files
27 </a>
[4b7e2d3]28 <a href="{{ route('dashboard.departments.export') }}" class="btn btn-success text-white">Export table</a>
[194a359]29 </div>
30 </div>
31
32 <div class="row">
33 <div class="col-md-12">
34 <div class="card">
35 <div class="card-body">
36 <div class="table-responsive">
37 <table id="user-list" class="table table-lg">
38 <thead>
39 <tr>
[24a616f]40 <th>
41 </th>
[194a359]42 <th>ID</th>
43 <th>Name</th>
44 <th>Code</th>
[c6b84df]45 <th>Folders</th>
[194a359]46 <th>Created by</th>
[24a616f]47 <th>Created at</th>
48 <th>Updated at</th>
49 <th>Directory</th>
[194a359]50 <th>Actions</th>
51 </tr>
52 </thead>
53 <tbody>
54 @foreach($departments as $department)
55 <tr>
[24a616f]56 <td></td>
[194a359]57 <td>{{$department->id }}</td>
[4b7e2d3]58 <td><a href="{{ route("dashboard.folders.index", ['id' => $department->id]) }}" class="text-linkedin">{{ $department->name }}</a></td>
[194a359]59 <td>{{ $department->code }}</td>
[4b7e2d3]60 <td>{{ $department->no_of_folders }}</td>
[194a359]61 <td>{{ $department->getCreatedByName() }}</td>
[24a616f]62 <td>{{ date('d.m.Y - H:i', strtotime($department->created_at)) }}</td>
63 @if($department->updated_at==NULL)
64 <td>/</td>
65 @else
66 <td>{{ date('d.m.Y - H:i', strtotime($department->updated_at)) }}</td>
67 @endif
68 <!-- Trigger -->
[c6b84df]69 <td><button data-clipboard-text="{{$department->location}}" class="btn btn-sm btn-primary text-white" data-toggle="tooltip" data-placement="right" title="{{$department->location}}"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-clipboard" viewBox="0 0 16 16">
[24a616f]70 <path d="M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1h1a1 1 0 0 1 1 1V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3.5a1 1 0 0 1 1-1h1v-1z"/>
71 <path d="M9.5 1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h3zm-3-1A1.5 1.5 0 0 0 5 1.5v1A1.5 1.5 0 0 0 6.5 4h3A1.5 1.5 0 0 0 11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3z"/>
72 </svg></button>
73 </td>
[194a359]74 <td>
[ea7b12a]75 <a href="javascript:void(0)" class="text-secondary" data-toggle="modal" data-target="#editModal_{{$department->id}}" title="Edit">
[194a359]76 <i class="ti-pencil"></i>
77 </a>
[c6b84df]78 <a href="{{ route("dashboard.departments.downloadDepartment", ['id' => $department->id]) }}" class="text-danger ml-2"title="Delete">
79 <i class="ti-download"></i>
80 </a>
[d795fa6]81 <a href="javascript:void(0)" class="text-danger ml-2" data-toggle="modal" data-target="#deleteModal_{{$department->id}}" title="Delete">
[194a359]82 <i class="ti-trash"></i>
83 </a>
84 </td>
85 </tr>
[d795fa6]86 <div class="modal fade" id="deleteModal_{{$department->id}}" tabindex="-1" role="dialog" aria-hidden="true">
87 <div class="modal-dialog modal-dialog-centered" role="document">
88 <div class="modal-content">
89 <div class="modal-header">
90 <h5 class="modal-title" id="exampleModalCenterTitle">Delete confirmation</h5>
91 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
92 <i class="ti-close"></i>
93 </button>
94 </div>
95 <div class="modal-body">
96 <form action="{{ route("dashboard.departments.destroy", $department->id) }}" method="POST">
97 @csrf
98 @method('DELETE')
99 <p>Are you sure you want to delete department {{$department->name}} with code: {{$department->code}}?</p>
[c6b84df]100 <p>Number of documents associated: <a href="{{ route("dashboard.folders.index", ['id' => $department->id]) }}" class="text-linkedin">{{$department->folder()->count()}}</a></p>
[d795fa6]101 <div class="modal-footer">
102 <button type="button" class="btn btn-secondary" data-dismiss="modal">Close
103 </button>
104 <button type="submit" class="btn btn-primary">Save changes</button>
105 </div>
106 </form>
107 </div>
108
109 </div>
110 </div>
111 </div>
[ea7b12a]112
113 <div class="modal fade" id="editModal_{{$department->id}}" tabindex="-1" role="dialog" aria-hidden="true">
114 <div class="modal-dialog modal-dialog-centered" role="document">
115 <div class="modal-content">
116 <div class="modal-header">
117 <h5 class="modal-title" id="exampleModalCenterTitle">Edit department</h5>
118 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
119 <i class="ti-close"></i>
120 </button>
121 </div>
122 <div class="modal-body">
123 <form action="{{ route("dashboard.departments.edit", ["id" =>$department->id]) }}" method="post" accept-charset="utf-8">
124 @method("patch")
125 @csrf
126 <div class="row">
127 <div class="col-md-6">
128 <div class="form-group">
129 <label class="form-label">Name</label>
130 <input type="text" name="name" value="{{ $department->name }}" minlength="2" maxlength="30" class="form-control" placeholder="Name" required>
131 </div>
132 </div>
133 <div class="col-md-6">
134 <div class="form-group">
135 <label class="form-label">Code</label>
[b39afb5]136 <input type="number" name="code" value="{{ $department->code }}" minlength="1" class="form-control" placeholder="Code" required>
[ea7b12a]137 </div>
138 </div>
139 </div>
[c6b84df]140 <br/>
141 <div class="modal-footer">
142 <button type="button" class="btn btn-secondary" data-dismiss="modal">Close
143 </button>
144 <button type="submit" class="btn btn-primary">Save changes</button>
145 </div>
[ea7b12a]146 </form>
147 </div>
148
149 </div>
150 </div>
151 </div>
[194a359]152 @endforeach
[ea7b12a]153
154 <div class="modal fade" id="createModal" tabindex="-1" role="dialog" aria-hidden="true">
155 <div class="modal-dialog modal-dialog-centered" role="document">
156 <div class="modal-content">
157 <div class="modal-header">
158 <h5 class="modal-title" id="exampleModalCenterTitle">Create department</h5>
159 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
160 <i class="ti-close"></i>
161 </button>
162 </div>
163 <div class="modal-body">
164 <form action="{{ route("dashboard.departments.store") }}" method="post" accept-charset="utf-8">
165 @csrf
166 <div class="row">
167 <div class="col-md-6">
168 <div class="form-group">
169 <label>Name</label>
170 <input type="text" name="name" value="{{ old('name') }}" minlength="2" maxlength="30" class="form-control" placeholder="Name" required>
171 </div>
172 </div>
173 <div class="col-md-6">
174 <div class="form-group">
175 <label>Code</label>
[b39afb5]176 <input type="number" name="code" value="{{ old('code') }}" minlength="1" class="form-control" placeholder="Code" required>
[ea7b12a]177 </div>
178 </div>
179 </div>
[c6b84df]180 <br/>
181 <div class="modal-footer">
182 <button type="button" class="btn btn-secondary" data-dismiss="modal">Close
183 </button>
184 <button type="submit" class="btn btn-primary">Save changes</button>
185 </div>
[ea7b12a]186 </form>
187 </div>
188
189 </div>
190 </div>
191 </div>
192
[194a359]193 </tbody>
194 </table>
195 </div>
196 </div>
197 </div>
198 </div>
199 </div>
200
201@endsection
202
203@section('script')
[c6b84df]204
205 @yield('script')
206
[120759b]207 <script src="{{ url('assets/js/examples/pages/user-list.js') }}"></script>
[194a359]208 <!-- Datatable -->
209 <script src="{{ url('vendors/dataTable/dataTables.min.js') }}"></script>
210@endsection
Note: See TracBrowser for help on using the repository browser.