This commit is contained in:
Marcin Kurczewski 2013-10-19 20:05:03 +02:00
parent 440029d6d6
commit b1740fbfcf
7 changed files with 73 additions and 20 deletions

View file

@ -2,15 +2,16 @@
float: left;
}
.comment-group .comments {
float: left;
margin-left: 170px;
overflow: hidden;
}
.comment-group .post img {
.comment-group .post {
margin-right: 1em;
margin-bottom: 1em;
}
.comment-group {
.comment-group:not(:last-child) {
border-bottom: 1px solid #eee;
margin-bottom: 1em;
}

View file

@ -1,3 +1,4 @@
.posts img {
.post {
margin: 0.5em;
float: left;
}

View file

@ -1,19 +1,61 @@
.post img {
.post {
border: 1px solid #ddd;
box-shadow: 0.25em 0.25em #eee;
padding: 0;
width: 140px;
height: 140px;
position: relative;
}
.post-type-flash img {
.post-type-flash {
border-color: #dd5;
box-shadow: 0.25em 0.25em #eeb, 0.1em 0.1em 0.5em 0.1em rgba(238,238,187,0.5);
}
.post:focus img,
.post:hover img {
.post:focus,
.post:hover {
border: 1px solid firebrick;
box-shadow: 0.25em 0.25em pink;
}
.post:focus img.thumb,
.post:hover img.thumb {
opacity: .9;
}
.post img.thumb {
width: 140px;
height: 140px;
display: block;
}
.post .info-bar {
display: none;
height: 20px;
width: 100%;
border-top: 1px solid firebrick;
background: rgba(255, 128, 128, 0.75);
position: absolute;
bottom: 0;
}
.post:hover .info-bar {
display: block;
}
.post .icon-comments {
margin-left: 3px;
background-position: -64px -1px;
}
.post .icon-favs {
background-position: -43px -1px;
}
.post [class^='icon-'] {
opacity: .75;
width: 20px;
height: 20px;
line-height: 20px;
vertical-align: top;
}
.post span {
vertical-align: top;
font-size: small;
line-height: 20px;
margin-right: 0.5em;
display: inline-block;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 322 B

After

Width:  |  Height:  |  Size: 612 B

View file

@ -501,7 +501,7 @@ class PostController
$this->context->stylesheets []= 'post-view.css';
$this->context->stylesheets []= 'comment-small.css';
$this->context->scripts []= 'post-view.js';
$this->context->subTitle = 'showing @' . $post->id;
$this->context->subTitle = 'showing @' . $post->id . ' - ' . join(', ', array_map(function($x) { return $x['name']; }, $post->sharedTag));
$this->context->favorite = $favorite;
$this->context->transport->post = $post;
$this->context->transport->prevPostId = $prevPost ? $prevPost['id'] : null;

View file

@ -1,11 +1,14 @@
<?php if (empty($this->context->transport->posts)): ?>
<p class="alert alert-warning">No posts to show.</p>
<?php else: ?>
<div class="posts paginator-content">
<?php foreach ($this->context->transport->posts as $post): ?>
<?php $this->context->post = $post ?>
<?php echo $this->renderFile('post-small') ?>
<?php endforeach ?>
<div class="posts-wrapper">
<div class="posts paginator-content">
<?php foreach ($this->context->transport->posts as $post): ?>
<?php $this->context->post = $post ?>
<?php echo $this->renderFile('post-small') ?>
<?php endforeach ?>
</div>
<div class="clear"></div>
</div>
<?php

View file

@ -1,3 +1,9 @@
<a class="post post-type-<?php echo TextHelper::camelCaseToHumanCase(PostType::toString($this->context->post->type)) ?>" href="<?php echo \Chibi\UrlHelper::route('post', 'view', ['id' => $this->context->post->id]) ?>">
<img src="<?php echo \Chibi\UrlHelper::route('post', 'thumb', ['id' => $this->context->post->id]) ?>" alt="@<?php echo $this->context->post->id ?>"/>
</a>
<div class="post post-type-<?php echo TextHelper::camelCaseToHumanCase(PostType::toString($this->context->post->type)) ?>">
<a href="<?php echo \Chibi\UrlHelper::route('post', 'view', ['id' => $this->context->post->id]) ?>">
<img class="thumb" src="<?php echo \Chibi\UrlHelper::route('post', 'thumb', ['id' => $this->context->post->id]) ?>" alt="@<?php echo $this->context->post->id ?>"/>
</a>
<div class="info-bar">
<i class="icon-comments"></i> <span><?php echo $this->context->post->countOwn('comment') ?></span>
<i class="icon-favs"></i> <span><?php echo $this->context->post->countOwn('favoritee') ?></span>
</div>
</div>