April 9 update v2

This commit is contained in:
George Frederick "Buzz" Beurling
2020-04-09 18:25:21 -04:00
parent bf28eac68a
commit 4b659c5db1
3 changed files with 100 additions and 75 deletions

View File

@@ -330,6 +330,10 @@ class GoogleDriveFile extends Model
public static function getSidebarFile() public static function getSidebarFile()
{ {
if (!\App\GoogleDriveFile::checkConfig())
{
return [];
}
$user = \Auth::user(); $user = \Auth::user();
$sidebarArray = []; $sidebarArray = [];
$dirList = \App\GoogleDriveFile::all(); $dirList = \App\GoogleDriveFile::all();

View File

@@ -84,39 +84,68 @@ class FilesController extends Controller
} }
public function guide() public function guide()
{
if (\App\GoogleDriveFile::checkConfig())
{ {
$dirID = \App\GoogleDriveFile::findByPath('.Privé/.Staff/.Guide'); $dirID = \App\GoogleDriveFile::findByPath('.Privé/.Staff/.Guide');
$dir = collect(\Storage::cloud()->listContents($dirID->id,false))->sortBy('name'); $dir = collect(\Storage::cloud()->listContents($dirID->id,false))->sortBy('name');
return view('admin.files.guide',['dir' => $dir]); return view('admin.files.guide',['dir' => $dir]);
} }
return redirect('/admin')->with('error','Google Drive n\'est pas configuré');
}
public function instruction() public function instruction()
{
if (\App\GoogleDriveFile::checkConfig())
{ {
return view('admin.files.Google Drive.index',['folder' => \App\GoogleDriveFile::where('path','=','.Privé/.Staff/.Instruction')->first()->id, 'mode' => 'folder']); return view('admin.files.Google Drive.index',['folder' => \App\GoogleDriveFile::where('path','=','.Privé/.Staff/.Instruction')->first()->id, 'mode' => 'folder']);
} }
return redirect('/admin')->with('error','Google Drive n\'est pas configuré');
}
public function cadet() public function cadet()
{ {
if (!\App\GoogleDriveFile::checkConfig())
{
return redirect('/admin')->with('error','Google Drive n\'est pas configuré');
}
return view('admin.files.Google Drive.index',['folder' => \App\GoogleDriveFile::where('path','=','.Privé/.Cadet')->first()->id, 'mode' => 'folder']); return view('admin.files.Google Drive.index',['folder' => \App\GoogleDriveFile::where('path','=','.Privé/.Cadet')->first()->id, 'mode' => 'folder']);
} }
public function staff() public function staff()
{ {
if (!\App\GoogleDriveFile::checkConfig())
{
return redirect('/admin')->with('error','Google Drive n\'est pas configuré');
}
return view('admin.files.Google Drive.index',['folder' => \App\GoogleDriveFile::where('path','=','.Privé/.Staff')->first()->id, 'mode' => 'folder']); return view('admin.files.Google Drive.index',['folder' => \App\GoogleDriveFile::where('path','=','.Privé/.Staff')->first()->id, 'mode' => 'folder']);
} }
public function etamas() public function etamas()
{ {
if (!\App\GoogleDriveFile::checkConfig())
{
return redirect('/admin')->with('error','Google Drive n\'est pas configuré');
}
return view('admin.files.Google Drive.index',['folder' => \App\GoogleDriveFile::where('path','=','.Privé/.ETAMAS')->first()->id, 'mode' => 'folder']); return view('admin.files.Google Drive.index',['folder' => \App\GoogleDriveFile::where('path','=','.Privé/.ETAMAS')->first()->id, 'mode' => 'folder']);
} }
public function officier() public function officier()
{ {
if (!\App\GoogleDriveFile::checkConfig())
{
return redirect('/admin')->with('error','Google Drive n\'est pas configuré');
}
return view('admin.files.Google Drive.index',['folder' => \App\GoogleDriveFile::where('path','=','.Privé/.Officier')->first()->id, 'mode' => 'folder']); return view('admin.files.Google Drive.index',['folder' => \App\GoogleDriveFile::where('path','=','.Privé/.Officier')->first()->id, 'mode' => 'folder']);
} }
public function publique() public function publique()
{ {
if (!\App\GoogleDriveFile::checkConfig())
{
return redirect('/admin')->with('error','Google Drive n\'est pas configuré');
}
return view('admin.files.Google Drive.index',['folder' => \App\GoogleDriveFile::where('path','=','.Publique')->first()->id, 'mode' => 'folder']); return view('admin.files.Google Drive.index',['folder' => \App\GoogleDriveFile::where('path','=','.Publique')->first()->id, 'mode' => 'folder']);
} }
} }

View File

@@ -15,10 +15,10 @@
<body> <body>
<!-- Include Header --> <!-- Include Header -->
@include('layouts.public.header') @include('layouts.public.header')
<div class="wrapper wrapper-full-page"> <div class="wrapper wrapper-full-page">
@yield('content') @yield('content')
@@ -31,35 +31,32 @@
</div> </div>
</footer> </footer>
</div> </div>
<!-- Scripts --> <!-- Scripts -->
<script src="https://polyfill.io/v3/polyfill.min.js?features=Intl.~locale.en"></script> <script src="https://polyfill.io/v3/polyfill.min.js?features=Intl.~locale.en"></script>
<script src="/js/core/jquery.min.js"></script> <script src="/js/core/jquery.min.js"></script>
<script src="/js/core/popper.min.js"></script> <script src="/js/core/popper.min.js"></script>
<script src="/js/core/bootstrap-material-design.min.js"></script> <script src="/js/core/bootstrap-material-design.min.js"></script>
<script src="/js/material-dashboard.js"></script> <script src="/js/material-dashboard.js"></script>
<script src="/js/material-kit.min.js"></script> <script src="/js/material-kit.min.js"></script>
<script src='/assets/fullcalendar/core/main.js'></script> <script src='/assets/fullcalendar/core/main.js'></script>
<script src='/assets/fullcalendar/daygrid/main.js'></script> <script src='/assets/fullcalendar/daygrid/main.js'></script>
<script> <script>
function toggleEdit() { function toggleEdit() {
if($('#edit-switch').prop( "checked" )) { if ($('#edit-switch').prop("checked")) {
$('.edit-btn').css({"display":"inline-block"}); $('.edit-btn').css({"display": "inline-block"});
} else { } else {
$('.edit-btn').css({"display":"none"}); $('.edit-btn').css({"display": "none"});
} }
} }
</script> </script>
<script> <script>
$('#test').html('Loading Start ...'); document.addEventListener('DOMContentLoaded', function () {
document.addEventListener('DOMContentLoaded', function() {
$('#test').html('DOM ContentLoaded');
var calendarEl = document.getElementById('public_calendar'); var calendarEl = document.getElementById('public_calendar');
try {
var calendar = new FullCalendar.Calendar(calendarEl, { var calendar = new FullCalendar.Calendar(calendarEl, {
plugins: [ 'dayGrid' ], plugins: ['dayGrid'],
locale: 'fr', locale: 'fr',
header: { header: {
left: 'title', left: 'title',
@@ -67,29 +64,24 @@
right: 'prev,next' right: 'prev,next'
}, },
events: '/api/schedule/events', events: '/api/schedule/events',
eventClick: function(info) { eventClick: function (info) {
console.log(info.event.id) console.log(info.event.id)
$.get( "/api/schedule/events/modal/" + info.event.id + "/"+ info.event.extendedProps.extraParams.db_type, function( data ) { $.get("/api/schedule/events/modal/" + info.event.id + "/" + info.event.extendedProps.extraParams.db_type, function (data) {
$( "#modal-content" ).html( data ); $("#modal-content").html(data);
}); });
$('#schedulemodal').modal('toggle') $('#schedulemodal').modal('toggle')
} }
}); });
$('#test').html('Begin render');
calendar.render(); calendar.render();
$('#test').html('Done render');
}
catch(err) {
document.getElementById("test").innerHTML = err.message;
}
}); });
</script> </script>
<div class="modal fade" id="schedulemodal" tabindex="-1" role="dialog" aria-labelledby="schedulemodal" aria-hidden="true"> <div class="modal fade" id="schedulemodal" tabindex="-1" role="dialog" aria-labelledby="schedulemodal"
aria-hidden="true">
<div class="modal-dialog w-100 modal-lg mx-2 mx-lg-auto" role="document"> <div class="modal-dialog w-100 modal-lg mx-2 mx-lg-auto" role="document">
<div class="modal-content" id="modal-content"></div> <div class="modal-content" id="modal-content"></div>
</div> </div>
</div> </div>
</body> </body>
</html> </html>