Skip to content

Commit

Permalink
bug
Browse files Browse the repository at this point in the history
  • Loading branch information
yidashi committed Jun 18, 2016
1 parent 370bc0f commit 98f076f
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 14 deletions.
10 changes: 5 additions & 5 deletions backend/views/article/_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@

<?= $form->field($model, 'cover')->widget('yidashi\webuploader\Webuploader') ?>

<?= $form->field($model, 'status')->radioList(['待审', '激活']) ?>
<?= $form->field($model, 'status')->checkbox() ?>

</div>
<div class="tab-pane" id="tab_2">
<?= $form->field($model, 'published_at')->widget(
\trntv\yii\datetime\DateTimeWidget::className(),
\kartik\datetime\DateTimePicker::className(),
[
'phpDatetimeFormat' => 'yyyy-MM-dd HH:mm:ss',
'phpMomentMapping' => ['yyyy-MM-dd HH:mm:ss' => 'YYYY-MM-DD HH:mm:ss'],
'locale' => 'zh-cn'
'type' => 1,
'convertFormat' => true,
'pluginOptions' => ['format' => 'php:Y-m-d H:i:s']
]
) ?>
<?= $form->field($model, 'desc')->textarea()?>
Expand Down
8 changes: 7 additions & 1 deletion backend/views/article/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@
'dataProvider' => $dataProvider,
'columns' => [
'id',
'title',
[
'attribute' => 'title',
'value' => function($model) {
return \common\helpers\Html::a($model->title, env('FRONTEND_URL') . '/' . $model->id . '.html', ['target' => '_blank']);
},
'format' => 'raw'
],
'category',
'status:boolean',
// 'author',
Expand Down
2 changes: 1 addition & 1 deletion backend/views/category/_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

<?= $form->field($model, 'title')->textInput(['maxlength' => true]) ?>

<?= $form->field($model, 'is_nav')->radioList(['', '']) ?>
<?= $form->field($model, 'is_nav')->checkbox() ?>

<?= $form->field($model, 'sort')->textInput() ?>

Expand Down
2 changes: 1 addition & 1 deletion common/models/Article.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function attributeLabels()
'updated_at' => Yii::t('common', 'Updated At'),
'deleted_at' => '删除时间',
'published_at' => '发布时间',
'status' => '状态',
'status' => '审核',
'cover' => '封面',
'category_id' => '分类',
'category' => '分类',
Expand Down
12 changes: 6 additions & 6 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions web/admin/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
// Environment
(new \Dotenv\Dotenv(dirname(dirname(__DIR__))))->load();

defined('YII_DEBUG') or define('YII_DEBUG', env('YII_DEBUG'));
defined('YII_ENV') or define('YII_ENV', env('YII_ENV', 'prod'));

require __DIR__.'/../../vendor/yiisoft/yii2/Yii.php';

// Config
Expand Down
3 changes: 3 additions & 0 deletions web/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
// Environment
(new \Dotenv\Dotenv(dirname(__DIR__)))->load();

defined('YII_DEBUG') or define('YII_DEBUG', env('YII_DEBUG'));
defined('YII_ENV') or define('YII_ENV', env('YII_ENV', 'prod'));

require __DIR__.'/../vendor/yiisoft/yii2/Yii.php';

// Config
Expand Down
3 changes: 3 additions & 0 deletions yii
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ require __DIR__.'/vendor/autoload.php';
// Environment
(new \Dotenv\Dotenv(__DIR__))->load();

defined('YII_DEBUG') or define('YII_DEBUG', env('YII_DEBUG'));
defined('YII_ENV') or define('YII_ENV', env('YII_ENV', 'prod'));

require(__DIR__ . '/vendor/yiisoft/yii2/Yii.php');


Expand Down

0 comments on commit 98f076f

Please sign in to comment.