Changed feature image style

This commit is contained in:
Marcin Kurczewski 2013-11-10 12:23:59 +01:00
parent 7faf46beb9
commit 6fadc612fd
2 changed files with 50 additions and 49 deletions

View file

@ -28,26 +28,9 @@
max-width: 500px; max-width: 500px;
} }
#content .header .tags:before {
margin: 0 0.5em;
content: '\2013';
}
#content .header ul {
list-style-type: none;
display: inline;
margin: 0;
padding: 0;
}
#content .header li {
display: inline;
}
#content .header li:not(:last-child) a:after {
content: ', ';
}
#content .body { #content .body {
background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAGCAYAAADgzO9IAAAAJElEQVQImWNgYGBgePfu3X8YZoABFA6SIqwS+HXgtANZF7IEAJnGPJE70lLLAAAAAElFTkSuQmCC'); background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAGCAYAAADgzO9IAAAAJElEQVQImWNgYGBgePfu3X8YZoABFA6SIqwS+HXgtANZF7IEAJnGPJE70lLLAAAAAElFTkSuQmCC');
margin: 1em 0; margin-top: 1em;
text-align: center; text-align: center;
} }
#content .body img { #content .body img {
@ -59,11 +42,26 @@
display: block; display: block;
} }
#content .header .favs-comments { #content .footer {
margin-left: 0.5em; font-size: small;
color: dimgray;
margin: 0.5em 0 3em 0;
}
#content .footer .left {
float: left;
}
#content .footer .right {
float: right; float: right;
} }
#content .footer ul {
#content .footer { list-style-type: none;
text-align: right; display: inline;
margin: 0;
padding: 0;
}
#content .footer li {
display: inline;
}
#content .footer li:not(:last-child) a:after {
content: ', ';
} }

View file

@ -6,9 +6,15 @@
</div> </div>
<?php if (!empty($this->context->featuredPost)): ?> <?php if (!empty($this->context->featuredPost)): ?>
<div class="header"> <div class="body">
Featured image <a href="<?php echo \Chibi\UrlHelper::route('post', 'view', ['id' => $this->context->featuredPost->id]) ?>">
<img title="Featured image" src="<?php echo \Chibi\UrlHelper::route('post', 'retrieve', ['name' => $this->context->featuredPost->name]) ?>" alt="<?php echo $this->context->featuredPost->name ?>"/>
</a>
</div>
<div class="footer">
<span class="left">
Tags:&nbsp;
<ul class="tags"> <ul class="tags">
<?php foreach ($this->context->featuredPost->sharedTag as $tag): ?> <?php foreach ($this->context->featuredPost->sharedTag as $tag): ?>
<li> <li>
@ -18,26 +24,23 @@
</li> </li>
<?php endforeach ?> <?php endforeach ?>
</ul> </ul>
<span class="favs-comments">
<?php printf('%d&nbsp;fav%s', $x = $this->context->featuredPost->countOwn('favoritee'), $x == 1 ? '' : 's') ?>,&#32;
<?php printf('%d&nbsp;comment%s', $x = $this->context->featuredPost->countOwn('comment'), $x == 1 ? '' : 's') ?>
</span> </span>
<div class="clear"></div>
</div>
<div class="body"> <span class="right">
<a href="<?php echo \Chibi\UrlHelper::route('post', 'view', ['id' => $this->context->featuredPost->id]) ?>">
<img src="<?php echo \Chibi\UrlHelper::route('post', 'retrieve', ['name' => $this->context->featuredPost->name]) ?>" alt="<?php echo $this->context->featuredPost->name ?>"/>
</a>
</div>
<div class="footer">
Featured&#32; Featured&#32;
<?php if ($this->context->featuredPostUser): ?> <?php if ($this->context->featuredPostUser): ?>
by <a href="<?php echo \Chibi\UrlHelper::route('user', 'view', ['name' => $this->context->featuredPostUser->name]) ?>"><?php echo $this->context->featuredPostUser->name ?></a>,&#32; by <a href="<?php echo \Chibi\UrlHelper::route('user', 'view', ['name' => $this->context->featuredPostUser->name]) ?>"><?php echo $this->context->featuredPostUser->name ?></a>,&#32;
<?php endif ?> <?php endif ?>
<?php printf('%d day%s', $x = round((time() - $this->context->featuredPostDate) / (24 * 3600.)), $x == 1 ? '' : 's') ?> ago <?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 ?>
</span>
<div class="clear"></div> <div class="clear"></div>
</div> </div>