Browse Source

Blog comment avatar fix

master
Egorka 7 years ago
parent
commit
8bbeb01592
  1. 4
      common/modules/blog/widgets/views/comments/_comment.php
  2. 2
      common/modules/blog/widgets/views/comments/comments.php

4
common/modules/blog/widgets/views/comments/_comment.php

@ -1,6 +1,6 @@
<?php
use core\components\avatar_generator\AvatarGenerator;
use zertex\avatar_generator\AvatarGenerator;
/* @var $item \common\modules\blog\widgets\CommentView */
/* @var $child integer */
@ -11,7 +11,7 @@ $avatar = new AvatarGenerator();
<div data-id="<?= $item->comment->id ?>" class="blog-comment <?= $child ? 'blog-comment-child' : 'blog-comment-parent' ?>" style="margin-left: <?= $child * 30 ?>px">
<div class="media mb-4">
<img class="d-flex mr-3 rounded-circle blog-comment-avatar" src="<?= $avatar->avatar($item->comment->user->id) ?>" alt="">
<img class="d-flex mr-3 rounded-circle blog-comment-avatar" src="<?= $avatar->show($item->comment->user_id->username) ?>" alt="">
<div class="media-body">
<a name="comment_<?= $item->comment->id ?>"></a>
<h5 class="mt-0"><?= $item->comment->user->username ?>

2
common/modules/blog/widgets/views/comments/comments.php

@ -4,7 +4,7 @@ use yii\bootstrap\ActiveForm;
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $post GuzzleHttp\Post\ */
/* @var $post \common\modules\blog\entities\BlogPost */
/* @var $items \common\modules\blog\widgets\CommentView[] */
/* @var $count integer */
/* @var $commentForm \common\modules\blog\forms\BlogCommentForm */

Loading…
Cancel
Save