summaryrefslogtreecommitdiff
path: root/public/app/views/admin
diff options
context:
space:
mode:
Diffstat (limited to 'public/app/views/admin')
-rw-r--r--public/app/views/admin/admin-menu.php47
-rw-r--r--public/app/views/admin/categories.php97
-rw-r--r--public/app/views/admin/skeleton.php40
3 files changed, 162 insertions, 22 deletions
diff --git a/public/app/views/admin/admin-menu.php b/public/app/views/admin/admin-menu.php
new file mode 100644
index 0000000..813420d
--- /dev/null
+++ b/public/app/views/admin/admin-menu.php
@@ -0,0 +1,47 @@
+<?php
+/** admin panel
+ * -----------------------------------------------------------------------------
+ *
+ * imported variables:
+ * ---
+ * @param $action (string) : array of articles
+ *
+ * example call:
+ * ---
+ * Render::template("sections/admin_panel.php",[
+ * 'action' => 'posts',
+ * ])
+ * -----------------------------------------------------------------------------
+ */
+
+
+$admin_options = [
+ 'new' => 'Νέο Μάθημα',
+ 'lessons' => 'Μαθήματα',
+ 'categories' => 'Κατηγορίες',
+ 'pages' => 'Σελίδες',
+ 'privileges' => 'Δικαιώματα',
+ 'users' => 'Χρήστες'
+];
+
+?>
+
+<div class="top-bar">
+
+ <span class="btn btn-warning">Admin</span>
+
+ <?php foreach($admin_options as $opt => $label) : ?>
+
+ <?php if ($opt == $action) : ?>
+ <span class="btn btn-primary selected"><?=$label?></span>
+
+ <?php else : ?>
+ <a href="/admin/<?= $opt ?>" class="btn"><?= $label ?></a>
+
+ <?php endif; ?>
+
+ <?php endforeach ?>
+
+ <a href="/logout" class="btn">Logout</a>
+
+</div> \ No newline at end of file
diff --git a/public/app/views/admin/categories.php b/public/app/views/admin/categories.php
new file mode 100644
index 0000000..e33d9b0
--- /dev/null
+++ b/public/app/views/admin/categories.php
@@ -0,0 +1,97 @@
+ <!-- title bar -->
+ <div class="title-bar">
+ <div>Διαχείριση Κατηγοριών</div>
+ <div>
+ <!-- Button trigger modal -->
+ <button type="button" class="btn btn-success pull-right"
+ data-bs-toggle="modal" data-bs-target="#manageCategory" data-id="0">
+ <i class="fas fa-plus"></i> &nbsp; Νέα Κατηγορία
+ </button>
+ </div>
+</div>
+
+<div class="manage">
+ <div class="row">
+ <div class="col-md-12">
+
+ <div id="categories-tree">
+
+ <table id="dt-categories" class="table table-responsive dt-table">
+ <thead>
+ <th class="dt-breadcrumb">Κατηγορία</th>
+ <th class="dt-actions"></th>
+ </thead>
+ </table>
+
+ </div>
+
+
+ </div>
+ </div>
+</div><!-- /manage -->
+
+
+
+<!-- MODAL for new/edit category -->
+<!-- NOTE: tabindex="-1" removed, ref:https://github.com/select2/select2-bootstrap-theme/issues/41 -->
+<div class="modal fade" id="manageCategory" aria-labelledby="myModalLabel" aria-hidden="true">
+ <div class="modal-dialog modal-lg" role="document">
+ <div class="modal-content">
+
+ <form method="post" action="">
+
+ <div class="modal-header">
+ <h4 class="modal-title" id="myModalLabel">Modal title</h4>
+ <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
+ </div><!-- /modal-header -->
+
+ <!-- modal-body -->
+ <div class="modal-body">
+
+ <!-- loader
+ <div class="modal-loader">
+ <img src="/img/ajax-loader.gif">
+ </div>
+ -->
+
+ <!-- form fields -->
+
+ <div class="row form-group">
+ <label class="control-label col-sm-12" for="label">Όνομα κατηγορίας</label>
+ <div class="col-sm-12">
+ <input class="form-control" type="text" name="label" value="" required="">
+ </div>
+ </div>
+
+ <div class="row form-group">
+ <label class="control-label col-sm-12" for="parent_id">Γονική Κατηγορία</label>
+ <div class="col-sm-12">
+ <select class="form-control" id="parent_id" name="parent_id" required /></select>
+ </div>
+ </div>
+
+ <div class="row form-group">
+ <input type="hidden" name="id" value="0"><!-- action = (0) ? 'new' : 'edit' -->
+ </div>
+
+
+ </div><!-- /modal body -->
+
+ <div class="modal-footer">
+ <div class="row">
+ <div class="form-actions">
+ <div class="col-xs-4">
+ <button type="button" class="btn btn-default js-modal-close col-sm-12" data-bs-dismiss="modal">Κλείσιμο</button>
+ </div>
+ <div class="col-xs-8">
+ <button class="btn btn-success col-sm-12" type="submit">Καταχώριση</button>
+ </div>
+ </div>
+ </div>
+ </div><!-- /modal-footer -->
+
+ </form><!-- /form -->
+
+ </div>
+ </div>
+</div>
diff --git a/public/app/views/admin/skeleton.php b/public/app/views/admin/skeleton.php
index a9c2dcf..fea346f 100644
--- a/public/app/views/admin/skeleton.php
+++ b/public/app/views/admin/skeleton.php
@@ -3,35 +3,31 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
- <title>ΣΚΛΑΒΕΝΙΤΗΣ - <?=$page['title']?></title>
+ <title>Classroom - <?=$title?></title>
- <!-- styling assets -->
-
- <link rel="preconnect" href="https://fonts.googleapis.com">
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
- <link href="https://fonts.googleapis.com/css2?family=Roboto+Slab:wght@300;400;500;700&display=swap" rel="stylesheet">
-
- <!-- script assets -->
+ <?php // header includes
+ ////////////////////////////////////////////////////////////////////////
+ Render::view('components/header_includes', ['administration' => true]);
+ ?>
</head>
<body>
- <div class="admin-container">
-
- <div class="menu">
-
- </div>
-
- <div class="workspace">
-
- </div>
-
- <div class="options">
-
- </div>
-
+ <div class="classroom admin-container">
+
+ <?php
+ Render::view('admin/admin-menu',[
+ 'action' => $action
+ ])
+ ?>
+
+ <?php
+ Render::view("admin/{$action}");
+ ?>
</div>
+ <script src="/assets/js/admin/<?= $action ?>.js"></script>
+
</body>
</html><?php ob_flush(); ?>