-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
148 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
use yii\helpers\Url; | ||
use yii\helpers\Html; | ||
use yii\helpers\HtmlPurifier; | ||
|
||
/** | ||
* @var \yuncms\question\models\QuestionComment $model | ||
*/ | ||
?> | ||
<div class="media-left"> | ||
<a href="<?= Url::to(['/user/space/view', 'id' => $model->user_id]) ?>" target="_blank"> | ||
<img class="media-object avatar-27" alt="<?= Html::encode($model->user->nickname) ?>" | ||
src="<?= $model->user->getAvatar() ?>"> | ||
</a> | ||
</div> | ||
<div class="media-body"> | ||
<div class="media-heading"> | ||
<a href="<?= Url::to(['/user/space/view', 'id' => $model->user_id]) ?>" | ||
target="_blank"><?= $model->user->nickname ?></a> | ||
<?php if ($model->to_user_id): ?> | ||
<span class="text-muted">回复 </span> | ||
<a href="<?= Url::to(['/user/space/view', 'id' => $model->to_user_id]) ?>" | ||
target="_blank"><?= $model->toUser->nickname ?></a> | ||
<?php endif; ?> | ||
</div> | ||
<div class="content"><p><?= HtmlPurifier::process($model->content) ?></p></div> | ||
<div class="media-footer"> | ||
<span class="text-muted"><?= Yii::$app->formatter->asRelativeTime($model->created_at); ?></span> | ||
<?php if (!Yii::$app->user->isGuest && $model->user_id != Yii::$app->user->id): ?> | ||
<a href="#" class="ml-10 comment-reply" | ||
data-model_id="<?= $model->model_id ?>" data-to_user_id="<?= $model->user_id ?>" | ||
data-model_class="<?= $model->model_class ?>" | ||
data-message="回复 <?= Html::encode($model->user->nickname) ?>"><i class="fa fa-reply"></i> 回复</a> | ||
<?php endif; ?> | ||
</div> | ||
|
||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
use yii\helpers\Url; | ||
use yii\helpers\Html; | ||
use yii\helpers\HtmlPurifier; | ||
?> | ||
<div class="media"> | ||
<?= $this->render( | ||
'_item.php', ['model' => $model] | ||
) ?> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
use yii\widgets\Pjax; | ||
use yii\widgets\ListView; | ||
?> | ||
<?php Pjax::begin(); ?> | ||
<?= ListView::widget([ | ||
'options' => ['class' => null], | ||
'dataProvider' => $dataProvider, | ||
'itemView' => '_item',//子视图 | ||
'itemOptions' => ['class' => 'media'], | ||
'layout' => "{items}\n{pager}", | ||
]); ?> | ||
<?php Pjax::end(); ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters