From 42595e1513ec247f39546361f027773e5b31bbcb Mon Sep 17 00:00:00 2001 From: merdan Date: Mon, 15 Mar 2021 11:59:08 +0500 Subject: [PATCH] view statistics --- plugins/rainlab/blog/components/Posts.php | 2 +- .../powerseo/components/StaticPage.php | 6 +++--- themes/modern/config/lang.yaml | 2 ++ themes/modern/layouts/cms.htm | 4 ++-- themes/modern/layouts/contacts.htm | 4 ++-- themes/modern/layouts/master.htm | 4 ++-- themes/modern/layouts/static.htm | 4 ++-- themes/modern/pages/category.htm | 4 +++- themes/modern/partials/post_list_item.htm | 17 +++++++++-------- 9 files changed, 26 insertions(+), 21 deletions(-) diff --git a/plugins/rainlab/blog/components/Posts.php b/plugins/rainlab/blog/components/Posts.php index 9f3bb1327..8b12faa67 100644 --- a/plugins/rainlab/blog/components/Posts.php +++ b/plugins/rainlab/blog/components/Posts.php @@ -202,7 +202,7 @@ class Posts extends ComponentBase */ $isPublished = !$this->checkEditor(); - $posts = BlogPost::with(['categories', 'featured_images'])->listFrontEnd([ + $posts = BlogPost::with(['categories'])->listFrontEnd([ 'page' => $this->property('pageNumber'), 'sort' => $this->property('sortOrder'), 'perPage' => $this->property('postsPerPage'), diff --git a/plugins/suresoftware/powerseo/components/StaticPage.php b/plugins/suresoftware/powerseo/components/StaticPage.php index c50a3a835..75866c1e4 100644 --- a/plugins/suresoftware/powerseo/components/StaticPage.php +++ b/plugins/suresoftware/powerseo/components/StaticPage.php @@ -59,10 +59,10 @@ class StaticPage extends ComponentBase $this->page = $this->page['page'] = $router->findByUrl($url); if ($this->page) { - $this->seo_title = $this->page['seo_title'] = $this->page->viewBag['meta_title']; + $this->seo_title = $this->page['seo_title'] = $this->page->viewBag['meta_title'] ?? ''; $this->title = $this->page['title'] = $this->page->viewBag['title']; - $this->seo_description = $this->page['seo_description'] = $this->page->viewBag['meta_description']; - $this->seo_keywords = $this->page['seo_keywords'] = $this->page->viewBag['meta_keywords']; + $this->seo_description = $this->page['seo_description'] = $this->page->viewBag['meta_description'] ?? ''; + $this->seo_keywords = $this->page['seo_keywords'] = $this->page->viewBag['meta_keywords'] ?? ''; // $this->canonical_url = $this->page['canonical_url'] = $this->page->getViewBag()->property('canonical_url'); // $this->redirect_url = $this->page['redirect_url'] = $this->page->getViewBag()->property('redirect_url'); $this->robot_index = $this->page['robot_index'] = $this->page->getViewBag()->property('robot_index'); diff --git a/themes/modern/config/lang.yaml b/themes/modern/config/lang.yaml index c5aacfba6..18a50201d 100644 --- a/themes/modern/config/lang.yaml +++ b/themes/modern/config/lang.yaml @@ -13,6 +13,7 @@ en: contact.address: 'Address' contact.phone: 'Phone' contact.feedback: 'Feedback' + post.not_found: 'No posts found' footer.copyright: 'ORIENT - INFORMATION AGENCY' ru: site.name: 'Ориент' @@ -29,5 +30,6 @@ ru: contact.address: 'Наш адрес' contact.phone: 'Тел' contact.feedback: 'Обратная связь' + post.not_found: 'Записей не найдено' footer.copyright: 'ORIENT - ИНФОРМАЦИОННОЕ АГЕНТСТВО' diff --git a/themes/modern/layouts/cms.htm b/themes/modern/layouts/cms.htm index 97821df49..0774b9288 100644 --- a/themes/modern/layouts/cms.htm +++ b/themes/modern/layouts/cms.htm @@ -1,5 +1,5 @@ [localePicker] -forceUrl = 0 +forceUrl = 1 [SeoCmsPage] == @@ -31,4 +31,4 @@ forceUrl = 0 ============================================= --> - \ No newline at end of file + diff --git a/themes/modern/layouts/contacts.htm b/themes/modern/layouts/contacts.htm index 0d7ec5858..7d4b0a3b6 100644 --- a/themes/modern/layouts/contacts.htm +++ b/themes/modern/layouts/contacts.htm @@ -1,5 +1,5 @@ [localePicker] -forceUrl = 0 +forceUrl = 1 [SeoStaticPage] @@ -37,4 +37,4 @@ default = 0 - \ No newline at end of file + diff --git a/themes/modern/layouts/master.htm b/themes/modern/layouts/master.htm index c1ec2e0f5..a4d6183d0 100644 --- a/themes/modern/layouts/master.htm +++ b/themes/modern/layouts/master.htm @@ -1,5 +1,5 @@ [localePicker] -forceUrl = 0 +forceUrl = 1 [SeoCmsPage] == @@ -22,4 +22,4 @@ forceUrl = 0 ============================================= --> - \ No newline at end of file + diff --git a/themes/modern/layouts/static.htm b/themes/modern/layouts/static.htm index 9ede2e2f1..bf131e2ed 100644 --- a/themes/modern/layouts/static.htm +++ b/themes/modern/layouts/static.htm @@ -1,5 +1,5 @@ [localePicker] -forceUrl = 0 +forceUrl = 1 [SeoStaticPage] @@ -29,4 +29,4 @@ default = 0 - \ No newline at end of file + diff --git a/themes/modern/pages/category.htm b/themes/modern/pages/category.htm index c78e1bead..77f85c2d9 100644 --- a/themes/modern/pages/category.htm +++ b/themes/modern/pages/category.htm @@ -24,6 +24,8 @@ localeUrl[en] = "/category/:slug" {% for item in posts %} {% partial 'post_list_item' post = item %} + {% else %} +

No posts found

{% endfor %} {% partial 'pagination'%} @@ -43,4 +45,4 @@ localeUrl[en] = "/category/:slug" field: document.getElementById('calendar') }); -{% endput %} \ No newline at end of file +{% endput %} diff --git a/themes/modern/partials/post_list_item.htm b/themes/modern/partials/post_list_item.htm index bd8fe3cf0..d4c12584b 100644 --- a/themes/modern/partials/post_list_item.htm +++ b/themes/modern/partials/post_list_item.htm @@ -1,6 +1,9 @@
- - + + + + +
@@ -13,7 +16,7 @@ fill="#a2a2a2" /> - {{post.published_at|date('HH:mm')}} + {{post.published_at|date('H:i')}}
@@ -36,13 +39,11 @@
- - От нефтепродуктов до солодки — что покупали на туркменской бирже за неделю + +
- Итог экспортных сделок Государственной товарно-сырьевой биржи Туркменистана за - первую неделю февраля вышел в сумму более 33,4 миллиона долларов США и 91,2 - миллиона манатов. + {{post.excerpt}}