Skip to content

Commit

Permalink
Add link to answer
Browse files Browse the repository at this point in the history
  • Loading branch information
tafid committed Nov 27, 2015
1 parent 78edf71 commit eabf9a5
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/views/ticket/_comment.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
if ($answer['author'] == 'anonym') {
$answer['email'] = $model->anonym_email;
}

$answerId = 'answer-' . $answer['answer_id'];
$this->registerJs(<<< JS
// Reply button
$('.comment-reply-button').on('click', function(event) {
Expand Down Expand Up @@ -49,7 +49,7 @@
JS
, \yii\web\View::POS_READY);
?>
<?= Html::beginTag('div', ['class' => ($answer['is_answer']) ? 'comment answer' : 'comment', 'id' => 'answer-' . $answer['answer_id']]); ?>
<?= Html::beginTag('div', ['class' => ($answer['is_answer']) ? 'comment answer' : 'comment', 'id' => $answerId]); ?>
<!-- Avatar -->
<?= Gravatar::widget([
'email' => $answer['email'] ?: $answer['email_hash'],
Expand All @@ -71,8 +71,15 @@
'id' => $answer['author_id'],
], ['class' => 'name']); ?>
<?php } ?>
&nbsp;·&nbsp;
<?= Html::tag('span', Yii::$app->formatter->asDatetime($answer['create_time'])) ?>
&nbsp;·&nbsp;
<?= Html::a("<i class='fa fa-hashtag'></i>", ['@ticket/view', 'id' => $model->id, '#' => $answerId], ['class' => 'name']) ?>
<?php if ($answer['spent']) { ?>
<?= Html::tag('span', Yii::t('app', 'Time spent {0, time, HH:mm}', (int)$model->spent * 60), ['class' => 'spent-time pull-right label label-info']) ?>
<?php } ?>
</div>
<div class="clearfix"></div>

<?= Html::tag('span', Thread::parseMessage($answer['message']), ['class' => 'body']); ?>

Expand Down

0 comments on commit eabf9a5

Please sign in to comment.