[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>
|
---|
[c6b84df] | 26 | <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>
|
---|
[194a359] | 27 | </div>
|
---|
| 28 | </div>
|
---|
| 29 | <div class="col-lg-9 col-md-12">
|
---|
| 30 | <div class="tab-content" id="v-pills-tabContent">
|
---|
[e6c1f87] | 31 | <div class="tab-pane {{$active_tab == 'account' ? 'active' : ""}}" id="account" role="tabpanel" aria-labelledby="account-tab">
|
---|
[194a359] | 32 | <div class="card">
|
---|
| 33 | <div class="card-body">
|
---|
| 34 | <h6 class="card-title">Account</h6>
|
---|
[d795fa6] | 35 | <form action="{{ route("dashboard.users.editUserData", ["id" =>$user->id]) }}" method="post" accept-charset="utf-8" enctype='multipart/form-data' class="needs-validation" novalidate>
|
---|
[194a359] | 36 | @method("patch")
|
---|
| 37 | @csrf
|
---|
| 38 | <div class="row">
|
---|
| 39 | <div class="col-md-6">
|
---|
| 40 | <div class="form-group">
|
---|
| 41 | <label>Name</label>
|
---|
[d795fa6] | 42 | <input type="text" name="name" value="{{ $user->name }}" minlength="2" maxlength="30" class="form-control" placeholder="Name" required>
|
---|
| 43 | <div class="invalid-feedback">
|
---|
| 44 | Please enter only letters and spaces with length between [2, 30]
|
---|
| 45 | </div>
|
---|
[194a359] | 46 | </div>
|
---|
| 47 | </div>
|
---|
| 48 | <div class="col-md-6">
|
---|
| 49 | <div class="form-group">
|
---|
| 50 | <label>Surname</label>
|
---|
| 51 | <input type="text" name="surname" value="{{$user->surname}}" class="form-control" placeholder="Surname" required>
|
---|
| 52 | </div>
|
---|
| 53 | </div>
|
---|
| 54 | </div>
|
---|
| 55 | <div class="row">
|
---|
| 56 | <div class="col-md-6">
|
---|
| 57 | <div class="form-group">
|
---|
| 58 | <label class="form-label">Mobile Number</label>
|
---|
[d795fa6] | 59 | <input type="text" name="phone_number" value="{{ $user->phone_number }}" class="form-control" placeholder="Phone number" autocomplete="off" required>
|
---|
[194a359] | 60 | </div>
|
---|
| 61 | </div>
|
---|
[24a616f] | 62 | <div class="col-md-5">
|
---|
| 63 | <div class="form-group">
|
---|
| 64 | <label>Avatar</label>
|
---|
| 65 | <input type="file" name="avatar" value="{{ $user->avatar }}" class="form-control" accept="image/*">
|
---|
| 66 | </div>
|
---|
| 67 | </div>
|
---|
| 68 | <div class="col-md-1">
|
---|
| 69 | <div class="form-group">
|
---|
| 70 | <label>Current</label>
|
---|
| 71 | @include('dashboard.partials.avatar')
|
---|
| 72 | </div>
|
---|
| 73 | </div>
|
---|
[194a359] | 74 | </div>
|
---|
| 75 | <input type="submit" value="Save changes" class="submitBtn btn btn-primary pull-right m-10">
|
---|
| 76 | </form>
|
---|
| 77 | </div>
|
---|
| 78 | </div>
|
---|
| 79 | </div>
|
---|
[e6c1f87] | 80 | <div class="tab-pane {{$active_tab == 'security' ? 'active' : ""}}" id="security" role="tabpanel" aria-labelledby="security-tab">
|
---|
[194a359] | 81 | <div class="card">
|
---|
| 82 | <div class="card-body">
|
---|
| 83 | <form class="actionForm" action="{{ route("dashboard.settings.password") }}"
|
---|
| 84 | method="post" accept-charset="UTF-8">
|
---|
| 85 |
|
---|
| 86 | @method("patch")
|
---|
| 87 | @csrf
|
---|
| 88 |
|
---|
| 89 | <fieldset class="form-fieldset">
|
---|
| 90 |
|
---|
| 91 | <h4 class="font-weight-normal border-bottom pb-2">Password</h4>
|
---|
| 92 |
|
---|
| 93 | <h6 class="font-weight-normal text-muted">After changing your
|
---|
| 94 | password you will be logged out automatically.</h6>
|
---|
| 95 |
|
---|
| 96 | <div class="row">
|
---|
| 97 |
|
---|
| 98 | <div class="col-md-4">
|
---|
| 99 | <div class="form-group">
|
---|
| 100 | <label class="form-label">Current Password <span
|
---|
| 101 | class="form-required">*</span></label>
|
---|
| 102 | <input type="password" class="form-control"
|
---|
| 103 | name="current_password" autocomplete="off"
|
---|
| 104 | required>
|
---|
| 105 | </div>
|
---|
| 106 | </div>
|
---|
| 107 |
|
---|
| 108 | <div class="col-md-4">
|
---|
| 109 | <div class="form-group">
|
---|
| 110 | <label class="form-label">New Password <span
|
---|
| 111 | class="form-required">*</span></label>
|
---|
| 112 | <input type="password" class="form-control"
|
---|
| 113 | name="password" autocomplete="off" required>
|
---|
| 114 | </div>
|
---|
| 115 | </div>
|
---|
| 116 |
|
---|
| 117 | <div class="col-md-4">
|
---|
| 118 | <div class="form-group">
|
---|
| 119 | <label class="form-label">Repeat New Password <span
|
---|
| 120 | class="form-required">*</span></label>
|
---|
| 121 | <input type="password" class="form-control"
|
---|
| 122 | name="password_confirmation" autocomplete="off"
|
---|
| 123 | required>
|
---|
| 124 | </div>
|
---|
| 125 | </div>
|
---|
| 126 |
|
---|
| 127 | <div class="col-md-12">
|
---|
| 128 | <div class="form-group mb-0 float-right">
|
---|
| 129 | <input type="submit" value="Submit"
|
---|
| 130 | class="submitBtn btn btn-primary">
|
---|
| 131 | </div>
|
---|
| 132 | </div>
|
---|
| 133 |
|
---|
| 134 | </div>
|
---|
| 135 |
|
---|
| 136 | </fieldset>
|
---|
| 137 |
|
---|
| 138 | </form>
|
---|
| 139 | </div>
|
---|
| 140 | </div>
|
---|
| 141 |
|
---|
| 142 |
|
---|
| 143 | <div class="card">
|
---|
| 144 | <div class="card-body">
|
---|
| 145 | <form class="actionForm" action="{{ route("dashboard.settings.username") }}"
|
---|
| 146 | method="post" accept-charset="UTF-8">
|
---|
| 147 |
|
---|
| 148 | @method("patch")
|
---|
| 149 | @csrf
|
---|
| 150 |
|
---|
| 151 | <fieldset class="form-fieldset">
|
---|
| 152 |
|
---|
| 153 | <h4 class="font-weight-normal border-bottom pb-2">Username</h4>
|
---|
| 154 |
|
---|
| 155 | <h6 class="font-weight-normal text-muted">After changing your
|
---|
| 156 | username you will be logged out automatically.</h6>
|
---|
| 157 |
|
---|
| 158 | <div class="row">
|
---|
| 159 |
|
---|
| 160 |
|
---|
| 161 | <div class="col-md-6">
|
---|
| 162 | <div class="form-group">
|
---|
| 163 | <label class="form-label">Username</label>
|
---|
| 164 | <input type="text"
|
---|
| 165 | value="{{ old("username", $user->username) }}"
|
---|
| 166 | name="username" class="form-control">
|
---|
| 167 | </div>
|
---|
| 168 | </div>
|
---|
| 169 |
|
---|
| 170 | <div class="col-md-12">
|
---|
| 171 | <div class="form-group mb-0 float-right">
|
---|
| 172 | <input type="submit" value="Submit"
|
---|
| 173 | class="submitBtn btn btn-primary">
|
---|
| 174 | </div>
|
---|
| 175 | </div>
|
---|
| 176 |
|
---|
| 177 | </div>
|
---|
| 178 |
|
---|
| 179 | </fieldset>
|
---|
| 180 |
|
---|
| 181 | </form>
|
---|
| 182 |
|
---|
| 183 | </div>
|
---|
| 184 | </div>
|
---|
| 185 |
|
---|
| 186 | <div class="card">
|
---|
| 187 | <div class="card-body">
|
---|
| 188 | <form class="actionForm" action="{{ route("dashboard.settings.email") }}"
|
---|
| 189 | method="post" accept-charset="UTF-8">
|
---|
| 190 |
|
---|
| 191 | @method("patch")
|
---|
| 192 | @csrf
|
---|
| 193 |
|
---|
| 194 | <fieldset class="form-fieldset">
|
---|
| 195 |
|
---|
| 196 | <h4 class="font-weight-normal border-bottom pb-2">E-mail</h4>
|
---|
| 197 |
|
---|
| 198 | <h6 class="font-weight-normal text-muted">This is where lost
|
---|
| 199 | password requests will be sent. After changing your e-mail you
|
---|
| 200 | will be logged out automatically.</h6>
|
---|
| 201 |
|
---|
| 202 | <div class="row">
|
---|
| 203 |
|
---|
| 204 | <div class="col-md-4">
|
---|
| 205 | <div class="form-group">
|
---|
| 206 | <label class="form-label">E-mail</label>
|
---|
| 207 | <input type="email"
|
---|
| 208 | value="{{ old("email", $user->email) }}"
|
---|
| 209 | name="email" class="form-control">
|
---|
| 210 | </div>
|
---|
| 211 | </div>
|
---|
| 212 |
|
---|
| 213 | <div class="col-md-12">
|
---|
| 214 | <div class="form-group mb-0 float-right">
|
---|
| 215 | <input type="submit" value="Submit"
|
---|
| 216 | class="submitBtn btn btn-primary">
|
---|
| 217 | </div>
|
---|
| 218 | </div>
|
---|
| 219 |
|
---|
| 220 | </div>
|
---|
| 221 |
|
---|
| 222 | </fieldset>
|
---|
| 223 | </form>
|
---|
| 224 | </div>
|
---|
| 225 | </div>
|
---|
| 226 | </div>
|
---|
[c6b84df] | 227 | <div class="tab-pane {{$active_tab == 'file-types' ? 'active' : ""}}" id="file-types" role="tabpanel" aria-labelledby="file-types-tab">
|
---|
| 228 |
|
---|
[194a359] | 229 | <div class="card">
|
---|
[c6b84df] | 230 | <div class="card-body">
|
---|
| 231 | <h6 class="card-title">File validation</h6>
|
---|
| 232 | <form action="{{ route("dashboard.settings.file-types") }}" method="post" accept-charset="utf-8" enctype='multipart/form-data'>
|
---|
| 233 | @method("patch")
|
---|
| 234 | @csrf
|
---|
| 235 | <div class="row">
|
---|
| 236 | <div class="col-md-6">
|
---|
| 237 | <div class="form-group">
|
---|
| 238 | <label>Mimes</label>
|
---|
| 239 | <input type="text" name="mimes" value="{{ $fileType->mimes }}" class="form-control" placeholder="Mimes" required>
|
---|
| 240 | </div>
|
---|
| 241 | </div>
|
---|
| 242 | <div class="col-md-6">
|
---|
| 243 | <div class="form-group">
|
---|
| 244 | <label class="form-label">Max file size (in KB)</label>
|
---|
| 245 | <input type="number" name="max_size" value="{{ $fileType->max_size }}" class="form-control" placeholder="Max file size" autocomplete="off" required>
|
---|
| 246 | <p class="text-danger p-2">Note: 1 MB = 1024 KB</p>
|
---|
| 247 | </div>
|
---|
| 248 | </div>
|
---|
| 249 | </div>
|
---|
| 250 | <input type="submit" value="Save changes" class="submitBtn btn btn-primary pull-right m-10">
|
---|
| 251 | </form>
|
---|
| 252 | </div>
|
---|
| 253 | </div>
|
---|
| 254 |
|
---|
[194a359] | 255 | </div>
|
---|
| 256 | </div>
|
---|
| 257 | </div>
|
---|
| 258 | </div>
|
---|
| 259 |
|
---|
| 260 | </div>
|
---|
| 261 | </div>
|
---|
| 262 |
|
---|
| 263 | @endsection
|
---|
[e6c1f87] | 264 |
|
---|
| 265 | @section('script')
|
---|
| 266 | <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>
|
---|
| 267 | <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>
|
---|
| 268 | <script>
|
---|
| 269 | //redirect to specific tab
|
---|
| 270 | $(document).ready(function () {
|
---|
| 271 | $('#tabMenu a[href="#{{ old('tab') }}"]').tabs('show')
|
---|
| 272 | });
|
---|
| 273 | </script>
|
---|
| 274 | @endsection
|
---|