Merge branch 'dev' into 'schedule-table'

# Conflicts:
#   config/version.yml
This commit is contained in:
Mathieu Lagace
2020-10-02 17:02:03 +00:00
8 changed files with 65 additions and 19 deletions

View File

@@ -44,6 +44,7 @@ deploy_697:
environment:
name: escadron697
url: http://escadron697.ca
when: manual
only:
- master
@@ -60,6 +61,7 @@ deploy_736:
environment:
name: escadron736
url: http://736.exvps.ca
when: manual
only:
- master
@@ -76,6 +78,7 @@ deploy_227:
environment:
name: CCMRC227
url: http://227.exvps.ca
when: manual
only:
- master
@@ -92,6 +95,7 @@ deploy_117:
environment:
name: CCMRC117
url: http://117.exvps.ca
when: manual
only:
- master
@@ -108,5 +112,6 @@ deploy_dev:
environment:
name: dev
url: http://dev.exvps.ca
when: manual
only:
- dev

View File

@@ -250,6 +250,22 @@ class UserController extends Controller
return redirect('/admin/profil')->with('success', 'Modification enregistré');
}
public function UserTelephone()
{
return view('admin.user.profil.telephone');
}
public function editUserTelephone()
{
$user = \Auth::user();
$user->telephone = request('telephone');
$user->save();
return redirect('/admin/profil')->with('success', 'Modification enregistré');
}
public function apiList()
{
$users = \App\User::all();

View File

@@ -14,14 +14,14 @@
<div class="col-md-12">
<div class="form-group">
<label>Nom</label>
<input class="form-control" type="text" name="name">
<input class="form-control" type="text" name="name" required>
<small class="form-text text-muted">Nom du grade</small>
</div>
</div>
<div class="col-md-12">
<div class="form-group">
<label>Description</label>
<textarea id="desc" name="desc"></textarea>
<textarea id="desc" name="desc" required></textarea>
<small class="form-text text-muted">Description du grade</small>
</div>
</div>

View File

@@ -14,14 +14,14 @@
<div class="col-md-12">
<div class="form-group">
<label>Nom</label>
<input class="form-control" type="text" name="name" value="{{$job->name}}">
<input class="form-control" type="text" name="name" value="{{$job->name}}" required>
<small class="form-text text-muted">Nom du poste</small>
</div>
</div>
<div class="col-md-12">
<div class="form-group">
<label>Description</label>
<textarea id="desc" name="desc">{!! $job->desc !!}</textarea>
<textarea id="desc" name="desc" required>{!! $job->desc !!}</textarea>
<small class="form-text text-muted">Description du poste</small>
</div>
</div>

View File

@@ -43,18 +43,7 @@
</div>
<div class="col-md-12">
<p>Téléphone<br>
@if ($user->telephone != "Inconnu")
@php
$data = '+'.$user->telephone;
if(preg_match( '/^\+\d(\d{3})(\d{3})(\d{4})$/',$data,$matches))
{
$result = $matches[1] . '-' .$matches[2] . '-' . $matches[3];
echo $result;
}
@endphp
@else
Inconnu
@endif
{{ $user->telephone }}
</p>
</div>
<div class="col-md-12">
@@ -96,7 +85,7 @@
<div class="card-body">
<a name="changepsw" id="changepsw" class="btn btn-warning btn-block" href="/admin/profil/password" role="button">Modifier mon mot de passe</a>
<a class="btn btn-secondary btn-block" href="/admin/profil/avatar" role="button">Modifier ma photo de profil</a>
<button disabled class="btn btn-secondary btn-block" href="/admin/profil/phone" role="button">Modifier mon numéro de téléphone</button>
<a class="btn btn-secondary btn-block" href="/admin/profil/telephone" role="button">Modifier mon numéro de téléphone</a>
<a class="btn btn-secondary btn-block" href="/admin/profil/adress" role="button">Modifier mon adresse</a>
<button disabled class="btn btn-primary btn-block" href="/admin/profil/preference" role="button">Modifier mes préférences</button>
<a class="btn btn-danger btn-block" href="/logout" role="button">Déconnexion</a>

View File

@@ -0,0 +1,28 @@
@extends('layouts.admin.main')
@section('content')
<div class="col-sm-12">
<div class="card">
<div class="card-header">
<strong class="card-title">Modification de mon numéro de téléphone </strong>
</div>
<div class="card-body">
<form autocomplete="off" action="/admin/profil/edit/telephone" method="POST" data-parsley-validate novalidate>
@csrf
<div class="form-group">
<label for="adress">Entrer votre nouveau numero de téléphone</label>
<input type="text" class="form-control" name="telephone" id="telephone" placeholder="213-546-5401" pattern="([0-9]{3}-[0-9]{3}-[0-9]{4})*"
data-parsley-error-message="Le numéro de téléphone est invalide" required>
</div>
<button type="submit" id="submit" class="btn btn-primary">Enregistrer</button>
</form>
</div>
</div>
</div>
@endsection
@section('custom_scripts')
<script>
$('#form').parsley();
</script>
@endsection

View File

@@ -275,6 +275,12 @@ Breadcrumbs::for('admin.profil.adress', function ($trail) {
$trail->push('Adresse', route('admin.profil.adress'));
});
// Admin > Profil > Telephone
Breadcrumbs::for('admin.profil.telephone', function ($trail) {
$trail->parent('admin.profil');
$trail->push('Téléphone', route('admin.profil.telephone'));
});
// Admin > Profil > Password
Breadcrumbs::for('admin.profil.psw', function ($trail) {
$trail->parent('admin.profil');
@@ -287,7 +293,7 @@ Breadcrumbs::for('admin.profil.courses', function ($trail) {
$trail->push('Mes cours', route('admin.profil.courses'));
});
// Admin > Profil > Adress
// Admin > Profil > Notification
Breadcrumbs::for('admin.profil.notifications', function ($trail) {
$trail->parent('admin.profil');
$trail->push('Mes notifications', route('admin.profil.notifications'));

View File

@@ -166,8 +166,10 @@ Route::middleware(['auth', 'firstlogin'])->name('admin.')->group(function () {
Route::get('/admin/profil/avatar', 'UserController@UserAvatar')->name('profil.avatar');
Route::get('/admin/profil/password', 'UserController@UserPassword')->name('profil.psw');
Route::get('/admin/profil/adress', 'UserController@UserAdress')->name('profil.adress');
Route::get('/admin/profil/telephone', 'UserController@UserTelephone')->name('profil.telephone');
Route::get('/admin/profil/notifications', 'UserController@userNotification')->name('profil.notifications');
Route::post('/admin/profil/edit/adress', 'UserController@editUserAdress');
Route::post('/admin/profil/edit/telephone', 'UserController@editUserTelephone');
Route::post('/admin/profil/edit/password', 'UserController@editUserPassword');
Route::get('/admin/profil/edit/avatar/{id}', 'UserController@editUserAvatar');
Route::get('/admin/profil/{id?}', 'UserController@showUserProfil')->name('profil');