aboutsummaryrefslogtreecommitdiff
path: root/app/view/templates
diff options
context:
space:
mode:
Diffstat (limited to 'app/view/templates')
-rw-r--r--app/view/templates/backtopbar.php2
-rw-r--r--app/view/templates/connect.php4
-rw-r--r--app/view/templates/navart.php2
-rw-r--r--app/view/templates/timeline.php90
4 files changed, 98 insertions, 0 deletions
diff --git a/app/view/templates/backtopbar.php b/app/view/templates/backtopbar.php
index 78e9181..d6b522e 100644
--- a/app/view/templates/backtopbar.php
+++ b/app/view/templates/backtopbar.php
@@ -15,6 +15,7 @@
<form action="<?= $this->url('log') ?>" method="post" id="connect">
<input type="password" name="pass" id="loginpass" placeholder="password">
+<input type="hidden" name="route" value="home">
<input type="submit" name="log" value="login">
</form>
@@ -22,6 +23,7 @@
<?php } else { ?>
<span>
+<a href="<?= $this->url('timeline') ?>" <?= $tab == 'timeline' ? 'class="actualpage"' : '' ?>>timeline</a>
<a href="<?= $this->url('user') ?>" <?= $tab == 'user' ? 'class="actualpage"' : '' ?>><?= $user->id() ?></a> <i><?= $user->level() ?></i>
</span>
diff --git a/app/view/templates/connect.php b/app/view/templates/connect.php
index 06fe9c8..5d7ee5c 100644
--- a/app/view/templates/connect.php
+++ b/app/view/templates/connect.php
@@ -11,7 +11,11 @@
<?php if($user->isvisitor()) { ?>
+<?= $route === 'artedit' ? '<p>Your edits have been temporary saved. You need to connect and update to store it completly</p>' : '' ?>
+
<form action="<?= $this->url('log') ?>" method="post">
+<input type="hidden" name="route" value="<?= $route ?>">
+<input type="hidden" name="id" value="<?= $id ?>">
<input type="password" name="pass" id="loginpass" placeholder="password">
<input name="log" type="submit" value="login">
</form>
diff --git a/app/view/templates/navart.php b/app/view/templates/navart.php
index be3b248..1e6b551 100644
--- a/app/view/templates/navart.php
+++ b/app/view/templates/navart.php
@@ -72,6 +72,7 @@
<li class="drop">
<form action="<?= $this->url('log') ?>" method="post">
<input type="password" name="pass" id="loginpass" placeholder="password">
+ <input type="hidden" name="route" value="artread/">
<input type="hidden" name="id" value="<?= $art->id() ?>">
<input type="submit" name="log" value="login" id="button">
</form>
@@ -82,6 +83,7 @@
<li class="drop">
<form action="<?= $this->url('log') ?>" method="post">
<input type="hidden" name="id" value="<?= $art->id() ?>">
+ <input type="hidden" name="route" value="artread/">
<input type="submit" name="log" value="logout" id="button">
</form>
</li>
diff --git a/app/view/templates/timeline.php b/app/view/templates/timeline.php
new file mode 100644
index 0000000..fcf8afd
--- /dev/null
+++ b/app/view/templates/timeline.php
@@ -0,0 +1,90 @@
+<?php $this->layout('layout', ['title' => 'timeline', 'css' => $css . 'home.css', 'favicon' => '']) ?>
+
+
+
+
+<?php $this->start('page') ?>
+
+
+<body>
+
+ <?php $this->insert('backtopbar', ['user' => $user, 'tab' => 'timeline']) ?>
+
+<?php if($user->iseditor()) { ?>
+
+<main class="timeline">
+
+<h1>Timeline</h1>
+
+<ul>
+
+<?php
+foreach ($groupedeventlist as $eventuser) {
+
+ if($user->id() === $eventuser['user']) {
+ $class = 'class="self user"';
+ } else {
+ $class = 'class="user"';
+ }
+ echo '<li '. $class .'>';
+ echo '<h3>'. $eventuser['user'] .'</h3>';
+ echo' <ul>';
+ foreach ($eventuser as $key => $event) {
+ if($key !== 'user') {
+ echo '<li class="event">';
+ switch ($event->type()) {
+ case 'message':
+ echo '<p class="eline">'. $event->message() .'</p>';
+ break;
+ }
+
+ ?>
+
+
+ <?= !empty($event->clap()) ? '<b class="eline">'. $event->clap() .'</b>' : '' ?>
+
+ <span class="details">
+
+ <?php if($user->id() !== $eventuser['user']) {?>
+ <form class="eline" method="post" action="<?= $this->url('timelineclap') ?>">
+ <input type="hidden" name="id" value="<?= $event->id() ?>">
+ <input type="submit" name="clap" value="👌">
+ </form>
+ <?php } ?>
+
+
+ <i class="eline"><?= $event->date('hrdi') ?> ago</i>
+
+ </span>
+
+ </li>
+
+ <?php
+ }
+ }
+ echo '</ul></li>';
+}
+?>
+
+</ul>
+
+<form action="<?= $this->url('timelineadd') ?>" method="post">
+
+<input type="hidden" name="type" value="message">
+
+<input type="hidden" name="user" value="<?= $user->id() ?>">
+
+<label for="message">message</label>
+<textarea name="message" id="message" cols="30" rows="10" autofocus></textarea>
+<input type="submit" value="send">
+</form>
+
+</main>
+
+<?php } ?>
+
+</body>
+
+
+
+<?php $this->stop() ?> \ No newline at end of file