Example #1
0
 * |___//_//____/  /_/ /_/ |_||_|     |_|
 * @link http://vistart.name/
 * @copyright Copyright (c) 2016 vistart
 * @license http://vistart.name/license/
 */
use yii\widgets\ActiveForm;
use yii\helpers\Html;
use rhopress\Module;
/* @var $article rhopress\models\Article */
?>
        <?php 
$form = ActiveForm::begin();
?>
        <?php 
echo $form->field($article, 'title', ['template' => "{input}\n{hint}\n{error}"]);
?>
        <?php 
echo $form->field($article, 'content', ['template' => "{input}\n{hint}\n{error}"])->textarea(['rows' => 2]);
?>
 
        <hr>
        <div class="form-group">
            <?php 
echo Html::submitButton('<span class="glyphicon glyphicon-plus"></span> ' . Module::t('views/article', 'Publish'), ['class' => 'btn btn-primary']);
?>
            <?php 
echo Html::resetButton('<span class="glyphicon glyphicon-refresh"></span> ' . Module::t('views/article', 'Reset'), ['class' => 'btn btn-danger']);
?>
        </div>
        <?php 
ActiveForm::end();
Example #2
0
 public function attributeLabels()
 {
     return ['content' => Module::t('models', 'Content'), 'create_time' => Module::t('models', 'Created At'), 'update_time' => Module::t('models', 'Last Updated At')];
 }
 public static function t($message, $params = [], $language = null)
 {
     return \rhopress\Module::t('controllers/article', $message, $params, $language);
 }
Example #4
0
use rhopress\widgets\comment\NewWidget;
use yii\helpers\Html;
use yii\helpers\Url;
/* @var $this yii\web\View */
/* @var $comment rhopress\models\Comment */
/* @var $newComment rhopress\models\Comment */
echo $comment->user->profile->display_name;
?>
:&nbsp;
<?php 
echo $comment->content;
if (!Yii::$app->user->isGuest && $comment->user->guid == Yii::$app->user->identity->guid) {
    ?>
    &nbsp;
    <?php 
    echo Html::a(Module::t('views/comment', 'Delete'), Url::to(['comment/delete', 'id' => $comment->article->id, 'cid' => $comment->id]), ['data-method' => 'post', 'class' => 'btn btn-danger btn-xs']);
}
if ($comment->children) {
    ?>
    <hr/>
    <div class="row">
        <div class="col-lg-offset-1">
            <?php 
    foreach ($comment->children as $sub) {
        echo ItemWidget::widget(['comment' => $sub]);
    }
    ?>
            <?php 
    if ($newComment) {
        ?>
                <?php 
Example #5
0
?>
        <h2 style="padding: 0; font-family: Noto Serif; margin-bottom: 12px"><?php 
echo Html::encode($article->title);
?>
</h2>
        <br/>
        <?php 
$createdAtAttribute = $article->createdAtAttribute;
echo $article->user->profile->display_name . ' ' . Module::t('views/article', 'Published At') . ' ' . $formatter->asDatetime($article->{$createdAtAttribute}, 'php:Y F d, l, H:i:s');
?>
        <?php 
if (!Yii::$app->user->isGuest && $article->user->guid == Yii::$app->user->identity->guid) {
    ?>
&nbsp;
        <?php 
    echo Html::a(Module::t('views/article', 'Delete'), Url::to(['article/delete', 'id' => $article->id]), ['data-method' => 'post', 'class' => 'btn btn-danger btn-sm']);
    ?>
        <?php 
}
?>
        <hr/>

        <div class="entry-content">
            <p style="font-family: Noto-Serif; font-size: 19px; font-weight: 400"><?php 
echo Html::encode($article->content);
?>
</p>
        </div>
        <?php 
if ($comments = $article->childComments) {
    ?>
Example #6
0
 /**
  * @inheritdoc
  */
 public static function t($message, $params = [], $language = null)
 {
     return Module::t('models/article', $message, $params, $language);
 }