Example #1
0
 $comments = $answerModel->comments;
 echo "<h5 style='padding-left:4px;'>";
 echo count($comments);
 echo " Comments</h5>";
 if ($comments) {
     foreach ($comments as $comment) {
         echo '<div style="border-bottom:1px solid #d8d8d8; padding: 4px;">';
         print humhub\widgets\RichText::widget(['text' => $comment->post_text]);
         echo '<div class="row"><div class="col-sm-6">';
         echo "<a class='display-name' href=\"" . \yii\helpers\Url::toRoute(['/user/profile', 'uguid' => $comment->user->guid]) . "\">" . $comment->user->displayName . "</a>";
         echo " &bull; " . date('Y-m-d H:i:s', strtotime($comment->created_at));
         echo '</div>';
         echo '<div class="col-sm-6">';
         echo "<small>";
         if (Yii::$app->user->isAdmin()) {
             echo Html::a('<div class="qanda-button pull-right"><span class="icon icon-trash"></span> Delete</div>', ['delete', 'id' => $comment->id], array('submit' => url::to('delete', array('id' => $comment->id)), 'confirm' => "Are you sure want to delete?", 'csrf' => true, 'params' => array('YII_CSRF_TOKEN' => Yii::$app->request->csrfToken)));
         }
         if (Yii::$app->user->isAdmin() || $comment->created_by == Yii::$app->user->id) {
             echo Html::a("<div class='qanda-button pull-right'><span class='icon icon-pencil'></span> Edit</div>", array('//questionanswer/comment/update', 'id' => $comment->id));
         }
         echo "</small>";
         echo '</div></div>';
         echo '</div>';
     }
 }
 ?>
                         
                         <div class="add-comment-button" style="padding-top:10px;">
                         		<a class="add-comment-link<?php 
 echo $question_answer['id'];
 ?>
Example #2
0
?>
><a
                href="<?php 
echo Module::url(['index']);
?>
"><?php 
echo 'Все';
?>
</a></li>

        <li <?php 
echo $route == 'unanswered' ? 'class="active"' : '';
?>
><a
                href="<?php 
echo url::to(['unanswered']);
?>
"><?php 
echo 'Неосвещенные';
?>
</a></li>

        <li <?php 
echo $route == 'answered' ? 'class="active"' : '';
?>
><a
                href="<?php 
echo Module::url(['answered']);
?>
"><?php 
echo 'Отвеченные';