diff options
author | vincent-peugnet <v.peugnet@free.fr> | 2019-01-15 04:04:01 +0100 |
---|---|---|
committer | vincent-peugnet <v.peugnet@free.fr> | 2019-01-15 04:04:01 +0100 |
commit | 2ff846f7fb65998cd6cf151554434f56f116d4f2 (patch) | |
tree | 8106cf1744dc7545e1482fd98bae16ea3628c153 /app/view/templates/timeline.php | |
parent | 8e79f279938f0fff64ddd381d073c2c277dd2d5c (diff) | |
parent | de195c2fca2f4b77a54be68fb58cd0ccee10a5b7 (diff) | |
download | wcms-2ff846f7fb65998cd6cf151554434f56f116d4f2.tar.gz wcms-2ff846f7fb65998cd6cf151554434f56f116d4f2.zip |
Merge branch 'implement-timeline' into develop
Diffstat (limited to 'app/view/templates/timeline.php')
-rw-r--r-- | app/view/templates/timeline.php | 90 |
1 files changed, 90 insertions, 0 deletions
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 |