Skip to content

Commit

Permalink
Merge branch 'master' into prod
Browse files Browse the repository at this point in the history
  • Loading branch information
shi-yang committed Sep 4, 2015
2 parents a44a8fe + d64080e commit c2fb549
Show file tree
Hide file tree
Showing 37 changed files with 482 additions and 164 deletions.
32 changes: 29 additions & 3 deletions backend/messages/zh-CN/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,44 @@
'Dashboard' => '仪表盘',
'Setting' => '系统',
'Settings' => '系统',
'Explore' => '探索',
'Cache' => '缓存',
'Content' => '内容',
'User' => '用户',
'Forum' => '论坛',
'Albums' => '相册',
'Blog' => '日志',
'RBAC' => '权限',
'Registered users' => '注册用户',
'Delete' => '删除',
'Save' => '保存',
'Edit' => '修改',
'Add' => '添加',
'Saved successfully' => '保存成功',
'Username does not exist.' => '用户名不存在',
'Incorrect password.' => '密码不正确',
'Service Data Table' => '服务器数据',

'User' => '用户',
'Username' => '用户名',
'Email' => '邮箱',
'Avatar' => '头像',
'Status' => '状态',
'Created At' => '创建时间',
'Updated At' => '更新时间',
'User Id' => '用户 ID',
'User ID' => '用户 ID',

'Forum' => '论坛',
'Forum ID' => '论坛 ID',
'Forum Name' => '论坛名称',
'Forum Description' => '论坛描述',
'Forum Url' => '论坛网址',
'Board Name' => '版块名称',
'Board Description' => '版块描述',

'Parent' => '父级',

'Explore' => '探索',
'Recommendation' => '推荐',
'Create a post' => '发表新文章',

'Site Name' => '站点名称',
'Site Title' => '站点标题',
Expand Down
12 changes: 6 additions & 6 deletions backend/views/explore/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
width: 170px;
}
.add-album {
font-size:100px
font-size:28px
}
.album-cover {
width:158px;
Expand All @@ -41,7 +41,7 @@
<div class="album-item col-md-2 col-sm-6">
<div class="album-img">
<a href="<?= Url::toRoute(['/explore/create', 'category' => 'album']) ?>">
<span class="add-album"><span class="glyphicon glyphicon-plus"></span></span>
<span class="add-album"><span class="glyphicon glyphicon-plus"></span> <?= Yii::t('app', 'Add') ?></span>
</a>
</div>
</div>
Expand Down Expand Up @@ -87,11 +87,11 @@
</div>
</li>
<?php endforeach ?>
<?= InfiniteScrollPager::widget([
'pagination' => $pages,
'widgetId' => '.timeline',
]);?>
</ul>
<?= InfiniteScrollPager::widget([
'pagination' => $pages,
'widgetId' => '.timeline',
]);?>
</div>
<div class="col-md-4">
<div class="panel panel-default">
Expand Down
2 changes: 1 addition & 1 deletion backend/views/site/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<div class="col-xs-12">
<div class="box">
<div class="box-header">
<h3 class="box-title">Service Data Table</h3>
<h3 class="box-title"><?= Yii::t('app', 'Service Data Table') ?></h3>
</div>
<div class="box-body table-responsive">
<table class="table table-bordered table-hover">
Expand Down
10 changes: 0 additions & 10 deletions backend/web/.htaccess

This file was deleted.

3 changes: 2 additions & 1 deletion common/components/Setting.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ public function set($date)
], '`key`=:key', [':key' => $key])->execute();
}

return $this->clearCache();
$this->clearCache();
return true;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion common/config/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
],
'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName'=>false
//'showScriptName'=>false
],
],
];
2 changes: 1 addition & 1 deletion frontend/config/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
'u/<id:[\x{4e00}-\x{9fa5}a-zA-Z0-9_]*>' => 'user/view',
'forum/<id:[\x{4e00}-\x{9fa5}a-zA-Z0-9_]*>' => 'forum/forum/view',
'thread/<id:\d+>' => 'forum/thread/view',
'p/<id:\d+>' => 'home/post/view'
'p/<id:\d+>' => 'user/view/view-post'
],
],
'user' => [
Expand Down
3 changes: 1 addition & 2 deletions frontend/controllers/ExploreController.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ public function actionForums()

public function actionPosts()
{

$query = new Query;
$query->select('e.id, title, content, e.created_at, u.username, u.avatar')
->from('{{%home_post}} as e')
Expand Down Expand Up @@ -140,7 +139,7 @@ public function actionViewPost($id)
Yii::$app->db->createCommand("UPDATE {{%explore_recommend}} SET view_count=view_count+1 WHERE id=:id")->bindValue(':id', $id)->execute();

if ($model['table_name'] == 'home_post') {
return $this->redirect(['/home/post/view', 'id' => $model['table_id']]);
return $this->redirect(['/user/view/view-post', 'id' => $model['table_id']]);
} elseif ($model['table_name'] == 'forum_thread') {
return $this->redirect(['/forum/thread/view', 'id' => $model['table_id']]);
}
Expand Down
2 changes: 2 additions & 0 deletions frontend/messages/zh-CN/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
'Update' => '更新',
'Save' => '保存',
'Create' => '创建',
'Edit' => '编辑',
'Send' => '发送',
'Name' => '名称',
'Upload' => '上传',
Expand Down Expand Up @@ -147,6 +148,7 @@
'Recommendation' => '推荐',

'Are you sure you want to Log out?' => '你确定要退出?',
'You need to sign in or sign up before continuing.' => '在继续之前,您需要登录或注册',
'If you forgot your password you can ' => '如果您忘记密码,请',
'reset it' => '点此重置',
'No data to display.' => '没有数据展示',
Expand Down
1 change: 0 additions & 1 deletion frontend/modules/home/controllers/PostController.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ public function actionIndex()
*/
public function actionView($id)
{
$this->layout = '@app/modules/user/views/layouts/profile';
return $this->render('view', [
'model' => $this->findModel($id),
]);
Expand Down
2 changes: 1 addition & 1 deletion frontend/modules/home/models/Post.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function beforeSave($insert)
*/
public function getUrl()
{
return Url::toRoute(['/home/post/view', 'id' => $this->id]);
return Url::toRoute(['/user/view/post-view', 'id' => $this->id]);
}

public function getUser()
Expand Down
3 changes: 0 additions & 3 deletions frontend/modules/user/controllers/ViewController.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
use app\modules\home\models\Post;
use app\modules\home\models\Album;

/**
* UserController implements the CRUD actions for User model.
*/
class ViewController extends BaseController
{
public $layout = 'profile';
Expand Down
4 changes: 4 additions & 0 deletions frontend/themes/basic/explore/viewPost.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,7 @@
<?= HtmlPurifier::process($model['content']) ?>
</div>
</article>
<?= \app\widgets\comment\Comment::widget([
'tableId' => $model['id'],
'tableName' => '{{%explore_recommend}}',
]) ?>
8 changes: 4 additions & 4 deletions frontend/themes/basic/modules/forum/views/board/_threads.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@
</table>
</article>
<?php endforeach; ?>
<?= InfiniteScrollPager::widget([
'pagination' => $model->threads['pages'],
'widgetId' => '#content',
]);?>
</div>
<?= InfiniteScrollPager::widget([
'pagination' => $model->threads['pages'],
'widgetId' => '#content',
]);?>
<?php else: ?>
<div class="jumbotron">
<h2><?= Yii::t('app', 'No data to display.') ?></h2>
Expand Down
70 changes: 35 additions & 35 deletions frontend/themes/basic/modules/forum/views/forum/broadcast.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,45 +18,45 @@
<?= $this->render('/broadcast/_form', ['newBroadcast' => $newBroadcast]) ?>
<?php endif; ?>
<div class="widget-container">
<div class="thread-list">
<?php if ($model->broadcastCount >= 1): ?>
<?php foreach ($model->broadcasts['result'] as $broadcast):?>
<div class="thread-item" id="div<?php echo $broadcast['id']; ?>">
<div class="media">
<div class="media-body">
<h4 class="media-heading">
<div class="pull-right">
<?php if ($model->user_id == Yii::$app->user->id) :?>
<a href="<?= Url::toRoute(['/forum/broadcast/delete', 'id' => $broadcast['id']]) ?>" data-confirm="<?= Yii::t('app', 'Are you sure to delete it?') ?>" data-method="broadcast">
<span class="glyphicon glyphicon-remove-circle"></span>
</a>
<?php endif; ?>
</div>
</h4>
<a><h3 class="media-title"><?= Html::encode($broadcast['title']) ?></h3></a>
<span class="thread-time">
<span class="glyphicon glyphicon-time"></span> <?= Yii::$app->formatter->asRelativeTime($broadcast['created_at']) ?>
</span>
<div class="media-content">
<?php echo $broadcast['content']; ?>
</div>
<div class="thread-time"></div>
<?php if ($model->broadcastCount >= 1): ?>
<div class="thread-list">
<?php foreach ($model->broadcasts['result'] as $broadcast):?>
<div class="thread-item" id="div<?php echo $broadcast['id']; ?>">
<div class="media">
<div class="media-body">
<h4 class="media-heading">
<div class="pull-right">
<?php if ($model->user_id == Yii::$app->user->id) :?>
<a href="<?= Url::toRoute(['/forum/broadcast/delete', 'id' => $broadcast['id']]) ?>" data-confirm="<?= Yii::t('app', 'Are you sure to delete it?') ?>" data-method="broadcast">
<span class="glyphicon glyphicon-remove-circle"></span>
</a>
<?php endif; ?>
</div>
</h4>
<a><h3 class="media-title"><?= Html::encode($broadcast['title']) ?></h3></a>
<span class="thread-time">
<span class="glyphicon glyphicon-time"></span> <?= Yii::$app->formatter->asRelativeTime($broadcast['created_at']) ?>
</span>
<div class="media-content">
<?php echo $broadcast['content']; ?>
</div>
<div class="thread-time"></div>
</div>
<?php endforeach; ?>
<?= InfiniteScrollPager::widget([
'pagination' => $model->broadcasts['pages'],
'widgetId' => '.thread-list',
]);?>
<?php else: ?>
<div class="widget-container">
<div style="padding:50px">
<h1><?= Yii::t('app', 'No data to display.') ?></h1>
</div>
</div>
<?php endif ?>
</div>
</div>
<?php endforeach; ?>
</div>
<?= InfiniteScrollPager::widget([
'pagination' => $model->broadcasts['pages'],
'widgetId' => '.thread-list',
]);?>
<?php else: ?>
<div class="widget-container">
<div style="padding:50px">
<h1><?= Yii::t('app', 'No data to display.') ?></h1>
</div>
</div>
<?php endif ?>
</div>
</div>
<div class="col-xs-12 col-sm-4 col-md-4">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
use yii\helpers\Html;
use yii\helpers\HtmlPurifier;
use yii\widgets\LinkPager;
use shiyang\infinitescroll\InfiniteScrollPager;

$floor = 1;
if (isset($_GET['page']) >= 2) //分页标识大于2才开始计算
Expand Down
8 changes: 4 additions & 4 deletions frontend/themes/basic/modules/home/views/feed/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@
</div>
</div>
<?php endforeach; ?>
<?= InfiniteScrollPager::widget([
'pagination' => $pages,
'widgetId' => '#content',
]);?>
</div>
<?= InfiniteScrollPager::widget([
'pagination' => $pages,
'widgetId' => '#content',
]);?>
<?php else: ?>
<div class="no-data-found">
<i class="glyphicon glyphicon-folder-open"></i>
Expand Down
8 changes: 4 additions & 4 deletions frontend/themes/basic/modules/home/views/post/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,16 @@
</div>
</article>
<?php endforeach; ?>
<?= InfiniteScrollPager::widget([
'pagination' => $pages,
'widgetId' => '#content',
]);?>
<?php else: ?>
<div class="no-data-found">
<i class="glyphicon glyphicon-folder-open"></i>
<?= Yii::t('app', 'No data to display.') ?>
</div>
<?php endif; ?>
</div>
<?= InfiniteScrollPager::widget([
'pagination' => $pages,
'widgetId' => '#content',
]);?>
</div>
</div>
2 changes: 1 addition & 1 deletion frontend/themes/basic/modules/home/views/post/update.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* @var $model app\modules\home\models\Post */

$this->title = Yii::t('app', 'Update Post:') . ' ' . $model->title;
$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Posts'), 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Blog'), 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->title, 'url' => ['view', 'id' => $model->id]];
$this->params['breadcrumbs'][] = Yii::t('app', 'Update');
?>
Expand Down
Loading

0 comments on commit c2fb549

Please sign in to comment.