Example #1
0
<?php

use yii\helpers\Html;
/* @var $this yii\web\View */
?>
<div class="media">

    <div class="media-left">
        <?php 
echo Html::a(Html::img($model->user->userAvatar, ['class' => 'media-object']), ['/user/default/show', 'username' => $model->user['username']]);
?>
    </div>
    <div class="media-body">
        <div class="fade-info">
            <?php 
echo Html::a($model->user['username'], ['/user/default/show', 'username' => $model->user['username']]), '•', Html::tag('span', \common\helpers\Formatter::relative($model->updated_at));
?>
        </div>

        <div class="media-heading">
            <?php 
echo \yii\helpers\HtmlPurifier::process(\yii\helpers\Markdown::process($model->content, 'gfm'));
?>
        </div>

        <div class="title-info pull-right">
            <?php 
if ($model->isCurrent()) {
    echo Html::a(Html::tag('i', '', ['class' => 'fa fa-thumbs-o-up']) . ' ' . Html::tag('span', $model->like_count . ' '), 'javascript:;');
    if ($model->comment_count == 0) {
        echo Html::a(Html::tag('i', '', ['class' => 'fa fa-trash']) . ' 删除', ['/tweet/default/delete', 'id' => $model->id], ['data' => ['confirm' => "您确认要删除吗?", 'method' => 'post']]);
Example #2
0
<?php

use yii\helpers\Html;
/* @var $this yii\web\View */
?>
<div class="media">



    <div class="media-body">

        <div class="media-heading">
            <?php 
echo Html::a(Html::encode($model->title), ['/topic/default/view', 'id' => $model->topic_id], ['title' => $model->title]);
?>
 <span class="title-info"><?php 
echo \common\helpers\Formatter::relative($model->updated_at);
?>
</span>
        </div>
    </div>
</div>
Example #3
0
        <?php 
echo Html::a(Html::img($model->user->userAvatar, ['class' => 'media-object']), ['/user/default/show', 'username' => $model->user['username']]);
?>
    </div>
    <div class="media-body">

        <div class="media-heading">
            <?php 
echo Html::a(Html::encode($model->title), ['/topic/default/view', 'id' => $model->id], ['title' => $model->title]);
?>
            <?php 
echo $model->status == Topic::STATUS_EXCELLENT ? Html::tag('i', '', ['class' => 'fa fa-trophy excellent']) : null;
?>
        </div>

        <div class="title-info">
            <?php 
if ($model->like_count) {
    echo Html::a(Html::tag('span', ' ' . $model->like_count . ' ', ['class' => 'fa fa-thumbs-o-up']), ['/topic/default/view', 'id' => $model->id], ['class' => 'remove-padding-left']), ' • ';
}
echo Html::a($model->category->name, ['/topic/default/index', 'node' => $model->category->alias], ['class' => 'node']), ' • ', Html::a($model->user['username'], ['/user/default/show', 'username' => $model->user['username']]), ' • ';
if ($model->last_comment_username) {
    echo Html::tag('span', Yii::t('frontend', 'last_by') . Html::a(' ' . $model->last_comment_username . ' ', ['/user/default/show', 'username' => $model->last_comment_username]) . Yii::t('frontend', 'reply_at {datetime}', ['datetime' => Formatter::relative($model->last_comment_time)]));
} else {
    echo Html::tag('span', Yii::t('frontend', 'created_at {datetime}', ['datetime' => Formatter::relative($model->updated_at)]));
}
?>
        </div>
    </div>
</div>