summaryrefslogtreecommitdiff
path: root/tpl/list
diff options
context:
space:
mode:
authorNicolas BERNSTEIN <alexis211@gmail.com>2011-11-20 13:39:47 +0100
committerNicolas BERNSTEIN <alexis211@gmail.com>2011-11-20 13:39:47 +0100
commitd45c7f14891d951f8a6987cc6492073b97e05b5b (patch)
treed6467b1202c27f67fd8e894d25fd4aea0085b559 /tpl/list
parent4d7e065c2d2ec407b6a7ebfc7569628bac9149d1 (diff)
downloadBits-d45c7f14891d951f8a6987cc6492073b97e05b5b.tar.gz
Bits-d45c7f14891d951f8a6987cc6492073b97e05b5b.zip
Added the bit list study system
Diffstat (limited to 'tpl/list')
-rw-r--r--tpl/list/ef.php15
-rw-r--r--tpl/list/index.php20
-rw-r--r--tpl/list/new.php8
-rw-r--r--tpl/list/view.php29
4 files changed, 72 insertions, 0 deletions
diff --git a/tpl/list/ef.php b/tpl/list/ef.php
new file mode 100644
index 0000000..1e7387a
--- /dev/null
+++ b/tpl/list/ef.php
@@ -0,0 +1,15 @@
+<?php
+require("tpl/general/top.php");
+
+if (isset($fields))
+ require("tpl/general/inc_form.php");
+
+echo '</div><div class="contents-left">';
+
+echo '<h1>' . $list['name'] . '</h1>';
+echo '<ul><li><a href="view-list-' . $list['id'] . '">Back to list</a></li>';
+echo '<li><a href="edit-list-' . $list['id'] . '">Edit list</a></li>';
+echo '<li><a href="addbatch-list-' . $list['id'] . '">Add batch to list</a></li>';
+echo '</ul>';
+
+require("tpl/general/bottom.php");
diff --git a/tpl/list/index.php b/tpl/list/index.php
new file mode 100644
index 0000000..85a503c
--- /dev/null
+++ b/tpl/list/index.php
@@ -0,0 +1,20 @@
+<?php
+
+$title = "Study lists";
+
+if ($user['id'] == 0) $message = "Hey, you should create an account so that you can study with us!";
+
+require("tpl/general/top.php");
+
+echo '<div class="ordering_links">' . filters_html_full() . '</div>';
+
+echo "<table><tr><th>Name</th><th>Users</th>";
+foreach ($lists as $list) {
+ echo '<tr><td><code>' . $list["owner"] . ':<a href="view-list-' . $list['id'] . '">' . $list["name"] . '</a></code></td>';
+ echo '<td>' . $list["nbUsers"] . '</td></tr>';
+}
+echo "</table>";
+
+require("tpl/study/lib_sidebar.php");
+
+require("tpl/general/bottom.php");
diff --git a/tpl/list/new.php b/tpl/list/new.php
new file mode 100644
index 0000000..1f7e81e
--- /dev/null
+++ b/tpl/list/new.php
@@ -0,0 +1,8 @@
+<?php
+require("tpl/general/top.php");
+
+require("tpl/general/inc_form.php");
+
+require("tpl/study/lib_sidebar.php");
+
+require("tpl/general/bottom.php");
diff --git a/tpl/list/view.php b/tpl/list/view.php
new file mode 100644
index 0000000..8b2c292
--- /dev/null
+++ b/tpl/list/view.php
@@ -0,0 +1,29 @@
+<?php
+
+$title = $list['owner'] . ':' . $list['name'];
+require("tpl/general/top.php");
+
+if ($can_edit) {
+ echo '<div class="small_right"><a href="edit-list-' . $list['id'] . '">edit</a> | ';
+ echo '<a href="addbatch-list-' . $list['id'] . '">add batch</a></div>';
+}
+
+echo $list['comment'];
+
+if ($can_start_study) {
+ echo '<p style="text-align: center; font-size: 1.2em;"><a href="listadd-study-' . $listid . '">&gt;&gt; start studying this list &lt;&lt;</a></p>';
+}
+
+echo '<table><tr><th>Batch name</th>' . ($can_edit ? '<th>actions</th>' : '') . '</tr>';
+foreach ($batches as $batch) {
+ echo '<tr><td>' . $batch['name'] . '</td>';
+ if ($can_edit) {
+ echo '<td><a href="edbatch-list-' . $batch['id'] . '">edit</a> | <a href="rmbatch-list-' . $batch['id'] . '">remove</a></td>';
+ }
+ echo '</tr>';
+}
+echo '</table>';
+
+require("tpl/study/lib_sidebar.php");
+
+require("tpl/general/bottom.php");