|
825 | 825 | <?php foreach ($model->comments as $comment): ?> |
826 | 826 | <div class="kanban-task-comment media<?php if ($i++ !== 0): ?> mt-3<?php endif; ?>"> |
827 | 827 | <div class="kanban-user mr-3"> |
828 | | - <?php if ($comment->author->image): ?> |
829 | | - <?= Html::img($comment->author->image, [ |
830 | | - 'class' => ['rounded-circle'], |
831 | | - 'title' => Html::encode($comment->author->name), |
832 | | - 'data' => [ |
833 | | - 'toggle' => 'tooltip' |
834 | | - ] |
835 | | - ]); ?> |
| 828 | + <?php if ($comment->author): ?> |
| 829 | + <?php if ($comment->author->image): ?> |
| 830 | + <?= Html::img($comment->author->image, [ |
| 831 | + 'class' => ['rounded-circle'], |
| 832 | + 'title' => Html::encode($comment->author->name), |
| 833 | + 'data' => [ |
| 834 | + 'toggle' => 'tooltip' |
| 835 | + ] |
| 836 | + ]); ?> |
| 837 | + <?php else: ?> |
| 838 | + <span class="kanban-visualisation" data-toggle="tooltip" |
| 839 | + title="<?= Html::encode($comment->author->name); ?>"> |
| 840 | + <?= strtoupper(substr($comment->author->name, 0, 1)); ?> |
| 841 | + </span> |
| 842 | + <?php endif; ?> |
836 | 843 | <?php else: ?> |
837 | 844 | <span class="kanban-visualisation" data-toggle="tooltip" |
838 | | - title="<?= Html::encode($comment->author->name); ?>"> |
839 | | - <?= strtoupper(substr($comment->author->name, 0, 1)); ?> |
840 | | - </span> |
| 845 | + title="Unknown"> |
| 846 | + U |
| 847 | + </span> |
841 | 848 | <?php endif; ?> |
842 | 849 | </div> |
843 | 850 | <div class="media-body"> |
844 | 851 | <span class="text-muted d-flex flex-row justify-content-between"> |
845 | | - <span><?= Html::encode($comment->author->name); ?></span> |
| 852 | + <?php if ($comment->author): ?> |
| 853 | + <span><?= Html::encode($comment->author->name); ?></span> |
| 854 | + <?php else: ?> |
| 855 | + <span>Unknown</span> |
| 856 | + <?php endif; ?> |
846 | 857 | <span> |
847 | 858 | <?= Yii::$app->formatter->asDatetime($comment->created_at, 'medium'); ?> |
848 | 859 | </span> |
|
0 commit comments