mirror of
https://gitlab.com/TheGamecraft/c-cms.git
synced 2026-04-21 10:49:10 -04:00
Merge branch 'dev' into 'master'
Dev See merge request TheGamecraft/c-cms!76
This commit is contained in:
@@ -40,4 +40,18 @@ class Event extends Model
|
||||
{
|
||||
return $this->morphMany('App\Log', 'logable');
|
||||
}
|
||||
|
||||
public static function future()
|
||||
{
|
||||
$events = collect();
|
||||
|
||||
foreach (Event::all() as $event)
|
||||
{
|
||||
if (date('U',strtotime($event->date_begin)) >= time())
|
||||
{
|
||||
$events->push($event);
|
||||
}
|
||||
}
|
||||
return $events;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,7 +50,15 @@ class EventController extends Controller
|
||||
$event->is_mandatory = 0;
|
||||
}
|
||||
$event->desc = request('desc');
|
||||
|
||||
if(\request('msg'))
|
||||
{
|
||||
$event->msg = request('msg');
|
||||
}
|
||||
else
|
||||
{
|
||||
$event->msg = "";
|
||||
}
|
||||
$event->date_msg = request('date_msg');
|
||||
$event->save();
|
||||
|
||||
if ($event->type == 1) {
|
||||
@@ -60,7 +68,7 @@ class EventController extends Controller
|
||||
$course = new \App\Course();
|
||||
|
||||
$users = \App\User::all();
|
||||
$instructor = 1;
|
||||
$instructor = request('instruc_n'.$l.'_p'.$p);
|
||||
|
||||
foreach ($users as $user) {
|
||||
if($user->fullname() == request('instruc_n'.$l.'_p'.$p))
|
||||
@@ -130,6 +138,7 @@ class EventController extends Controller
|
||||
$event->is_mandatory = 0;
|
||||
}
|
||||
$event->desc = request('desc');
|
||||
$event->msg = \request('msg');
|
||||
|
||||
$event->save();
|
||||
|
||||
@@ -151,7 +160,7 @@ class EventController extends Controller
|
||||
}
|
||||
|
||||
$users = \App\User::all();
|
||||
$instructor = 1;
|
||||
$instructor = request('instruc_n'.$l.'_p'.$p);
|
||||
|
||||
foreach ($users as $user) {
|
||||
if($user->fullname() == request('instruc_n'.$l.'_p'.$p))
|
||||
|
||||
@@ -20,7 +20,7 @@ class JobController extends Controller
|
||||
|
||||
$jobs = $jobs_sorted->values();
|
||||
|
||||
return view('admin.job.index', ['jobs' => $jobs]);
|
||||
return view('admin.configs.jobs.index', ['jobs' => $jobs]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -43,90 +43,22 @@ class JobController extends Controller
|
||||
{
|
||||
$job = new Job;
|
||||
|
||||
$job->name = request('name');
|
||||
$job->acces_level = request('acces_level');
|
||||
$job->desc = request('desc');
|
||||
$job->name = $request->name;
|
||||
$job->desc = $request->desc;
|
||||
|
||||
if (null !==(request('schedule_see'))) {
|
||||
$job->schedule_see = request('schedule_see');
|
||||
} else {
|
||||
$job->schedule_see = false;
|
||||
}
|
||||
|
||||
if (null !==(request('schedule_edit'))) {
|
||||
$job->schedule_edit = 1;
|
||||
} else {
|
||||
$job->schedule_edit = false;
|
||||
}
|
||||
if (null !==(request('schedule_notify'))) {
|
||||
$job->schedule_notify = 1;
|
||||
} else {
|
||||
$job->schedule_notify = false;
|
||||
}
|
||||
if (null !==(request('message_see'))) {
|
||||
$job->message_see = 1;
|
||||
} else {
|
||||
$job->message_see = false;
|
||||
}
|
||||
if (null !==(request('message_edit'))) {
|
||||
$job->message_edit = 1;
|
||||
} else {
|
||||
$job->message_edit = false;
|
||||
}
|
||||
if (null !==(request('message_notify'))) {
|
||||
$job->message_notify = 1;
|
||||
} else {
|
||||
$job->message_notify = false;
|
||||
}
|
||||
if (null !==(request('paper_edit'))) {
|
||||
$job->paper_edit = 1;
|
||||
} else {
|
||||
$job->paper_edit = false;
|
||||
}
|
||||
if (null !==(request('paper_publish'))) {
|
||||
$job->paper_publish = 1;
|
||||
} else {
|
||||
$job->paper_publish = false;
|
||||
}
|
||||
if (null !==(request('paper_notify'))) {
|
||||
$job->paper_notify = 1;
|
||||
} else {
|
||||
$job->paper_notify = false;
|
||||
}
|
||||
if (null !==(request('inventory_see'))) {
|
||||
$job->inventory_see = 1;
|
||||
} else {
|
||||
$job->inventory_see = false;
|
||||
}
|
||||
if (null !==(request('inventory_edit'))) {
|
||||
$job->inventory_edit = 1;
|
||||
} else {
|
||||
$job->inventory_edit = false;
|
||||
}
|
||||
if (null !==(request('inventory_notify'))) {
|
||||
$job->inventory_notify = 1;
|
||||
} else {
|
||||
$job->inventory_notify = false;
|
||||
}
|
||||
if (null !==(request('user_see'))) {
|
||||
$job->user_see = 1;
|
||||
} else {
|
||||
$job->user_see = false;
|
||||
}
|
||||
if (null !==(request('user_edit'))) {
|
||||
$job->user_edit = 1;
|
||||
} else {
|
||||
$job->user_edit = false;
|
||||
}
|
||||
if (null !==(request('user_notify'))) {
|
||||
$job->user_notify = 1;
|
||||
} else {
|
||||
$job->user_notify = false;
|
||||
$tpermission = [];
|
||||
|
||||
foreach (\App\Permission::all() as $perm)
|
||||
{
|
||||
$tkey = $perm->ckey;
|
||||
$tpermission[$tkey] = $request->$tkey;
|
||||
}
|
||||
|
||||
$job->permissions = json_encode($tpermission);
|
||||
$job->save();
|
||||
|
||||
return redirect('/admin/config/job/'.$job->id);
|
||||
clog('add','success','Poste ajouté avec succès');
|
||||
return redirect('/admin/config/jobs')->with('success','Poste ajouté avec succès');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -162,19 +94,44 @@ class JobController extends Controller
|
||||
* @param \App\Job $job
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request, Job $job)
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
//
|
||||
$job = Job::find($id);
|
||||
|
||||
$job->name = $request->name;
|
||||
$job->desc = $request->desc;
|
||||
|
||||
$tpermission = [];
|
||||
|
||||
foreach (\App\Permission::all() as $perm)
|
||||
{
|
||||
$tkey = $perm->ckey;
|
||||
$tpermission[$tkey] = $request->$tkey;
|
||||
}
|
||||
|
||||
$job->permissions = json_encode($tpermission);
|
||||
$job->save();
|
||||
|
||||
clog('add','success','Poste modifié avec succès');
|
||||
return redirect('/admin/config/jobs')->with('success','Poste modifié avec succès');
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param \App\Job $job
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy(Job $job)
|
||||
public function destroy(Request $request)
|
||||
{
|
||||
//
|
||||
$job = Job::find($request->id);
|
||||
foreach (\App\User::all() as $user)
|
||||
{
|
||||
if($user->job->id == $job->id)
|
||||
{
|
||||
$user->job_id = 1;
|
||||
$user->save();
|
||||
}
|
||||
}
|
||||
clog('delete','success','Poste supprimé avec succès');
|
||||
$job->delete();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,13 +14,13 @@ class NewsController extends Controller
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
return view('public.allnews',['news' => News::where('publish','=','1')->paginate(9)]);
|
||||
return view('public.allnews',['news' => News::allWithWeeklyMsg()->where('publish','=','1')->sortByDesc('updated_at')->paginate(9)]);
|
||||
}
|
||||
|
||||
public function indexAdmin()
|
||||
{
|
||||
clogNav('a consulté les nouvelles');
|
||||
return view('admin.news.index',['news' => \App\News::paginate(9)]);
|
||||
return view('admin.news.index',['news' => News::allWithWeeklyMsg()->sortByDesc('updated_at')->paginate(9)]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -69,9 +69,15 @@ class NewsController extends Controller
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
clog('see','success','a consulté une nouvelle',null,'App\News',$id);
|
||||
if (\request('type') == 'msg')
|
||||
{
|
||||
return view('public.news', ['new' => \App\News::getWeeklyMsg(\App\Event::find($id))]);
|
||||
}
|
||||
else
|
||||
{
|
||||
return view('public.news', ['new' => \App\News::find($id)]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\News;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class PublicController extends Controller
|
||||
@@ -14,7 +15,7 @@ class PublicController extends Controller
|
||||
public function index()
|
||||
{
|
||||
return view('public.index',[
|
||||
'news' => \App\News::all()->where('publish','1')->sortByDesc('created_at')->take(3),
|
||||
'news' => \App\News::allWithWeeklyMsg()->where('publish','=','1')->sortByDesc('created_at')->take(3),
|
||||
'activities' => \App\ComplementaryActivity::all()->where('is_promoted','1'),
|
||||
'pictures' => \App\Picture::all()->sortByDesc('created_at')->take(\App\Config::getData('nb_activity_public'))
|
||||
]);
|
||||
|
||||
@@ -109,12 +109,19 @@ class RankController extends Controller
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param \App\Rank $rank
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy(Rank $rank)
|
||||
public function destroy(Request $request)
|
||||
{
|
||||
//
|
||||
$rank = Rank::find($request->id);
|
||||
foreach (\App\User::all() as $user)
|
||||
{
|
||||
if($user->rank->id == $rank->id)
|
||||
{
|
||||
$user->rank_id = 1;
|
||||
$user->save();
|
||||
}
|
||||
}
|
||||
clog('delete','success','Grade supprimé avec succès');
|
||||
$rank->delete();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -213,10 +213,14 @@ class ScheduleController extends Controller
|
||||
$activity = \App\ComplementaryActivity::find($type);
|
||||
$begin_time = $date." ".$activity->begin_time;
|
||||
$end_time = $date." ".$activity->end_time;
|
||||
|
||||
$msg_time = Date('c',strtotime($begin_time.'-4day'));
|
||||
|
||||
return view('admin.schedule.modal.add',[
|
||||
'activity' => \App\ComplementaryActivity::find($type),
|
||||
'begin_time' => $begin_time,
|
||||
'end_time' => $end_time
|
||||
'end_time' => $end_time,
|
||||
'msg_time' => $msg_time
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ class UserController extends Controller
|
||||
|
||||
$user->avatar = rand(1,16);
|
||||
$user->rank_id = request('rank');
|
||||
$user->job = request('job');
|
||||
$user->job_id = request('job');
|
||||
$user->password = bcrypt(request('psw'));
|
||||
$user->api_token = str_random(60);
|
||||
|
||||
@@ -142,7 +142,7 @@ class UserController extends Controller
|
||||
}
|
||||
|
||||
$user->rank_id = request('rank');
|
||||
$user->job = request('job');
|
||||
$user->job_id = request('job');
|
||||
if (request('psw') != null) {
|
||||
$user->password = bcrypt(request('psw'));
|
||||
}
|
||||
|
||||
25
app/Job.php
25
app/Job.php
@@ -6,7 +6,26 @@ use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Job extends Model
|
||||
{
|
||||
protected $casts = [
|
||||
'perm' => 'array',
|
||||
];
|
||||
public function permissions()
|
||||
{
|
||||
return collect(json_decode($this->permissions,true));
|
||||
}
|
||||
|
||||
public function permission($permission)
|
||||
{
|
||||
foreach ($this->permissions() as $perm => $value)
|
||||
{
|
||||
if ($permission == $perm)
|
||||
{
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public function p($perm)
|
||||
{
|
||||
return $this->permission($perm);
|
||||
}
|
||||
}
|
||||
|
||||
39
app/News.php
39
app/News.php
@@ -6,6 +6,10 @@ use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class News extends Model
|
||||
{
|
||||
protected $casts = [
|
||||
'tags' => 'array',
|
||||
];
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo('App\User');
|
||||
@@ -20,4 +24,39 @@ class News extends Model
|
||||
{
|
||||
return $this->morphMany('App\Log', 'logable');
|
||||
}
|
||||
|
||||
public static function allWithWeeklyMsg()
|
||||
{
|
||||
|
||||
$news = \App\News::all();
|
||||
|
||||
foreach (\App\Event::future() as $event)
|
||||
{
|
||||
if($event->type == 1 && $event->msg != "")
|
||||
{
|
||||
if (date('U',strtotime($event->date_msg)) <= time())
|
||||
{
|
||||
$news->push(self::getWeeklyMsg($event));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $news;
|
||||
}
|
||||
|
||||
public static function getWeeklyMsg(\App\Event $event)
|
||||
{
|
||||
$n = new News();
|
||||
|
||||
$n->event_id = $event->id;
|
||||
$n->title = 'Message de la semaine du '.date('Y-m-d',strtotime($event->date_begin));
|
||||
$n->body = $event->msg;
|
||||
$n->user_id = $event->user_id;
|
||||
$n->publish = 1;
|
||||
$n->created_at = $event->created_at;
|
||||
$n->updated_at = $event->updated_at;
|
||||
$n->tags = ['message de la semaine','Important'];
|
||||
|
||||
return $n;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@ namespace App\Providers;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Pagination\LengthAwarePaginator;
|
||||
|
||||
class AppServiceProvider extends ServiceProvider
|
||||
{
|
||||
@@ -15,6 +17,29 @@ class AppServiceProvider extends ServiceProvider
|
||||
public function boot()
|
||||
{
|
||||
Schema::defaultStringLength(191);
|
||||
|
||||
/**
|
||||
* Paginate a standard Laravel Collection.
|
||||
*
|
||||
* @param int $perPage
|
||||
* @param int $total
|
||||
* @param int $page
|
||||
* @param string $pageName
|
||||
* @return array
|
||||
*/
|
||||
Collection::macro('paginate', function($perPage, $total = null, $page = null, $pageName = 'page') {
|
||||
$page = $page ?: LengthAwarePaginator::resolveCurrentPage($pageName);
|
||||
return new LengthAwarePaginator(
|
||||
$this->forPage($page, $perPage),
|
||||
$total ?: $this->count(),
|
||||
$perPage,
|
||||
$page,
|
||||
[
|
||||
'path' => LengthAwarePaginator::resolveCurrentPath(),
|
||||
'pageName' => $pageName,
|
||||
]
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
12
app/User.php
12
app/User.php
@@ -32,6 +32,11 @@ class User extends Authenticatable
|
||||
return $this->belongsTo('App\Rank');
|
||||
}
|
||||
|
||||
public function job()
|
||||
{
|
||||
return $this->belongsTo('App\Job');
|
||||
}
|
||||
|
||||
public function logs()
|
||||
{
|
||||
return $this->hasMany(Log::class);
|
||||
@@ -286,9 +291,16 @@ class User extends Authenticatable
|
||||
}
|
||||
|
||||
public function permission($perm)
|
||||
{
|
||||
if ($this->job->permission($perm) == 0)
|
||||
{
|
||||
return $this->rank->permission($perm);
|
||||
}
|
||||
else
|
||||
{
|
||||
return $this->job->permission($perm);
|
||||
}
|
||||
}
|
||||
|
||||
public function p($perm)
|
||||
{
|
||||
|
||||
@@ -25,23 +25,7 @@ class CreateUsersTable extends Migration
|
||||
$table->string('age');
|
||||
$table->string('avatar')->default('1');
|
||||
$table->string('sexe');
|
||||
$table->string('job')->default(6);
|
||||
$table->string('acces_level')->default('unknown');
|
||||
$table->string('schedule_see')->default('unknown');
|
||||
$table->string('schedule_edit')->default('unknown');
|
||||
$table->string('schedule_notify')->default('unknown');
|
||||
$table->string('message_see')->default('unknown');
|
||||
$table->string('message_edit')->default('unknown');
|
||||
$table->string('message_notify')->default('unknown');
|
||||
$table->string('paper_edit')->default('unknown');
|
||||
$table->string('paper_publish')->default('unknown');
|
||||
$table->string('paper_notify')->default('unknown');
|
||||
$table->string('inventory_see')->default('unknown');
|
||||
$table->string('inventory_edit')->default('unknown');
|
||||
$table->string('inventory_notify')->default('unknown');
|
||||
$table->string('user_see')->default('unknown');
|
||||
$table->string('user_edit')->default('unknown');
|
||||
$table->string('user_notify')->default('unknown');
|
||||
$table->string('job_id')->default(6);
|
||||
$table->string('api_token', 60)->unique()->default(str_shuffle(str_random(60)));
|
||||
$table->rememberToken();
|
||||
$table->timestamps();
|
||||
|
||||
@@ -17,22 +17,7 @@ class CreateJobsTable extends Migration
|
||||
$table->increments('id');
|
||||
$table->string('name');
|
||||
$table->text('desc');
|
||||
$table->text('acces_level');
|
||||
$table->boolean('schedule_see');
|
||||
$table->boolean('schedule_edit');
|
||||
$table->boolean('schedule_notify');
|
||||
$table->boolean('message_see');
|
||||
$table->boolean('message_edit');
|
||||
$table->boolean('message_notify');
|
||||
$table->boolean('paper_edit');
|
||||
$table->boolean('paper_publish');
|
||||
$table->boolean('paper_notify');
|
||||
$table->boolean('inventory_see');
|
||||
$table->boolean('inventory_edit');
|
||||
$table->boolean('inventory_notify');
|
||||
$table->boolean('user_see');
|
||||
$table->boolean('user_edit');
|
||||
$table->boolean('user_notify');
|
||||
$table->text('permissions');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ class CreateNewsTable extends Migration
|
||||
$table->text('body');
|
||||
$table->integer('user_id');
|
||||
$table->boolean('publish');
|
||||
$table->string('tags')->default("[]");
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -23,6 +23,8 @@ class CreateEventsTable extends Migration
|
||||
$table->string('location');
|
||||
$table->boolean('is_mandatory');
|
||||
$table->text('desc');
|
||||
$table->text('msg');
|
||||
$table->string('date_msg');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -221,6 +221,11 @@ class ConfigsTableSeeder extends Seeder
|
||||
'name' => 'public_index_img_url',
|
||||
'state' => 0,
|
||||
'data' => '["./assets/img/bg2.jpg"]'
|
||||
],
|
||||
[
|
||||
'name' => 'default_weekly_msg',
|
||||
'state' => 0,
|
||||
'data' => "[\"<strong>/* Nom de l'évènement */</strong><br>Heure (Cadets):<br>Lieu:<br>Tenue:<br>Matériel:<br>/* Commentaire */\"]"
|
||||
]
|
||||
];
|
||||
|
||||
|
||||
@@ -15,82 +15,7 @@ class JobsTableSeeder extends Seeder
|
||||
[
|
||||
'name' => "Indéterminé",
|
||||
'desc' => "Aucun poste",
|
||||
'acces_level' => '0',
|
||||
'schedule_see' => false,
|
||||
'schedule_edit' => false,
|
||||
'schedule_notify' => false,
|
||||
'message_see' => false,
|
||||
'message_edit' => false,
|
||||
'message_notify' => false,
|
||||
'paper_edit' => false,
|
||||
'paper_publish' => false,
|
||||
'paper_notify' => false,
|
||||
'inventory_see' => false,
|
||||
'inventory_edit' => false,
|
||||
'inventory_notify' => false,
|
||||
'user_see' => false,
|
||||
'user_edit' => false,
|
||||
'user_notify' => false
|
||||
],
|
||||
[
|
||||
'name' => "Cadet Commandant",
|
||||
'desc' => "Description a modifier ...",
|
||||
'acces_level' => '2',
|
||||
'schedule_see' => true,
|
||||
'schedule_edit' => true,
|
||||
'schedule_notify' => true,
|
||||
'message_see' => true,
|
||||
'message_edit' => true,
|
||||
'message_notify' => true,
|
||||
'paper_edit' => true,
|
||||
'paper_publish' => true,
|
||||
'paper_notify' => false,
|
||||
'inventory_see' => true,
|
||||
'inventory_edit' => true,
|
||||
'inventory_notify' => false,
|
||||
'user_see' => true,
|
||||
'user_edit' => true,
|
||||
'user_notify' => false
|
||||
],
|
||||
[
|
||||
'name' => "Chef Instructeur",
|
||||
'desc' => "Description a modifier ...",
|
||||
'acces_level' => '2',
|
||||
'schedule_see' => true,
|
||||
'schedule_edit' => true,
|
||||
'schedule_notify' => false,
|
||||
'message_see' => true,
|
||||
'message_edit' => true,
|
||||
'message_notify' => true,
|
||||
'paper_edit' => true,
|
||||
'paper_publish' => true,
|
||||
'paper_notify' => false,
|
||||
'inventory_see' => true,
|
||||
'inventory_edit' => true,
|
||||
'inventory_notify' => false,
|
||||
'user_see' => true,
|
||||
'user_edit' => false,
|
||||
'user_notify' => false
|
||||
],
|
||||
[
|
||||
'name' => "Adjudant Maitre d'Escadron",
|
||||
'desc' => "Description a modifier ...",
|
||||
'acces_level' => '2',
|
||||
'schedule_see' => true,
|
||||
'schedule_edit' => false,
|
||||
'schedule_notify' => false,
|
||||
'message_see' => true,
|
||||
'message_edit' => true,
|
||||
'message_notify' => true,
|
||||
'paper_edit' => true,
|
||||
'paper_publish' => true,
|
||||
'paper_notify' => false,
|
||||
'inventory_see' => true,
|
||||
'inventory_edit' => true,
|
||||
'inventory_notify' => false,
|
||||
'user_see' => true,
|
||||
'user_edit' => false,
|
||||
'user_notify' => false
|
||||
'permissions' => \App\Permission::allToString(0)
|
||||
]
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ class RanksTableSeeder extends Seeder
|
||||
[
|
||||
'name' => "SuperAdmin",
|
||||
'acces_level' => '2',
|
||||
'desc' => 'Compte SuperAdmin donne toutes les permissions ne peux être modifié',
|
||||
'desc' => 'Compte SuperAdmin donne toutes les permissions <strong>ne peux être modifié</strong>',
|
||||
'permissions' => \App\Permission::allToString(1)
|
||||
]
|
||||
]);
|
||||
|
||||
@@ -22,7 +22,7 @@ class UsersTableSeeder extends Seeder
|
||||
'age' => '99',
|
||||
'avatar' => '3',
|
||||
'sexe' => 'm',
|
||||
'job' => '1',
|
||||
'job_id' => '1',
|
||||
'api_token' => str_shuffle(str_random(60)),
|
||||
],
|
||||
[
|
||||
@@ -35,7 +35,7 @@ class UsersTableSeeder extends Seeder
|
||||
'age' => '99',
|
||||
'avatar' => '3',
|
||||
'sexe' => 'm',
|
||||
'job' => '1',
|
||||
'job_id' => '1',
|
||||
'api_token' => str_shuffle(str_random(60)),
|
||||
]
|
||||
]);
|
||||
|
||||
35
public/css/custom.css
vendored
35
public/css/custom.css
vendored
@@ -2,6 +2,14 @@
|
||||
margin-top: 50px;
|
||||
}
|
||||
|
||||
.news-title {
|
||||
height: 3.2rem;
|
||||
}
|
||||
|
||||
.news-tags {
|
||||
height: 1.5rem;
|
||||
}
|
||||
|
||||
.news-body-small {
|
||||
height: 15rem;
|
||||
overflow: hidden;
|
||||
@@ -53,6 +61,33 @@
|
||||
height: 3rem;
|
||||
overflow: hidden;
|
||||
}
|
||||
.autocomplete-items {
|
||||
position: absolute;
|
||||
border: 1px solid #d4d4d4;
|
||||
border-bottom: none;
|
||||
border-top: none;
|
||||
z-index: 99;
|
||||
/*position the autocomplete items to be the same width as the container:*/
|
||||
top: 64%;
|
||||
left: 0;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.autocomplete-items div {
|
||||
padding: 10px;
|
||||
cursor: pointer;
|
||||
background-color: #fff;
|
||||
border-bottom: 1px solid #d4d4d4;
|
||||
}
|
||||
.autocomplete-items div:hover {
|
||||
/*when hovering an item:*/
|
||||
background-color: #e9e9e9;
|
||||
}
|
||||
.autocomplete-active {
|
||||
/*when navigating through the items using the arrow keys:*/
|
||||
background-color: DodgerBlue !important;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 800px) {
|
||||
.calendar-container {
|
||||
|
||||
4
public/js/app.js
vendored
4
public/js/app.js
vendored
File diff suppressed because one or more lines are too long
1
public/js/calendar.js
vendored
1
public/js/calendar.js
vendored
@@ -45,6 +45,7 @@ function switchType(date) {
|
||||
$.get( "/api/schedule/events/add/modal/"+selectInput.val()+"/"+date+"?api_token="+api_token, function( data ) {
|
||||
$( "#container" ).html( data );
|
||||
console.log( "Loading defaut value for activity type ("+selectInput.val()+")" );
|
||||
$('select').selectpicker();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
106
public/js/plugins/autocomplete.js
vendored
Normal file
106
public/js/plugins/autocomplete.js
vendored
Normal file
@@ -0,0 +1,106 @@
|
||||
function autocomplete(inp, arr) {
|
||||
/*the autocomplete function takes two arguments,
|
||||
the text field element and an array of possible autocompleted values:*/
|
||||
var currentFocus;
|
||||
/*execute a function when someone writes in the text field:*/
|
||||
inp.addEventListener("input", function(e) {
|
||||
var a, b, i, val = this.value;
|
||||
/*close any already open lists of autocompleted values*/
|
||||
closeAllLists();
|
||||
if (!val) { return false;}
|
||||
currentFocus = -1;
|
||||
/*create a DIV element that will contain the items (values):*/
|
||||
a = document.createElement("DIV");
|
||||
a.setAttribute("id", this.id + "autocomplete-list");
|
||||
a.setAttribute("class", "autocomplete-items");
|
||||
/*append the DIV element as a child of the autocomplete container:*/
|
||||
this.parentNode.appendChild(a);
|
||||
/*for each item in the array...*/
|
||||
for (i = 0; i < arr.length; i++) {
|
||||
/*check if the item starts with the same letters as the text field value:*/
|
||||
if (arr[i].substr(0, val.length).toUpperCase() == val.toUpperCase()) {
|
||||
/*create a DIV element for each matching element:*/
|
||||
b = document.createElement("DIV");
|
||||
/*make the matching letters bold:*/
|
||||
b.innerHTML = "<strong>" + arr[i].substr(0, val.length) + "</strong>";
|
||||
b.innerHTML += arr[i].substr(val.length);
|
||||
/*insert a input field that will hold the current array item's value:*/
|
||||
b.innerHTML += "<input type='hidden' value='" + arr[i] + "'>";
|
||||
/*execute a function when someone clicks on the item value (DIV element):*/
|
||||
b.addEventListener("click", function(e) {
|
||||
/*insert the value for the autocomplete text field:*/
|
||||
inp.value = this.getElementsByTagName("input")[0].value;
|
||||
/*close the list of autocompleted values,
|
||||
(or any other open lists of autocompleted values:*/
|
||||
closeAllLists();
|
||||
});
|
||||
a.appendChild(b);
|
||||
}
|
||||
}
|
||||
});
|
||||
/*execute a function presses a key on the keyboard:*/
|
||||
inp.addEventListener("keydown", function(e) {
|
||||
var x = document.getElementById(this.id + "autocomplete-list");
|
||||
if (x) x = x.getElementsByTagName("div");
|
||||
if (e.keyCode == 40) {
|
||||
/*If the arrow DOWN key is pressed,
|
||||
increase the currentFocus variable:*/
|
||||
currentFocus++;
|
||||
/*and and make the current item more visible:*/
|
||||
addActive(x);
|
||||
} else if (e.keyCode == 38) { //up
|
||||
/*If the arrow UP key is pressed,
|
||||
decrease the currentFocus variable:*/
|
||||
currentFocus--;
|
||||
/*and and make the current item more visible:*/
|
||||
addActive(x);
|
||||
} else if (e.keyCode == 13) {
|
||||
/*If the ENTER key is pressed, prevent the form from being submitted,*/
|
||||
e.preventDefault();
|
||||
if (currentFocus > -1) {
|
||||
/*and simulate a click on the "active" item:*/
|
||||
if (x) x[currentFocus].click();
|
||||
}
|
||||
}
|
||||
});
|
||||
function addActive(x) {
|
||||
/*a function to classify an item as "active":*/
|
||||
if (!x) return false;
|
||||
/*start by removing the "active" class on all items:*/
|
||||
removeActive(x);
|
||||
if (currentFocus >= x.length) currentFocus = 0;
|
||||
if (currentFocus < 0) currentFocus = (x.length - 1);
|
||||
/*add class "autocomplete-active":*/
|
||||
x[currentFocus].classList.add("autocomplete-active");
|
||||
}
|
||||
function removeActive(x) {
|
||||
/*a function to remove the "active" class from all autocomplete items:*/
|
||||
for (var i = 0; i < x.length; i++) {
|
||||
x[i].classList.remove("autocomplete-active");
|
||||
}
|
||||
}
|
||||
function closeAllLists(elmnt) {
|
||||
/*close all autocomplete lists in the document,
|
||||
except the one passed as an argument:*/
|
||||
var x = document.getElementsByClassName("autocomplete-items");
|
||||
for (var i = 0; i < x.length; i++) {
|
||||
if (elmnt != x[i] && elmnt != inp) {
|
||||
x[i].parentNode.removeChild(x[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
/*execute a function when someone clicks in the document:*/
|
||||
document.addEventListener("click", function (e) {
|
||||
closeAllLists(e.target);
|
||||
});
|
||||
}
|
||||
|
||||
function initAutoComplete(htmlClass)
|
||||
{
|
||||
$.get('/api/user/list?api_token='+api_token, function ( data ) {
|
||||
var users = JSON.parse(data);
|
||||
$("."+htmlClass).each(function ( index ) {
|
||||
autocomplete(document.getElementById(this.id), users);
|
||||
})
|
||||
});
|
||||
}
|
||||
@@ -1,6 +1,4 @@
|
||||
{
|
||||
"/js/app.js": "/js/app.js",
|
||||
"/css/app.css": "/css/app.css",
|
||||
"/css/material-dashboard.css": "/css/material-dashboard.css",
|
||||
"/css/custom.css": "/css/custom.css"
|
||||
}
|
||||
|
||||
35
resources/custom.css
vendored
35
resources/custom.css
vendored
@@ -2,6 +2,14 @@
|
||||
margin-top: 50px;
|
||||
}
|
||||
|
||||
.news-title {
|
||||
height: 3.2rem;
|
||||
}
|
||||
|
||||
.news-tags {
|
||||
height: 1.5rem;
|
||||
}
|
||||
|
||||
.news-body-small {
|
||||
height: 15rem;
|
||||
overflow: hidden;
|
||||
@@ -53,6 +61,33 @@
|
||||
height: 3rem;
|
||||
overflow: hidden;
|
||||
}
|
||||
.autocomplete-items {
|
||||
position: absolute;
|
||||
border: 1px solid #d4d4d4;
|
||||
border-bottom: none;
|
||||
border-top: none;
|
||||
z-index: 99;
|
||||
/*position the autocomplete items to be the same width as the container:*/
|
||||
top: 64%;
|
||||
left: 0;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.autocomplete-items div {
|
||||
padding: 10px;
|
||||
cursor: pointer;
|
||||
background-color: #fff;
|
||||
border-bottom: 1px solid #d4d4d4;
|
||||
}
|
||||
.autocomplete-items div:hover {
|
||||
/*when hovering an item:*/
|
||||
background-color: #e9e9e9;
|
||||
}
|
||||
.autocomplete-active {
|
||||
/*when navigating through the items using the arrow keys:*/
|
||||
background-color: DodgerBlue !important;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 800px) {
|
||||
.calendar-container {
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
@foreach($activity as $a)
|
||||
<div class="col-md-4">
|
||||
<div class="col-xl-4 col-lg-6">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title">{{$a->name}}</h4>
|
||||
@@ -23,17 +23,17 @@
|
||||
<div class="card-footer">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="btn-group w-100">
|
||||
<div class="text-center">
|
||||
@if(\Auth::user()->p('article_edit') == 1)
|
||||
<a href="/admin/article/activity/edit/{{$a->id}}" type="button" class="btn btn-secondary btn-block"><i class="fa fa-cog"></i> Modifier l'article</a>
|
||||
<a href="/admin/article/activity/edit/{{$a->id}}" type="button" class="btn btn-secondary"><i class="fa fa-cog"></i> Modifier l'article</a>
|
||||
@endif
|
||||
@if(\Auth::user()->p('article_edit') == 1 && \Auth::user()->p('picture_add'))
|
||||
<a href="/admin/article/activity/picture/{{$a->id}}" type="button" class="btn btn-secondary btn-block"><i class="fa fa-picture-o"></i> Gérer les photos</a>
|
||||
<a href="/admin/article/activity/picture/{{$a->id}}" type="button" class="btn btn-secondary"><i class="fa fa-picture-o"></i> Gérer les photos</a>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<a href="/activity/{{$a->id}}" target="_blank" type="button" class="btn btn-outline-secondary btn-block"><i class="fa fa-picture-o"></i> Voir l'article</a>
|
||||
<div class="col-md-12 text-center">
|
||||
<a href="/activity/{{$a->id}}" target="_blank" type="button" class="btn btn-outline-secondary"><i class="fa fa-picture-o"></i> Voir l'article</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -25,7 +25,11 @@
|
||||
{{$event->fulldesc}}
|
||||
</div>
|
||||
<div class="col-md-6 text-right">
|
||||
@if(is_numeric($event->user_id))
|
||||
{{$event->user->fullname()}}
|
||||
@else
|
||||
{{$event->user_id}}
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -7,15 +7,15 @@
|
||||
Configuration Générale
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row form-group">
|
||||
<div class="row">
|
||||
@foreach ($activities as $activity)
|
||||
<div class="col-md-6 p-2">
|
||||
<div class="col-lg-12 col-xl-6 p-2">
|
||||
<div class="row m-auto">
|
||||
<div class="col-md-8">
|
||||
<div class="col">
|
||||
<label for="text-input" class=" form-control-label">{{$activity->name}}</label>
|
||||
<small class="form-text text-muted">{{$activity->admin_desc}}</small>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="col text-right">
|
||||
<div class="btn-group">
|
||||
<a href="/admin/config/activity/edit/{{$activity->id}}" class="btn btn-primary"><i class="fa fa-cog" aria-hidden="true"></i> Modifier</a>
|
||||
<button class="btn btn-danger" onclick="delActivity({{$activity->id}})" ><i class="fa fa-times" aria-hidden="true" data-toggle="tooltip" data-placement="bottom" title="Supprimer"></i></button>
|
||||
|
||||
88
resources/views/admin/configs/jobs/index.blade.php
Normal file
88
resources/views/admin/configs/jobs/index.blade.php
Normal file
@@ -0,0 +1,88 @@
|
||||
@extends('layouts.admin.main')
|
||||
|
||||
@section('content')
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header card-header-primary">
|
||||
<h4>Configuration des postes</h4>
|
||||
</div>
|
||||
<div class="card-body mt-5">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<a href="/admin/config/jobs/add" class="btn btn-primary btn-block mb-3">Ajouter un poste</a>
|
||||
</div>
|
||||
@foreach($jobs as $job)
|
||||
<div class="col-md-4">
|
||||
<div class="card">
|
||||
<div class="card-header @if($job->id == 1) card-header-danger @else card-header-primary @endif">
|
||||
<h4>{{$job->name}}</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div>
|
||||
{!! $job->desc!!}
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-10">
|
||||
@if($job->id == 1)
|
||||
<button disabled class="btn btn-primary btn-block">Gérer</button>
|
||||
@else
|
||||
<a href="/admin/config/jobs/{{$job->id}}" class="btn btn-primary btn-block">Gérer</a>
|
||||
@endif
|
||||
</div>
|
||||
<div class="col">
|
||||
@if($job->id == 1)
|
||||
<button disabled class="btn btn-danger btn-just-icon"><i class="fa fa-close"></i></button>
|
||||
@else
|
||||
<button class="btn btn-danger btn-just-icon" onclick="deleteJobs({{$job->id}})"><i class="fa fa-close"></i></button>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('custom_scripts')
|
||||
<script>
|
||||
function deleteJobs(pid){
|
||||
swal({
|
||||
title: 'Êtes vous certain ?',
|
||||
html:
|
||||
'Vous ne pourrez annuler cette action! <br>' +
|
||||
'<strong>Veuillez donner un nouveau poste a tous les utilisateurs posédant présentement le poste que vous voulez supprimer</strong>',
|
||||
type: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Oui',
|
||||
cancelButtonText: 'Non'
|
||||
}).then((result) => {
|
||||
if (result.value) {
|
||||
|
||||
(function($) {
|
||||
$.post('/api/config/job/delete?api_token='+api_token, { id: pid } , function(data) {
|
||||
console.log('Delete');
|
||||
});
|
||||
|
||||
|
||||
})(jQuery);
|
||||
|
||||
swal(
|
||||
'Supprimé!',
|
||||
"Le poste a été supprimé",
|
||||
'success'
|
||||
).then((result) => {
|
||||
if (result.value) {
|
||||
location.reload();
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
@endsection
|
||||
@@ -8,6 +8,9 @@
|
||||
</div>
|
||||
<div class="card-body mt-5">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<a href="/admin/config/ranks/add" class="btn btn-primary btn-block mb-3">Ajouter un grade</a>
|
||||
</div>
|
||||
@foreach($ranks as $rank)
|
||||
<div class="col-md-4">
|
||||
<div class="card">
|
||||
@@ -16,11 +19,22 @@
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div>
|
||||
{{$rank->desc}}
|
||||
{!! $rank->desc!!}
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-10">
|
||||
@if($rank->id == 1)
|
||||
<button disabled class="btn btn-primary btn-block">Gérer</button>
|
||||
@else
|
||||
<a href="/admin/config/ranks/{{$rank->id}}" class="btn btn-primary btn-block">Gérer</a>
|
||||
@endif
|
||||
</div>
|
||||
<div class="col">
|
||||
@if($rank->id == 1)
|
||||
<button disabled class="btn btn-danger btn-just-icon"><i class="fa fa-close"></i></button>
|
||||
@else
|
||||
<button class="btn btn-danger btn-just-icon" onclick="deleteRanks({{$rank->id}})"><i class="fa fa-close"></i></button>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -32,3 +46,43 @@
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('custom_scripts')
|
||||
<script>
|
||||
function deleteRanks(pid){
|
||||
swal({
|
||||
title: 'Êtes vous certain ?',
|
||||
html:
|
||||
'Vous ne pourrez annuler cette action! <br>' +
|
||||
'<strong>Veuillez donner un nouveau grade a tous les utilisateurs posédant présentement le grade que vous voulez supprimer</strong>',
|
||||
type: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Oui',
|
||||
cancelButtonText: 'Non'
|
||||
}).then((result) => {
|
||||
if (result.value) {
|
||||
|
||||
(function($) {
|
||||
$.post('/api/config/rank/delete?api_token='+api_token, { id: pid } , function(data) {
|
||||
console.log('Delete');
|
||||
});
|
||||
|
||||
|
||||
})(jQuery);
|
||||
|
||||
swal(
|
||||
'Supprimé!',
|
||||
"Le grade a été supprimé",
|
||||
'success'
|
||||
).then((result) => {
|
||||
if (result.value) {
|
||||
location.reload();
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
@endsection
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
<h4 class="card-title"> Cours à venir</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
@if(\Auth::user()->courses->isEmpty())
|
||||
<div class="col-sm-12 text-center">
|
||||
<h4 class="m-4">Aucun cours à venir</h4>
|
||||
@@ -31,6 +32,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header card-header-primary">
|
||||
@@ -94,7 +96,7 @@
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
@foreach (\App\News::all()->forPage(1,4); as $msg)
|
||||
@foreach (\App\News::all()->forPage(1,3) as $msg)
|
||||
<div class="col-12 text-center">
|
||||
<a href="/admin/message/{{$msg->id}}">
|
||||
<div style="height:2rem;">{{$msg->title}}</div>
|
||||
|
||||
@@ -3,126 +3,72 @@
|
||||
@section('content')
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<strong class="card-title">Ajouter un poste <a href="#"><i class="fa fa-question-circle" aria-hidden="true"></i>
|
||||
</a></strong>
|
||||
<div class="card-header card-header-primary">
|
||||
<h4>Ajouter un poste</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form action="/admin/config/job/add" method="post">
|
||||
|
||||
<div class="card-body mt-5">
|
||||
<form method="post" action="/admin/config/jobs/add">
|
||||
@csrf
|
||||
|
||||
<div id="myTabContent">
|
||||
<div id="name" role="tabpanel">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<label for="name">Nom du poste</label>
|
||||
<input type="text" class="form-control" name="name" id="name" aria-describedby="helpId" placeholder="" required>
|
||||
<small id="helpId" class="form-text text-muted">Nom du poste</small>
|
||||
<label>Nom</label>
|
||||
<input class="form-control" type="text" name="name">
|
||||
<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"></textarea>
|
||||
<small class="form-text text-muted">Description du poste</small>
|
||||
</div>
|
||||
<div class="row form-group">
|
||||
<div class="col-12"><textarea name="desc" id="desc" rows="9" class="form-control" required></textarea>
|
||||
<small class="form-text text-muted">Description du poste</small></div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="row form-group">
|
||||
<div class="col col-md-3"><label for="text-input" class=" form-control-label">Niveau d'accès</label></div>
|
||||
<div class="col col-md-3">
|
||||
<select name="acces_level" id="acces_level" class="form-control" required>
|
||||
<option value="0">Cadet</option>
|
||||
<option value="regular">Staff</option>
|
||||
<option value="pilotage">Officer</option>
|
||||
</select>
|
||||
<div class="col-md-12">
|
||||
<h3>Permissions du poste</h3>
|
||||
<p>
|
||||
Choisissez quels permissions doivent être associé avec ce poste.
|
||||
</p>
|
||||
<div id="accordion" role="tablist">
|
||||
@foreach(\App\Permission::allToArray() as $key => $cat)
|
||||
<div class="card card-collapse">
|
||||
<div class="card-header" role="tab" id="headingOne">
|
||||
<h5 class="mb-0">
|
||||
<a class="text-capitalize" data-toggle="collapse" href="#coll-{{$key}}" @if ($loop->first) aria-expanded="true" @endif aria-controls="collapseOne">
|
||||
{{$key}}
|
||||
<i class="material-icons">keyboard_arrow_down</i>
|
||||
</a>
|
||||
</h5>
|
||||
</div>
|
||||
|
||||
<div id="coll-{{$key}}" class="collapse @if ($loop->first) show @endif" role="tabpanel" aria-labelledby="headingOne" data-parent="#accordion">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
@foreach($cat as $r)
|
||||
<div class="col text-center">
|
||||
<input class="d-none" type="text" id="{{$r['ckey']}}" name="{{$r['ckey']}}">
|
||||
<h5>{{$r['communName']}}</h5>
|
||||
<div class="btn-group">
|
||||
<button type="button" id="{{$r['ckey']}}-close" class="btn btn-just-icon btn-outline-danger" onclick="switchPermissionSwitch('{{$r['ckey']}}','close')"><i class="fa fa-close"></i></button>
|
||||
<button type="button" id="{{$r['ckey']}}-slash" class="btn btn-just-icon btn-warning" onclick="switchPermissionSwitch('{{$r['ckey']}}','slash')"><i class="fa fa-slash"></i></button>
|
||||
<button type="button" id="{{$r['ckey']}}-plus" class="btn btn-just-icon btn-outline-success" onclick="switchPermissionSwitch('{{$r['ckey']}}','plus')"><i class="fa fa-plus"></i></button>
|
||||
</div>
|
||||
<div class="row form-group">
|
||||
<div class="col col-md-3"><label for="text-input" class=" form-control-label">Horaire détaillé</label><small class="form-text text-muted"> L'utilisateur avec ce poste peut t'il consulter les détails de l'horaire</small></div>
|
||||
<div class="col col-md-3" style="margin: auto;">
|
||||
<label for="disabled-input" class=" form-control-label"></label>
|
||||
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input id="schedule_see" name="schedule_see" class="switch-input" type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
|
||||
<p>
|
||||
<small>{{$r['desc']}}</small>
|
||||
</p>
|
||||
</div>
|
||||
<div class="col col-md-3"><label for="text-input" class=" form-control-label">Modification horaire</label><small class="form-text text-muted"> L'utilisateur avec ce poste peut t'il ajouter, modifier et supprimer des événements a l'horaire</small></div>
|
||||
<div class="col col-md-3" style="margin: auto;">
|
||||
<label for="disabled-input" class=" form-control-label"></label>
|
||||
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input id="schedule_edit" name="schedule_edit" class="switch-input" type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row form-group">
|
||||
<div class="col col-md-3"><label for="text-input" class=" form-control-label">Notifiation horaire</label><small class="form-text text-muted"> L'utilisateur avec ce poste doit t-il recevoir des notifiation pour tous les changements a l'horaire.</small></div>
|
||||
<div class="col col-md-3" style="margin: auto;">
|
||||
<label for="disabled-input" class=" form-control-label"></label>
|
||||
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input id="schedule_notify" name="schedule_notify" class="switch-input" type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
|
||||
</div>
|
||||
<div class="col col-md-3"><label for="text-input" class=" form-control-label">Consultation messages</label><small class="form-text text-muted"> L'utilisateur avec ce poste peut t'il consulter les messages</small></div>
|
||||
<div class="col col-md-3" style="margin: auto;">
|
||||
<label for="disabled-input" class=" form-control-label"></label>
|
||||
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input id="message_see" name="message_see" class="switch-input" type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row form-group">
|
||||
<div class="col col-md-3"><label for="text-input" class=" form-control-label">Modification messages</label><small class="form-text text-muted"> L'utilisateur avec ce poste peut t'il ajouter, modifier et supprimer des messages</small></div>
|
||||
<div class="col col-md-3" style="margin: auto;">
|
||||
<label for="disabled-input" class=" form-control-label"></label>
|
||||
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input id="message_edit" name="message_edit" class="switch-input" type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
|
||||
</div>
|
||||
<div class="col col-md-3"><label for="text-input" class=" form-control-label">Notifiation messages</label><small class="form-text text-muted"> L'utilisateur avec ce poste doit t-il recevoir des notifiation pour tous les changements en lien avec les messages.</small></div>
|
||||
<div class="col col-md-3" style="margin: auto;">
|
||||
<label for="disabled-input" class=" form-control-label"></label>
|
||||
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input id="message_notify" name="message_notify" class="switch-input" type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row form-group">
|
||||
<div class="col col-md-3"><label for="text-input" class=" form-control-label">Modification article</label><small class="form-text text-muted"> L'utilisateur avec ce poste peut t'il ajouter, modifier et supprimer des articles</small></div>
|
||||
<div class="col col-md-3" style="margin: auto;">
|
||||
<label for="disabled-input" class=" form-control-label"></label>
|
||||
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input id="paper_edit" name="paper_edit" class="switch-input" type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
|
||||
</div>
|
||||
<div class="col col-md-3"><label for="text-input" class=" form-control-label">Publication articles</label><small class="form-text text-muted"> L'utilisateur avec ce poste peux t-il autoriser la publication ou appouver des changements a un articles</small></div>
|
||||
<div class="col col-md-3" style="margin: auto;">
|
||||
<label for="disabled-input" class=" form-control-label"></label>
|
||||
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input id="paper_publish" name="paper_publish" class="switch-input" type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row form-group">
|
||||
<div class="col col-md-3"><label for="text-input" class=" form-control-label">Notifiation articles</label><small class="form-text text-muted"> L'utilisateur avec ce poste doit t-il recevoir des notifiation pour tous les changements en lien avec les articles.</small></div>
|
||||
<div class="col col-md-3" style="margin: auto;">
|
||||
<label for="disabled-input" class=" form-control-label"></label>
|
||||
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input id="paper_notify" name="paper_notify" class="switch-input" type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
|
||||
</div>
|
||||
<div class="col col-md-3"><label for="text-input" class=" form-control-label">Consultation inventaire</label><small class="form-text text-muted"> L'utilisateur avec ce poste peut t'il consulter l'inventaire</small></div>
|
||||
<div class="col col-md-3" style="margin: auto;">
|
||||
<label for="disabled-input" class=" form-control-label"></label>
|
||||
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input id="inventory_see" name="inventory_see" class="switch-input" type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row form-group">
|
||||
<div class="col col-md-3"><label for="text-input" class=" form-control-label">Modification inventaire</label><small class="form-text text-muted"> L'utilisateur avec ce poste peut t'il ajouter, modifier et supprimer l'inventaire</small></div>
|
||||
<div class="col col-md-3" style="margin: auto;">
|
||||
<label for="disabled-input" class=" form-control-label"></label>
|
||||
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input id="inventory_edit" name="inventory_edit" class="switch-input" type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
|
||||
</div>
|
||||
<div class="col col-md-3"><label for="text-input" class=" form-control-label">Notifiation inventaire</label><small class="form-text text-muted"> L'utilisateur avec ce poste doit t-il recevoir des notifiation pour tous les changements en lien avec les articles.</small></div>
|
||||
<div class="col col-md-3" style="margin: auto;">
|
||||
<label for="disabled-input" class=" form-control-label"></label>
|
||||
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input id="inventory_notify" name="inventory_notify" class="switch-input" type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row form-group">
|
||||
<div class="col col-md-3"><label for="text-input" class=" form-control-label">Modification utilisateur</label><small class="form-text text-muted"> L'utilisateur avec ce poste peut t'il ajouter, modifier et supprimer des utilisateurs</small></div>
|
||||
<div class="col col-md-3" style="margin: auto;">
|
||||
<label for="disabled-input" class=" form-control-label"></label>
|
||||
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input id="user_edit" name="user_edit" class="switch-input" type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
|
||||
</div>
|
||||
<div class="col col-md-3"><label for="text-input" class=" form-control-label">Notifiation utilisateur</label><small class="form-text text-muted"> L'utilisateur avec ce poste doit t-il recevoir des notifiation pour tous les changements en lien avec les utilisateurs.</small></div>
|
||||
<div class="col col-md-3" style="margin: auto;">
|
||||
<label for="disabled-input" class=" form-control-label"></label>
|
||||
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input id="user_notify" name="user_notify" class="switch-input" type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<button type="submit" class="btn btn-primary btn-sm">
|
||||
<i class="fa fa-dot-circle-o"></i> Submit
|
||||
</button>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12 mt-5">
|
||||
<button type="submit" class="btn btn-primary">Sauvegarder</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@@ -131,37 +77,11 @@
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('breadcrumb')
|
||||
<div class="breadcrumbs">
|
||||
<div class="col-sm-4">
|
||||
<div class="page-header float-left">
|
||||
<div class="page-title">
|
||||
<h1>{{ trans('admin/dashboard.page_title')}}</h1>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-8">
|
||||
<div class="page-header float-right">
|
||||
<div class="page-title">
|
||||
<ol class="breadcrumb text-right">
|
||||
<li class="active">{{ trans('admin/dashboard.breadcrumb')}}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('custom_scripts')
|
||||
|
||||
<script src="https://cloud.tinymce.com/stable/tinymce.min.js?apiKey=r82pabvd9arn3fjb1e2fsolf2xpixuv4hwfwart4cf1fb7mx"></script>
|
||||
<script src="/js/permissions.js"></script>
|
||||
<script>
|
||||
tinymce.init({
|
||||
selector: '#desc',
|
||||
branding: false,
|
||||
menubar: 'edit view format'
|
||||
$('#desc').trumbowyg({
|
||||
lang: 'fr'
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@endsection
|
||||
@@ -3,128 +3,72 @@
|
||||
@section('content')
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<strong class="card-title">Modification du poste : {{$job->name}}<a href="#"><i class="fa fa-question-circle" aria-hidden="true"></i>
|
||||
</a></strong>
|
||||
<div class="card-header card-header-primary">
|
||||
<h4>Configuration du poste {{$job->name}}</h4>
|
||||
</div>
|
||||
<div class="card-body mt-5">
|
||||
<form method="post" action="">
|
||||
@csrf
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<label>Nom</label>
|
||||
<input class="form-control" type="text" name="name" value="{{$job->name}}">
|
||||
<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>
|
||||
<small class="form-text text-muted">Description du poste</small>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form>
|
||||
<div class="tab-content pl-3 p-1" id="myTabContent">
|
||||
<div id="{{$job->name}}" role="tabpanel" aria-labelledby="{{$job->name}}-tab">
|
||||
<div class="row form-group">
|
||||
<div class="col-12"><textarea name="{{$job->id}}_desc" name="{{$job->id}}_desc" rows="9" class="form-control"></textarea>
|
||||
<small class="form-text text-muted">Description du poste</small></div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="row form-group">
|
||||
<div class="col col-md-3"><label for="text-input" class=" form-control-label">Niveau d'accès</label></div>
|
||||
<div class="col col-md-3">
|
||||
<select name="{{$job->id}}_event_type" name="{{$job->id}}_event_type" class="form-control">
|
||||
@switch($job->acces_level)
|
||||
@case(1)
|
||||
<option value="1">Staff</option>
|
||||
@break
|
||||
@case(2)
|
||||
<option value="2">Officer</option>
|
||||
@break
|
||||
@default
|
||||
<option value="0">Cadet</option>
|
||||
@endswitch
|
||||
<option value="0">Cadet</option>
|
||||
<option value="1">Staff</option>
|
||||
<option value="2">Officer</option>
|
||||
</select>
|
||||
<div class="col-md-12">
|
||||
<h3>Permissions du poste</h3>
|
||||
<p>
|
||||
Choisissez quels permissions doivent être associé avec ce poste.
|
||||
</p>
|
||||
<div id="accordion" role="tablist">
|
||||
@foreach(\App\Permission::allToArray() as $key => $cat)
|
||||
<div class="card card-collapse">
|
||||
<div class="card-header" role="tab" id="headingOne">
|
||||
<h5 class="mb-0">
|
||||
<a class="text-capitalize" data-toggle="collapse" href="#coll-{{$key}}" @if ($loop->first) aria-expanded="true" @endif aria-controls="collapseOne">
|
||||
{{$key}}
|
||||
<i class="material-icons">keyboard_arrow_down</i>
|
||||
</a>
|
||||
</h5>
|
||||
</div>
|
||||
|
||||
<div id="coll-{{$key}}" class="collapse @if ($loop->first) show @endif" role="tabpanel" aria-labelledby="headingOne" data-parent="#accordion">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
@foreach($cat as $r)
|
||||
<div class="col text-center">
|
||||
<input class="d-none" type="text" id="{{$r['ckey']}}" name="{{$r['ckey']}}" value="{{$job->p($r['ckey'])}}">
|
||||
<h5>{{$r['communName']}}</h5>
|
||||
<div class="btn-group">
|
||||
<button type="button" id="{{$r['ckey']}}-close" class="btn btn-just-icon @if($job->p($r['ckey']) != -1) btn-outline-danger @else btn-danger @endif" onclick="switchPermissionSwitch('{{$r['ckey']}}','close')"><i class="fa fa-close"></i></button>
|
||||
<button type="button" id="{{$r['ckey']}}-slash" class="btn btn-just-icon @if($job->p($r['ckey']) == 0) btn-warning @else btn-outline-warning @endif" onclick="switchPermissionSwitch('{{$r['ckey']}}','slash')"><i class="fa fa-slash"></i></button>
|
||||
<button type="button" id="{{$r['ckey']}}-plus" class="btn btn-just-icon @if($job->p($r['ckey']) != 1) btn-outline-success @else btn-success @endif" onclick="switchPermissionSwitch('{{$r['ckey']}}','plus')"><i class="fa fa-plus"></i></button>
|
||||
</div>
|
||||
<div class="row form-group">
|
||||
<div class="col col-md-3"><label for="text-input" class=" form-control-label">Horaire détaillé</label><small class="form-text text-muted">|| {{$job->schedule_see}} || L'utilisateur avec ce poste peut t'il consulter les détails de l'horaire</small></div>
|
||||
<div class="col col-md-3" style="margin: auto;">
|
||||
<label for="disabled-input" class=" form-control-label"></label>
|
||||
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input name="{{$job->id}}_schedule_see" name="{{$job->id}}_schedule_see" class="switch-input" @if($job->schedule_see == "1") checked="true" @endif type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
|
||||
<p>
|
||||
<small>{{$r['desc']}}</small>
|
||||
</p>
|
||||
</div>
|
||||
<div class="col col-md-3"><label for="text-input" class=" form-control-label">Modification horaire</label><small class="form-text text-muted">|| {{$job->schedule_edit}} || L'utilisateur avec ce poste peut t'il ajouter, modifier et supprimer des événements a l'horaire</small></div>
|
||||
<div class="col col-md-3" style="margin: auto;">
|
||||
<label for="disabled-input" class=" form-control-label"></label>
|
||||
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input name="{{$job->id}}_schedule_edit" name="{{$job->id}}_schedule_edit" class="switch-input" @if($job->schedule_edit == "1") checked="true" @endif type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row form-group">
|
||||
<div class="col col-md-3"><label for="text-input" class=" form-control-label">Notifiation horaire</label><small class="form-text text-muted">|| {{$job->schedule_notify}} || L'utilisateur avec ce poste doit t-il recevoir des notifiation pour tous les changements a l'horaire.</small></div>
|
||||
<div class="col col-md-3" style="margin: auto;">
|
||||
<label for="disabled-input" class=" form-control-label"></label>
|
||||
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input name="{{$job->id}}_schedule_notify" name="{{$job->id}}_schedule_notify" class="switch-input" @if($job->schedule_notify == "1") checked="true" @endif type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
|
||||
</div>
|
||||
<div class="col col-md-3"><label for="text-input" class=" form-control-label">Consultation messages</label><small class="form-text text-muted">|| {{$job->message_see}} || L'utilisateur avec ce poste peut t'il consulter les messages</small></div>
|
||||
<div class="col col-md-3" style="margin: auto;">
|
||||
<label for="disabled-input" class=" form-control-label"></label>
|
||||
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input name="{{$job->id}}_message_see" name="{{$job->id}}_message_see" class="switch-input" @if($job->message_see == "1") checked="true" @endif type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row form-group">
|
||||
<div class="col col-md-3"><label for="text-input" class=" form-control-label">Modification messages</label><small class="form-text text-muted"> L'utilisateur avec ce poste peut t'il ajouter, modifier et supprimer des messages</small></div>
|
||||
<div class="col col-md-3" style="margin: auto;">
|
||||
<label for="disabled-input" class=" form-control-label"></label>
|
||||
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input name="{{$job->id}}_message_edit" name="{{$job->id}}_message_edit" class="switch-input" @if($job->message_edit == "1") checked="true" @endif type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
|
||||
</div>
|
||||
<div class="col col-md-3"><label for="text-input" class=" form-control-label">Notifiation messages</label><small class="form-text text-muted"> L'utilisateur avec ce poste doit t-il recevoir des notifiation pour tous les changements en lien avec les messages.</small></div>
|
||||
<div class="col col-md-3" style="margin: auto;">
|
||||
<label for="disabled-input" class=" form-control-label"></label>
|
||||
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input name="{{$job->id}}_message_notify" name="{{$job->id}}_message_notify" class="switch-input" @if($job->message_notify == "1") checked="true" @endif type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row form-group">
|
||||
<div class="col col-md-3"><label for="text-input" class=" form-control-label">Modification article</label><small class="form-text text-muted"> L'utilisateur avec ce poste peut t'il ajouter, modifier et supprimer des articles</small></div>
|
||||
<div class="col col-md-3" style="margin: auto;">
|
||||
<label for="disabled-input" class=" form-control-label"></label>
|
||||
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input name="{{$job->id}}_paper_edit" name="{{$job->id}}_paper_edit" class="switch-input" @if($job->paper_edit == "1") checked="true" @endif type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
|
||||
</div>
|
||||
<div class="col col-md-3"><label for="text-input" class=" form-control-label">Publication articles</label><small class="form-text text-muted"> L'utilisateur avec ce poste peux t-il autoriser la publication ou appouver des changements a un articles</small></div>
|
||||
<div class="col col-md-3" style="margin: auto;">
|
||||
<label for="disabled-input" class=" form-control-label"></label>
|
||||
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input name="{{$job->id}}_paper_publish" name="{{$job->id}}_paper_publish" class="switch-input" @if($job->paper_publish == "1") checked="true" @endif type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row form-group">
|
||||
<div class="col col-md-3"><label for="text-input" class=" form-control-label">Notifiation articles</label><small class="form-text text-muted"> L'utilisateur avec ce poste doit t-il recevoir des notifiation pour tous les changements en lien avec les articles.</small></div>
|
||||
<div class="col col-md-3" style="margin: auto;">
|
||||
<label for="disabled-input" class=" form-control-label"></label>
|
||||
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input name="{{$job->id}}_paper_notify" name="{{$job->id}}_paper_notify" class="switch-input" @if($job->paper_notify == "1") checked="true" @endif type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
|
||||
</div>
|
||||
<div class="col col-md-3"><label for="text-input" class=" form-control-label">Consultation inventaire</label><small class="form-text text-muted"> L'utilisateur avec ce poste peut t'il consulter l'inventaire</small></div>
|
||||
<div class="col col-md-3" style="margin: auto;">
|
||||
<label for="disabled-input" class=" form-control-label"></label>
|
||||
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input name="{{$job->id}}_inventory_see" name="{{$job->id}}_inventory_see" class="switch-input" @if($job->inventory_see == "1") checked="true" @endif type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row form-group">
|
||||
<div class="col col-md-3"><label for="text-input" class=" form-control-label">Modification inventaire</label><small class="form-text text-muted"> L'utilisateur avec ce poste peut t'il ajouter, modifier et supprimer l'inventaire</small></div>
|
||||
<div class="col col-md-3" style="margin: auto;">
|
||||
<label for="disabled-input" class=" form-control-label"></label>
|
||||
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input name="{{$job->id}}_inventory_edit" name="{{$job->id}}_inventory_edit" class="switch-input" @if($job->inventory_edit == "1") checked="true" @endif type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
|
||||
</div>
|
||||
<div class="col col-md-3"><label for="text-input" class=" form-control-label">Notifiation inventaire</label><small class="form-text text-muted"> L'utilisateur avec ce poste doit t-il recevoir des notifiation pour tous les changements en lien avec les articles.</small></div>
|
||||
<div class="col col-md-3" style="margin: auto;">
|
||||
<label for="disabled-input" class=" form-control-label"></label>
|
||||
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input name="{{$job->id}}_inventory_notify" name="{{$job->id}}_inventory_notify" class="switch-input" @if($job->inventory_notify == "1") checked="true" @endif type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row form-group">
|
||||
<div class="col col-md-3"><label for="text-input" class=" form-control-label">Modification utilisateur</label><small class="form-text text-muted"> L'utilisateur avec ce poste peut t'il ajouter, modifier et supprimer des utilisateurs</small></div>
|
||||
<div class="col col-md-3" style="margin: auto;">
|
||||
<label for="disabled-input" class=" form-control-label"></label>
|
||||
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input name="{{$job->id}}_user_edit" name="{{$job->id}}_user_edit" class="switch-input" @if($job->user_edit == "1") checked="true" @endif type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
|
||||
</div>
|
||||
<div class="col col-md-3"><label for="text-input" class=" form-control-label">Notifiation utilisateur</label><small class="form-text text-muted"> L'utilisateur avec ce poste doit t-il recevoir des notifiation pour tous les changements en lien avec les utilisateurs.</small></div>
|
||||
<div class="col col-md-3" style="margin: auto;">
|
||||
<label for="disabled-input" class=" form-control-label"></label>
|
||||
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input name="{{$job->id}}_user_notify" name="{{$job->id}}_user_notify" class="switch-input" @if($job->user_notify == "1") checked="true" @endif type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<button type="submit" class="btn btn-primary btn-sm">
|
||||
<i class="fa fa-dot-circle-o"></i> Submit
|
||||
</button>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12 mt-5">
|
||||
<button type="submit" class="btn btn-primary">Sauvegarder</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@@ -133,35 +77,11 @@
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('breadcrumb')
|
||||
<div class="breadcrumbs">
|
||||
<div class="col-sm-4">
|
||||
<div class="page-header float-left">
|
||||
<div class="page-title">
|
||||
<h1>{{ trans('admin/dashboard.page_title')}}</h1>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-8">
|
||||
<div class="page-header float-right">
|
||||
<div class="page-title">
|
||||
<ol class="breadcrumb text-right">
|
||||
<li class="active">{{ trans('admin/dashboard.breadcrumb')}}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('custom_scripts')
|
||||
<script src="https://cloud.tinymce.com/stable/tinymce.min.js?apiKey=r82pabvd9arn3fjb1e2fsolf2xpixuv4hwfwart4cf1fb7mx"></script>
|
||||
<script src="/js/permissions.js"></script>
|
||||
<script>
|
||||
tinymce.init({
|
||||
selector: '#<?php echo $job->id?>_desc',
|
||||
branding: false,
|
||||
menubar: 'edit view format'
|
||||
$('#desc').trumbowyg({
|
||||
lang: 'fr'
|
||||
});
|
||||
</script>
|
||||
|
||||
@endsection
|
||||
@@ -15,7 +15,7 @@
|
||||
<div class="col-md-8">
|
||||
<div class="form-group">
|
||||
<label>Titre</label>
|
||||
<input class="form-control" type="text" name="title">
|
||||
<input class="form-control" type="text" name="title" required>
|
||||
<small class="form-text text-muted">Titre de la nouvelle à publier</small>
|
||||
</div>
|
||||
</div>
|
||||
@@ -33,7 +33,7 @@
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<label>Contenu</label>
|
||||
<textarea id="body" name="body"></textarea>
|
||||
<textarea id="body" name="body" required></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
@section('content')
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<div class="card-header card-header-primary">
|
||||
<strong class="card-title">Nouvelles <a href="#"><i class="fa fa-question-circle" aria-hidden="true"></i>
|
||||
</a></strong>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="btn-group btn-block">
|
||||
@if(\Auth::user()->p('news_add') == 1)
|
||||
<a name="add" id="add" class="btn btn-primary btn-block" href="/admin/news/add" role="button">Ajouter un nouvelle</a>
|
||||
<a name="add" id="add" class="btn btn-outline-primary btn-block" href="/admin/news/add" role="button">Ajouter un nouvelle</a>
|
||||
@endif
|
||||
</div>
|
||||
<hr>
|
||||
@@ -24,8 +24,19 @@
|
||||
<div class="col-md-4">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title">{{$n->title}}</h4>
|
||||
<h4 class="card-title news-title">{{$n->title}}</h4>
|
||||
<p class="category">{{$n->user->fullname()}} - {{$n->created_at}}
|
||||
<div class="news-tags">
|
||||
@if($n->tags != [])
|
||||
@foreach($n->tags as $tag)
|
||||
@if($tag == "Important")
|
||||
<span class="badge badge-pill badge-danger">{{$tag}}</span>
|
||||
@else
|
||||
<span class="badge badge-pill badge-default">{{$tag}}</span>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
@if($n->publish == 0) <span class="badge badge-warning float-right">Brouillon</span> @endif</p>
|
||||
</div>
|
||||
<div class="card-body news-body-small">
|
||||
@@ -33,10 +44,12 @@
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<div class="btn-group">
|
||||
@if(\Auth::user()->p('news_edit') == 1)
|
||||
@if(\Auth::user()->p('news_edit') == 1 && !isset($n->event_id))
|
||||
<a href="/admin/news/edit/{{$n->id}}" type="button" class="btn btn-secondary"><i class="fa fa-cog"></i> Modifier</a>
|
||||
@else
|
||||
<a href="/admin/schedule/edit/{{$n->event_id}}" type="button" class="btn btn-secondary"><i class="fa fa-cog"></i> Modifier</a>
|
||||
@endif
|
||||
@if(\Auth::user()->p('news_delete') == 1)
|
||||
@if(\Auth::user()->p('news_delete') == 1 && !isset($n->event_id))
|
||||
<a type="button" class="btn btn-danger" onclick="deleteEvent({{$n->id}});"><i class="fa fa-times-circle" style="color:white;"></i></a>
|
||||
@endif
|
||||
</div>
|
||||
@@ -44,6 +57,9 @@
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
<div class="col-12">
|
||||
{{ $news->links() }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -49,6 +49,7 @@ $('.datetimepicker').datetimepicker({
|
||||
close: 'fa fa-remove'
|
||||
}
|
||||
});
|
||||
$('select').selectpicker();
|
||||
</script>
|
||||
|
||||
@endsection
|
||||
@@ -23,6 +23,9 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" id="container">
|
||||
<div class="col-md-12 mt-4 text-center">
|
||||
<h4>Information Générale</h4>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<label for="name">Nom de l'événement</label>
|
||||
@@ -30,26 +33,26 @@
|
||||
<small id="nameHelp" class="text-muted">Veuillez entrer le nom de l'événement</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="col-lg-3 col-md-4">
|
||||
<div class="form-group">
|
||||
<label class="label-control">Date et Heure de début</label>
|
||||
<input name="begin" type="text" id="datetimepickerbegin" class="form-control datetimepicker" required/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="col-lg-3 col-md-4">
|
||||
<div class="form-group">
|
||||
<label class="label-control">Date et Heure de fin</label>
|
||||
<input name="end" type="text" id="datetimepickerend" class="form-control datetimepicker" required/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<div class="col-lg-6 col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="name">Lieux</label>
|
||||
<input type="text" name="location" id="location" class="form-control" placeholder="" aria-describedby="nameHelp" value="{{$activity->location}}" required>
|
||||
<small id="nameHelp" class="text-muted">Veuillez entrer le lieu de l'événement</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3 m-auto">
|
||||
<div class="col-md-12 my-auto text-center">
|
||||
<div class="form-group">
|
||||
<div class="form-check">
|
||||
<label class="form-check-label">
|
||||
@@ -57,7 +60,7 @@
|
||||
@if ($activity->is_mandatory == 1)
|
||||
checked
|
||||
@endif>
|
||||
L'événement est obligatoire
|
||||
L'événement est t-il obligatoire pour tous les cadets ?
|
||||
<span class="form-check-sign">
|
||||
<span class="check"></span>
|
||||
</span>
|
||||
@@ -65,15 +68,46 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12 mt-4 text-center">
|
||||
<h4>Options Supplémentaires</h4>
|
||||
</div>
|
||||
<div class="col-md-12 mt-4">
|
||||
<ul class="nav nav-pills mb-3 justify-content-center" id="pills-tab" role="tablist">
|
||||
<li class="nav-item w-25">
|
||||
<a class="nav-link active w-100" id="pills-home-tab" data-toggle="pill" href="#comment" role="tab" aria-controls="pills-home" aria-selected="true">Description</a>
|
||||
</li>
|
||||
<li class="nav-item w-25">
|
||||
<a class="nav-link" id="pills-profile-tab" data-toggle="pill" href="#msg" role="tab" aria-controls="pills-profile" aria-selected="false">Message de la semaine</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content" id="pills-tabContent">
|
||||
<div class="tab-pane fade show active" id="comment" role="tabpanel" aria-labelledby="pills-home-tab">
|
||||
<div class="form-group">
|
||||
<textarea class="form-control richeditor" name="desc" id="desc" rows="6" required>{{$activity->desc}}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="msg" role="tabpanel" aria-labelledby="pills-profile-tab">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="label-control">Date et heure de publication des messages de la semaine</label>
|
||||
<input name="date_msg" type="text" id="datetimepickermsg" class="form-control datetimepicker" required/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<label for="desc">Commentaire</label>
|
||||
<br>
|
||||
<textarea class="form-control" name="desc" id="desc" rows="6" required>{!!$activity->desc!!}</textarea>
|
||||
<textarea class="form-control richeditor" name="msg" id="msg" rows="6" required>{{$activity->msg}}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if ($activity->type == 1)
|
||||
<div class="col-md-12 mt-4 text-center">
|
||||
<h4>Horaire d'instruction</h4>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div id="accordion" role="tablist">
|
||||
@for ($i = 1; $i <= \App\Config::getData('admin_level_in_schedule_nb'); $i++)
|
||||
@@ -104,7 +138,9 @@
|
||||
<div class="form-group">
|
||||
<div class="form-group">
|
||||
<label for="name">Instructeur</label>
|
||||
<input type="text" name="instruc_n{{$i}}_p{{$p}}" id="instruc_n{{$i}}_p{{$p}}" class="form-control basicAutoComplete" aria-describedby="nameHelp" required @if($activity->course($p,$i) != null) value="{{\App\User::find($activity->course($p,$i)->user_id)->fullname()}}" @endif>
|
||||
<div class="autocomplete">
|
||||
<input type="text" name="instruc_n{{$i}}_p{{$p}}" id="instruc_n{{$i}}_p{{$p}}" class="form-control AutoComplete" aria-describedby="nameHelp" autocomplete="off" required @if($activity->course($p,$i) != null) value="@if(is_numeric($activity->course($p,$i)->user_id)){{\App\User::find($activity->course($p,$i)->user_id)->fullname()}} @else {{$activity->course($p,$i)->user_id}} @endif" @endif>
|
||||
</div>
|
||||
<small id="nameHelp" class="text-muted">Veuillez entrer le nom de l'instructeur</small>
|
||||
</div>
|
||||
</div>
|
||||
@@ -146,9 +182,12 @@
|
||||
|
||||
@section('custom_scripts')
|
||||
<script src="/js/calendar.js"></script>
|
||||
<script src="/js/plugins/autocomplete.js"></script>
|
||||
<script>
|
||||
var countries = ["Afghanistan","Albania","Algeria","Andorra","Angola","Anguilla","Antigua & Barbuda","Argentina","Armenia","Aruba","Australia","Austria","Azerbaijan","Bahamas","Bahrain","Bangladesh","Barbados","Belarus","Belgium","Belize","Benin","Bermuda","Bhutan","Bolivia","Bosnia & Herzegovina","Botswana","Brazil","British Virgin Islands","Brunei","Bulgaria","Burkina Faso","Burundi","Cambodia","Cameroon","Canada","Cape Verde","Cayman Islands","Central Arfrican Republic","Chad","Chile","China","Colombia","Congo","Cook Islands","Costa Rica","Cote D Ivoire","Croatia","Cuba","Curacao","Cyprus","Czech Republic","Denmark","Djibouti","Dominica","Dominican Republic","Ecuador","Egypt","El Salvador","Equatorial Guinea","Eritrea","Estonia","Ethiopia","Falkland Islands","Faroe Islands","Fiji","Finland","France","French Polynesia","French West Indies","Gabon","Gambia","Georgia","Germany","Ghana","Gibraltar","Greece","Greenland","Grenada","Guam","Guatemala","Guernsey","Guinea","Guinea Bissau","Guyana","Haiti","Honduras","Hong Kong","Hungary","Iceland","India","Indonesia","Iran","Iraq","Ireland","Isle of Man","Israel","Italy","Jamaica","Japan","Jersey","Jordan","Kazakhstan","Kenya","Kiribati","Kosovo","Kuwait","Kyrgyzstan","Laos","Latvia","Lebanon","Lesotho","Liberia","Libya","Liechtenstein","Lithuania","Luxembourg","Macau","Macedonia","Madagascar","Malawi","Malaysia","Maldives","Mali","Malta","Marshall Islands","Mauritania","Mauritius","Mexico","Micronesia","Moldova","Monaco","Mongolia","Montenegro","Montserrat","Morocco","Mozambique","Myanmar","Namibia","Nauro","Nepal","Netherlands","Netherlands Antilles","New Caledonia","New Zealand","Nicaragua","Niger","Nigeria","North Korea","Norway","Oman","Pakistan","Palau","Palestine","Panama","Papua New Guinea","Paraguay","Peru","Philippines","Poland","Portugal","Puerto Rico","Qatar","Reunion","Romania","Russia","Rwanda","Saint Pierre & Miquelon","Samoa","San Marino","Sao Tome and Principe","Saudi Arabia","Senegal","Serbia","Seychelles","Sierra Leone","Singapore","Slovakia","Slovenia","Solomon Islands","Somalia","South Africa","South Korea","South Sudan","Spain","Sri Lanka","St Kitts & Nevis","St Lucia","St Vincent","Sudan","Suriname","Swaziland","Sweden","Switzerland","Syria","Taiwan","Tajikistan","Tanzania","Thailand","Timor L'Este","Togo","Tonga","Trinidad & Tobago","Tunisia","Turkey","Turkmenistan","Turks & Caicos","Tuvalu","Uganda","Ukraine","United Arab Emirates","United Kingdom","United States of America","Uruguay","Uzbekistan","Vanuatu","Vatican City","Venezuela","Vietnam","Virgin Islands (US)","Yemen","Zambia","Zimbabwe"];
|
||||
var begin = "<?php echo $activity->date_begin ?>";
|
||||
var end = "<?php echo $activity->date_end ?>";
|
||||
var msg = "<?php echo $activity->date_msg ?>";
|
||||
$('#datetimepickerbegin').datetimepicker({
|
||||
icons: {
|
||||
time: "fa fa-clock-o",
|
||||
@@ -177,12 +216,24 @@
|
||||
},
|
||||
date: new Date(end)
|
||||
});
|
||||
$('#desc').trumbowyg({
|
||||
$('#datetimepickermsg').datetimepicker({
|
||||
icons: {
|
||||
time: "fa fa-clock-o",
|
||||
date: "fa fa-calendar",
|
||||
up: "fa fa-chevron-up",
|
||||
down: "fa fa-chevron-down",
|
||||
previous: 'fa fa-chevron-left',
|
||||
next: 'fa fa-chevron-right',
|
||||
today: 'fa fa-screenshot',
|
||||
clear: 'fa fa-trash',
|
||||
close: 'fa fa-remove'
|
||||
},
|
||||
date: new Date(msg)
|
||||
});
|
||||
$('.richeditor').trumbowyg({
|
||||
lang: 'fr'
|
||||
});
|
||||
$( ".basicAutoComplete" ).autocomplete({
|
||||
source: '/api/user/list?api_token='+api_token
|
||||
});
|
||||
initAutoComplete("AutoComplete");
|
||||
</script>
|
||||
|
||||
@endsection
|
||||
@@ -1,3 +1,6 @@
|
||||
<div class="col-md-12 mt-4 text-center">
|
||||
<h4>Information Générale</h4>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<label for="name">Nom de l'événement</label>
|
||||
@@ -5,26 +8,26 @@
|
||||
<small id="nameHelp" class="text-muted">Veuillez entrer le nom de l'événement</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="col-lg-3 col-md-4">
|
||||
<div class="form-group">
|
||||
<label class="label-control">Date et Heure de début</label>
|
||||
<input name="begin" type="text" id="datetimepickerbegin" class="form-control datetimepicker" required/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="col-lg-3 col-md-4">
|
||||
<div class="form-group">
|
||||
<label class="label-control">Date et Heure de fin</label>
|
||||
<input name="end" type="text" id="datetimepickerend" class="form-control datetimepicker" required/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<div class="col-lg-6 col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="name">Lieux</label>
|
||||
<input type="text" name="location" id="location" class="form-control" placeholder="" aria-describedby="nameHelp" value="{{$activity->location}}" required>
|
||||
<small id="nameHelp" class="text-muted">Veuillez entrer le lieu de l'événement</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3 m-auto">
|
||||
<div class="col-md-12 my-auto text-center">
|
||||
<div class="form-group">
|
||||
<div class="form-check">
|
||||
<label class="form-check-label">
|
||||
@@ -32,7 +35,7 @@
|
||||
@if ($activity->is_mandatory == 1)
|
||||
checked
|
||||
@endif>
|
||||
L'événement est obligatoire
|
||||
L'événement est t-il obligatoire pour tous les cadets ?
|
||||
<span class="form-check-sign">
|
||||
<span class="check"></span>
|
||||
</span>
|
||||
@@ -40,14 +43,47 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12 mt-4 text-center">
|
||||
<h4>Options Supplémentaires</h4>
|
||||
</div>
|
||||
<div class="col-md-12 mt-4">
|
||||
<ul class="nav nav-pills mb-3 justify-content-center" id="pills-tab" role="tablist">
|
||||
<li class="nav-item w-25">
|
||||
<a class="nav-link active w-100" id="pills-home-tab" data-toggle="pill" href="#comment" role="tab" aria-controls="pills-home" aria-selected="true">Description</a>
|
||||
</li>
|
||||
<li class="nav-item w-25">
|
||||
<a class="nav-link" id="pills-profile-tab" data-toggle="pill" href="#msg" role="tab" aria-controls="pills-profile" aria-selected="false">Message de la semaine</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content" id="pills-tabContent">
|
||||
<div class="tab-pane fade show active" id="comment" role="tabpanel" aria-labelledby="pills-home-tab">
|
||||
<div class="form-group">
|
||||
<label for="desc">Description</label>
|
||||
<textarea class="form-control richeditor" name="desc" id="desc" rows="6" required>{{$activity->admin_desc}}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="msg" role="tabpanel" aria-labelledby="pills-profile-tab">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="label-control">Date et heure de publication des messages de la semaine</label>
|
||||
<input name="date_msg" type="text" id="datetimepickermsg" class="form-control datetimepicker" required/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<label for="desc">Commentaire</label>
|
||||
<textarea class="form-control" name="desc" id="desc" rows="6" required>{{$activity->admin_desc}}</textarea>
|
||||
<label for="desc">Message de le semaine</label>
|
||||
<textarea class="form-control richeditor" name="msg" id="msg" rows="6" required>{{\App\Config::getData('default_weekly_msg')}}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if ($activity->id == 1)
|
||||
<div class="col-md-12 mt-4 text-center">
|
||||
<h4>Horaire d'instruction</h4>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div id="accordion" role="tablist">
|
||||
@for ($i = 1; $i <= \App\Config::getData('admin_level_in_schedule_nb'); $i++)
|
||||
@@ -70,36 +106,33 @@
|
||||
<div class="col-sm-6 my-2">
|
||||
<div class="form-group">
|
||||
<label for="name">Nom du cours</label>
|
||||
<input type="text" name="name_n{{$i}}_p{{$p}}" id="name_n{{$i}}_p{{$p}}" class="form-control" aria-describedby="nameHelp" required>
|
||||
<input type="text" name="name_n{{$i}}_p{{$p}}" id="name_n{{$i}}_p{{$p}}" class="form-control" aria-describedby="nameHelp" required @if(env('APP_DEBUG') == true)value="Nom du cours"@endif>
|
||||
<small id="nameHelp" class="text-muted">Veuillez entrer le nom du cours</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="form-group">
|
||||
<div class="form-group">
|
||||
<label for="name">Instructeur</label>
|
||||
<input type="text" name="instruc_n{{$i}}_p{{$p}}" id="instruc_n{{$i}}_p{{$p}}" class="form-control basicAutoComplete" aria-describedby="nameHelp" required>
|
||||
<small id="nameHelp" class="text-muted">Veuillez entrer le nom de l'instructeur</small>
|
||||
<div class="autocomplete">
|
||||
<input type="text" name="instruc_n{{$i}}_p{{$p}}" id="instruc_n{{$i}}_p{{$p}}" class="form-control AutoComplete" aria-describedby="nameHelp" autocomplete="off" required>
|
||||
</div>
|
||||
<small id="nameHelp" class="text-muted">Veuillez entrer le nom de l'instructeur</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6 my-2">
|
||||
<div class="form-group">
|
||||
<label for="name">OCOM</label>
|
||||
<input type="text" name="ocom_n{{$i}}_p{{$p}}" id="ocom_n{{$i}}_p{{$p}}" class="form-control" aria-describedby="nameHelp" required>
|
||||
<input type="text" name="ocom_n{{$i}}_p{{$p}}" id="ocom_n{{$i}}_p{{$p}}" class="form-control" aria-describedby="nameHelp" required @if(env('APP_DEBUG') == true)value="OCOM"@endif>
|
||||
<small id="nameHelp" class="text-muted">Veuillez entrer l'OCOM</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6 my-2">
|
||||
<div class="form-group">
|
||||
<label for="name">Lieux</label>
|
||||
<input type="text" name="loc_n{{$i}}_p{{$p}}" id="loc_n{{$i}}_p{{$p}}" class="form-control" placeholder="" aria-describedby="nameHelp" required>
|
||||
<input type="text" name="loc_n{{$i}}_p{{$p}}" id="loc_n{{$i}}_p{{$p}}" class="form-control" placeholder="" aria-describedby="nameHelp" required @if(env('APP_DEBUG') == true)value="Lieu"@endif>
|
||||
<small id="nameHelp" class="text-muted">Veuillez entrer le lieux</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12">
|
||||
<button type="button" class="btn btn-primary btn-block" disabled>Réservation de materiel (Disponible une fois l'événement sauvegarder)</button>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
@endfor
|
||||
@@ -111,10 +144,11 @@
|
||||
</div>
|
||||
|
||||
@endif
|
||||
|
||||
<script src="/js/plugins/autocomplete.js"></script>
|
||||
<script>
|
||||
var begin = "<?php echo $begin_time ?>";
|
||||
var end = "<?php echo $end_time ?>";
|
||||
var msg = "<?php echo $msg_time ?>";
|
||||
$('#datetimepickerbegin').datetimepicker({
|
||||
icons: {
|
||||
time: "fa fa-clock-o",
|
||||
@@ -143,10 +177,22 @@ $('#datetimepickerend').datetimepicker({
|
||||
},
|
||||
date: new Date(end)
|
||||
});
|
||||
$('#desc').trumbowyg({
|
||||
$('#datetimepickermsg').datetimepicker({
|
||||
icons: {
|
||||
time: "fa fa-clock-o",
|
||||
date: "fa fa-calendar",
|
||||
up: "fa fa-chevron-up",
|
||||
down: "fa fa-chevron-down",
|
||||
previous: 'fa fa-chevron-left',
|
||||
next: 'fa fa-chevron-right',
|
||||
today: 'fa fa-screenshot',
|
||||
clear: 'fa fa-trash',
|
||||
close: 'fa fa-remove'
|
||||
},
|
||||
date: new Date(msg)
|
||||
});
|
||||
$('.richeditor').trumbowyg({
|
||||
lang: 'fr'
|
||||
});
|
||||
$( ".basicAutoComplete" ).autocomplete({
|
||||
source: '/api/user/list?api_token='+api_token
|
||||
});
|
||||
initAutoComplete("AutoComplete");
|
||||
</script>
|
||||
@@ -54,7 +54,7 @@
|
||||
@if(\App\User::find($course->user_id))
|
||||
{{\App\User::find($course->user_id)->fullname()}}
|
||||
@else
|
||||
Utilisateur Inconnu
|
||||
{{$course->user_id}}
|
||||
@endif
|
||||
</div>
|
||||
<div class="col-sm-6 my-2">
|
||||
|
||||
@@ -45,7 +45,7 @@ Du <strong>{{$event->date_begin}}</strong> au <strong>{{$event->date_end}}</stro
|
||||
<table class="w-100 mx-5 table-borderless bg-white">
|
||||
<tr>
|
||||
<td>{{$course->name}}</td>
|
||||
<td class="text-right">{{$course->user->fullname()}}</td>
|
||||
<td class="text-right">@if(is_numeric($course->user_id)){{$course->user->fullname()}}@else{{$course->user_id}}@endif</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{$course->ocom}}</td>
|
||||
|
||||
@@ -2,6 +2,89 @@
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<h3 class="card-title">3.2.4</h3>
|
||||
<p class="category">2019-10-19</p>
|
||||
</div>
|
||||
<div class="col-sm-6 text-right">
|
||||
<span class="badge badge-pill badge-success">STABLE</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<p>
|
||||
Nouveauté
|
||||
<ul class="list-group list-group-flush ml-3">
|
||||
<li class="list-group-item">
|
||||
<div class="row">
|
||||
<div class="text-success" style="font-size: 1.3rem;width: 1.5rem">
|
||||
<i class="fas fa-coffee"></i>
|
||||
</div>
|
||||
<div class="col m-auto text-left">
|
||||
La gestion des postes est maintenant possible.
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<div class="row">
|
||||
<div class="text-success" style="font-size: 1.3rem;width: 1.5rem">
|
||||
<i class="fas fa-coffee"></i>
|
||||
</div>
|
||||
<div class="col m-auto text-left">
|
||||
Refonte du code responsable de la gestion des postes
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<div class="row">
|
||||
<div class="text-success" style="font-size: 1.3rem;width: 1.5rem">
|
||||
<i class="fas fa-coffee"></i>
|
||||
</div>
|
||||
<div class="col m-auto text-left">
|
||||
Modernisation de la base de données des utilisateurs
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<div class="row">
|
||||
<div class="text-success" style="font-size: 1.3rem;width: 1.5rem">
|
||||
<i class="fas fa-coffee"></i>
|
||||
</div>
|
||||
<div class="col m-auto text-left">
|
||||
Ajout de message la semaine.
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<p>
|
||||
Bug
|
||||
<ul class="list-group list-group-flush ml-3">
|
||||
<li class="list-group-item">
|
||||
<div class="row">
|
||||
<div class="text-success" style="font-size: 1.3rem;width: 1.5rem">
|
||||
<i class="fas fa-bug"></i>
|
||||
</div>
|
||||
<div class="col m-auto text-left">
|
||||
Correction de multiples bugs</a>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
|
||||
@@ -107,7 +107,7 @@
|
||||
<div class="form-group">
|
||||
<label for="job">Poste</label>
|
||||
<select class="form-control" name="job" id="job" required>
|
||||
<option value={{$user->job}}>{{\App\Job::find($user->job)->name}}</option>
|
||||
<option value={{$user->job->id}}>{{$user->job->name}}</option>
|
||||
@foreach ($JobsList as $job)
|
||||
<option value="{{$job->id}}">{{$job->name}}</option>
|
||||
@endforeach
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<td style="width: 5%;">{{$item->id}}</td>
|
||||
<td>{{$item->fullname()}}</td>
|
||||
<td>{{$item->rank->name}}</td>
|
||||
<td>{{\App\Job::find($item->job)->name}}</td>
|
||||
<td>{{$item->job->name}}</td>
|
||||
<td class="td-actions text-right" style="width: 12%;">
|
||||
<a class="btn btn-info p-2 text-white" href="/admin/user/edit/{{$item->id}}"><i class="material-icons">edit</i></a>
|
||||
<a class="btn btn-danger p-2 text-white" onclick="deleteEvent({{$item->id}});"><i class="material-icons">close</i></a>
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<div class="col-sm-6 text-center">
|
||||
<div class="row mt-3">
|
||||
<div class="col-md-12">
|
||||
<p>{{\App\Rank::find($user->job)->name}}</p>
|
||||
<p>{{$user->job->name}}</p>
|
||||
<hr>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
@@ -71,6 +71,7 @@
|
||||
<thead class="thead-default">
|
||||
<tr>
|
||||
<th>Horodatage</th>
|
||||
<th>Résultat</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -78,7 +79,8 @@
|
||||
@foreach ($user->logs()->take(6)->get() as $log)
|
||||
<tr>
|
||||
<td scope="row">{{$log->created_at}}</td>
|
||||
<td>{{$log->action}}</td>
|
||||
<td><span class="badge badge-pill badge-{{$log->result}} text-uppercase">{{$log->result}}</span></td>
|
||||
<td>{{$log->event}}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
@@ -95,7 +97,7 @@
|
||||
<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>
|
||||
<button disabled class="btn btn-secondary btn-block" href="/admin/profil/adress" role="button">Modifier mon adresse</button>
|
||||
<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>
|
||||
</div>
|
||||
|
||||
@@ -213,17 +213,29 @@
|
||||
</li>
|
||||
@endif
|
||||
<li class="nav-item ">
|
||||
<a class="nav-link" href="/admin/files">
|
||||
<a class="nav-link" data-toggle="collapse" href="#file">
|
||||
<i class="material-icons">folder</i>
|
||||
<p> Fichier</p>
|
||||
<p> Fichier
|
||||
<b class="caret"></b>
|
||||
</p>
|
||||
</a>
|
||||
<div class="collapse" id="file">
|
||||
<ul class="nav">
|
||||
<li class="nav-item ">
|
||||
<a class="nav-link" href="/admin/guide">
|
||||
<span class="sidebar-mini"> <i class="fas fa-book"></i></span>
|
||||
<span class="sidebar-normal"> Guide pédagogique </span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item ">
|
||||
<a class="nav-link" href="/admin/guide">
|
||||
<i class="material-icons">library_books</i>
|
||||
<p> Guide pédagogique</p>
|
||||
<a class="nav-link" href="/admin/files">
|
||||
<span class="sidebar-mini"> <i class="fas fa-cog"></i> </span>
|
||||
<span class="sidebar-normal"> Divers </span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
@if(\Auth::user()->p('config_edit') == 1)
|
||||
<li class="nav-item ">
|
||||
<a class="nav-link" data-toggle="collapse" href="#config">
|
||||
|
||||
@@ -9,10 +9,27 @@
|
||||
<div class="row">
|
||||
@foreach ($news as $new)
|
||||
<div class="col-md-4">
|
||||
<h3>{{ $new->title }}</h3>
|
||||
<h3 class="news-title mb-4">{{ $new->title }}</h3>
|
||||
<div class="news-body-small"> {!! $new->body !!}</div>
|
||||
<span class="news-small">{{ \App\User::find($new->user_id)->fullname()}}, {{$new->created_at}}</span>
|
||||
<a name="news" id="news" class="btn btn-block btn-secondary mt-2" href="/news/{{$new->id}}" role="button">Voir plus!</a>
|
||||
<div class="news-tags">
|
||||
@if($new->tags != [])
|
||||
@foreach($new->tags as $tag)
|
||||
@if($tag == "Important")
|
||||
<span class="badge badge-pill badge-danger">{{$tag}}</span>
|
||||
@else
|
||||
<span class="badge badge-pill badge-default">{{$tag}}</span>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
<a name="news" id="news" class="btn btn-block btn-secondary mt-2"
|
||||
@if(isset($new->event_id))
|
||||
href="/news/{{$new->event_id}}?type=msg" role="button">Voir plus!
|
||||
@else
|
||||
href="/news/{{$new->id}}" role="button">Voir plus!
|
||||
@endif
|
||||
</a>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
@extends('layouts.public.main')
|
||||
|
||||
@section('content')
|
||||
<div class="page-header header-filter clear-filter purple-filter" data-parallax="true" style="background-image: url({{'"'.\App\Config::getData('public_index_img_url').'"'}});">
|
||||
<div class="page-header header-filter clear-filter" data-parallax="true" style="background-image: url({{'"'.\App\Config::getData('public_index_img_url').'"'}});">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-8 ml-auto mr-auto">
|
||||
@@ -22,12 +22,29 @@
|
||||
<div class="row">
|
||||
@foreach ($news as $new)
|
||||
<div class="col-md-4">
|
||||
<h3>{{ $new->title }}</h3>
|
||||
<h3 class="news-title" >{{ $new->title }}</h3>
|
||||
<div class="news-body-small">
|
||||
{!! $new->body !!}
|
||||
</div>
|
||||
<span class="news-small">{{ \App\User::find($new->user_id)->fullname()}}, {{ $new->created_at }}</span>
|
||||
<a name="news" id="news" class="btn btn-block btn-secondary mt-2" href="/news/{{ $new->id }}" role="button">Voir plus!</a>
|
||||
<div class="news-tags">
|
||||
@if($new->tags != [])
|
||||
@foreach($new->tags as $tag)
|
||||
@if($tag == "Important")
|
||||
<span class="badge badge-pill badge-danger">{{$tag}}</span>
|
||||
@else
|
||||
<span class="badge badge-pill badge-default">{{$tag}}</span>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
<a name="news" id="news" class="btn btn-block btn-secondary mt-2" role="button"
|
||||
@if(isset($new->event_id))
|
||||
href="/news/{{$new->event_id}}?type=msg" role="button">Voir plus!
|
||||
@else
|
||||
href="/news/{{$new->id}}" role="button">Voir plus!
|
||||
@endif
|
||||
</a>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
@extends('layouts.public.main')
|
||||
|
||||
@section('content')
|
||||
<div class="page-header header-filter clear-filter purple-filter" data-parallax="true" style="background-image: url({{'"'.\App\Config::getData('public_index_img_url').'"'}});">
|
||||
<div class="page-header header-filter clear-filter" data-parallax="true" style="background-image: url({{'"'.\App\Config::getData('public_index_img_url').'"'}});">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-8 ml-auto mr-auto">
|
||||
<div class="brand">
|
||||
<h2>{{ $new->title }}</h2>
|
||||
<h2 class="news-title">{{ $new->title }}</h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -30,6 +30,17 @@
|
||||
{!! $new->body !!}
|
||||
</p>
|
||||
<span class="news-small">{{ \App\User::find($new->user_id)->fullname()}}, {{ $new->created_at }}</span>
|
||||
<div class="news-tags">
|
||||
@if($new->tags != [])
|
||||
@foreach($new->tags as $tag)
|
||||
@if($tag == "Important")
|
||||
<span class="badge badge-pill badge-danger">{{$tag}}</span>
|
||||
@else
|
||||
<span class="badge badge-pill badge-default">{{$tag}}</span>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<a href="{{ url()->previous() }}" class="btn button primary">Retour</a>
|
||||
|
||||
@@ -51,6 +51,12 @@ Route::middleware('auth:api')->group(function () {
|
||||
Route::post('/config/general/save', 'ConfigController@update')->middleware('perm:config_edit');
|
||||
Route::post('/config/activity/delete', 'ComplementaryActivityController@destroy')->middleware('perm:config_delete');
|
||||
|
||||
/** Rank Route */
|
||||
Route::post('/config/rank/delete','RankController@destroy')->middleware('perm:config_edit');
|
||||
|
||||
/** Job Route */
|
||||
Route::post('/config/job/delete','JobController@destroy')->middleware('perm:config_edit');
|
||||
|
||||
Route::get('/user/perm/{id}', function($id) {
|
||||
$user = \App\User::find($id);
|
||||
return $user->getPerm("schedule_edit");
|
||||
|
||||
@@ -48,7 +48,7 @@ Route::middleware(['auth'])->group(function () {
|
||||
Route::post('/admin/schedule/event/edit/{id}','EventController@update')->middleware('perm:schedule_edit');
|
||||
|
||||
/** Statistique */
|
||||
Route::get('/admin/stats/log' , 'LogController@index')->middleware('perm:stats_see');;
|
||||
Route::get('/admin/stats/log' , 'LogController@index')->middleware('perm:stats_see');
|
||||
|
||||
/** Message */
|
||||
Route::get('/admin/message' , 'MessageController@index')->middleware('perm:msg_see');
|
||||
@@ -64,10 +64,6 @@ Route::middleware(['auth'])->group(function () {
|
||||
Route::post('/admin/user/edit/{id}' , 'UserController@update')->middleware('perm:user_edit');
|
||||
|
||||
/** Config */
|
||||
Route::get('/admin/config/job' , 'JobController@index')->middleware('perm:config_see');
|
||||
Route::get('/admin/config/job/add' , 'JobController@create')->middleware('perm:config_add');
|
||||
Route::post('/admin/config/job/add' , 'JobController@store')->middleware('perm:config_add');
|
||||
Route::get('/admin/config/job/edit/{id}' , 'JobController@edit')->middleware('perm:config_add');
|
||||
Route::get('/admin/config/schedule' , 'ScheduleController@index')->middleware('perm:config_edit');
|
||||
Route::post('/admin/config/schedule/edit' , 'ScheduleController@update')->middleware('perm:config_edit');
|
||||
Route::get('/admin/config/activity' , 'ComplementaryActivityController@index')->middleware('perm:config_edit');
|
||||
@@ -86,6 +82,10 @@ Route::middleware(['auth'])->group(function () {
|
||||
Route::get('/admin/config/ranks/{id}','RankController@show')->middleware('perm:config_edit');
|
||||
Route::post('/admin/config/ranks/{id}','RankController@update')->middleware('perm:config_edit');
|
||||
Route::get('/admin/config/jobs','JobController@index')->middleware('perm:config_edit');
|
||||
Route::get('/admin/config/jobs/add','JobController@create')->middleware('perm:config_edit');
|
||||
Route::post('/admin/config/jobs/add','JobController@store')->middleware('perm:config_edit');
|
||||
Route::get('/admin/config/jobs/{id}','JobController@edit')->middleware('perm:config_edit');
|
||||
Route::post('/admin/config/jobs/{id}','JobController@update')->middleware('perm:config_edit');
|
||||
|
||||
/** Public page */
|
||||
Route::get('/admin/public/edit/{config}', 'PublicController@edit')->middleware('perm:config_edit');
|
||||
|
||||
Reference in New Issue
Block a user