From 9ceb5bebaea1137b9fbedd950ad1558601d18f50 Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 25 Sep 2017 18:52:11 +0300 Subject: [PATCH] -Blog started --- backend/config/main.php | 3 +++ backend/views/layouts/menu_items.php | 22 ++++++++++++++++++++++ common/config/bootstrap.php | 3 +++ common/config/main.php | 4 ++++ composer.json | 7 ++++++- frontend/controllers/BlogController.php | 18 ++++++++++++++++++ frontend/views/blog/index.php | 176 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 232 insertions(+), 1 deletion(-) create mode 100644 frontend/controllers/BlogController.php create mode 100644 frontend/views/blog/index.php diff --git a/backend/config/main.php b/backend/config/main.php index dad1624..6c527c0 100755 --- a/backend/config/main.php +++ b/backend/config/main.php @@ -23,6 +23,9 @@ 'alias' => 'artbox\core\controllers\AliasController', 'seo' => 'artbox\core\controllers\SeoController', 'feedback' => 'artbox\core\controllers\FeedbackController', + 'blog-article' => 'artbox\weblog\controllers\ArticleController', + 'blog-category' => 'artbox\weblog\controllers\CategoryController', + 'blog-tag' => 'artbox\weblog\controllers\TagController', ], 'components' => [ 'assetManager' => [ diff --git a/backend/views/layouts/menu_items.php b/backend/views/layouts/menu_items.php index 38a8bb5..004d7ab 100755 --- a/backend/views/layouts/menu_items.php +++ b/backend/views/layouts/menu_items.php @@ -74,6 +74,28 @@ ], ], [ + 'label' => \Yii::t('core', 'Blog'), + 'url' => '#', + 'icon' => 'pencil', + 'items' => [ + [ + 'label' => \Yii::t('blog', 'Articles'), + 'url' => [ '/blog-article/index' ], + 'icon' => 'file-text', + ], + [ + 'label' => \Yii::t('blog', 'Categories'), + 'url' => [ '/blog-category/index' ], + 'icon' => 'list', + ], + [ + 'label' => \Yii::t('blog', 'Tags'), + 'url' => [ '/blog-tag/index' ], + 'icon' => 'code', + ], + ], + ], + [ 'label' => \Yii::t('core', 'Image manager'), 'url' => [ '/imagemanager' ], 'icon' => 'image', diff --git a/common/config/bootstrap.php b/common/config/bootstrap.php index 6828027..9dee74a 100755 --- a/common/config/bootstrap.php +++ b/common/config/bootstrap.php @@ -6,4 +6,7 @@ Yii::setAlias('@storage', dirname(dirname(__DIR__)) . '/storage'); if (!Yii::getAlias('@artbox/core', false)) { Yii::setAlias('@artbox/core', dirname(dirname(__DIR__)) . '/artweb/artbox-core'); + } + if (!Yii::getAlias('@artbox/weblog', false)) { + Yii::setAlias('@artbox/weblog', dirname(dirname(__DIR__)) . '/artweb/artbox-weblog'); } \ No newline at end of file diff --git a/common/config/main.php b/common/config/main.php index 64184b7..da8f8da 100755 --- a/common/config/main.php +++ b/common/config/main.php @@ -32,6 +32,10 @@ 'class' => 'yii\i18n\PhpMessageSource', 'basePath' => '@common/messages', ], + 'blog' => [ + 'class' => 'yii\i18n\PhpMessageSource', + 'basePath' => '@artbox/weblog/messages', + ], ], ], 'filedb' => [ diff --git a/composer.json b/composer.json index f384886..09e2ba7 100755 --- a/composer.json +++ b/composer.json @@ -31,7 +31,8 @@ "speixoto/yii2-amcharts": "^0.1.1", "2amigos/yii2-tinymce-widget": "~1.1", "kartik-v/yii2-widget-select2": "@dev", - "artweb/artbox-core": "@dev" + "artweb/artbox-core": "@dev", + "artweb/artbox-weblog": "@dev" }, "require-dev": { "yiisoft/yii2-debug": "~2.0.0", @@ -53,6 +54,10 @@ { "type": "vcs", "url": "git@gitlab.artweb.com.ua:yarik.nechyporuk/artbox-core.git" + }, + { + "type": "vcs", + "url": "git@gitlab.artweb.com.ua:Alexey/artbox-weblog.git" } ] } diff --git a/frontend/controllers/BlogController.php b/frontend/controllers/BlogController.php new file mode 100644 index 0000000..a90ce3c --- /dev/null +++ b/frontend/controllers/BlogController.php @@ -0,0 +1,18 @@ +render('index'); + } + } \ No newline at end of file diff --git a/frontend/views/blog/index.php b/frontend/views/blog/index.php new file mode 100644 index 0000000..a6596ef --- /dev/null +++ b/frontend/views/blog/index.php @@ -0,0 +1,176 @@ + + +
+
+
+ + +
+ +
+

Fashion now

+
+
+

By John Snow in Webdesign +

+
+ +
+
+ + Example blog post alt + +
+

Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean + ultricies mi vitae est. Mauris placerat eleifend leo.

+

Continue reading +

+
+ + +
+

Who is who - example blog post

+
+
+

By John Snow in Webdesign +

+
+ +
+
+
+ +
+ +
+

Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean + ultricies mi vitae est. Mauris placerat eleifend leo.

+

Continue reading +

+
+ + + + +
+ + + + + + +
+ + + + + + + + + + + + +
+ + + + +
+ +
+ +
\ No newline at end of file -- libgit2 0.21.4