From ccdcba869916cc67689fb26584b88ae0f2f71c66 Mon Sep 17 00:00:00 2001 From: Diego Najar Date: Mon, 29 Oct 2018 18:21:42 +0100 Subject: [PATCH 01/86] bug fix profile picture --- bl-kernel/admin/views/edit-user.php | 10 ++++++++-- bl-kernel/ajax/profile-picture.php | 15 +++++++++++++-- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/bl-kernel/admin/views/edit-user.php b/bl-kernel/admin/views/edit-user.php index 8aee28d1..e6ede905 100644 --- a/bl-kernel/admin/views/edit-user.php +++ b/bl-kernel/admin/views/edit-user.php @@ -242,10 +242,16 @@ $(document).ready(function() { $("#jsprofilePictureInputFile").on("change", function() { + // Data to send via AJAX + var username = $("#jsusername").val(); + var formData = new FormData($("#jsprofilePictureForm")[0]); + formData.append('username', username); + formData.append('tokenCSRF', tokenCSRF); + $.ajax({ - url: "ajax/profile-picture", + url: HTML_PATH_ADMIN_ROOT+"ajax/profile-picture", type: "POST", - data: new FormData($("#jsprofilePictureForm")[0]), + data: formData, cache: false, contentType: false, processData: false, diff --git a/bl-kernel/ajax/profile-picture.php b/bl-kernel/ajax/profile-picture.php index fc27f865..c831badb 100644 --- a/bl-kernel/ajax/profile-picture.php +++ b/bl-kernel/ajax/profile-picture.php @@ -1,6 +1,19 @@ 1, + 'message'=>'Error in username.' + ))); +} + if (!isset($_FILES['profilePictureInputFile'])) { exit (json_encode(array( 'status'=>1, @@ -10,8 +23,6 @@ if (!isset($_FILES['profilePictureInputFile'])) { // File extension $fileExtension = pathinfo($_FILES['profilePictureInputFile']['name'], PATHINFO_EXTENSION); -// Username who is uploading the image -$username = $login->username(); // Tmp filename $tmpFilename = $username.'.'.$fileExtension; // Final filename From 2317100a819297625e63d5d282ec3d8a9e45b286 Mon Sep 17 00:00:00 2001 From: Diego Najar Date: Tue, 30 Oct 2018 16:12:44 +0100 Subject: [PATCH 02/86] Improve UI when create or edit content --- .gitignore | 1 + bl-kernel/admin/themes/booty/css/bludit.css | 65 ++- bl-kernel/admin/themes/booty/index.php | 3 + bl-kernel/admin/themes/booty/init.php | 36 +- bl-kernel/admin/views/edit-content.php | 456 +++++++++----------- bl-kernel/admin/views/new-content.php | 415 ++++++++---------- bl-languages/en.json | 2 +- 7 files changed, 453 insertions(+), 525 deletions(-) diff --git a/.gitignore b/.gitignore index c593b486..180be1db 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ bl-themes/editorial bl-themes/mediumish bl-themes/clean-blog bl-themes/grayscale +bl-themes/massively diff --git a/bl-kernel/admin/themes/booty/css/bludit.css b/bl-kernel/admin/themes/booty/css/bludit.css index e5f32e29..5e9fd404 100644 --- a/bl-kernel/admin/themes/booty/css/bludit.css +++ b/bl-kernel/admin/themes/booty/css/bludit.css @@ -84,6 +84,7 @@ code { /* LOGIN */ + body.login { background: rgb(255,255,255); background: linear-gradient(0deg, rgba(255,255,255,1) 0%, rgba(250,250,250,1) 53%); @@ -140,7 +141,6 @@ body.login { /* Create a dashed line with a pattern */ } -/* This selector overrides the points style on line charts. Points on line charts are actually just very short strokes. This allows you to customize even the point size in CSS */ .ct-series-a .ct-point { /* Colour of your points */ stroke: #4a90e2; @@ -151,6 +151,7 @@ body.login { /* ALERT */ + #alert { display: none; position: fixed; @@ -176,6 +177,7 @@ body.login { /* SIDEBAR */ + div.sidebar .nav-item a { padding-left:0; padding-right:0; @@ -204,6 +206,7 @@ div.sidebar .nav-item span.oi { /* PLUGINS */ + .plugin-form label { display: block; margin-top: 1rem !important; @@ -256,3 +259,63 @@ td.child { line-height: 1.5em; } + +#jseditorSidebar { + display: none; + height: calc(100% - 45px); + width: 50%; + max-width: 350px; + position: absolute; + z-index: 50; + top: 45px; + right: 15px; + background-color: #fff; + overflow-x: hidden; + transition: 0.5s; + border-left: 1px solid #ccc; + border-right: 1px solid #ccc; + border-top: 1px solid #ccc; +} + +@media (max-width: 575.98px) { + #jseditorSidebar { + width: 100%; + max-width: 100%; + right: 0; + } + #jseditorToolbarRight button { + font-size: 0px !important; + } + #jseditorToolbarRight button span { + font-size: 16px !important; + } +} + +#jseditorSidebar nav { + background: #f3f3f3; +} + +#jseditorSidebar nav a { + color: #000; +} + +#jseditorSidebar .nav-tabs .nav-link { + border: none; +} + +#jseditorSidebar .nav-link.active { + background: none; + border: none; + border-bottom: 3px solid #ccc; +} + +#jsshadow { + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + background-color: rgba(255,255,255,0.7); + z-index: 10; + display: none; +} \ No newline at end of file diff --git a/bl-kernel/admin/themes/booty/index.php b/bl-kernel/admin/themes/booty/index.php index 18da30e4..1f1b48d9 100644 --- a/bl-kernel/admin/themes/booty/index.php +++ b/bl-kernel/admin/themes/booty/index.php @@ -51,6 +51,9 @@ echo ''.PHP_EOL; ?> + +
+ diff --git a/bl-kernel/admin/themes/booty/init.php b/bl-kernel/admin/themes/booty/init.php index e62be777..4798180f 100644 --- a/bl-kernel/admin/themes/booty/init.php +++ b/bl-kernel/admin/themes/booty/init.php @@ -96,7 +96,7 @@ EOF; { $title = $args['title']; return <<$title +
$title
EOF; } @@ -112,13 +112,15 @@ EOF; $class = $class.' '.$args['class']; } - $html = '
'; + $disabled = empty($args['disabled'])?'':'disabled'; + + $html = '
'; if (isset($args['label'])) { - $html .= ''; + $html .= ''; } - $html .= ''; + $html .= ''; if (isset($args['tip'])) { $html .= ''.$args['tip'].''; @@ -190,9 +192,9 @@ EOF; $class = $class.' '.$args['class']; } - $html = '
'; + $html = '
'; if (!empty($args['label'])) { - $html .= ''; + $html .= ''; } $html .= ''; @@ -267,7 +269,6 @@ EOF; public static function formCheckbox($args) { - $label = isset($args['label'])?$args['label']:''; $labelForCheckbox = isset($args['labelForCheckbox'])?$args['labelForCheckbox']:''; $placeholder = isset($args['placeholder'])?$args['placeholder']:''; $tip = isset($args['tip'])?$args['tip']:' '; @@ -279,7 +280,7 @@ EOF; } $disabled = isset($args['disabled'])?'disabled':''; - $class = 'form-group row'; + $class = 'form-group'; if (isset($args['class'])) { $class = $class.' '.$args['class']; } @@ -289,17 +290,20 @@ EOF; $type = $args['type']; } + $label = ''; + if (!empty($args['label'])) { + $label = ''; + } + $checked = $args['checked']?'checked':''; return << - -
-
- - - $tip -
+ $label +
+ + + $tip
EOF; @@ -353,7 +357,7 @@ EOF; $html = '
'; if (!empty($args['label'])) { - $html .= ''; + $html .= ''; } $html .= ' -
- - -
contentRaw(false) ?>
- - - + - -