Skip to content

Commit

Permalink
fixed some bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
shi-yang committed Apr 17, 2017
1 parent e8a37ec commit 0700921
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 23 deletions.
4 changes: 3 additions & 1 deletion frontend/themes/basic/modules/home/views/feed/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@
</div>
<div class="widget-footer">
<div class="footer-detail">
&nbsp;
<a href="<?= Url::toRoute(['/home/feed/update', 'id' => $feed['id']]) ?>">
<span class="glyphicon glyphicon-edit"></span> <?= Yii::t('app', 'Edit') ?>
</a>
<a href="<?= Url::toRoute(['/home/feed/delete', 'id' => $feed['id']]) ?>" data-clicklog="delete" onclick="return false;" title="<?= Yii::t('app', 'Are you sure to delete it?') ?>">
<span class="glyphicon glyphicon-trash"></span> <?= Yii::t('app', 'Delete') ?>
</a>
Expand Down
13 changes: 1 addition & 12 deletions frontend/themes/basic/modules/home/views/feed/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
?>
<div class="feed-view">

<h1><?= Html::encode($this->title) ?></h1>
<h1><?= Html::encode($model->content) ?></h1>

<p>
<?= Html::a(Yii::t('app', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
Expand All @@ -25,16 +25,5 @@
]) ?>
</p>

<?= DetailView::widget([
'model' => $model,
'attributes' => [
'id',
'type',
'content:ntext',
'comment_count',
'repost_count',
'feed_data',
],
]) ?>

</div>
9 changes: 3 additions & 6 deletions frontend/themes/basic/modules/home/views/post/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<div class="post-index">
<h1><?= Html::encode($this->title) ?></h1>
<p>
<?= Html::a(Yii::t('app', 'Create Post'), ['create'], ['class' => 'btn btn-success']) ?>
<?= Html::a(Yii::t('app', 'Create Post'), ['create'], ['class' => 'btn btn-success', 'data-pjax' => 0]) ?>
</p>
</div>
<div class="row">
Expand All @@ -31,20 +31,17 @@
<?php if ($post['status'] == 'private'): ?>
<i class="glyphicon glyphicon-lock"></i>
<?php endif ?>
<?= Html::a(Html::encode($post['title']), ['/home/post/view', 'id' => $post['id']]) ?>
<?= Html::a(Html::encode($post['title']), ['/home/post/view', 'id' => $post['id']], ['data-pjax' => 0]) ?>
</h3>
</header>
<div class="post-footer">
&nbsp;
<a href="<?= Url::toRoute(['/home/post/delete', 'id' => $post['id']]) ?>" data-clicklog="delete" onclick="return false;" title="<?= Yii::t('app', 'Are you sure to delete it?') ?>">
<span class="glyphicon glyphicon-trash"></span> <?= Yii::t('app', 'Delete') ?>
</a>
&nbsp;
<span class="item-line"></span>
<a href="<?= Url::toRoute(['/home/post/update', 'id' => $post['id']]) ?>">
<a href="<?= Url::toRoute(['/home/post/update', 'id' => $post['id']]) ?>" data-pjax="0">
<span class="glyphicon glyphicon-edit"></span> <?= Yii::t('app', 'Edit') ?>
</a>
&nbsp;
<span class="item-line"></span>
<span class="glyphicon glyphicon-time"></span> <?= Yii::$app->formatter->asRelativeTime($post['created_at']) ?>
</div>
Expand Down
2 changes: 1 addition & 1 deletion frontend/themes/basic/modules/home/views/post/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/* @var $model app\modules\home\models\Post */

$this->title = $model->title;
$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Blog'), 'url' => ['/home/post/index']];
$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Blog'), 'url' => ['/home/post/index'], ['data-pjax' => 0]];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="panel">
Expand Down
6 changes: 4 additions & 2 deletions frontend/themes/basic/modules/user/views/dashboard/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,13 @@
<div class="widget-footer">
<div class="footer-detail">
<?php if(Yii::$app->user->id == $feed['user_id']): ?>
&nbsp;
<a href="<?= Url::toRoute(['/home/feed/update', 'id' => $feed['id']]) ?>">
<span class="glyphicon glyphicon-edit"></span> <?= Yii::t('app', 'Edit') ?>
</a>
<span class="item-line"></span>
<a href="<?= Url::toRoute(['/home/feed/delete', 'id' => $feed['id']]) ?>" data-clicklog="delete" onclick="return false;" title="<?= Yii::t('app', 'Are you sure to delete it?') ?>">
<span class="glyphicon glyphicon-trash"></span> <?= Yii::t('app', 'Delete') ?>
</a>
&nbsp;
<span class="item-line"></span>
<?php endif ?>
<a href="javascript:;" onclick="setRepostFormAction(<?= $feed['id'] ?>)" data-toggle="modal" data-target="#repost-modal">
Expand Down
2 changes: 1 addition & 1 deletion frontend/themes/basic/modules/user/views/layouts/user.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
</a>
</li>
<li>
<a href="<?= Url::toRoute('/explore/index') ?>">
<a href="<?= Url::toRoute('/explore/index') ?>" data-pjax="0">
<span class="menu-icon">
<i class="glyphicon glyphicon-globe"></i>
</span>
Expand Down

0 comments on commit 0700921

Please sign in to comment.