From 132a4febbcb7b743bf75e9545e4aa4f5e9717e3d Mon Sep 17 00:00:00 2001 From: root Date: Wed, 24 Nov 2021 12:28:48 +0000 Subject: [PATCH] server --- .../tps/reklama/components/Advertisement.php | 15 +- .../components/advertisement/redirect.htm | 18 +- .../components/advertisement/slider.htm | 3 + .../tps/reklama/models/reklama/columns.yaml | 10 +- themes/modern2/assets/css/style.css | 7 + themes/modern2/layouts/cms.htm | 1 + themes/modern2/layouts/contacts.htm | 6 + themes/modern2/layouts/master.htm | 2 + themes/modern2/layouts/static.htm | 7 +- themes/modern2/pages/home2.htm | 212 ++++++++++++++++++ themes/modern2/pages/index.htm | 70 +++++- themes/modern2/pages/post.htm | 32 +++ themes/modern2/partials/head.htm | 3 +- .../modern2/partials/index/category_posts.htm | 6 +- .../partials/index/category_posts2.htm | 40 ++++ themes/modern2/partials/popular-posts.htm | 7 +- themes/modern2/partials/popular-posts2.htm | 31 +++ 17 files changed, 451 insertions(+), 19 deletions(-) create mode 100644 themes/modern2/pages/home2.htm create mode 100644 themes/modern2/partials/index/category_posts2.htm create mode 100644 themes/modern2/partials/popular-posts2.htm diff --git a/plugins/tps/reklama/components/Advertisement.php b/plugins/tps/reklama/components/Advertisement.php index ea869f545..0ac950f03 100644 --- a/plugins/tps/reklama/components/Advertisement.php +++ b/plugins/tps/reklama/components/Advertisement.php @@ -117,12 +117,15 @@ class Advertisement extends ComponentBase $statistika->increment('click'); } - if($data['url']){ - $this->page['url'] = $data['url']; - return [ - '@#'.$this->alias => $this->renderPartial('@redirect'), - ]; - } + //if($data['url']){ + + // $this->page['url'] = $data['url']; + //return Redirect::to($data['url']); + // return [ + // '@#'.$this->alias => $this->renderPartial('@redirect'), + //]; + + //} } } diff --git a/plugins/tps/reklama/components/advertisement/redirect.htm b/plugins/tps/reklama/components/advertisement/redirect.htm index 5c374432e..681ca8d66 100644 --- a/plugins/tps/reklama/components/advertisement/redirect.htm +++ b/plugins/tps/reklama/components/advertisement/redirect.htm @@ -1,3 +1,19 @@ diff --git a/plugins/tps/reklama/components/advertisement/slider.htm b/plugins/tps/reklama/components/advertisement/slider.htm index 1897f0791..fb992821b 100644 --- a/plugins/tps/reklama/components/advertisement/slider.htm +++ b/plugins/tps/reklama/components/advertisement/slider.htm @@ -8,6 +8,7 @@ {% else %} href="{{reklama.url|default('#')}}" target="_blank" {% endif %} + onclick='window.open("{{reklama.url}}", "_blank");' > @@ -16,8 +17,10 @@ {% endfor %} + {% if __SELF__.property('random') %} diff --git a/themes/modern2/layouts/contacts.htm b/themes/modern2/layouts/contacts.htm index d03f80e73..2b352e86c 100644 --- a/themes/modern2/layouts/contacts.htm +++ b/themes/modern2/layouts/contacts.htm @@ -42,6 +42,12 @@ random = 0 ============================================= --> {% framework extras %} + diff --git a/themes/modern2/layouts/master.htm b/themes/modern2/layouts/master.htm index 6f6b10959..d9c123c40 100644 --- a/themes/modern2/layouts/master.htm +++ b/themes/modern2/layouts/master.htm @@ -36,11 +36,13 @@ random = 0 {% partial 'footer' %} + {% framework extras %} {% scripts %} + diff --git a/themes/modern2/layouts/static.htm b/themes/modern2/layouts/static.htm index b4b3fee76..1b9da8f38 100644 --- a/themes/modern2/layouts/static.htm +++ b/themes/modern2/layouts/static.htm @@ -33,7 +33,12 @@ random = 0 ============================================= --> {% framework extras %} - + diff --git a/themes/modern2/pages/home2.htm b/themes/modern2/pages/home2.htm new file mode 100644 index 000000000..9f28840e0 --- /dev/null +++ b/themes/modern2/pages/home2.htm @@ -0,0 +1,212 @@ +title = "home2" +url = "/home2" +layout = "master" +is_hidden = 0 +robot_index = "index" +robot_follow = "follow" + +[blogCategories] +slug = "{{ :slug }}" +displayEmpty = 0 +categoryPage = "category" + +[adverts adv_center_1] +code = "bank" +type = "slider" +random = 0 + +[adverts adv_center_2] +code = "bottom" +type = "slider" +random = 0 + +[adverts adv_center_3] +code = "cnpc" +type = "slider" +random = 0 + +[adverts adv_center_4] +code = "china-daily" +type = "slider" +random = 0 + +[adverts adv_center_5] +code = "very-bottom" +type = "slider" +random = 0 + +[adverts right_top] +code = "right-top" +type = "slider" +random = 0 + +[adverts right_middle] +code = "right-middle" +type = "slider" +random = 0 + +[adverts right_bottom] +code = "right-bottom" +type = "slider" +random = 0 + +[adverts right_top_m] +code = "right-top" +type = "slider" +random = 0 + +[adverts right_middle_m] +code = "right-middle" +type = "slider" +random = 0 + +[adverts right_bottom_m] +code = "right-bottom" +type = "slider" +random = 0 +== + +
+
+
+ {% partial 'slider' %} +
+
+
+ + +
+
+
+
+
+ {% component 'adv_center_1' %} +
+ + {% partial 'index/top_section' category = blogCategories.categories.shift %} + +
+ {% component 'adv_center_2' %} +
+
+
+ {% partial 'index/category_posts2' category = blogCategories.categories.shift %} + + {% partial 'index/category_posts2' category = blogCategories.categories.shift %} +
+
+
+ {% component 'adv_center_3' %} +
+
+
+ {% partial 'index/category_posts2' category = blogCategories.categories.shift %} + + {% partial 'index/category_posts2' category = blogCategories.categories.shift %} +
+
+
+ {% component 'adv_center_4' %} +
+
+
+ {% partial 'index/category_posts2' category = blogCategories.categories.shift %} + + {% partial 'index/category_posts2' category = blogCategories.categories.shift %} +
+
+
+ {% component 'adv_center_5' %} +
+ +
+
+ {% partial 'sidebar__cards' %} + {% component 'right_top' css_class= 'main__sidebar-adv' %} + {% partial 'popular-posts2' %} + {% component 'right_middle' css_class = 'main__sidebar-adv' %} + {% component 'right_bottom' css_class= 'main__sidebar-adv' %} + {% component 'right_top' css_class= 'main__sidebar-adv' %} + {% partial 'tags' %} + {% partial 'calendar' %} +
+
+
+
+ +{% partial 'index/mobile_app' %} + + + \ No newline at end of file diff --git a/themes/modern2/pages/index.htm b/themes/modern2/pages/index.htm index a15fc0302..b8ca0cc8e 100644 --- a/themes/modern2/pages/index.htm +++ b/themes/modern2/pages/index.htm @@ -74,6 +74,71 @@ code = "right-bottom" type = "slider" random = 0 == +
@@ -139,11 +204,10 @@ random = 0 {% partial 'sidebar__cards' %} {% component 'right_top' css_class= 'main__sidebar-adv' %} {% partial 'popular-posts' %} - {% partial 'tenders' %} - {% partial 'tags' %} {% component 'right_middle' css_class = 'main__sidebar-adv' %} - {% partial 'calendar' %} {% component 'right_bottom' css_class= 'main__sidebar-adv' %} + {% partial 'tags' %} + {% partial 'calendar' %}
diff --git a/themes/modern2/pages/post.htm b/themes/modern2/pages/post.htm index 96f99f77f..f11d7d14b 100644 --- a/themes/modern2/pages/post.htm +++ b/themes/modern2/pages/post.htm @@ -20,6 +20,38 @@ slug = "{{ :slug }}" [SeoBlogPost] post = "post" == + {% component 'SeoBlogPost' %}
diff --git a/themes/modern2/partials/head.htm b/themes/modern2/partials/head.htm index 066a88f8b..7a6db935b 100644 --- a/themes/modern2/partials/head.htm +++ b/themes/modern2/partials/head.htm @@ -15,4 +15,5 @@ - \ No newline at end of file + + \ No newline at end of file diff --git a/themes/modern2/partials/index/category_posts.htm b/themes/modern2/partials/index/category_posts.htm index 344ac1448..1ce494da7 100644 --- a/themes/modern2/partials/index/category_posts.htm +++ b/themes/modern2/partials/index/category_posts.htm @@ -1,7 +1,7 @@ [viewBag] == -{% set posts = category.take_posts(4) %} -
+{% set posts = category.take_posts(3) %} +
{{category.name}} @@ -37,4 +37,4 @@ {% partial 'index/category_post_item' post = post %} {% endfor %}
-
+
\ No newline at end of file diff --git a/themes/modern2/partials/index/category_posts2.htm b/themes/modern2/partials/index/category_posts2.htm new file mode 100644 index 000000000..1ce494da7 --- /dev/null +++ b/themes/modern2/partials/index/category_posts2.htm @@ -0,0 +1,40 @@ +[viewBag] +== +{% set posts = category.take_posts(3) %} +
+
+
+ {{category.name}} +
+ + {{'page.more'|_}} + +
+ + {{posts.first.title}} + +
+
+
+
+ {{category.name}} +
+
+
+ +
+ + {{posts.first.title}} + +
+{% for post in posts.slice(1) %} + {% partial 'index/category_post_item' post = post %} +{% endfor %} +
+
\ No newline at end of file diff --git a/themes/modern2/partials/popular-posts.htm b/themes/modern2/partials/popular-posts.htm index f2da7341c..0351b69e6 100644 --- a/themes/modern2/partials/popular-posts.htm +++ b/themes/modern2/partials/popular-posts.htm @@ -1,11 +1,12 @@ description = "popular-posts" +[viewBag] + [popularPosts] -postsLimit = 10 +category = "{{ :category }}" +postsLimit = 5 noPostsMessage = "No posts found" postPage = "post" - -[viewBag] ==
diff --git a/themes/modern2/partials/popular-posts2.htm b/themes/modern2/partials/popular-posts2.htm new file mode 100644 index 000000000..6320d2571 --- /dev/null +++ b/themes/modern2/partials/popular-posts2.htm @@ -0,0 +1,31 @@ +[popularPosts] +category = "{{ :category }}" +postsLimit = 5 +noPostsMessage = "No posts found" +postPage = "post" + +[viewBag] +== +
+
+

{{'Самое читаемое'|_}}

+
+
+ {% for post in posts %} +
+
+

{{ post.categories.first.name }}

+ +
+ +
+
+ {% endfor %} +
\ No newline at end of file