Skip to content

Commit

Permalink
xiaoxiugai
Browse files Browse the repository at this point in the history
  • Loading branch information
yidashi committed Jun 4, 2016
1 parent e54bee6 commit 56415dc
Show file tree
Hide file tree
Showing 7 changed files with 98 additions and 53 deletions.
10 changes: 5 additions & 5 deletions common/models/Article.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ public function rules()
['status', 'in', 'range' => [self::STATUS_ACTIVE, self::STATUS_INIT]],
[['category_id'], 'setCategory'],
['category_id', 'exist', 'targetClass' => Category::className(), 'targetAttribute' => 'id'],
[['title', 'category', 'author'], 'string', 'max' => 50],
[['author', 'cover', 'source'], 'string', 'max' => 255],
[['title', 'category'], 'string', 'max' => 50],
[['cover', 'source'], 'string', 'max' => 255],
[['desc', 'tagNames'], 'safe']
];
}
Expand All @@ -72,7 +72,6 @@ public function attributeLabels()
return [
'id' => Yii::t('common', 'ID'),
'title' => '标题',
'author' => '作者',
'created_at' => Yii::t('common', 'Created At'),
'updated_at' => Yii::t('common', 'Updated At'),
'deleted_at' => '删除时间',
Expand All @@ -83,7 +82,8 @@ public function attributeLabels()
'category' => '分类',
'source' => '来源连接',
'desc' => '摘要',
'tagNames' => '标签'
'tagNames' => '标签',
'user_id' => '作者'
];
}
public function attributeHints()
Expand Down Expand Up @@ -113,7 +113,7 @@ public function behaviors()

/**
* @inheritdoc
* @return ActiveQuery the newly created [[ActiveQuery]] instance.
* @return ArticleQuery the newly created [[ActiveQuery]] instance.
*/
public static function find()
{
Expand Down
47 changes: 35 additions & 12 deletions composer.lock

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

1 change: 0 additions & 1 deletion console/migrations/init.sql
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ CREATE TABLE `pop_article` (
`title` varchar(50) NOT NULL COMMENT '标题',
`category` varchar(50) NOT NULL COMMENT '分类',
`category_id` int(11) NOT NULL,
`author` varchar(100) NOT NULL COMMENT '作者',
`published_at` int(10) NOT NULL,
`created_at` int(10) NOT NULL,
`updated_at` int(10) NOT NULL,
Expand Down
3 changes: 1 addition & 2 deletions frontend/themes/basic/my/_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

/* @var $this yii\web\View */
/* @var $model common\models\Article */
/* @var $dataModel common\models\ArticleData */
/* @var $form yii\widgets\ActiveForm */
?>

Expand All @@ -18,8 +19,6 @@

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

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

<?= $form->field($model, 'category_id')->dropDownList(\common\models\Category::find()->select('title')->indexBy('id')->column()) ?>

<?= $form->field($model, 'cover')->widget('yidashi\webuploader\Webuploader') ?>
Expand Down
3 changes: 2 additions & 1 deletion vendor/composer/autoload_psr4.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
'yii\\' => array($vendorDir . '/yiisoft/yii2'),
'yidashi\\webuploader\\' => array($vendorDir . '/yidashi/yii2-webuploader'),
'yidashi\\sidenav\\' => array($vendorDir . '/yidashi/yii2-sidenav'),
'yidashi\\markdown\\' => array($vendorDir . '/yidashi/yii2-boostrap-markdown', $vendorDir . '/yidashi/yii2-bootstrap-markdown'),
'yidashi\\markdown\\' => array($vendorDir . '/yidashi/yii2-bootstrap-markdown'),
'trntv\\yii\\datetime\\' => array($vendorDir . '/trntv/yii2-datetime-widget/src'),
'rmrevin\\yii\\fontawesome\\' => array($vendorDir . '/rmrevin/yii2-fontawesome'),
'mihaildev\\elfinder\\' => array($vendorDir . '/mihaildev/yii2-elfinder'),
Expand All @@ -45,4 +45,5 @@
'GuzzleHttp\\' => array($vendorDir . '/guzzlehttp/guzzle/src'),
'Goutte\\' => array($vendorDir . '/fabpot/goutte/Goutte'),
'Faker\\' => array($vendorDir . '/fzaninotto/faker/src/Faker'),
'Dotenv\\' => array($vendorDir . '/vlucas/phpdotenv/src'),
);
81 changes: 52 additions & 29 deletions vendor/composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -2544,35 +2544,6 @@
"notification-url": "https://packagist.org/downloads/",
"description": "yii2-webuploader"
},
{
"name": "yidashi/yii2-boostrap-markdown",
"version": "v1.0.2",
"version_normalized": "1.0.2.0",
"source": {
"type": "git",
"url": "https://github.com/yidashi/yii2-bootstrap-markdown.git",
"reference": "156c87428b4177662656a0443674cb21b0875af6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/yidashi/yii2-bootstrap-markdown/zipball/156c87428b4177662656a0443674cb21b0875af6",
"reference": "156c87428b4177662656a0443674cb21b0875af6",
"shasum": ""
},
"require": {
"php": ">=5.4.0"
},
"time": "2015-12-15 10:32:15",
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-4": {
"yidashi\\markdown\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"description": "yii2-boostrap-markdown"
},
{
"name": "yidashi/yii2-bootstrap-markdown",
"version": "v1.0.3",
Expand Down Expand Up @@ -2881,5 +2852,57 @@
"sdk",
"storage"
]
},
{
"name": "vlucas/phpdotenv",
"version": "v2.2.1",
"version_normalized": "2.2.1.0",
"source": {
"type": "git",
"url": "https://github.com/vlucas/phpdotenv.git",
"reference": "63f37b9395e8041cd4313129c08ece896d06ca8e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/63f37b9395e8041cd4313129c08ece896d06ca8e",
"reference": "63f37b9395e8041cd4313129c08ece896d06ca8e",
"shasum": ""
},
"require": {
"php": ">=5.3.9"
},
"require-dev": {
"phpunit/phpunit": "^4.8 || ^5.0"
},
"time": "2016-04-15 10:48:49",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.2-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-4": {
"Dotenv\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause-Attribution"
],
"authors": [
{
"name": "Vance Lucas",
"email": "[email protected]",
"homepage": "http:https://www.vancelucas.com"
}
],
"description": "Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.",
"keywords": [
"dotenv",
"env",
"environment"
]
}
]
6 changes: 3 additions & 3 deletions web/css/site.css
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ h4 { font-size: 16px; }
.navbar-brand { padding-top: 0; padding-right: 0; }
.navbar-right > li:first-child > a { position: relative; }
.navbar-right > li > a.avatar { padding-top: 10px; padding-bottom: 0; }
.navbar-right > li > a.avatar img { border-radius: 50%; border: #ccc solid 1px; width: 32px; height: 32px; }
.navbar-right > li > a.avatar img { border-radius: 50%; width: 32px; height: 32px; }
.navbar-right > li .badge { background: #D8582B; padding: 2px 4px; font-size: 10px; font-weight: normal; position: absolute; top: 10px; left: 25px; }
.navbar-right .dropdown-menu .divider { margin: 5px 0; }
/* 主导航结束 */
Expand Down Expand Up @@ -567,9 +567,9 @@ table.emot td {cursor: pointer; border: #eee solid 1px; padding: 2px;}
z-index: 20140628;
}
/* 头像开始 */
.panel img { width: 40px; height: 40px; padding: 1px; border: #ddd solid 1px; border-radius: 4px; }
.panel img { width: 40px; height: 40px; padding: 1px; border-radius: 4px; }
.media-object, .media-user .media-object { width: 48px; height: 48px; padding: 2px; border: #ddd solid 1px; border-radius: 6px; -webkit-box-shadow: 0px 1px 2px rgba(0, 0, 0, .05); box-shadow: 0px 1px 2px rgba(0, 0, 0, .05); }
.avatar img, .online img { border-radius: 4px; border: #fff solid 1px; width: 36px; height: 36px; }
.avatar img, .online img { border-radius: 4px; width: 36px; height: 36px; }
.user img.avatar { width: 120px; height: 120px; border-radius: 50%; }
.thumbnail a > img.media-object { max-width: 48px; }
.avatar-list { margin: -7px; }
Expand Down

0 comments on commit 56415dc

Please sign in to comment.