source: resources/views/dashboard/settings/index.blade.php@ 4d73966

Last change on this file since 4d73966 was 1c17e70, checked in by beratkjufliju <kufliju@…>, 3 years ago

bug fixes

  • Property mode set to 100644
File size: 17.2 KB
RevLine 
[194a359]1@extends('layouts.app')
2
3@section("title", "User Settings")
4
5@section('content')
6
7 <div class="page-header">
8 <nav aria-label="breadcrumb" class="d-flex align-items-start">
9 <ol class="breadcrumb">
10 <li class="breadcrumb-item">
[c6b84df]11 <a href="{{ url('/') }}">Dashboard</a>
[194a359]12 </li>
[c6b84df]13 <li class="breadcrumb-item active" aria-current="page">Settings</li>
[194a359]14 </ol>
15 </nav>
16 </div>
17
18 <div class="row">
19 <div class="col-md-12">
20
21 <div class="row">
22 <div class="col-lg-3 col-md-12 mb-3">
[e6c1f87]23 <div class="nav flex-lg-column flex-sm-row nav-pills" id="#tabMenu" role="tablist" aria-orientation="vertical">
24 <a class="nav-link {{$active_tab == 'account' ? 'active' : ""}}" id="account-tab" data-toggle="pill" href="#account" role="tab" aria-controls="account" aria-selected="true">Account</a>
25 <a class="nav-link {{$active_tab == 'security' ? 'active' : ""}}" id="security-tab" data-toggle="pill" href="#security" role="tab" aria-controls="security" aria-selected="false">Security</a>
[1c17e70]26 @if(auth()->user()->hasPermission('manage_file_types'))
[c6b84df]27 <a class="nav-link {{$active_tab == 'file-types' ? 'active' : ""}}" id="file-types-tab" data-toggle="pill" href="#file-types" role="tab" aria-controls="file-types" aria-selected="false">File validation</a>
[0df7a93]28 @endif
[194a359]29 </div>
30 </div>
31 <div class="col-lg-9 col-md-12">
32 <div class="tab-content" id="v-pills-tabContent">
[e6c1f87]33 <div class="tab-pane {{$active_tab == 'account' ? 'active' : ""}}" id="account" role="tabpanel" aria-labelledby="account-tab">
[194a359]34 <div class="card">
35 <div class="card-body">
36 <h6 class="card-title">Account</h6>
[d795fa6]37 <form action="{{ route("dashboard.users.editUserData", ["id" =>$user->id]) }}" method="post" accept-charset="utf-8" enctype='multipart/form-data' class="needs-validation" novalidate>
[194a359]38 @method("patch")
39 @csrf
40 <div class="row">
41 <div class="col-md-6">
42 <div class="form-group">
43 <label>Name</label>
[d795fa6]44 <input type="text" name="name" value="{{ $user->name }}" minlength="2" maxlength="30" class="form-control" placeholder="Name" required>
45 <div class="invalid-feedback">
46 Please enter only letters and spaces with length between [2, 30]
47 </div>
[194a359]48 </div>
49 </div>
50 <div class="col-md-6">
51 <div class="form-group">
52 <label>Surname</label>
53 <input type="text" name="surname" value="{{$user->surname}}" class="form-control" placeholder="Surname" required>
54 </div>
55 </div>
56 </div>
57 <div class="row">
58 <div class="col-md-6">
59 <div class="form-group">
60 <label class="form-label">Mobile Number</label>
[d795fa6]61 <input type="text" name="phone_number" value="{{ $user->phone_number }}" class="form-control" placeholder="Phone number" autocomplete="off" required>
[194a359]62 </div>
63 </div>
[24a616f]64 <div class="col-md-5">
65 <div class="form-group">
66 <label>Avatar</label>
67 <input type="file" name="avatar" value="{{ $user->avatar }}" class="form-control" accept="image/*">
68 </div>
69 </div>
70 <div class="col-md-1">
71 <div class="form-group">
72 <label>Current</label>
[0208bbd]73 <figure class="avatar avatar-sm mr-2">
74 @if(auth()->user()->avatar==NULL)
75 <img src="{{ url('assets/media/images/user.png') }}" class="rounded-circle" alt="avatar">
76 @else
77 <img src="{{url('uploads/users/' . auth()->user()->avatar)}}" class="rounded-circle" alt="avatar">
78 @endif
79 </figure>
80
[24a616f]81 </div>
82 </div>
[194a359]83 </div>
84 <input type="submit" value="Save changes" class="submitBtn btn btn-primary pull-right m-10">
85 </form>
86 </div>
87 </div>
88 </div>
[e6c1f87]89 <div class="tab-pane {{$active_tab == 'security' ? 'active' : ""}}" id="security" role="tabpanel" aria-labelledby="security-tab">
[194a359]90 <div class="card">
91 <div class="card-body">
92 <form class="actionForm" action="{{ route("dashboard.settings.password") }}"
93 method="post" accept-charset="UTF-8">
94
95 @method("patch")
96 @csrf
97
98 <fieldset class="form-fieldset">
99
100 <h4 class="font-weight-normal border-bottom pb-2">Password</h4>
101
102 <h6 class="font-weight-normal text-muted">After changing your
103 password you will be logged out automatically.</h6>
104
105 <div class="row">
106
107 <div class="col-md-4">
108 <div class="form-group">
109 <label class="form-label">Current Password <span
110 class="form-required">*</span></label>
111 <input type="password" class="form-control"
112 name="current_password" autocomplete="off"
113 required>
114 </div>
115 </div>
116
117 <div class="col-md-4">
118 <div class="form-group">
119 <label class="form-label">New Password <span
120 class="form-required">*</span></label>
121 <input type="password" class="form-control"
122 name="password" autocomplete="off" required>
123 </div>
124 </div>
125
126 <div class="col-md-4">
127 <div class="form-group">
128 <label class="form-label">Repeat New Password <span
129 class="form-required">*</span></label>
130 <input type="password" class="form-control"
131 name="password_confirmation" autocomplete="off"
132 required>
133 </div>
134 </div>
135
136 <div class="col-md-12">
137 <div class="form-group mb-0 float-right">
138 <input type="submit" value="Submit"
139 class="submitBtn btn btn-primary">
140 </div>
141 </div>
142
143 </div>
144
145 </fieldset>
146
147 </form>
148 </div>
149 </div>
150
151
152 <div class="card">
153 <div class="card-body">
154 <form class="actionForm" action="{{ route("dashboard.settings.username") }}"
155 method="post" accept-charset="UTF-8">
156
157 @method("patch")
158 @csrf
159
160 <fieldset class="form-fieldset">
161
162 <h4 class="font-weight-normal border-bottom pb-2">Username</h4>
163
164 <h6 class="font-weight-normal text-muted">After changing your
165 username you will be logged out automatically.</h6>
166
167 <div class="row">
168
169
170 <div class="col-md-6">
171 <div class="form-group">
172 <label class="form-label">Username</label>
173 <input type="text"
174 value="{{ old("username", $user->username) }}"
175 name="username" class="form-control">
176 </div>
177 </div>
178
179 <div class="col-md-12">
180 <div class="form-group mb-0 float-right">
181 <input type="submit" value="Submit"
182 class="submitBtn btn btn-primary">
183 </div>
184 </div>
185
186 </div>
187
188 </fieldset>
189
190 </form>
191
192 </div>
193 </div>
194
195 <div class="card">
196 <div class="card-body">
197 <form class="actionForm" action="{{ route("dashboard.settings.email") }}"
198 method="post" accept-charset="UTF-8">
199
200 @method("patch")
201 @csrf
202
203 <fieldset class="form-fieldset">
204
205 <h4 class="font-weight-normal border-bottom pb-2">E-mail</h4>
206
207 <h6 class="font-weight-normal text-muted">This is where lost
208 password requests will be sent. After changing your e-mail you
209 will be logged out automatically.</h6>
210
211 <div class="row">
212
213 <div class="col-md-4">
214 <div class="form-group">
215 <label class="form-label">E-mail</label>
216 <input type="email"
217 value="{{ old("email", $user->email) }}"
218 name="email" class="form-control">
219 </div>
220 </div>
221
222 <div class="col-md-12">
223 <div class="form-group mb-0 float-right">
224 <input type="submit" value="Submit"
225 class="submitBtn btn btn-primary">
226 </div>
227 </div>
228
229 </div>
230
231 </fieldset>
232 </form>
233 </div>
234 </div>
235 </div>
[c6b84df]236 <div class="tab-pane {{$active_tab == 'file-types' ? 'active' : ""}}" id="file-types" role="tabpanel" aria-labelledby="file-types-tab">
[1c17e70]237 @if(auth()->user()->hasPermission('manage_file_types'))
[194a359]238 <div class="card">
[c6b84df]239 <div class="card-body">
240 <h6 class="card-title">File validation</h6>
241 <form action="{{ route("dashboard.settings.file-types") }}" method="post" accept-charset="utf-8" enctype='multipart/form-data'>
242 @method("patch")
243 @csrf
244 <div class="row">
245 <div class="col-md-6">
246 <div class="form-group">
247 <label>Mimes</label>
248 <input type="text" name="mimes" value="{{ $fileType->mimes }}" class="form-control" placeholder="Mimes" required>
249 </div>
250 </div>
251 <div class="col-md-6">
252 <div class="form-group">
253 <label class="form-label">Max file size (in KB)</label>
254 <input type="number" name="max_size" value="{{ $fileType->max_size }}" class="form-control" placeholder="Max file size" autocomplete="off" required>
255 <p class="text-danger p-2">Note: 1 MB = 1024 KB</p>
256 </div>
257 </div>
258 </div>
259 <input type="submit" value="Save changes" class="submitBtn btn btn-primary pull-right m-10">
260 </form>
261 </div>
262 </div>
[0df7a93]263@endif
[194a359]264 </div>
265 </div>
266 </div>
267 </div>
268
269 </div>
270 </div>
271
272@endsection
[e6c1f87]273
274@section('script')
275 <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js" integrity="sha512-894YE6QWD5I59HgZOGReFYm4dnWc1Qt5NtvYSaNcOP+u1T9qYdvdihz0PPSiiqn/+/3e7Jo4EaG7TubfWGUrMQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
276 <script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js" integrity="sha512-uto9mlQzrs59VwILcLiRYeLKPPbS/bT71da/OEBYEwcdNUk8jYIy+D176RYoop1Da+f9mvkYrmj5MCLZWEtQuA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
277 <script>
278 //redirect to specific tab
279 $(document).ready(function () {
280 $('#tabMenu a[href="#{{ old('tab') }}"]').tabs('show')
281 });
282 </script>
283@endsection
Note: See TracBrowser for help on using the repository browser.