mirror of
https://gitlab.com/TheGamecraft/c-cms.git
synced 2026-04-21 02:39:10 -04:00
April 9 update
This commit is contained in:
1
public/css/Chart.min.css
vendored
Normal file
1
public/css/Chart.min.css
vendored
Normal file
@@ -0,0 +1 @@
|
||||
@keyframes chartjs-render-animation{from{opacity:.99}to{opacity:1}}.chartjs-render-monitor{animation:chartjs-render-animation 1ms}.chartjs-size-monitor,.chartjs-size-monitor-expand,.chartjs-size-monitor-shrink{position:absolute;direction:ltr;left:0;top:0;right:0;bottom:0;overflow:hidden;pointer-events:none;visibility:hidden;z-index:-1}.chartjs-size-monitor-expand>div{position:absolute;width:1000000px;height:1000000px;left:0;top:0}.chartjs-size-monitor-shrink>div{position:absolute;width:200%;height:200%;left:0;top:0}
|
||||
4
public/css/custom.css
vendored
4
public/css/custom.css
vendored
@@ -1836,4 +1836,8 @@ h2 {
|
||||
|
||||
.no-hover:hover {
|
||||
background-color: initial;
|
||||
}
|
||||
|
||||
tfoot > tr {
|
||||
width: 100%;
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 125 KiB |
BIN
public/images/sidebar.png
Normal file
BIN
public/images/sidebar.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
12
public/js/app.js
vendored
12
public/js/app.js
vendored
@@ -1,4 +1,16 @@
|
||||
extendSidebar();
|
||||
|
||||
function navigate(url)
|
||||
{
|
||||
window.location.href = window.location+'/'+url;
|
||||
}
|
||||
|
||||
function extendSidebar()
|
||||
{
|
||||
let foo = $('.nav-item.active');
|
||||
if (foo.attr('parent'))
|
||||
{
|
||||
$('#'+foo.attr('parent')).collapse('show');
|
||||
$('#link-'+foo.attr('parent')).addClass('active');
|
||||
}
|
||||
}
|
||||
7
public/js/plugins/Chart.min.js
vendored
Normal file
7
public/js/plugins/Chart.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
9
public/js/plugins/chartist.min.js
vendored
9
public/js/plugins/chartist.min.js
vendored
File diff suppressed because one or more lines are too long
45
public/js/plugins/course.js
vendored
Normal file
45
public/js/plugins/course.js
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
$('.richeditor').trumbowyg({
|
||||
lang: 'fr',
|
||||
btns: [
|
||||
['viewHTML'],
|
||||
['emoji'],
|
||||
['undo', 'redo'], // Only supported in Blink browsers
|
||||
['strong', 'em', 'del'],
|
||||
['superscript', 'subscript'],
|
||||
['fontfamily'],
|
||||
['fontsize'],
|
||||
['foreColor', 'backColor'],
|
||||
['link'],
|
||||
['justifyLeft', 'justifyCenter', 'justifyRight', 'justifyFull'],
|
||||
['unorderedList', 'orderedList'],
|
||||
['horizontalRule'],
|
||||
['removeformat'],
|
||||
['fullscreen']
|
||||
]
|
||||
});
|
||||
|
||||
function switchPlanStatus(id)
|
||||
{
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: '/api/course/'+id+'/plan/validate?api_token='+api_token,
|
||||
success: function (data) {
|
||||
if (data == '1')
|
||||
{
|
||||
showNotification('success','Le plan de cours est maintenant vérifié','top', 'center');
|
||||
$("[name='isPlanCheck']").prop( "checked", true );
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
showNotification('warning','Le plan de cours n\'est maintenant plus vérifié','top', 'center');
|
||||
$("[name='isPlanCheck']").prop( "checked", false );
|
||||
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
showNotification('error','Erreur impossible de changer le status du plan de cours','top', 'center');
|
||||
$("[name='isPlanCheck']").prop( "checked", false );
|
||||
}
|
||||
})
|
||||
}
|
||||
105
public/js/plugins/drive-explorer.js
vendored
105
public/js/plugins/drive-explorer.js
vendored
@@ -4,8 +4,13 @@ var currentFolder = '';
|
||||
var folderGoBack = [];
|
||||
var permissionModalHtml = null;
|
||||
var progressBar = 0;
|
||||
function init(folder)
|
||||
var originalFolder;
|
||||
var mode = '';
|
||||
function init(folder,pmode = '')
|
||||
{
|
||||
mode = pmode;
|
||||
console.log(mode);
|
||||
originalFolder = folder;
|
||||
loadFolder(folder);
|
||||
loadHistory();
|
||||
}
|
||||
@@ -28,7 +33,17 @@ function loadHistory() {
|
||||
updateProgressBar(progressBar+10);
|
||||
if(!currentFolder == '' || !currentFolder == 'root')
|
||||
{
|
||||
btnBack.removeAttr('disabled');
|
||||
if (mode == 'folder')
|
||||
{
|
||||
if (currentFolder != originalFolder)
|
||||
{
|
||||
btnBack.removeAttr('disabled');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
btnBack.removeAttr('disabled');
|
||||
}
|
||||
}
|
||||
updateProgressBar(progressBar+5);
|
||||
},
|
||||
@@ -50,11 +65,13 @@ function loadFolder(folder) {
|
||||
type: 'GET',
|
||||
url: '/api/drive/folders/'+folder+'?api_token=' + api_token,
|
||||
success: function (template) {
|
||||
// Load Explorer Content
|
||||
updateProgressBar(progressBar+30);
|
||||
$(".drive-explorer").html(template);
|
||||
currentFolder = folder;
|
||||
window.history.pushState("object or string", "Page Title", "/admin/drive/"+folder);
|
||||
if (mode != 'folder')
|
||||
{
|
||||
window.history.pushState("object or string", "Page Title", "/admin/drive/"+folder);
|
||||
}
|
||||
updateProgressBar(progressBar+5);
|
||||
hideLoader();
|
||||
|
||||
@@ -68,7 +85,21 @@ function loadFolder(folder) {
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#backbtn').removeAttr('disabled');
|
||||
if (mode == 'folder')
|
||||
{
|
||||
if (currentFolder != originalFolder)
|
||||
{
|
||||
$('#backbtn').removeAttr('disabled');
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#backbtn').prop('disabled','true');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#backbtn').removeAttr('disabled');
|
||||
}
|
||||
}
|
||||
}
|
||||
updateProgressBar(progressBar+10);
|
||||
@@ -151,13 +182,16 @@ function editPermission(folder,subject,id)
|
||||
$('#permissionModal').on('hidden.bs.modal', function (e) {
|
||||
$('#permissionModalHtml').html(permissionModalHtml);
|
||||
});
|
||||
|
||||
let csrf = $('input[name="_token"]').val();
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: '/api/drive/'+folder+'/permission/'+subject+'/'+id+'?api_token=' + api_token,
|
||||
success: function (modal) {
|
||||
permissionModalHtml = $('#permissionModalHtml').html();
|
||||
$('#permissionModalHtml').html(modal);
|
||||
|
||||
$('#csrf').val(csrf);
|
||||
|
||||
$('#permissionModal').modal('show');
|
||||
},
|
||||
error: function () {
|
||||
@@ -166,6 +200,51 @@ function editPermission(folder,subject,id)
|
||||
});
|
||||
}
|
||||
|
||||
function addPermission(folder,subject)
|
||||
{
|
||||
$('#permissionModal').on('hidden.bs.modal', function (e) {
|
||||
$('#permissionModalHtml').html(permissionModalHtml);
|
||||
});
|
||||
let csrf = $('input[name="_token"]').val();
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: '/api/drive/'+folder+'/addpermission/'+subject+'/?api_token=' + api_token,
|
||||
success: function (modal) {
|
||||
permissionModalHtml = $('#permissionModalHtml').html();
|
||||
$('#permissionModalHtml').html(modal);
|
||||
|
||||
$('#csrf').val(csrf);
|
||||
|
||||
$('#permissionModal').modal('show');
|
||||
},
|
||||
error: function () {
|
||||
showNotification('error', 'Impossible de charger le dossier '+folder, 'top', 'center')
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function deletePermission(folder,subject,id)
|
||||
{
|
||||
$('#permissionModal').on('hidden.bs.modal', function (e) {
|
||||
$('#permissionModalHtml').html(permissionModalHtml);
|
||||
});
|
||||
swal({
|
||||
title: 'Êtes vous certain de vouloir supprimer les permissions ?',
|
||||
text: "Vous ne pourrez pas annuler cette action",
|
||||
type: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Oui',
|
||||
cancelButtonText: 'Non'
|
||||
}).then((result) => {
|
||||
if (result.value) {
|
||||
window.location.href = '/admin/drive/'+folder+'/deletepermission/'+subject+'/'+id;
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
function updateProgressBar(value)
|
||||
{
|
||||
progressBar = value;
|
||||
@@ -180,3 +259,17 @@ function updateProgressBar(value)
|
||||
$('.progress').fadeIn(650);
|
||||
}
|
||||
}
|
||||
|
||||
function updateHeader(perm)
|
||||
{
|
||||
if (perm == 1)
|
||||
{
|
||||
$('#createDropdown').removeClass('d-none');
|
||||
$('#uploadDropdown').removeClass('d-none');
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#createDropdown').addClass('d-none');
|
||||
$('#uploadDropdown').addClass('d-none');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user