2014-02-01 11:17:02 +01:00
<?php
2014-02-27 15:04:36 +01:00
CustomAssetViewDecorator::setSubtitle('home');
CustomAssetViewDecorator::addStylesheet('index-index.css');
2014-02-01 11:17:02 +01:00
?>
2013-10-21 09:35:06 +02:00
< div id = "welcome" >
2014-04-27 14:44:06 +02:00
< h1 > <? = $this -> config -> main -> title ?> </ h1 >
2013-10-19 13:38:20 +02:00
< p >
2014-04-27 14:44:06 +02:00
< span > serving <? = $this -> context -> transport -> postCount ?> posts</ span >
2013-10-19 13:38:20 +02:00
< / p >
< / div >
<?php if ( ! empty ( $this -> context -> featuredPost )) : ?>
2013-10-21 09:35:06 +02:00
< div class = "body" >
2013-11-23 00:11:06 +01:00
<?php $this -> context -> imageLink = \Chibi\UrlHelper :: route ( 'post' , 'view' , [ 'id' => $this -> context -> featuredPost -> id ]) ?>
<?php $this -> context -> transport -> post = $this -> context -> featuredPost ?>
2014-04-27 14:44:06 +02:00
<? = $this -> renderFile ( 'post-file-render' ) ?>
2013-10-21 09:35:06 +02:00
< / div >
2013-10-19 13:38:20 +02:00
2013-10-21 09:35:06 +02:00
< div class = "footer" >
2013-11-18 14:00:54 +01:00
< div class = "left" >
2013-11-10 12:23:59 +01:00
Tags:
< ul class = "tags" >
2013-12-18 15:10:53 +01:00
<?php $tags = $this -> context -> featuredPost -> getTags () ?>
2013-12-14 16:55:07 +01:00
<?php uasort ( $tags , function ( $a , $b ) { return strnatcasecmp ( $a -> name , $b -> name ); }) ?>
<?php foreach ( $tags as $tag ) : ?>
< li >
2014-04-27 14:44:06 +02:00
< a href = " <? = \Chibi\UrlHelper :: route ( 'post' , 'list' , [ 'query' => $tag -> name ]) ?> " >
<? = $tag -> name ?>
2013-12-14 16:55:07 +01:00
< / a >
< / li >
<?php endforeach ?>
2013-11-10 12:23:59 +01:00
< / ul >
2013-11-18 14:00:54 +01:00
< / div >
2013-11-10 12:23:59 +01:00
2013-11-18 14:00:54 +01:00
< div class = "right" >
2013-11-10 12:23:59 +01:00
Featured 
<?php if ( $this -> context -> featuredPostUser ) : ?>
2014-04-27 14:44:06 +02:00
by < a href = " <? = \Chibi\UrlHelper :: route ( 'user' , 'view' , [ 'name' => $this -> context -> featuredPostUser -> name ]) ?> " > <? = $this -> context -> featuredPostUser -> name ?> </ a > , 
2013-11-10 12:23:59 +01:00
<?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 ?>
2013-11-18 14:00:54 +01:00
< / div >
2013-11-10 12:23:59 +01:00
2013-10-19 13:38:20 +02:00
< div class = "clear" > < / div >
< / div >
2013-10-21 09:35:06 +02:00
< div class = "clear" > < / div >
2013-10-19 13:38:20 +02:00
<?php endif ?>