summaryrefslogtreecommitdiff
path: root/public/app/views
diff options
context:
space:
mode:
Diffstat (limited to 'public/app/views')
-rw-r--r--public/app/views/components/breadcrumbs.php6
-rw-r--r--public/app/views/components/lessons_list.php51
-rw-r--r--public/app/views/components/subcategories.php18
-rw-r--r--public/app/views/components/top_bar.php6
-rw-r--r--public/app/views/templates/course.php82
5 files changed, 157 insertions, 6 deletions
diff --git a/public/app/views/components/breadcrumbs.php b/public/app/views/components/breadcrumbs.php
index 471cfb6..90b4af9 100644
--- a/public/app/views/components/breadcrumbs.php
+++ b/public/app/views/components/breadcrumbs.php
@@ -5,7 +5,7 @@
* imported variables
* ---
* @param $id : category_id of last level
- * @param $title : category title of last level
+ * @param $label : category title of last level
* @param $parents : array of parent nodes
* -----------------------------------------------------------------------------
*/
@@ -18,13 +18,13 @@
<!-- parent nodes -->
<?php if ($id != 0) : ?>
<?php foreach($parents as $node) : ?>
- <i class="fas fa-angle-right"></i> <a href="/wiki/category?id=<?=$node['id']?>"><?=$node['title']?></a>
+ <i class="fas fa-angle-right"></i> <a href="/course/<?=$node['id']?>"><?=$node['label']?></a>
<?php endforeach; ?>
<?php endif; ?>
<!-- last (current) node -->
<?php if ($id != 0) : ?>
- <i class="fas fa-angle-right"></i> <a href="/wiki/category?id=<?=$id?>"><?=$title?></a>
+ <i class="fas fa-angle-right"></i> <a href="/course/<?=$id?>"><?=$label?></a>
<?php endif; ?>
</div> \ No newline at end of file
diff --git a/public/app/views/components/lessons_list.php b/public/app/views/components/lessons_list.php
new file mode 100644
index 0000000..1c59164
--- /dev/null
+++ b/public/app/views/components/lessons_list.php
@@ -0,0 +1,51 @@
+<?php
+/** lessons list
+ * -----------------------------------------------------------------------------
+ *
+ * imported variables:
+ * ---
+ * @param $lessons : array of lessons
+ * @param $fieldset : array of optional fields to show [category, intro, date]
+ *
+ * example call:
+ * ---
+ * Render::template("sections/articles_list.php",[
+ * 'articles' => $category_tree,
+ * 'fieldset' => ['date', 'intro']
+ * ])
+ * -----------------------------------------------------------------------------
+ */
+?>
+<div class="row">
+
+ <?php foreach($lessons as $post) : ?>
+
+ <!-- <div class="col-xl-4 col-lg-6"> -->
+ <div class="post-card">
+
+ <?php if (in_array('date', $fieldset)) : ?>
+ <?=$post['date']?>
+ <?php endif; ?>
+
+ <div class="post-card--content">
+
+ <h3>
+ <a href="/lesson/<?=$post['id']?>"><?=$post['title']?></a>
+ </h3>
+
+ <?php if (in_array('category', $fieldset)) : ?>
+ <p class="category"><?=$post['course_id']?></p>
+ <?php endif; ?>
+
+ <?php if (in_array('intro', $fieldset) && $post['intro']) : ?>
+ <p class="intro"><?=$post['intro']?></p>
+ <?php endif; ?>
+
+ </div>
+
+ </div>
+ <!-- </div> -->
+
+ <?php endforeach; ?>
+
+</div> \ No newline at end of file
diff --git a/public/app/views/components/subcategories.php b/public/app/views/components/subcategories.php
new file mode 100644
index 0000000..58f53fa
--- /dev/null
+++ b/public/app/views/components/subcategories.php
@@ -0,0 +1,18 @@
+<!-- Sub-Categories -->
+
+<?php if ($breadcrumbs[ $id ]['childs'] != []) : ?>
+
+ <h5>Υποκατηγορίες</h5>
+ <div class="category-childs">
+
+ <?php foreach($breadcrumbs[ $id ]['childs'] as $key => $child) : ?>
+
+ <a href="/course/<?=$child['id']?>" class="btn btn-light">
+ <?=$child['label']?>
+ </a>
+
+ <?php endforeach; ?>
+
+ </div>
+
+<?php endif; ?> \ No newline at end of file
diff --git a/public/app/views/components/top_bar.php b/public/app/views/components/top_bar.php
index ed96e35..0e6e437 100644
--- a/public/app/views/components/top_bar.php
+++ b/public/app/views/components/top_bar.php
@@ -3,9 +3,9 @@
<?php // breadcrumbs
////////////////////////////////////////////////////////////////////////
Render::template("components/breadcrumbs", [
- 'id' => 0,
- 'title' => '',
- 'parents' => []
+ 'id' => $id,
+ 'label' => $label,
+ 'parents' => $parents
]);
?>
diff --git a/public/app/views/templates/course.php b/public/app/views/templates/course.php
new file mode 100644
index 0000000..9d42297
--- /dev/null
+++ b/public/app/views/templates/course.php
@@ -0,0 +1,82 @@
+<!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[ $id ]['rec']['label'],
+ 'parents' => $breadcrumbs[ $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 course-view">
+
+ <!-- Category Title -->
+ <h3>
+ <?=$breadcrumbs[ $id ]['rec']['label']?>
+ </h3>
+
+
+ <!-- Sub-Categories -->
+ <?php
+ Render::view('components/subcategories',[
+ 'id' => $id,
+ 'breadcrumbs' => $breadcrumbs
+ ])
+ ?>
+
+
+ <!-- Articles List -->
+ <?php if ($lessons) : ?>
+
+ <h5>Μαθήματα</h5>
+
+ <?php // list of posts/articles
+ ////////////////////////////////////////////////////
+ Render::view("components/lessons_list", [
+ 'lessons' => $lessons,
+ 'fieldset' => ['intro'] // ['intro', 'date']
+ ]);
+ ?>
+ <?php endif; ?>
+
+
+
+
+ </div>
+
+ </div>
+ </div>
+
+
+ <script src="/assets/js/classroom.js"></script>
+</body>
+</html>