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.php2
-rw-r--r--public/app/views/admin/edit_page.php139
-rw-r--r--public/app/views/admin/pages.php109
3 files changed, 249 insertions, 1 deletions
diff --git a/public/app/views/admin/admin-menu.php b/public/app/views/admin/admin-menu.php
index b783b39..52e8522 100644
--- a/public/app/views/admin/admin-menu.php
+++ b/public/app/views/admin/admin-menu.php
@@ -21,7 +21,7 @@ $admin_options = [
'edit_lesson' => 'Νέο Μάθημα',
'lessons' => 'Μαθήματα',
'categories' => 'Κεφάλαια',
- // 'pages' => 'Σελίδες',
+ 'pages' => 'Σελίδες',
'files' => 'Αρχεία',
'privileges' => 'Πρόσβαση',
'users' => 'Χρήστες'
diff --git a/public/app/views/admin/edit_page.php b/public/app/views/admin/edit_page.php
new file mode 100644
index 0000000..46c47bc
--- /dev/null
+++ b/public/app/views/admin/edit_page.php
@@ -0,0 +1,139 @@
+<?php
+ // some labels (if editing new or existing record)
+ // --- -- -- - - -
+ if ($id == 0) {
+ $action_title = "Δημιουργία Σελίδας";
+ $action_button = "Δημιουργία";
+
+ } else {
+ $action_title = "Επεξεργασία Σελίδας";
+ $action_button = "Αποθήκευση Αλλαγών";
+ }
+?>
+
+<!-- title bar -->
+<div class="title-bar">
+ <div><h5><?=$action_title?></h5></div>
+ <div>
+ <button type="button" class="btn pull-right"
+ data-bs-toggle="modal" data-bs-target="#editorModal" data-action="preview">
+ <i class="fas fa-search"></i> &nbsp; Προεπισκόπηση
+ </button>
+ </div>
+</div>
+
+<!-- manage -->
+<div class="manage edit-page">
+ <form>
+ <div class="row">
+
+
+ <div class="col col-8">
+
+ <!-- id (hidden) -->
+ <input type="hidden" name="id" value="0"><!-- action = (0) ? 'new' : 'edit' -->
+
+ <!--
+ <div class="row form-group">
+ <input type="date" name="date" value="" readonly="">
+ </div>
+ -->
+
+ <div class="row form-group">
+ <label class="control-label col-sm-12" for="title">Τίτλος</label>
+ <div class="col-sm-12">
+ <input class="form-control form-control-sm" type="text" name="title" value="" required="">
+ </div>
+ </div>
+
+ <!-- Post body -->
+ <div class="row form-group">
+ <label class="control-label col-sm-12" for="body">Κείμενο</label>
+ <div class="col-sm-12">
+ <textarea class="form-control form-control-sm" type="text" name="body" value="" required=""></textarea>
+ </div>
+ </div>
+
+ </div>
+
+ <div class="col">
+
+ <div class="row form-group">
+ <label class="control-label col-sm-12" for="status">Κατάσταση</label>
+ <div class="col-sm-12">
+ <select class="form-control form-control-sm form-select form-select-sm" name="status" onchange="this.dataset.chosen = this.value;">
+ <option value="0">Αδημοσίευτο</option>
+ <option value="one">ΔΗΜΟΣΙΕΥΜΕΝΟ</option>
+ </select>
+ </div>
+ </div>
+
+ <div class="row form-group">
+ <label class="control-label col-sm-12" for="media">Αρχεία</label>
+ <div class="col-sm-12 post-media">
+
+ <!-- Button trigger modal -->
+ <button type="button" class="btn btn-sm btn-success pull-right over-bar"
+ data-bs-toggle="modal" data-bs-target="#editorModal" data-action="upload_file">
+ <i class="fas fa-plus"></i> &nbsp; Προσθήκη
+ </button>
+
+ <ul id="files_list">
+ </ul>
+
+ </div>
+ </div>
+
+ <?php if ($id != 0) : ?>
+ <!--
+ <div class="row form-group">
+ <label class="control-label col-sm-12">Πληροφορίες</label>
+ <div class="col-sm-12" id="post-info">
+ </div>
+ </div>
+ -->
+ <?php endif; ?>
+
+ </div>
+
+ </div>
+
+ <div class="row">
+
+ <div class="col">
+ <hr/>
+ <!-- close | submit buttons -->
+
+ <div class="form-actions row justify-content-md-center">
+
+ <div class="col-3">
+ <button type="button" id="go-back" class="btn btn-light col-sm-12">
+ Επιστροφή
+ </button>
+ </div>
+
+ <div class="col-4">
+ <button class="btn btn-primary col-sm-12" type="submit">
+ <?=$action_button?>
+ </button>
+ </div>
+
+ </div>
+
+ </div>
+
+ </form>
+
+ </div>
+</div><!-- /manage -->
+
+
+<!-- MODAL for file uploads and preview -->
+<div class="modal fade" id="editorModal" aria-labelledby="myModalLabel" aria-hidden="true">
+ <div class="modal-dialog modal-lg" role="document">
+ <div class="modal-content">
+ <!-- content will be dynamic -->
+ </div>
+ </div>
+</div>
+
diff --git a/public/app/views/admin/pages.php b/public/app/views/admin/pages.php
new file mode 100644
index 0000000..dd8f954
--- /dev/null
+++ b/public/app/views/admin/pages.php
@@ -0,0 +1,109 @@
+ <!-- title bar -->
+ <div class="title-bar">
+ <div><h5>Διαχείριση Μαθημάτων</h5></div>
+ <div>
+ <!-- Button trigger modal -->
+ <a type="button" class="btn pull-right" href="/admin/edit_page">
+ <i class="fas fa-plus"></i> &nbsp; Νέα Σελίδα
+ </a>
+ </div>
+</div>
+
+<div class="manage">
+ <div class="row">
+ <div class="col-md-12">
+
+ <div id="pages">
+
+ <table id="dt-pages" class="table table-responsive dt-table" style="width:100%">
+ <thead>
+ <th class="dt-id">α/α</th>
+ <th class="dt-title">Τίτλος</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="managePages" 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">Παράμετροι Μαθήματος</h4>
+ <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
+ </div><!-- /modal-header -->
+
+ <!-- modal-body -->
+ <div class="modal-body">
+
+ <!-- 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 form-control-sm" type="text" name="title" value="" required="">
+ </div>
+ </div>
+
+
+ <!-- one line / two parts; status: pull right -->
+ <div class="row">
+ <div class="col-md-8">
+ &nbsp<!-- nothing -->
+ </div>
+ <div class="col-md-4">
+
+ <!-- status: published|unpublished -->
+ <div class="row form-group">
+ <label class="control-label col-sm-12" for="status">Κατάσταση</label>
+ <div class="col-sm-12">
+ <select class="form-control form-control-sm form-select form-select-sm" name="status" onchange="this.dataset.chosen = this.value;">
+ <option value="0">Αδημοσίευτο</option>
+ <option value="one">ΔΗΜΟΣΙΕΥΜΕΝΟ</option>
+ </select>
+ </div>
+ </div>
+
+
+ </div>
+ </div>
+
+
+
+
+ <div class="row form-group">
+ <input type="hidden" name="id" value="0"><!-- page-id -->
+ </div>
+
+
+ </div><!-- /modal body -->
+
+ <div class="modal-footer">
+ <div class="row" style="width: 50%;">
+ <div class="form-actions">
+ <div class="col-4">
+ <button type="button" class="btn btn-default js-modal-close col-sm-12" data-bs-dismiss="modal">Κλείσιμο</button>
+ </div>
+ <div class="col-8">
+ <button class="btn btn-success col-sm-12" type="submit">Καταχώριση</button>
+ </div>
+ </div>
+ </div>
+ </div><!-- /modal-footer -->
+
+ </form><!-- /form -->
+
+ </div>
+ </div>
+</div>