From d9bce23822117d03b1630f002d3ee0491ac83d4b Mon Sep 17 00:00:00 2001 From: Geo Halkiadakis Date: Thu, 20 Apr 2023 17:10:06 +0300 Subject: hashing passwords; compatibility with dotNet --- public/app/routes/backend.php | 14 ++- public/app/views/admin/admin-menu.php | 10 +-- public/app/views/admin/edit_lesson.php | 152 +++++++++++++++++++++++++++++++++ public/app/views/admin/new_lesson.php | 144 ------------------------------- public/app/views/admin/skeleton.php | 28 ++++-- public/assets/css/overides.css | 13 ++- public/assets/js/admin/edit_lesson.js | 0 7 files changed, 198 insertions(+), 163 deletions(-) create mode 100644 public/app/views/admin/edit_lesson.php delete mode 100644 public/app/views/admin/new_lesson.php create mode 100644 public/assets/js/admin/edit_lesson.js (limited to 'public') diff --git a/public/app/routes/backend.php b/public/app/routes/backend.php index 5356407..88bf4b8 100644 --- a/public/app/routes/backend.php +++ b/public/app/routes/backend.php @@ -88,11 +88,21 @@ Route::add('/admin/api/privileges', function () { // new lesson // ----------------------------------------------------------------------------- -Route::add('/admin/new_lesson', function () { +Route::add('/admin/edit_lesson', function () { Auth::allowRoles([1, 2, 3]); // allow few admin-panel roles Render::view('admin/skeleton', [ 'title' => 'Νέο Μάθημα', - 'action' => 'new_lesson' + 'action' => 'edit_lesson', ]); }); +// new lesson +// ----------------------------------------------------------------------------- +Route::add('/admin/edit_lesson/([0-9]*)', function ($id) { + Auth::allowRoles([1, 2, 3]); // allow few admin-panel roles + Render::view('admin/skeleton', [ + 'title' => 'Νέο Μάθημα', + 'action' => 'edit_lesson', + 'id' => intval($id) + ]); +}); diff --git a/public/app/views/admin/admin-menu.php b/public/app/views/admin/admin-menu.php index d7e7b09..a06d2eb 100644 --- a/public/app/views/admin/admin-menu.php +++ b/public/app/views/admin/admin-menu.php @@ -4,26 +4,26 @@ * * imported variables: * --- - * @param $action (string) : array of articles + * @param $action (string): array of articles + * @param $id (int): id of entity (when editing entity) | 0: new entity * * example call: * --- * Render::template("sections/admin_panel.php",[ * 'action' => 'posts', + * 'id' => 4 * ]) * ----------------------------------------------------------------------------- */ - $admin_options = [ - 'new_lesson' => 'Νέο Μάθημα', + 'edit_lesson' => 'Νέο Μάθημα', 'lessons' => 'Μαθήματα', 'categories' => 'Κατηγορίες', 'pages' => 'Σελίδες', 'privileges' => 'Πρόσβαση', 'users' => 'Χρήστες' ]; - ?>
@@ -32,7 +32,7 @@ $admin_options = [ $label) : ?> - + diff --git a/public/app/views/admin/edit_lesson.php b/public/app/views/admin/edit_lesson.php new file mode 100644 index 0000000..30dd42f --- /dev/null +++ b/public/app/views/admin/edit_lesson.php @@ -0,0 +1,152 @@ + + + +
+
+
+ +
+
+ + +
+
+
+ + +
+ + + + + + +
+ +
+ +
+
+ +
+ +
+ +
+
+ + +
+ +
+ +
+
+ +
+ +
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ + + + +
    +
+ +
+
+ + +
+ +
+
+
+ + +
+ +
+ +
+ +
+
+ + +
+ +
+ +
+ +
+ +
+ +
+ +
+ + + +
+
+ diff --git a/public/app/views/admin/new_lesson.php b/public/app/views/admin/new_lesson.php deleted file mode 100644 index c48fc82..0000000 --- a/public/app/views/admin/new_lesson.php +++ /dev/null @@ -1,144 +0,0 @@ - - - -
-
Επεξεργασία Μαθήματος
-
- -
-
- - -
-
-
- - -
- - - - - - -
- -
- -
-
- -
- -
- -
-
- - -
- -
- -
-
- -
- -
- -
- -
- -
-
- -
- -
- -
-
- -
- -
- -
-
- -
- -
- - - - -
    -
- -
-
- - -
- -
-
-
- - -
- -
- -
- -
-
- - -
- -
- -
- -
- -
- -
- -
- - - -
-
- diff --git a/public/app/views/admin/skeleton.php b/public/app/views/admin/skeleton.php index fea346f..927bd2d 100644 --- a/public/app/views/admin/skeleton.php +++ b/public/app/views/admin/skeleton.php @@ -7,7 +7,9 @@ true]); + Render::view('components/header_includes', //////////////////////////// + ['administration' => true] + ); ?> @@ -17,16 +19,26 @@
$action - ]) - ?> - - $action, + 'id' => $id + ]); + + // render main content + //////////////////////////////////////////////////////////////////// + Render::view("admin/{$action}",[ 'id' => $id ]); //////////////// ?>
+ + diff --git a/public/assets/css/overides.css b/public/assets/css/overides.css index 0709f4d..b217f65 100644 --- a/public/assets/css/overides.css +++ b/public/assets/css/overides.css @@ -85,9 +85,8 @@ ul.select2-results__options li { font-size: 14px; padding: 4px 8px; } /* hack select2 caret styling * (like bootstrap5 select caret) - * ----------------------------------------------------------------------------- + * ----------------------------------------------------------------------- start */ - .select2-container--default .select2-selection--single .select2-selection__arrow b { background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e"); background-color: transparent; @@ -101,5 +100,11 @@ ul.select2-results__options li { font-size: 14px; padding: 4px 8px; } height: 14px; } .select2-container--default .select2-selection--single .select2-selection__arrow { width: 24px; } -.select2-container--default .select2-selection--single { height: 31px; } - \ No newline at end of file +.select2-container--default .select2-selection--single { height: 31px; } +/* ------------------------------------------------------------------------- end +*/ + +.admin-container .edit-post textarea[name=body] { height: calc(100vh - 420px); } /* almost all avialable height */ +.admin-container .edit-post textarea[name=intro] { height: 73px ;} /* almost 3 (half-)lines */ + + diff --git a/public/assets/js/admin/edit_lesson.js b/public/assets/js/admin/edit_lesson.js new file mode 100644 index 0000000..e69de29 -- cgit v1.2.3