summaryrefslogtreecommitdiff
path: root/public/app/views/components/lessons_list.php
diff options
context:
space:
mode:
authorGeorge Halkiadakis <gchalkiadakis@sklavenitis.co.gr>2023-04-27 03:47:30 +0300
committerGeorge Halkiadakis <gchalkiadakis@sklavenitis.co.gr>2023-04-27 03:47:30 +0300
commit059e0d95d0c28bc5060e87e146eaf7411f51bf90 (patch)
tree7c21ac432f16dde2329a0d5954d70711eceb48e6 /public/app/views/components/lessons_list.php
parent26cd8ee99659ef1926c96a049c93645ffc9b169d (diff)
downloadgyraf1gov-059e0d95d0c28bc5060e87e146eaf7411f51bf90.tar.gz
gyraf1gov-059e0d95d0c28bc5060e87e146eaf7411f51bf90.tar.bz2
gyraf1gov-059e0d95d0c28bc5060e87e146eaf7411f51bf90.zip
skeleton commit; based on an anom project
Diffstat (limited to 'public/app/views/components/lessons_list.php')
-rw-r--r--public/app/views/components/lessons_list.php54
1 files changed, 54 insertions, 0 deletions
diff --git a/public/app/views/components/lessons_list.php b/public/app/views/components/lessons_list.php
new file mode 100644
index 0000000..a778d59
--- /dev/null
+++ b/public/app/views/components/lessons_list.php
@@ -0,0 +1,54 @@
+<?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']
+ * ])
+ * -----------------------------------------------------------------------------
+ */
+?>
+
+
+<?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('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; ?>
+
+ <?php if (in_array('intro', $fieldset) && $post['intro']) : ?>
+ <p class="intro"><?=$post['intro']?></p>
+ <?php endif; ?>
+
+ </div>
+
+ </div>
+ <!-- </div> -->
+
+<?php endforeach; ?>
+