From bd707d8c2e855b13c4d72e5c977f2edbad30b780 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 18 Dec 2022 11:13:59 +0000 Subject: [PATCH] from server 18 --- plugins/rainlab/blog/components/Posts.php | 9 +- themes/modern2/meta/menus/new-top-menui.yaml | 171 +++++++++++++++--- themes/modern2/pages/new/afisha-post.htm | 92 ++++++++++ themes/modern2/pages/new/afisha.htm | 39 ++++ themes/modern2/pages/new/group.htm | 14 +- themes/modern2/partials/new/afisha-item.htm | 44 +++++ .../modern2/partials/newHome/main-tender.htm | 4 +- themes/modern2/partials/newHome/poleznoe.htm | 2 +- .../partials/newHome/post-item-img-cat.htm | 7 +- .../partials/newHome/right-sidebar.htm | 4 +- 10 files changed, 345 insertions(+), 41 deletions(-) create mode 100644 themes/modern2/pages/new/afisha-post.htm create mode 100644 themes/modern2/pages/new/afisha.htm create mode 100644 themes/modern2/partials/new/afisha-item.htm diff --git a/plugins/rainlab/blog/components/Posts.php b/plugins/rainlab/blog/components/Posts.php index 6784bdfa9..a7f0e98b8 100644 --- a/plugins/rainlab/blog/components/Posts.php +++ b/plugins/rainlab/blog/components/Posts.php @@ -85,6 +85,12 @@ class Posts extends ComponentBase 'type' => 'string', 'default' => '', ], + 'categoryGroup' => [ + 'title' => 'categoryGroup', + 'description' => 'categoryGroup', + 'type' => 'string', + 'default' => '', + ], 'typePost' => [ 'title' => 'typePost', 'description' => 'typePost', @@ -223,6 +229,7 @@ class Posts extends ComponentBase 'perPage' => $this->property('postsPerPage'), 'featured' => $featured, 'typePost' => empty($this->property('typePost')) ? null : $this->property('typePost'), + 'group' => empty($this->property('categoryGroup')) ? null : $this->property('categoryGroup'), 'search' => trim(input('q')), 'category' => $category, 'date' => input('date'), @@ -234,7 +241,7 @@ class Posts extends ComponentBase ? $this->property('exceptCategories') : preg_split('/,\s*/', $this->property('exceptCategories'), -1, PREG_SPLIT_NO_EMPTY), ]); - + //dd($this->property('categoryGroup')); /* * Add a "url" helper attribute for linking to each post and category */ diff --git a/themes/modern2/meta/menus/new-top-menui.yaml b/themes/modern2/meta/menus/new-top-menui.yaml index 845d4706f..0bb254f85 100644 --- a/themes/modern2/meta/menus/new-top-menui.yaml +++ b/themes/modern2/meta/menus/new-top-menui.yaml @@ -1,9 +1,13 @@ items: - title: Новости + nesting: null type: url url: /ru/new/posts/news code: '' + reference: null + cmsPage: null + replace: null viewBag: locale: en: @@ -18,9 +22,13 @@ items: items: - title: События + nesting: null type: url url: /ru/new/posts/news/events code: '' + reference: null + cmsPage: null + replace: null viewBag: locale: en: @@ -34,9 +42,13 @@ items: isExternal: '0' - title: Watan + nesting: null type: url url: /ru/new/posts/news/watan code: '' + reference: null + cmsPage: null + replace: null viewBag: locale: en: @@ -52,7 +64,7 @@ items: title: Экономика nesting: null type: url - url: /new/group/news/economy + url: /ru/new/posts/news/economy code: '' reference: null cmsPage: null @@ -72,7 +84,7 @@ items: title: Общество nesting: null type: url - url: /new/group/news/society + url: /ru/new/posts/news/society code: '' reference: null cmsPage: null @@ -90,9 +102,13 @@ items: isExternal: '0' - title: Статьи + nesting: null type: url url: /ru/new/posts/stati code: '' + reference: null + cmsPage: null + replace: null viewBag: locale: en: @@ -107,9 +123,13 @@ items: items: - title: Экономика + nesting: null type: url url: /ru/new/posts/stati/economy code: '' + reference: null + cmsPage: null + replace: null viewBag: locale: en: @@ -124,12 +144,12 @@ items: - title: Экомир nesting: null - type: category-blog-posts - url: null + type: url + url: /ru/new/posts/stati/eco-world code: '' - reference: '13' - cmsPage: new/newPost - replace: 0 + reference: null + cmsPage: null + replace: null viewBag: locale: en: @@ -143,9 +163,13 @@ items: isExternal: '0' - title: Технологии + nesting: null type: url url: /ru/new/posts/stati/technology code: '' + reference: null + cmsPage: null + replace: null viewBag: locale: en: @@ -160,12 +184,12 @@ items: - title: Спорт nesting: null - type: category-blog-posts - url: null + type: url + url: /ru/new/posts/stati/sport code: '' - reference: '10' - cmsPage: new/newPost - replace: 0 + reference: null + cmsPage: null + replace: null viewBag: locale: en: @@ -180,12 +204,12 @@ items: - title: События nesting: null - type: category-blog-posts - url: null + type: url + url: /ru/new/posts/stati/events code: '' - reference: '9' - cmsPage: new/newPost - replace: 0 + reference: null + cmsPage: null + replace: null viewBag: locale: en: @@ -200,12 +224,12 @@ items: - title: Полезное nesting: null - type: category-blog-posts - url: null + type: url + url: /ru/new/posts/stati/poleznoe code: '' - reference: '803' - cmsPage: new/newPost - replace: 0 + reference: null + cmsPage: null + replace: null viewBag: locale: en: @@ -239,13 +263,9 @@ items: isExternal: '0' - title: Афиша - nesting: null type: url - url: / + url: /ru/new/posts/poster code: '' - reference: null - cmsPage: null - replace: null viewBag: locale: en: @@ -257,6 +277,103 @@ items: isHidden: '0' cssClass: '' isExternal: '0' + items: + - + title: Театры + type: url + url: /ru/new/posts/poster/teatry + code: '' + viewBag: + locale: + en: + title: '' + url: '' + tm: + title: '' + url: '' + isHidden: '0' + cssClass: '' + isExternal: '0' + - + title: Спорт + type: url + url: /ru/new/posts/poster/sport + code: '' + viewBag: + locale: + en: + title: '' + url: '' + tm: + title: '' + url: '' + isHidden: '0' + cssClass: '' + isExternal: '0' + - + title: Объявления + type: url + url: /ru/new/posts/poster/obyavleniya + code: '' + viewBag: + locale: + en: + title: '' + url: '' + tm: + title: '' + url: '' + isHidden: '0' + cssClass: '' + isExternal: '0' + - + title: Концерты + type: url + url: /ru/new/posts/poster/koncerty + code: '' + viewBag: + locale: + en: + title: '' + url: '' + tm: + title: '' + url: '' + isHidden: '0' + cssClass: '' + isExternal: '0' + - + title: Кинотеатры + type: url + url: /ru/new/posts/poster/kinoteatry + code: '' + viewBag: + locale: + en: + title: '' + url: '' + tm: + title: '' + url: '' + isHidden: '0' + cssClass: '' + isExternal: '0' + - + title: Выставки + type: url + url: /ru/new/posts/poster/vystavki + code: '' + viewBag: + locale: + en: + title: '' + url: '' + tm: + title: '' + url: '' + isHidden: '0' + cssClass: '' + isExternal: '0' - title: Контакты nesting: null diff --git a/themes/modern2/pages/new/afisha-post.htm b/themes/modern2/pages/new/afisha-post.htm new file mode 100644 index 000000000..fa39f25d8 --- /dev/null +++ b/themes/modern2/pages/new/afisha-post.htm @@ -0,0 +1,92 @@ +title = "new/afisha-post" +url = "/new/afisha-post/:id/:slug" +layout = "new/master-inside" +is_hidden = 0 +robot_index = "index" +robot_follow = "follow" + +[views] +slug = "{{ :slug }}" + +[blogPost] +slug = "{{ :slug }}" +id = "{{ :id }}" +categoryPage = 404 +== +{% put styles %} + + + +{% endput %} + +{% set post = blogPost.post %} + +
+
+
+
+ +
+

+ {{post.title}} +

+ {{post.published_at|date('d.m.Y')}} | {{post.published_at|date('H:i')}} +
+ +
+
+
+
+ + {% if post.afisha_address %} +
+
+ +
+ {{ post.afisha_address }} +
+ {% endif %} + + {% if post.afisha_address %} +
+
+ +
+ {{ post.afisha_phone }} +
+ {% endif %} + +
+
+ +
+ 1938 +
+
+
+
+ {% if post.featured_image %} + {{post.title}} + {% endif %} +
+
+
+ {{post.content|md}} +
+
+ + + +
+ {% partial 'newHome/right-sidebar.htm' class="article-aside" %} +
+
+
+ + {% put scripts %} + + {% endput %} \ No newline at end of file diff --git a/themes/modern2/pages/new/afisha.htm b/themes/modern2/pages/new/afisha.htm new file mode 100644 index 000000000..9d1fa7629 --- /dev/null +++ b/themes/modern2/pages/new/afisha.htm @@ -0,0 +1,39 @@ +title = "new/afisha" +url = "/new/afisha/:slug" +layout = "new/master-inside" +is_hidden = 0 +robot_index = "index" +robot_follow = "follow" + +[blogPosts] +pageNumber = "{{ :page }}" +categoryFilter = "{{ :slug }}" +postsPerPage = 10 +noPostsMessage = "No posts found" +sortOrder = "published_at desc" +categoryPage = 404 +postPage = 404 +== +
+
+
+ +
+ + {% for post in blogPosts.posts %} + {% partial 'new/afisha-item' post = post %} + {% else %} +

No posts found

+ {% endfor %} + + +
+ + {% partial 'new/pagination' items = blogPosts.posts %} + +
+
+
\ No newline at end of file diff --git a/themes/modern2/pages/new/group.htm b/themes/modern2/pages/new/group.htm index 03d4008c5..080f2a0d9 100644 --- a/themes/modern2/pages/new/group.htm +++ b/themes/modern2/pages/new/group.htm @@ -1,5 +1,5 @@ title = "new/group/category" -url = "/new/posts/:group/:slug?" +url = "/new/posts/:categoryGroup/:slug?" layout = "new/master-inside" is_hidden = 0 robot_index = "index" @@ -8,6 +8,7 @@ robot_follow = "follow" [blogPosts] pageNumber = "{{ :page }}" categoryFilter = "{{ :slug }}" +Group Filter = "{{ :categoryGroup }}" postsPerPage = 10 noPostsMessage = "No posts found" sortOrder = "published_at desc" @@ -15,11 +16,12 @@ categoryPage = "new/category" postPage = "new/newPost" == param('group'); - -} +// $this['group'] = $this->param('categoryGroup'); +// $this['groupName'] = RainLab\Blog\Models\CategoryGroup::where('slug', $this['group'])->first(); + //dd( $this['groupName']); +//} ?> == @@ -27,7 +29,7 @@ function onStart(){
diff --git a/themes/modern2/partials/new/afisha-item.htm b/themes/modern2/partials/new/afisha-item.htm new file mode 100644 index 000000000..16108934d --- /dev/null +++ b/themes/modern2/partials/new/afisha-item.htm @@ -0,0 +1,44 @@ +[viewBag] +== + +
+ {% if post.featured_image %} + {{post.title}} + {% endif %} +
+
+
+

{{post.published_at|date('d.m.Y')}}

+ | +

{{post.published_at|date('H:i')}}

+
+

{{post.title}}

+
+ + {% if post.afisha_address %} +
+
+ +
+ {{ post.afisha_address }} +
+ {% endif %} + + {% if post.afish_phone %} +
+
+ +
+ {{ post.afish_phone }} +
+ {%endif%} + +
+
+ +
+ 1938 +
+
+
+
\ No newline at end of file diff --git a/themes/modern2/partials/newHome/main-tender.htm b/themes/modern2/partials/newHome/main-tender.htm index 272392e18..1408f43f0 100644 --- a/themes/modern2/partials/newHome/main-tender.htm +++ b/themes/modern2/partials/newHome/main-tender.htm @@ -3,7 +3,7 @@ with('category_items')->first(); +$this['afisha'] = RainLab\Blog\Models\CategoryGroup::where('slug', 'poster')->with('category_items')->first(); } ?> @@ -36,7 +36,7 @@ $this['afisha'] = RainLab\Blog\Models\CategoryGroup::where('slug', 'afisha')->wi

{{afisha.name}}

{% for category in afisha.category_items %} - {{ category.name }} + {{ category.name }} {% else %} No Record diff --git a/themes/modern2/partials/newHome/poleznoe.htm b/themes/modern2/partials/newHome/poleznoe.htm index 619610152..f69773a25 100644 --- a/themes/modern2/partials/newHome/poleznoe.htm +++ b/themes/modern2/partials/newHome/poleznoe.htm @@ -51,7 +51,7 @@ postPage = 404 {% for post in mediaPosts %} - {% partial 'newHome/media-post-item' post=post %} + {% partial 'newHome/post-item-img-cat' post=post categoryHidden=true %} {% endfor %} diff --git a/themes/modern2/partials/newHome/post-item-img-cat.htm b/themes/modern2/partials/newHome/post-item-img-cat.htm index a9fc73392..097733768 100644 --- a/themes/modern2/partials/newHome/post-item-img-cat.htm +++ b/themes/modern2/partials/newHome/post-item-img-cat.htm @@ -6,8 +6,11 @@