diff --git a/app/Course.php b/app/Course.php
index cadf4d75..d0c7493b 100644
--- a/app/Course.php
+++ b/app/Course.php
@@ -13,7 +13,7 @@ class Course extends Model
public function user()
{
- return $this->belongsTo('App\User');
+ return $this->belongsTo('App\User');
}
public function event()
diff --git a/app/Event.php b/app/Event.php
index 1f3d3af8..d3dcf87c 100644
--- a/app/Event.php
+++ b/app/Event.php
@@ -18,7 +18,7 @@ class Event extends Model
public function user()
{
- return $this->belongsTo('App\User');
+ return $this->belongsTo('App\User');
}
public function course($p,$l)
@@ -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;
+ }
}
diff --git a/app/Http/Controllers/EventController.php b/app/Http/Controllers/EventController.php
index ffdb46d2..cec44fcf 100644
--- a/app/Http/Controllers/EventController.php
+++ b/app/Http/Controllers/EventController.php
@@ -50,7 +50,8 @@ class EventController extends Controller
$event->is_mandatory = 0;
}
$event->desc = request('desc');
-
+ $event->msg = request('msg');
+ $event->date_msg = request('date_msg');
$event->save();
if ($event->type == 1) {
@@ -60,7 +61,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 +131,7 @@ class EventController extends Controller
$event->is_mandatory = 0;
}
$event->desc = request('desc');
+ $event->msg = \request('msg');
$event->save();
@@ -151,7 +153,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))
diff --git a/app/Http/Controllers/JobController.php b/app/Http/Controllers/JobController.php
index 4cbef7ca..9562f25a 100644
--- a/app/Http/Controllers/JobController.php
+++ b/app/Http/Controllers/JobController.php
@@ -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]);
}
/**
diff --git a/app/Http/Controllers/NewsController.php b/app/Http/Controllers/NewsController.php
index 76c006f1..c88b8db4 100644
--- a/app/Http/Controllers/NewsController.php
+++ b/app/Http/Controllers/NewsController.php
@@ -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,8 +69,14 @@ class NewsController extends Controller
*/
public function show($id)
{
- clog('see','success','a consulté une nouvelle',null,'App\News',$id);
- return view('public.news', ['new' => \App\News::find($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)]);
+ }
}
/**
diff --git a/app/Http/Controllers/PublicController.php b/app/Http/Controllers/PublicController.php
index 7dca49f0..23bd9d4d 100644
--- a/app/Http/Controllers/PublicController.php
+++ b/app/Http/Controllers/PublicController.php
@@ -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'))
]);
diff --git a/app/Http/Controllers/ScheduleController.php b/app/Http/Controllers/ScheduleController.php
index e382ac57..ad0bef3e 100644
--- a/app/Http/Controllers/ScheduleController.php
+++ b/app/Http/Controllers/ScheduleController.php
@@ -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
]);
}
diff --git a/app/Job.php b/app/Job.php
index 73a19e40..1006fa7e 100644
--- a/app/Job.php
+++ b/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);
+ }
}
diff --git a/app/News.php b/app/News.php
index 10e4e734..c5a44fc5 100644
--- a/app/News.php
+++ b/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)
+ {
+ 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;
+ }
}
diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php
index 6e1d8d35..dc914cc9 100644
--- a/app/Providers/AppServiceProvider.php
+++ b/app/Providers/AppServiceProvider.php
@@ -3,7 +3,9 @@
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
-use Illuminate\Support\Facades\Schema;
+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,
+ ]
+ );
+ });
}
/**
diff --git a/app/User.php b/app/User.php
index 32b5fae3..481c08ab 100644
--- a/app/User.php
+++ b/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);
@@ -287,7 +292,14 @@ class User extends Authenticatable
public function permission($perm)
{
- return $this->rank->permission($perm);
+ if ($this->job->permission($perm) == 0)
+ {
+ return $this->rank->permission($perm);
+ }
+ else
+ {
+ return $this->job->permission($perm);
+ }
}
public function p($perm)
diff --git a/database/migrations/2014_10_12_000000_create_users_table.php b/database/migrations/2014_10_12_000000_create_users_table.php
index bbb8c931..6678198d 100644
--- a/database/migrations/2014_10_12_000000_create_users_table.php
+++ b/database/migrations/2014_10_12_000000_create_users_table.php
@@ -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();
diff --git a/database/migrations/2018_08_21_094628_create_jobs_table.php b/database/migrations/2018_08_21_094628_create_jobs_table.php
index d2747004..fce5dd49 100644
--- a/database/migrations/2018_08_21_094628_create_jobs_table.php
+++ b/database/migrations/2018_08_21_094628_create_jobs_table.php
@@ -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();
});
}
diff --git a/database/migrations/2019_07_19_171303_create_news_table.php b/database/migrations/2019_07_19_171303_create_news_table.php
index 27907a05..6e6829c3 100644
--- a/database/migrations/2019_07_19_171303_create_news_table.php
+++ b/database/migrations/2019_07_19_171303_create_news_table.php
@@ -19,6 +19,7 @@ class CreateNewsTable extends Migration
$table->text('body');
$table->integer('user_id');
$table->boolean('publish');
+ $table->string('tags')->default("[]");
$table->timestamps();
});
}
diff --git a/database/migrations/2019_08_17_102431_create_events_table.php b/database/migrations/2019_08_17_102431_create_events_table.php
index ad681b15..d46edc27 100644
--- a/database/migrations/2019_08_17_102431_create_events_table.php
+++ b/database/migrations/2019_08_17_102431_create_events_table.php
@@ -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();
});
}
diff --git a/database/seeds/ConfigsTableSeeder.php b/database/seeds/ConfigsTableSeeder.php
index d7ae4183..f098f221 100644
--- a/database/seeds/ConfigsTableSeeder.php
+++ b/database/seeds/ConfigsTableSeeder.php
@@ -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' => "[\"/* Nom de l'évènement */
Heure (Cadets):
Lieu:
Tenue:
Matériel:
/* Commentaire */\"]"
]
];
diff --git a/database/seeds/JobsTableSeeder.php b/database/seeds/JobsTableSeeder.php
index c3f05fe4..242c2c19 100644
--- a/database/seeds/JobsTableSeeder.php
+++ b/database/seeds/JobsTableSeeder.php
@@ -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)
]
]);
}
diff --git a/database/seeds/RanksTableSeeder.php b/database/seeds/RanksTableSeeder.php
index 170727f4..6fe2973d 100644
--- a/database/seeds/RanksTableSeeder.php
+++ b/database/seeds/RanksTableSeeder.php
@@ -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 ne peux être modifié',
'permissions' => \App\Permission::allToString(1)
]
]);
diff --git a/database/seeds/UsersTableSeeder.php b/database/seeds/UsersTableSeeder.php
index 6e303df5..6603e464 100644
--- a/database/seeds/UsersTableSeeder.php
+++ b/database/seeds/UsersTableSeeder.php
@@ -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)),
]
]);
diff --git a/public/css/custom.css b/public/css/custom.css
index b5ee2e06..eba9b71e 100644
--- a/public/css/custom.css
+++ b/public/css/custom.css
@@ -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,32 @@
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: 50%;
+ 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 {
diff --git a/public/js/calendar.js b/public/js/calendar.js
index baca88e2..4a0ea46a 100644
--- a/public/js/calendar.js
+++ b/public/js/calendar.js
@@ -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();
});
}
diff --git a/public/js/plugins/autocomplete.js b/public/js/plugins/autocomplete.js
new file mode 100644
index 00000000..2102ed7e
--- /dev/null
+++ b/public/js/plugins/autocomplete.js
@@ -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 = "" + arr[i].substr(0, val.length) + "";
+ b.innerHTML += arr[i].substr(val.length);
+ /*insert a input field that will hold the current array item's value:*/
+ b.innerHTML += "";
+ /*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);
+ })
+ });
+}
\ No newline at end of file
diff --git a/resources/custom.css b/resources/custom.css
index b5ee2e06..eba9b71e 100644
--- a/resources/custom.css
+++ b/resources/custom.css
@@ -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,32 @@
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: 50%;
+ 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 {
diff --git a/resources/views/admin/article/index.blade.php b/resources/views/admin/article/index.blade.php
index 7ea11e73..95a9810f 100644
--- a/resources/views/admin/article/index.blade.php
+++ b/resources/views/admin/article/index.blade.php
@@ -10,7 +10,7 @@
{{date('Y-m-d',strtotime($course->event->date_begin))}}
-Période {{$course->periode}}, Niveau {{$course->level}}
-{{date('Y-m-d',strtotime($course->event->date_begin))}}
+Période {{$course->periode}}, Niveau {{$course->level}}
+{{$n->user->fullname()}} - {{$n->created_at}} +
@if($n->publish == 0) Brouillon @endif