65 lines
1.7 KiB
PHTML
65 lines
1.7 KiB
PHTML
<?php
|
|
Assets::setSubtitle('home');
|
|
Assets::addStylesheet('static-main.css');
|
|
?>
|
|
|
|
<div id="welcome">
|
|
<h1><?= getConfig()->main->title ?></h1>
|
|
<p>
|
|
<span>serving <?= $this->context->transport->postCount ?> posts</span>
|
|
</p>
|
|
</div>
|
|
|
|
<?php if (!empty($this->context->featuredPost)): ?>
|
|
<div class="body">
|
|
<?php
|
|
$this->context->transport->post = $this->context->featuredPost;
|
|
$this->context->imageLink = \Chibi\Router::linkTo(['PostController', 'viewAction'], [
|
|
'id' => $this->context->featuredPost->id]);
|
|
?>
|
|
|
|
<?php \Chibi\View::render('post-file-render', $this->context) ?>
|
|
</div>
|
|
|
|
<div class="footer">
|
|
<div class="left">
|
|
Tags:
|
|
<ul class="tags">
|
|
<?php $tags = $this->context->featuredPost->getTags() ?>
|
|
<?php uasort($tags, function($a, $b) { return strnatcasecmp($a->name, $b->name); }) ?>
|
|
<?php foreach ($tags as $tag): ?>
|
|
<li>
|
|
<a href="<?= \Chibi\Router::linkTo(['PostController', 'listView'], ['query' => $tag->name]) ?>">
|
|
<?= $tag->name ?>
|
|
</a>
|
|
</li>
|
|
<?php endforeach ?>
|
|
</ul>
|
|
</div>
|
|
|
|
<div class="right">
|
|
Featured
|
|
<?php if ($this->context->featuredPostUser): ?>
|
|
by
|
|
<a href="<?= \Chibi\Router::linkTo(
|
|
['UserController', 'viewAction'],
|
|
['name' => $this->context->featuredPostUser->name]) ?>">
|
|
<?= $this->context->featuredPostUser->name ?>
|
|
</a>,
|
|
<?php endif ?>
|
|
|
|
<?php $x = round((time() - $this->context->featuredPostDate) / (24 * 3600.)) ?>
|
|
<?php if ($x == 0): ?>
|
|
today
|
|
<?php elseif ($x == 1):?>
|
|
yesterday
|
|
<?php else: ?>
|
|
<?php printf('%d days ago', $x) ?>
|
|
<?php endif ?>
|
|
</div>
|
|
|
|
<div class="clear"></div>
|
|
</div>
|
|
|
|
<div class="clear"></div>
|
|
<?php endif ?>
|