summaryrefslogtreecommitdiff
path: root/public/app/views
diff options
context:
space:
mode:
authorGeorge Halkiadakis <gchalkiadakis@sklavenitis.co.gr>2023-04-25 16:45:03 +0300
committerGeorge Halkiadakis <gchalkiadakis@sklavenitis.co.gr>2023-04-25 16:45:03 +0300
commitb594effb847b86fc6b1dae49d7948c46bba35e58 (patch)
tree8c5a090cf8746870521324797762bb0ff14c8ae5 /public/app/views
parent65d07ba64d45c77d2db16272710ec5702b34d641 (diff)
downloadclassroom-b594effb847b86fc6b1dae49d7948c46bba35e58.tar.gz
classroom-b594effb847b86fc6b1dae49d7948c46bba35e58.tar.bz2
classroom-b594effb847b86fc6b1dae49d7948c46bba35e58.zip
alfa version; uploaded into test server (coder)
Diffstat (limited to 'public/app/views')
-rw-r--r--public/app/views/.gitkeep0
-rw-r--r--public/app/views/components/breadcrumbs.php2
-rw-r--r--public/app/views/components/lessons_list.php4
-rw-r--r--public/app/views/components/subcategories.php3
-rw-r--r--public/app/views/components/top_bar.php25
-rw-r--r--public/app/views/error/404.php1
-rw-r--r--public/app/views/error/general.php16
-rw-r--r--public/app/views/templates/course.php2
-rw-r--r--public/app/views/templates/lesson.php72
9 files changed, 118 insertions, 7 deletions
diff --git a/public/app/views/.gitkeep b/public/app/views/.gitkeep
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/public/app/views/.gitkeep
diff --git a/public/app/views/components/breadcrumbs.php b/public/app/views/components/breadcrumbs.php
index 90b4af9..59c0fca 100644
--- a/public/app/views/components/breadcrumbs.php
+++ b/public/app/views/components/breadcrumbs.php
@@ -9,8 +9,8 @@
* @param $parents : array of parent nodes
* -----------------------------------------------------------------------------
*/
-?>
+?>
<div class="breadcrumb">
<!-- home -->
<a href="/">Classroom</a>
diff --git a/public/app/views/components/lessons_list.php b/public/app/views/components/lessons_list.php
index 1c59164..46c1f7e 100644
--- a/public/app/views/components/lessons_list.php
+++ b/public/app/views/components/lessons_list.php
@@ -33,6 +33,10 @@
<a href="/lesson/<?=$post['id']?>"><?=$post['title']?></a>
</h3>
+ <?php if (in_array('level', $fieldset)) : ?>
+ <p class="getegory">(επίπεδο πρόσβασης <?=$post['privilege_id']?>)</p>
+ <?php endif; ?>
+
<?php if (in_array('category', $fieldset)) : ?>
<p class="category"><?=$post['course_id']?></p>
<?php endif; ?>
diff --git a/public/app/views/components/subcategories.php b/public/app/views/components/subcategories.php
index 58f53fa..5c05a94 100644
--- a/public/app/views/components/subcategories.php
+++ b/public/app/views/components/subcategories.php
@@ -2,7 +2,8 @@
<?php if ($breadcrumbs[ $id ]['childs'] != []) : ?>
- <h5>Υποκατηγορίες</h5>
+ <h5>Υποκεφάλαια</h5>
+
<div class="category-childs">
<?php foreach($breadcrumbs[ $id ]['childs'] as $key => $child) : ?>
diff --git a/public/app/views/components/top_bar.php b/public/app/views/components/top_bar.php
index 0e6e437..eaffe76 100644
--- a/public/app/views/components/top_bar.php
+++ b/public/app/views/components/top_bar.php
@@ -1,8 +1,31 @@
+<?php
+/** top bar
+ * -----------------------------------------------------------------------------
+ *
+ * rendrers breadcrumbs and user menu
+ *
+ * imported variables
+ * ---
+ * @param $id : category_id of last level
+ * @param $label : category title of last level
+ * @param $parents : array of parent nodes
+ * -----------------------------------------------------------------------------
+ */
+
+// initialize variables needed if not passed
+// (needed while requiring breadcrumbs)
+if (!isset($id)) {
+ $id = 0;
+ $label = "";
+ $parents = [];
+}
+
+?>
<div class="top-bar">
<?php // breadcrumbs
////////////////////////////////////////////////////////////////////////
- Render::template("components/breadcrumbs", [
+ Render::view("components/breadcrumbs", [
'id' => $id,
'label' => $label,
'parents' => $parents
diff --git a/public/app/views/error/404.php b/public/app/views/error/404.php
index 89c35cc..4bbf083 100644
--- a/public/app/views/error/404.php
+++ b/public/app/views/error/404.php
@@ -26,6 +26,7 @@
text-align: center; justify-center: center;
opacity: .33;
}
+ .btn { font-size: 18px; padding: 4px 12px; }
</style>
</head>
<body>
diff --git a/public/app/views/error/general.php b/public/app/views/error/general.php
index 74566a4..0a27e56 100644
--- a/public/app/views/error/general.php
+++ b/public/app/views/error/general.php
@@ -1,10 +1,19 @@
<?php
/** general message template
+ * -----------------------------------------------------------------------------
+ * renders an error with custom title and message
+ *
+ * passed values:
*
- * passed:
- * @var $title (string): page title
- * @var $message (string): message
+ * optional @var $title (string): title
+ * optional @var $message (string): message
+ *
+ * NOTE:
+ * if title and/or message are not passed, then defaults are used
+ *
+ * -----------------------------------------------------------------------------
*/
+
?><!DOCTYPE html>
<html lang="en">
<head>
@@ -39,6 +48,7 @@
opacity: .33;
font-size: .87em
}
+ .btn { font-size: 18px; padding: 4px 12px; }
</style>
</head>
<body>
diff --git a/public/app/views/templates/course.php b/public/app/views/templates/course.php
index 9d42297..39e177f 100644
--- a/public/app/views/templates/course.php
+++ b/public/app/views/templates/course.php
@@ -63,7 +63,7 @@
////////////////////////////////////////////////////
Render::view("components/lessons_list", [
'lessons' => $lessons,
- 'fieldset' => ['intro'] // ['intro', 'date']
+ 'fieldset' => ['intro', 'level'] // ['intro', 'date']
]);
?>
<?php endif; ?>
diff --git a/public/app/views/templates/lesson.php b/public/app/views/templates/lesson.php
new file mode 100644
index 0000000..3baafd0
--- /dev/null
+++ b/public/app/views/templates/lesson.php
@@ -0,0 +1,72 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title><?=SITE_TITLE?> - <?=$title?></title>
+
+ <?php // header includes
+ ////////////////////////////////////////////////////////////////////////
+ Render::view('components/header_includes');
+ ?>
+
+</head>
+<body class="classroom">
+
+ <?php // top-bar
+ ////////////////////////////////////////////////////////////////////////
+ Render::view('components/top_bar', [
+ 'id' => $id,
+ 'label' => $breadcrumbs[ $course_id ]['rec']['label'],
+ 'parents' => $breadcrumbs[ $course_id ]['parents']
+ ]);
+ ?>
+
+
+<div class="main-content container">
+ <div class="row">
+
+ <div class="col col-md-5 col-lg-4 d-sm-none d-md-block side-bar">
+
+ <?php // tree of courses
+ ////////////////////////////////////////////////////////////////////////
+ Render::view('components/courses_menu', [
+ 'categories' => $categories,
+ 'open_path' => $course_path
+ ]);
+ ?>
+
+ </div>
+
+ <div class="col col-sm-12 col-md-7 col-lg-8 lesson-view">
+
+ <!-- Lesson Title -->
+ <h3>
+ <?=$title?>
+ </h3>
+
+ <!-- intro -->
+ <?php if ($lesson['intro'] != "") : ?>
+ <p class="intro"><?=$lesson['intro']?></p>
+ <?php endif; ?>
+
+ <!-- body -->
+ <div class="article-body">
+ <?php
+
+ $parsedown = new Parsedown();
+ echo $parsedown->text($lesson['body']);
+
+ ?>
+ </div>
+
+
+ </div>
+
+ </div>
+ </div>
+
+
+ <script src="/assets/js/classroom.js"></script>
+ <script src="/assets/js/lesson-features.js"></script>
+</body>
+</html>