Skip to content
This repository has been archived by the owner on Dec 3, 2018. It is now read-only.

Commit

Permalink
thread view
Browse files Browse the repository at this point in the history
Pinned and locked threads header and list modified.
Subscription star modified.
  • Loading branch information
Bizley committed Oct 25, 2016
1 parent 16ecd45 commit 867178b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/views/elements/forum/_thread.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
<a href="<?= Url::to(['forum/thread', 'cid' => $model->category_id, 'fid' => $model->forum_id, 'id' => $model->id, 'slug' => $model->slug]) ?>" class="hidden-lg hidden-md hidden-sm pull-left btn btn-<?= $model->getCssClass() ?> btn-xs" style="margin-right:5px" data-pjax="0" data-toggle="tooltip" data-placement="top" title="<?= $model->getDescription() ?>">
<span class="glyphicon glyphicon-<?= $model->getIcon() ?>"></span>
</a>
<a href="<?= Url::to(['forum/thread', 'cid' => $model->category_id, 'fid' => $model->forum_id, 'id' => $model->id, 'slug' => $model->slug]) ?>" class="center-block" data-pjax="0">
<?= Html::encode($model->name) ?>
<a href="<?= Url::to(['forum/thread', 'cid' => $model->category_id, 'fid' => $model->forum_id, 'id' => $model->id, 'slug' => $model->slug]) ?>" class="center-block <?= $model->locked ? 'text-danger' : '' ?>" data-pjax="0">
<?= $model->pinned ? '<mark>' : '' ?><?= Html::encode($model->name) ?><?= $model->pinned ? '</mark>' : '' ?>
</a>
</td>
<td class="text-center"><?= $model->posts > 0 ? $model->posts - 1 : 0 ?></td>
Expand Down
19 changes: 16 additions & 3 deletions src/views/forum/thread.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,17 +123,30 @@
</div>
</div>

<?php
$headerClass = 'default';
$headerIcon = Html::tag('span', '', ['class' => 'glyphicon glyphicon-comment']);
if ($thread->pinned) {
$headerClass = 'success';
$headerIcon = Html::tag('span', '', ['class' => 'glyphicon glyphicon-pushpin']);
}
if ($thread->locked) {
$headerClass = 'danger';
$headerIcon = Html::tag('span', '', ['class' => 'glyphicon glyphicon-lock']);
}
?>

<div class="row">
<div class="col-sm-12">
<div class="panel panel-default">
<div class="panel panel-<?= $headerClass ?>">
<div class="panel-heading">
<h3 class="panel-title">
<?php if ($thread->subscription): ?>
<a href="<?= Url::to(['profile/subscriptions']) ?>" class="btn btn-warning btn-xs pull-right" data-toggle="tooltip" data-placement="left" title="<?= Yii::t('podium/view', 'You subscribe this thread') ?>"><span class="glyphicon glyphicon-star"></span></a>
<a href="<?= Url::to(['profile/subscriptions']) ?>" class="btn btn-default btn-lg pull-right" data-toggle="tooltip" data-placement="left" title="<?= Yii::t('podium/view', 'You subscribe this thread') ?>"><span class="glyphicon glyphicon-star"></span></a>
<?php elseif (!Yii::$app->user->isGuest): ?>
<small id="subsription-status" class="pull-right"><button class="add-subscription btn btn-success btn-xs"><span class="glyphicon glyphicon-star-empty"></span> <?= Yii::t('podium/view', 'Subscribe to this thread') ?></button></small>
<?php endif; ?>
<?= Html::encode($thread->name) ?>
<?= $headerIcon ?> <?= Html::encode($thread->name) ?>
</h3>
</div>
</div>
Expand Down

0 comments on commit 867178b

Please sign in to comment.