ALPHA 3.0.1e

This commit is contained in:
TheGamecraft
2018-07-18 21:24:34 -04:00
parent 4fa17f4136
commit 636c17441e
22 changed files with 1272 additions and 92 deletions

View File

@@ -4,6 +4,9 @@ namespace App\Http\Controllers;
use Illuminate\Http\Request;
use \App\Log;
use \App\Schedule;
use Carbon\Carbon;
class CalendarController extends Controller
{
@@ -14,7 +17,7 @@ class CalendarController extends Controller
*/
public function __construct()
{
$this->middleware('auth', ['except' => ['generate']]);
$this->middleware('auth', ['except' => ['generate','load']]);
}
/**
@@ -31,11 +34,28 @@ class CalendarController extends Controller
public function generate()
{
$lang = str_replace('_', '-', app()->getLocale());
setlocale(LC_ALL, $lang.'_'.strtoupper($lang).'.utf8','fra');
setlocale(LC_ALL, "fr");
$month = request('month');
$year = request('year');
$nextMonth = $month + 1;
$nextYear = $year;
if ($nextMonth > 12) {
$nextMonth = 1;
$nextYear = $nextYear + 1;
}
$prevMonth = $month - 1;
$prevYear = $year;
if ($prevMonth < 1) {
$prevMonth = 12;
$prevYear = $prevYear - 1;
}
$calendar = array();
$dayinmonth = cal_days_in_month(CAL_GREGORIAN, $month, $year);
@@ -51,8 +71,10 @@ class CalendarController extends Controller
echo '<table class="table calendar">';
echo '<thead class="thead-dark">';
echo '<td colspan="7">'.strftime("%B", strtotime("01-".$month."-".$year)).'</td>';
echo '<td><a class="btn" onclick="generate('.$prevMonth.','.$prevYear.')"><i class="fa fa-chevron-left" aria-hidden="true"></i></a></td><td colspan="5">'.ucfirst(strftime("%B %Y", strtotime("01-".$month."-".$year))).'</td><td><a class="btn" onclick="generate('.$nextMonth.','.$nextYear.')"><i class="fa fa-chevron-right" aria-hidden="true"></i></a></td>';
echo '<tr><td>Dimanche</td><td>Lundi</td><td>Mardi</td><td>Mercredi</td><td>Jeudi</td><td>Vendredi</td><td>Samedi</td></tr>';
echo '</thead>';
for ($i=0; $i < 6 ; $i++)
{
echo '<tr>';
@@ -61,9 +83,24 @@ class CalendarController extends Controller
if (isset($calendar[(($i*7) + $a)]))
{
echo '<td class="calendar-container">';
$today = date("Y-m-d", strtotime($year."-".$month."-".$calendar[(($i*7) + $a)]));
echo date("j", strtotime($today));
$activityToday = Schedule::where('date','=',$today)->get();
if ($activityToday->isEmpty()) {
echo '<div><a name="'.$today.'" type="button" data-toggle="modal" data-target="#scrollmodal" id="calendar_'.$calendar[(($i*7) + $a)].'" class="btn btn-block btn-calendar" onclick="openCalendar(this.name)"><div class="calendar-date">'.date("j", strtotime($today)).'</div></a></div>';
} else {
$text = "";
foreach ($activityToday as $activity) {
$text = '<div style="color:blue;"><i class="fa fa-plane" aria-hidden="true"></i>'.$text.ucfirst($activity->type)."</div><br>";
}
echo '<div><a name="'.$today.'" type="button" data-toggle="modal" data-target="#scrollmodal" id="calendar_'.$calendar[(($i*7) + $a)].'" class="btn btn-block btn-calendar" onclick="openCalendar(this.name)"><div class="calendar-date">'.date("j", strtotime($today)).'</div><div class="calendar-text">'.$text.'</div></a></div>';
}
echo '</td>';
} else {
echo '<td class="calendar-container" style="border:none !important"></td>';
}
}
echo '</tr>';
@@ -72,4 +109,70 @@ class CalendarController extends Controller
}
public function load()
{
$lang = str_replace('_', '-', app()->getLocale());
setlocale(LC_ALL, $lang.'_'.strtoupper($lang).'.utf8','fra');
$date = request('date');
$today = Schedule::where('date','=',$date)->get();
$isEmpty = $today->isEmpty();
if ($isEmpty) { ?>
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="scrollmodalLabel"><?php echo ucfirst(strftime("%A le %e %B %Y", strtotime($date))) ?></h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<p><?php echo trans('calendar.nothing_today'); ?></p>
<button type="button" class="btn btn-primary btn-lg btn-block"><?php echo trans('calendar.add_to_schedule'); ?></button>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal"><?php echo trans('pagination.close'); ?></button>
</div>
</div><?php
} else {
foreach ($today as $date) {
if ($date->id) {
switch ($date->type) {
case 'pilotage':
$this->loadPilotage($date);
break;
case 'instruction':
$this->loadInstruction($date);
break;
default:
# code...
break;
}
}
}
}
}
private function loadPilotage($schedule)
{ ?>
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="scrollmodalLabel"><?php echo ucfirst(strftime("%A le %e %B %Y", strtotime($schedule->date))) ?></h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<p><?php echo trans('calendar.pilotage_title'); ?></p>
<p><?php echo trans('calendar.begin_at').$schedule->data['begin_at'].trans('calendar.end_at').$schedule->data['end_at'];?></p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal"><?php echo trans('pagination.close'); ?></button>
</div>
</div>
<?php }
}

View File

@@ -0,0 +1,10 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class ScheduleController extends Controller
{
//
}

12
app/Schedule.php Normal file
View File

@@ -0,0 +1,12 @@
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Schedule extends Model
{
protected $casts = [
'data' => 'array',
];
}

View File

@@ -0,0 +1,34 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateSchedulesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('schedules', function (Blueprint $table) {
$table->increments('id');
$table->string('date');
$table->string('type');
$table->text('data');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('schedules');
}
}

View File

@@ -2247,16 +2247,30 @@ header .form-inline {
display: flex;
}
.calendar-container{
width: 14%;
height: 7.5rem;
text-align: center;
vertical-align: middle !important;
border: none !important;
border: solid 1px #d9d9d9 !important;
padding: 0px !important;
}
.calendar-date{
float: left;
margin-top: -2rem;
margin-left: 1rem;
}
.calendar-text{
float: right;
margin-bottom: -2rem;
margin-right: 1rem;
}
.btn-calendar{
height: 100px;
width: 100px;
border-radius: 50%;
background-color: #949CA0;
padding: 36px 0;
height: 7.5rem;
margin: 0px;
}
.btn-calendar:hover{
background-color: #f2f2f26e;
}
.thead-dark {
color: #fff;
@@ -2264,3 +2278,30 @@ header .form-inline {
border-color: #32383e;
text-align: center;
}
.loader{
text-align: center;
}
.loader-bg{
width: 70px;
margin-top: 50px;
margin-bottom: 50px;
}
.loader-spinner {
position: absolute;
border: 16px solid #f3f3f3;
border-top: 16px solid #272c33;
border-radius: 50%;
width: 120px;
height: 120px;
animation: spin 2s linear infinite;
left: 0px;
right: 0px;
margin-left: auto;
margin-right: auto;
top: 44px;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}

View File

@@ -8,34 +8,27 @@ function init() {
$( document ).ajaxError(function() {
$( ".log" ).text( "Triggered ajaxError handler." );
});
})(jQuery);
})(jQuery);
(function($) {
var mycalendar = $('.calendar');
$.post('/api/calendar/generate', { month: "7", year: "2018" } , function(data) {
mycalendar.replaceWith(data);
console.log('Calendar Initialised');
});
})(jQuery);
var d = new Date();
var m = d.getMonth() + 1;
var y = d.getFullYear();
generate(m,y);
}
function calsetactive(myid) {
if (lastid != 99) {
document.getElementById(lastid).classList.toggle("calendar-btn-active");
}
var myDate = document.getElementById(myid);
myDate.classList.toggle("calendar-btn-active");
lastid = myid;
function openCalendar(btnDate)
{
(function($) {
var calendarModal = $('.modal-content');
$.post('/api/calendar/loadDay', { date: btnDate } , function(data) {
calendarModal.replaceWith(data);
console.log('Test');
});
if (myDate.classList.contains("calendar-nothing")) {
calendarEmptyDay(myid);
} else {
calendarOpen(myid);
}
})(jQuery);
}
function calendarOpen(myid) {
@@ -60,52 +53,14 @@ function calendarEmptyDay(myid) {
});
}
function generate(pmonth,pyear){
(function($) {
var mycalendar = $('.calendar');
$.post('/api/calendar/generate', { month: pmonth, year: pyear } , function(data) {
mycalendar.replaceWith(data);
//Modal Calendar
// When the user clicks on <span> (x), close the modal
function calendarmodalClose() {
document.getElementById('calendar-modal').style.display = "none";
}
// When the user clicks anywhere outside of the modal, close it
window.onclick = function(event) {
if (event.target == document.getElementById('calendar-modal')) {
document.getElementById('calendar-modal').style.display = "none";
}
}
// Boutton Back and Next on calendar Head
function calendarback() {
console.log("click detect");
lastid = 99;
$(function() {
var mycalendar = $('.calendar');
varmonth = varmonth - 1;
if (varmonth < 1) {
varyear = varyear - 1;
varmonth = 12;
}
$.get('/adminV2/assets/lib/calendar/calendar.php?month='+varmonth+'&year='+varyear, function(data) {
mycalendar.replaceWith(data);
console.log("Going next");
});
});
}
function calendarnext(){
console.log("click detect");
lastid = 99;
$(function() {
var mycalendar = $('.calendar');
varmonth = varmonth + 1;
if (varmonth > 12) {
varyear = varyear + 1;
varmonth = 1;
}
$.get('/adminV2/assets/lib/calendar/calendar.php?month='+varmonth+'&year='+varyear, function(data) {
mycalendar.replaceWith(data);
console.log("Going next");
});
});
console.log('Calendar Initialised');
});
})(jQuery);
}

935
public/assets/js/pace.min.js vendored Normal file
View File

@@ -0,0 +1,935 @@
(function() {
var AjaxMonitor, Bar, DocumentMonitor, ElementMonitor, ElementTracker, EventLagMonitor, Evented, Events, NoTargetError, Pace, RequestIntercept, SOURCE_KEYS, Scaler, SocketRequestTracker, XHRRequestTracker, animation, avgAmplitude, bar, cancelAnimation, cancelAnimationFrame, defaultOptions, extend, extendNative, getFromDOM, getIntercept, handlePushState, ignoreStack, init, now, options, requestAnimationFrame, result, runAnimation, scalers, shouldIgnoreURL, shouldTrack, source, sources, uniScaler, _WebSocket, _XDomainRequest, _XMLHttpRequest, _i, _intercept, _len, _pushState, _ref, _ref1, _replaceState,
__slice = [].slice,
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
__indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
defaultOptions = {
catchupTime: 100,
initialRate: .03,
minTime: 250,
ghostTime: 100,
maxProgressPerFrame: 20,
easeFactor: 1.25,
startOnPageLoad: true,
restartOnPushState: true,
restartOnRequestAfter: 500,
target: 'body',
elements: {
checkInterval: 100,
selectors: ['body']
},
eventLag: {
minSamples: 10,
sampleCount: 3,
lagThreshold: 3
},
ajax: {
trackMethods: ['GET'],
trackWebSockets: true,
ignoreURLs: []
}
};
now = function() {
var _ref;
return (_ref = typeof performance !== "undefined" && performance !== null ? typeof performance.now === "function" ? performance.now() : void 0 : void 0) != null ? _ref : +(new Date);
};
requestAnimationFrame = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame;
cancelAnimationFrame = window.cancelAnimationFrame || window.mozCancelAnimationFrame;
if (requestAnimationFrame == null) {
requestAnimationFrame = function(fn) {
return setTimeout(fn, 50);
};
cancelAnimationFrame = function(id) {
return clearTimeout(id);
};
}
runAnimation = function(fn) {
var last, tick;
last = now();
tick = function() {
var diff;
diff = now() - last;
if (diff >= 33) {
last = now();
return fn(diff, function() {
return requestAnimationFrame(tick);
});
} else {
return setTimeout(tick, 33 - diff);
}
};
return tick();
};
result = function() {
var args, key, obj;
obj = arguments[0], key = arguments[1], args = 3 <= arguments.length ? __slice.call(arguments, 2) : [];
if (typeof obj[key] === 'function') {
return obj[key].apply(obj, args);
} else {
return obj[key];
}
};
extend = function() {
var key, out, source, sources, val, _i, _len;
out = arguments[0], sources = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
for (_i = 0, _len = sources.length; _i < _len; _i++) {
source = sources[_i];
if (source) {
for (key in source) {
if (!__hasProp.call(source, key)) continue;
val = source[key];
if ((out[key] != null) && typeof out[key] === 'object' && (val != null) && typeof val === 'object') {
extend(out[key], val);
} else {
out[key] = val;
}
}
}
}
return out;
};
avgAmplitude = function(arr) {
var count, sum, v, _i, _len;
sum = count = 0;
for (_i = 0, _len = arr.length; _i < _len; _i++) {
v = arr[_i];
sum += Math.abs(v);
count++;
}
return sum / count;
};
getFromDOM = function(key, json) {
var data, e, el;
if (key == null) {
key = 'options';
}
if (json == null) {
json = true;
}
el = document.querySelector("[data-pace-" + key + "]");
if (!el) {
return;
}
data = el.getAttribute("data-pace-" + key);
if (!json) {
return data;
}
try {
return JSON.parse(data);
} catch (_error) {
e = _error;
return typeof console !== "undefined" && console !== null ? console.error("Error parsing inline pace options", e) : void 0;
}
};
Evented = (function() {
function Evented() {}
Evented.prototype.on = function(event, handler, ctx, once) {
var _base;
if (once == null) {
once = false;
}
if (this.bindings == null) {
this.bindings = {};
}
if ((_base = this.bindings)[event] == null) {
_base[event] = [];
}
return this.bindings[event].push({
handler: handler,
ctx: ctx,
once: once
});
};
Evented.prototype.once = function(event, handler, ctx) {
return this.on(event, handler, ctx, true);
};
Evented.prototype.off = function(event, handler) {
var i, _ref, _results;
if (((_ref = this.bindings) != null ? _ref[event] : void 0) == null) {
return;
}
if (handler == null) {
return delete this.bindings[event];
} else {
i = 0;
_results = [];
while (i < this.bindings[event].length) {
if (this.bindings[event][i].handler === handler) {
_results.push(this.bindings[event].splice(i, 1));
} else {
_results.push(i++);
}
}
return _results;
}
};
Evented.prototype.trigger = function() {
var args, ctx, event, handler, i, once, _ref, _ref1, _results;
event = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
if ((_ref = this.bindings) != null ? _ref[event] : void 0) {
i = 0;
_results = [];
while (i < this.bindings[event].length) {
_ref1 = this.bindings[event][i], handler = _ref1.handler, ctx = _ref1.ctx, once = _ref1.once;
handler.apply(ctx != null ? ctx : this, args);
if (once) {
_results.push(this.bindings[event].splice(i, 1));
} else {
_results.push(i++);
}
}
return _results;
}
};
return Evented;
})();
Pace = window.Pace || {};
window.Pace = Pace;
extend(Pace, Evented.prototype);
options = Pace.options = extend({}, defaultOptions, window.paceOptions, getFromDOM());
_ref = ['ajax', 'document', 'eventLag', 'elements'];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
source = _ref[_i];
if (options[source] === true) {
options[source] = defaultOptions[source];
}
}
NoTargetError = (function(_super) {
__extends(NoTargetError, _super);
function NoTargetError() {
_ref1 = NoTargetError.__super__.constructor.apply(this, arguments);
return _ref1;
}
return NoTargetError;
})(Error);
Bar = (function() {
function Bar() {
this.progress = 0;
}
Bar.prototype.getElement = function() {
var targetElement;
if (this.el == null) {
targetElement = document.querySelector(options.target);
if (!targetElement) {
throw new NoTargetError;
}
this.el = document.createElement('div');
this.el.className = "pace pace-active";
document.body.className = document.body.className.replace(/pace-done/g, '');
document.body.className += ' pace-running';
this.el.innerHTML = '<div class="pace-progress">\n <div class="pace-progress-inner"></div>\n</div>\n<div class="pace-activity"></div>';
if (targetElement.firstChild != null) {
targetElement.insertBefore(this.el, targetElement.firstChild);
} else {
targetElement.appendChild(this.el);
}
}
return this.el;
};
Bar.prototype.finish = function() {
var el;
el = this.getElement();
el.className = el.className.replace('pace-active', '');
el.className += ' pace-inactive';
document.body.className = document.body.className.replace('pace-running', '');
return document.body.className += ' pace-done';
};
Bar.prototype.update = function(prog) {
this.progress = prog;
return this.render();
};
Bar.prototype.destroy = function() {
try {
this.getElement().parentNode.removeChild(this.getElement());
} catch (_error) {
NoTargetError = _error;
}
return this.el = void 0;
};
Bar.prototype.render = function() {
var el, key, progressStr, transform, _j, _len1, _ref2;
if (document.querySelector(options.target) == null) {
return false;
}
el = this.getElement();
transform = "translate3d(" + this.progress + "%, 0, 0)";
_ref2 = ['webkitTransform', 'msTransform', 'transform'];
for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) {
key = _ref2[_j];
el.children[0].style[key] = transform;
}
if (!this.lastRenderedProgress || this.lastRenderedProgress | 0 !== this.progress | 0) {
el.children[0].setAttribute('data-progress-text', "" + (this.progress | 0) + "%");
if (this.progress >= 100) {
progressStr = '99';
} else {
progressStr = this.progress < 10 ? "0" : "";
progressStr += this.progress | 0;
}
el.children[0].setAttribute('data-progress', "" + progressStr);
}
return this.lastRenderedProgress = this.progress;
};
Bar.prototype.done = function() {
return this.progress >= 100;
};
return Bar;
})();
Events = (function() {
function Events() {
this.bindings = {};
}
Events.prototype.trigger = function(name, val) {
var binding, _j, _len1, _ref2, _results;
if (this.bindings[name] != null) {
_ref2 = this.bindings[name];
_results = [];
for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) {
binding = _ref2[_j];
_results.push(binding.call(this, val));
}
return _results;
}
};
Events.prototype.on = function(name, fn) {
var _base;
if ((_base = this.bindings)[name] == null) {
_base[name] = [];
}
return this.bindings[name].push(fn);
};
return Events;
})();
_XMLHttpRequest = window.XMLHttpRequest;
_XDomainRequest = window.XDomainRequest;
_WebSocket = window.WebSocket;
extendNative = function(to, from) {
var e, key, _results;
_results = [];
for (key in from.prototype) {
try {
if ((to[key] == null) && typeof from[key] !== 'function') {
if (typeof Object.defineProperty === 'function') {
_results.push(Object.defineProperty(to, key, {
get: function() {
return from.prototype[key];
},
configurable: true,
enumerable: true
}));
} else {
_results.push(to[key] = from.prototype[key]);
}
} else {
_results.push(void 0);
}
} catch (_error) {
e = _error;
}
}
return _results;
};
ignoreStack = [];
Pace.ignore = function() {
var args, fn, ret;
fn = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
ignoreStack.unshift('ignore');
ret = fn.apply(null, args);
ignoreStack.shift();
return ret;
};
Pace.track = function() {
var args, fn, ret;
fn = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
ignoreStack.unshift('track');
ret = fn.apply(null, args);
ignoreStack.shift();
return ret;
};
shouldTrack = function(method) {
var _ref2;
if (method == null) {
method = 'GET';
}
if (ignoreStack[0] === 'track') {
return 'force';
}
if (!ignoreStack.length && options.ajax) {
if (method === 'socket' && options.ajax.trackWebSockets) {
return true;
} else if (_ref2 = method.toUpperCase(), __indexOf.call(options.ajax.trackMethods, _ref2) >= 0) {
return true;
}
}
return false;
};
RequestIntercept = (function(_super) {
__extends(RequestIntercept, _super);
function RequestIntercept() {
var monitorXHR,
_this = this;
RequestIntercept.__super__.constructor.apply(this, arguments);
monitorXHR = function(req) {
var _open;
_open = req.open;
return req.open = function(type, url, async) {
if (shouldTrack(type)) {
_this.trigger('request', {
type: type,
url: url,
request: req
});
}
return _open.apply(req, arguments);
};
};
window.XMLHttpRequest = function(flags) {
var req;
req = new _XMLHttpRequest(flags);
monitorXHR(req);
return req;
};
try {
extendNative(window.XMLHttpRequest, _XMLHttpRequest);
} catch (_error) {}
if (_XDomainRequest != null) {
window.XDomainRequest = function() {
var req;
req = new _XDomainRequest;
monitorXHR(req);
return req;
};
try {
extendNative(window.XDomainRequest, _XDomainRequest);
} catch (_error) {}
}
if ((_WebSocket != null) && options.ajax.trackWebSockets) {
window.WebSocket = function(url, protocols) {
var req;
if (protocols != null) {
req = new _WebSocket(url, protocols);
} else {
req = new _WebSocket(url);
}
if (shouldTrack('socket')) {
_this.trigger('request', {
type: 'socket',
url: url,
protocols: protocols,
request: req
});
}
return req;
};
try {
extendNative(window.WebSocket, _WebSocket);
} catch (_error) {}
}
}
return RequestIntercept;
})(Events);
_intercept = null;
getIntercept = function() {
if (_intercept == null) {
_intercept = new RequestIntercept;
}
return _intercept;
};
shouldIgnoreURL = function(url) {
var pattern, _j, _len1, _ref2;
_ref2 = options.ajax.ignoreURLs;
for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) {
pattern = _ref2[_j];
if (typeof pattern === 'string') {
if (url.indexOf(pattern) !== -1) {
return true;
}
} else {
if (pattern.test(url)) {
return true;
}
}
}
return false;
};
getIntercept().on('request', function(_arg) {
var after, args, request, type, url;
type = _arg.type, request = _arg.request, url = _arg.url;
if (shouldIgnoreURL(url)) {
return;
}
if (!Pace.running && (options.restartOnRequestAfter !== false || shouldTrack(type) === 'force')) {
args = arguments;
after = options.restartOnRequestAfter || 0;
if (typeof after === 'boolean') {
after = 0;
}
return setTimeout(function() {
var stillActive, _j, _len1, _ref2, _ref3, _results;
if (type === 'socket') {
stillActive = request.readyState < 2;
} else {
stillActive = (0 < (_ref2 = request.readyState) && _ref2 < 4);
}
if (stillActive) {
Pace.restart();
_ref3 = Pace.sources;
_results = [];
for (_j = 0, _len1 = _ref3.length; _j < _len1; _j++) {
source = _ref3[_j];
if (source instanceof AjaxMonitor) {
source.watch.apply(source, args);
break;
} else {
_results.push(void 0);
}
}
return _results;
}
}, after);
}
});
AjaxMonitor = (function() {
function AjaxMonitor() {
var _this = this;
this.elements = [];
getIntercept().on('request', function() {
return _this.watch.apply(_this, arguments);
});
}
AjaxMonitor.prototype.watch = function(_arg) {
var request, tracker, type, url;
type = _arg.type, request = _arg.request, url = _arg.url;
if (shouldIgnoreURL(url)) {
return;
}
if (type === 'socket') {
tracker = new SocketRequestTracker(request);
} else {
tracker = new XHRRequestTracker(request);
}
return this.elements.push(tracker);
};
return AjaxMonitor;
})();
XHRRequestTracker = (function() {
function XHRRequestTracker(request) {
var event, size, _j, _len1, _onreadystatechange, _ref2,
_this = this;
this.progress = 0;
if (window.ProgressEvent != null) {
size = null;
request.addEventListener('progress', function(evt) {
if (evt.lengthComputable) {
return _this.progress = 100 * evt.loaded / evt.total;
} else {
return _this.progress = _this.progress + (100 - _this.progress) / 2;
}
}, false);
_ref2 = ['load', 'abort', 'timeout', 'error'];
for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) {
event = _ref2[_j];
request.addEventListener(event, function() {
return _this.progress = 100;
}, false);
}
} else {
_onreadystatechange = request.onreadystatechange;
request.onreadystatechange = function() {
var _ref3;
if ((_ref3 = request.readyState) === 0 || _ref3 === 4) {
_this.progress = 100;
} else if (request.readyState === 3) {
_this.progress = 50;
}
return typeof _onreadystatechange === "function" ? _onreadystatechange.apply(null, arguments) : void 0;
};
}
}
return XHRRequestTracker;
})();
SocketRequestTracker = (function() {
function SocketRequestTracker(request) {
var event, _j, _len1, _ref2,
_this = this;
this.progress = 0;
_ref2 = ['error', 'open'];
for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) {
event = _ref2[_j];
request.addEventListener(event, function() {
return _this.progress = 100;
}, false);
}
}
return SocketRequestTracker;
})();
ElementMonitor = (function() {
function ElementMonitor(options) {
var selector, _j, _len1, _ref2;
if (options == null) {
options = {};
}
this.elements = [];
if (options.selectors == null) {
options.selectors = [];
}
_ref2 = options.selectors;
for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) {
selector = _ref2[_j];
this.elements.push(new ElementTracker(selector));
}
}
return ElementMonitor;
})();
ElementTracker = (function() {
function ElementTracker(selector) {
this.selector = selector;
this.progress = 0;
this.check();
}
ElementTracker.prototype.check = function() {
var _this = this;
if (document.querySelector(this.selector)) {
return this.done();
} else {
return setTimeout((function() {
return _this.check();
}), options.elements.checkInterval);
}
};
ElementTracker.prototype.done = function() {
return this.progress = 100;
};
return ElementTracker;
})();
DocumentMonitor = (function() {
DocumentMonitor.prototype.states = {
loading: 0,
interactive: 50,
complete: 100
};
function DocumentMonitor() {
var _onreadystatechange, _ref2,
_this = this;
this.progress = (_ref2 = this.states[document.readyState]) != null ? _ref2 : 100;
_onreadystatechange = document.onreadystatechange;
document.onreadystatechange = function() {
if (_this.states[document.readyState] != null) {
_this.progress = _this.states[document.readyState];
}
return typeof _onreadystatechange === "function" ? _onreadystatechange.apply(null, arguments) : void 0;
};
}
return DocumentMonitor;
})();
EventLagMonitor = (function() {
function EventLagMonitor() {
var avg, interval, last, points, samples,
_this = this;
this.progress = 0;
avg = 0;
samples = [];
points = 0;
last = now();
interval = setInterval(function() {
var diff;
diff = now() - last - 50;
last = now();
samples.push(diff);
if (samples.length > options.eventLag.sampleCount) {
samples.shift();
}
avg = avgAmplitude(samples);
if (++points >= options.eventLag.minSamples && avg < options.eventLag.lagThreshold) {
_this.progress = 100;
return clearInterval(interval);
} else {
return _this.progress = 100 * (3 / (avg + 3));
}
}, 50);
}
return EventLagMonitor;
})();
Scaler = (function() {
function Scaler(source) {
this.source = source;
this.last = this.sinceLastUpdate = 0;
this.rate = options.initialRate;
this.catchup = 0;
this.progress = this.lastProgress = 0;
if (this.source != null) {
this.progress = result(this.source, 'progress');
}
}
Scaler.prototype.tick = function(frameTime, val) {
var scaling;
if (val == null) {
val = result(this.source, 'progress');
}
if (val >= 100) {
this.done = true;
}
if (val === this.last) {
this.sinceLastUpdate += frameTime;
} else {
if (this.sinceLastUpdate) {
this.rate = (val - this.last) / this.sinceLastUpdate;
}
this.catchup = (val - this.progress) / options.catchupTime;
this.sinceLastUpdate = 0;
this.last = val;
}
if (val > this.progress) {
this.progress += this.catchup * frameTime;
}
scaling = 1 - Math.pow(this.progress / 100, options.easeFactor);
this.progress += scaling * this.rate * frameTime;
this.progress = Math.min(this.lastProgress + options.maxProgressPerFrame, this.progress);
this.progress = Math.max(0, this.progress);
this.progress = Math.min(100, this.progress);
this.lastProgress = this.progress;
return this.progress;
};
return Scaler;
})();
sources = null;
scalers = null;
bar = null;
uniScaler = null;
animation = null;
cancelAnimation = null;
Pace.running = false;
handlePushState = function() {
if (options.restartOnPushState) {
return Pace.restart();
}
};
if (window.history.pushState != null) {
_pushState = window.history.pushState;
window.history.pushState = function() {
handlePushState();
return _pushState.apply(window.history, arguments);
};
}
if (window.history.replaceState != null) {
_replaceState = window.history.replaceState;
window.history.replaceState = function() {
handlePushState();
return _replaceState.apply(window.history, arguments);
};
}
SOURCE_KEYS = {
ajax: AjaxMonitor,
elements: ElementMonitor,
document: DocumentMonitor,
eventLag: EventLagMonitor
};
(init = function() {
var type, _j, _k, _len1, _len2, _ref2, _ref3, _ref4;
Pace.sources = sources = [];
_ref2 = ['ajax', 'elements', 'document', 'eventLag'];
for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) {
type = _ref2[_j];
if (options[type] !== false) {
sources.push(new SOURCE_KEYS[type](options[type]));
}
}
_ref4 = (_ref3 = options.extraSources) != null ? _ref3 : [];
for (_k = 0, _len2 = _ref4.length; _k < _len2; _k++) {
source = _ref4[_k];
sources.push(new source(options));
}
Pace.bar = bar = new Bar;
scalers = [];
return uniScaler = new Scaler;
})();
Pace.stop = function() {
Pace.trigger('stop');
Pace.running = false;
bar.destroy();
cancelAnimation = true;
if (animation != null) {
if (typeof cancelAnimationFrame === "function") {
cancelAnimationFrame(animation);
}
animation = null;
}
return init();
};
Pace.restart = function() {
Pace.trigger('restart');
Pace.stop();
return Pace.start();
};
Pace.go = function() {
var start;
Pace.running = true;
bar.render();
start = now();
cancelAnimation = false;
return animation = runAnimation(function(frameTime, enqueueNextFrame) {
var avg, count, done, element, elements, i, j, remaining, scaler, scalerList, sum, _j, _k, _len1, _len2, _ref2;
remaining = 100 - bar.progress;
count = sum = 0;
done = true;
for (i = _j = 0, _len1 = sources.length; _j < _len1; i = ++_j) {
source = sources[i];
scalerList = scalers[i] != null ? scalers[i] : scalers[i] = [];
elements = (_ref2 = source.elements) != null ? _ref2 : [source];
for (j = _k = 0, _len2 = elements.length; _k < _len2; j = ++_k) {
element = elements[j];
scaler = scalerList[j] != null ? scalerList[j] : scalerList[j] = new Scaler(element);
done &= scaler.done;
if (scaler.done) {
continue;
}
count++;
sum += scaler.tick(frameTime);
}
}
avg = sum / count;
bar.update(uniScaler.tick(frameTime, avg));
if (bar.done() || done || cancelAnimation) {
bar.update(100);
Pace.trigger('done');
return setTimeout(function() {
bar.finish();
Pace.running = false;
return Pace.trigger('hide');
}, Math.max(options.ghostTime, Math.max(options.minTime - (now() - start), 0)));
} else {
return enqueueNextFrame();
}
});
};
Pace.start = function(_options) {
extend(options, _options);
Pace.running = true;
try {
bar.render();
} catch (_error) {
NoTargetError = _error;
}
if (!document.querySelector('.pace')) {
return setTimeout(Pace.start, 50);
} else {
Pace.trigger('start');
return Pace.go();
}
};
if (typeof define === 'function' && define.amd) {
define(['pace'], function() {
return Pace;
});
} else if (typeof exports === 'object') {
module.exports = Pace;
} else {
if (options.startOnPageLoad) {
Pace.start();
}
}
}).call(this);

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 KiB

View File

@@ -0,0 +1,19 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Calendar Language Lines
|--------------------------------------------------------------------------
|
*/
'nothing_today' => "Il n'y a rien a l'horaire pour cette date",
'admin_page_title' => "Horaire",
'admin_breadcrumb' => "Horaire",
'add_to_schedule' => "Ajouter une activité a l'horaire",
'begin_at' => "Commence a ",
'end_at' => " et termine a ",
'pilotage_title' => "Cours de pilotage",
];

View File

@@ -15,5 +15,6 @@ return [
'previous' => '&laquo; Précédent',
'next' => 'Suivant &raquo;',
'close' => 'Fermer',
];

View File

@@ -21,6 +21,28 @@
</div>
</div>
</div>
<div class="modal fade" id="scrollmodal" tabindex="-1" role="dialog" aria-labelledby="scrollmodalLabel" style="display: none;" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="scrollmodalLabel">Scrolling Long Content Modal</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<div class="loader">
<img class="loader-bg" src="/images/leaf_of_canada.png"></img>
<div class="loader-spinner"></div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-primary">Confirm</button>
</div>
</div>
</div>
</div>
@endsection
@section('breadcrumb')
@@ -28,7 +50,7 @@
<div class="col-sm-4">
<div class="page-header float-left">
<div class="page-title">
<h1>{{ trans('admin/dashboard.page_title')}}</h1>
<h1>{{ trans('calendar.admin_page_title')}}</h1>
</div>
</div>
</div>
@@ -36,7 +58,7 @@
<div class="page-header float-right">
<div class="page-title">
<ol class="breadcrumb text-right">
<li class="active">{{ trans('admin/dashboard.breadcrumb')}}</li>
<li class="active">{{ trans('calendar.admin_breadcrumb')}}</li>
</ol>
</div>
</div>

View File

@@ -2,9 +2,35 @@
@section('content')
<!--/* ALPHA 3.0.1c */-->
<!--/* ALPHA 3.0.1e */-->
<div class="card-header">
<strong class="card-title"><i class="fa fa-star" aria-hidden="true" style="color: gold"></i> ALPHA 3.0.1c<small><span class="badge badge-danger float-right mt-1">UNSTABLE</span> <span class="badge badge-warning float-right mt-1">ALPHA</span></small></strong>
<strong class="card-title"><i class="fa fa-star" aria-hidden="true" style="color: gold"></i> ALPHA 3.0.1e<small><span class="badge badge-danger float-right mt-1">UNSTABLE</span> <span class="badge badge-warning float-right mt-1">ALPHA</span></small></strong>
</div>
<div class="card-body">
<p class="card-text">
Nouveauté
<ul style="margin-left: 28px;list-style-type: none;">
<li><i class="fa fa-plus" aria-hidden="true" style="color: green"></i> Amélioration générale de l'horaire</li>
<li><i class="fa fa-plus" aria-hidden="true" style="color: green"></i> Ajout du model d'activité</li>
<li><i class="fa fa-plus" aria-hidden="true" style="color: green"></i> Ajout de la migration d'activité</li>
<li><i class="fa fa-plus" aria-hidden="true" style="color: green"></i> Ajout du CSS du calendrier</li>
<li><i class="fa fa-plus" aria-hidden="true" style="color: green"></i> Ajout d'un préloader</li>
<li><i class="fa fa-plus" aria-hidden="true" style="color: green"></i> Ajout de photos sur la page publique</li>
</ul>
</p>
<hr>
<p>
Correction de bug
<ul style="margin-left: 28px;list-style-type: none;">
<li><i class="fa fa-bug" aria-hidden="true" style="color: green"></i> Correction de multiple bug mineur</li>
</ul>
</p>
<small><span class="badge badge-primary float-right mt-1">2018-07-18 21:23</span></small>
</div>
<!--/* ALPHA 3.0.1d */-->
<div class="card-header">
<strong class="card-title"><i class="fa fa-star" aria-hidden="true" style="color: gold"></i> ALPHA 3.0.1d<small><span class="badge badge-danger float-right mt-1">UNSTABLE</span> <span class="badge badge-warning float-right mt-1">ALPHA</span></small></strong>
</div>
<div class="card-body">
<p class="card-text">

View File

@@ -1,7 +1,10 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<?php setlocale( LC_ALL, str_replace('_', '-', app()->getLocale())) ?>
<?php
$lang = str_replace('_', '-', app()->getLocale());
setlocale( LC_ALL, $lang.'_'.strtoupper($lang).'.utf8','fra');
?>
<title>C-CMS - Espace Administration</title>
<meta name="description" content="Sufee Admin - HTML5 Admin Template">
<meta name="viewport" content="width=device-width, initial-scale=1">

View File

@@ -12,7 +12,6 @@ use App\Notifications\Alert;
</head>
<body>
<!-- Including Left Panel -->
@include('layouts.admin.sidebar')

View File

@@ -92,13 +92,13 @@
<section id="three" class="wrapper style3 special">
<div class="inner">
<header class="major">
<h2>Photo</h2>
<h2>Photos</h2>
<p>Voici quelques photos de nos activités, même s'il est mieux d'y participer réellement!</p>
</header>
<ul class="features">
<li>
<h3><img src="/assets/public/images/survie_2.png" alt="Un Cadet-Cadre qui a été trop efficace" width="100%"></h3>
<p> Les Cadets-Cadre travaillent très fort en survie, comme en témoigne l'Adjudant Première Classe Lagacé.</p>
<p>Les Cadets-Cadre travaillent très fort en survie, comme en témoigne l'Adjudant Première Classe Lagacé.</p>
</li>
<li>
<h3><img src="/assets/public/images/survie_1.png" alt="Une activité en attente de cours de survie" width="100%"></h3>
@@ -116,6 +116,14 @@
<h3><img src="/assets/public/images/parade-2018-1.png" alt="Parade du jour du Souvenir" width="100%"></h3>
<p>Comme à chaque année, l'escadron participe à la parade du Jour du Souvenir, pour honorer les canadiens tombés au combat.</p>
</li>
<li>
<h3><img src="/assets/public/images/griffon.png" alt="Hélicoptère Griffon" width="100%"></h3>
<p>Lors d'une activité spéciale, les cadets on eu la chance unique de faire un tour de Griffon.</p>
</li>
<li>
<h3><img src="/assets/public/images/CL-415.png" alt="Avion anti-incendie" width="100%"></h3>
<p>Lors d'une autre activité spéciale, les cadets ont eu la chance de visiter l'intérieur d'un CL-415 et de discuter avec les pilotes.</p>
</li>
</ul>
</div>
</section>

View File

@@ -19,3 +19,4 @@ Route::middleware('auth:api')->get('/user', function (Request $request) {
/* Calendar Route */
Route::post('/calendar/generate', 'CalendarController@generate');
Route::post('/calendar/loadDay', 'CalendarController@load');

View File

@@ -1,4 +1,5 @@
<?php
use \App\Notifications\Alert;
/*
|--------------------------------------------------------------------------
| Web Routes
@@ -27,7 +28,13 @@ Route::get('/admin/calendar', 'CalendarController@index');
/* Other Route */
Route::get('/test', function () {
\App\Log::saveLog('Test');
$today = new \App\Schedule;
$today->date = "2018-07-18";
$today->type = "pilotage";
$today->data = ['begin_at' => '09:30','end_at' => '12:00'];
$today->save();
});

View File

@@ -14,6 +14,7 @@ return array(
'App\\Http\\Controllers\\Auth\\LoginController' => $baseDir . '/app/Http/Controllers/Auth/LoginController.php',
'App\\Http\\Controllers\\Auth\\RegisterController' => $baseDir . '/app/Http/Controllers/Auth/RegisterController.php',
'App\\Http\\Controllers\\Auth\\ResetPasswordController' => $baseDir . '/app/Http/Controllers/Auth/ResetPasswordController.php',
'App\\Http\\Controllers\\CalendarController' => $baseDir . '/app/Http/Controllers/CalendarController.php',
'App\\Http\\Controllers\\Controller' => $baseDir . '/app/Http/Controllers/Controller.php',
'App\\Http\\Controllers\\TaskController' => $baseDir . '/app/Http/Controllers/TaskController.php',
'App\\Http\\Kernel' => $baseDir . '/app/Http/Kernel.php',
@@ -29,6 +30,7 @@ return array(
'App\\Providers\\BroadcastServiceProvider' => $baseDir . '/app/Providers/BroadcastServiceProvider.php',
'App\\Providers\\EventServiceProvider' => $baseDir . '/app/Providers/EventServiceProvider.php',
'App\\Providers\\RouteServiceProvider' => $baseDir . '/app/Providers/RouteServiceProvider.php',
'App\\Schedule' => $baseDir . '/app/Schedule.php',
'App\\Task' => $baseDir . '/app/Task.php',
'App\\User' => $baseDir . '/app/User.php',
'Carbon\\Carbon' => $vendorDir . '/nesbot/carbon/src/Carbon/Carbon.php',

View File

@@ -328,6 +328,7 @@ class ComposerStaticInit7aa8410dad307922e6e62bcfdfadda15
'App\\Http\\Controllers\\Auth\\LoginController' => __DIR__ . '/../..' . '/app/Http/Controllers/Auth/LoginController.php',
'App\\Http\\Controllers\\Auth\\RegisterController' => __DIR__ . '/../..' . '/app/Http/Controllers/Auth/RegisterController.php',
'App\\Http\\Controllers\\Auth\\ResetPasswordController' => __DIR__ . '/../..' . '/app/Http/Controllers/Auth/ResetPasswordController.php',
'App\\Http\\Controllers\\CalendarController' => __DIR__ . '/../..' . '/app/Http/Controllers/CalendarController.php',
'App\\Http\\Controllers\\Controller' => __DIR__ . '/../..' . '/app/Http/Controllers/Controller.php',
'App\\Http\\Controllers\\TaskController' => __DIR__ . '/../..' . '/app/Http/Controllers/TaskController.php',
'App\\Http\\Kernel' => __DIR__ . '/../..' . '/app/Http/Kernel.php',
@@ -343,6 +344,7 @@ class ComposerStaticInit7aa8410dad307922e6e62bcfdfadda15
'App\\Providers\\BroadcastServiceProvider' => __DIR__ . '/../..' . '/app/Providers/BroadcastServiceProvider.php',
'App\\Providers\\EventServiceProvider' => __DIR__ . '/../..' . '/app/Providers/EventServiceProvider.php',
'App\\Providers\\RouteServiceProvider' => __DIR__ . '/../..' . '/app/Providers/RouteServiceProvider.php',
'App\\Schedule' => __DIR__ . '/../..' . '/app/Schedule.php',
'App\\Task' => __DIR__ . '/../..' . '/app/Task.php',
'App\\User' => __DIR__ . '/../..' . '/app/User.php',
'Carbon\\Carbon' => __DIR__ . '/..' . '/nesbot/carbon/src/Carbon/Carbon.php',