diff --git a/plugins/rainlab/blog/Plugin.php b/plugins/rainlab/blog/Plugin.php index 2780ee04d..7deb5b9d9 100644 --- a/plugins/rainlab/blog/Plugin.php +++ b/plugins/rainlab/blog/Plugin.php @@ -145,7 +145,7 @@ class Plugin extends PluginBase return [ 'blog-category' => 'rainlab.blog::lang.menuitem.blog_category', 'all-blog-categories' => 'rainlab.blog::lang.menuitem.all_blog_categories', - 'blog-post' => 'rainlab.blog::lang.menuitem.blog_post', +// 'blog-post' => 'rainlab.blog::lang.menuitem.blog_post', 'all-blog-posts' => 'rainlab.blog::lang.menuitem.all_blog_posts', 'category-blog-posts' => 'rainlab.blog::lang.menuitem.category_blog_posts', ]; diff --git a/plugins/rainlab/blog/components/Posts.php b/plugins/rainlab/blog/components/Posts.php index 85ff2f953..82fddac57 100644 --- a/plugins/rainlab/blog/components/Posts.php +++ b/plugins/rainlab/blog/components/Posts.php @@ -88,7 +88,8 @@ class Posts extends ComponentBase 'featured' => [ 'title' => 'Featured posts', 'description' => 'Filter featured posts', - 'type' => 'checkbox', + 'type' => 'dropdown', + 'options' => ['yes' => 'Yes', 'not' => 'Not'] ], 'postsPerPage' => [ @@ -208,11 +209,13 @@ class Posts extends ComponentBase */ $isPublished = !$this->checkEditor(); + $featured = $this->property('featured') ? $this->property('featured')=='yes':null; + $posts = BlogPost::with(['categories'])->listFrontEnd([ 'page' => $this->property('pageNumber'), 'sort' => $this->property('sortOrder'), 'perPage' => $this->property('postsPerPage'), - 'featured' => $this->property('featured'), + 'featured' => $featured, 'search' => trim(input('q')), 'category' => $category, 'date' => input('date'), diff --git a/plugins/rainlab/blog/models/Post.php b/plugins/rainlab/blog/models/Post.php index ffad5e2fd..54e6bfb0c 100644 --- a/plugins/rainlab/blog/models/Post.php +++ b/plugins/rainlab/blog/models/Post.php @@ -282,8 +282,8 @@ class Post extends Model $query->isPublished(); } - if($featured){ - $query-> where('featured',1); + if(isset($featured)){ + $query-> where('featured',$featured); } $date = trim($date); @@ -399,7 +399,7 @@ class Post extends Model $q->whereIn('id', $categories); }); } - + public function scopeFilterLocale($query, array $types) { foreach ($types as $type) { switch ($type) { @@ -411,8 +411,8 @@ class Post extends Model break; } } - - + + } // diff --git a/plugins/rainlab/blog/models/post/columns.yaml b/plugins/rainlab/blog/models/post/columns.yaml index 987fd983e..d54f24f45 100644 --- a/plugins/rainlab/blog/models/post/columns.yaml +++ b/plugins/rainlab/blog/models/post/columns.yaml @@ -1,40 +1,31 @@ -# =================================== -# Column Definitions -# =================================== - columns: - title: - label: rainlab.blog::lang.post.title + label: 'rainlab.blog::lang.post.title' + type: text searchable: true - - # author: - # label: Author - # relation: user - # select: login - # searchable: true - categories: - label: rainlab.blog::lang.post.categories - relation: categories - select: name + label: 'rainlab.blog::lang.post.categories' + type: text searchable: true - sortable: false + select: name + relation: categories locale: label: Language - + type: text views: label: Views + type: number created_at: - label: rainlab.blog::lang.post.created + label: 'rainlab.blog::lang.post.created' type: date invisible: true - updated_at: - label: rainlab.blog::lang.post.updated + label: 'rainlab.blog::lang.post.updated' type: date invisible: true - published_at: - label: rainlab.blog::lang.post.published + label: 'rainlab.blog::lang.post.published' type: date + featured: + label: Featured + type: switch diff --git a/plugins/tps/reklama/components/advertisement/carousel.htm b/plugins/tps/reklama/components/advertisement/carousel.htm index 977fd0393..88fed663e 100644 --- a/plugins/tps/reklama/components/advertisement/carousel.htm +++ b/plugins/tps/reklama/components/advertisement/carousel.htm @@ -36,6 +36,7 @@ dots: false, infinite: true, speed: 300, + autoplay: true, slidesToShow: 5, arrows: true, prevArrow: $(".p1"), @@ -81,6 +82,7 @@ speed: 300, slidesToShow: 5, arrows: true, + autoplay: true, prevArrow: $(".p1"), nextArrow: $(".n1"), slidesToScroll: 1, diff --git a/plugins/tps/reklama/components/advertisement/slider.htm b/plugins/tps/reklama/components/advertisement/slider.htm index ee1b31a2f..5d0994212 100644 --- a/plugins/tps/reklama/components/advertisement/slider.htm +++ b/plugins/tps/reklama/components/advertisement/slider.htm @@ -11,7 +11,7 @@ > - {{reklama.title}} + {{reklama.title}} {% endfor %} diff --git a/plugins/vdlp/rssfetcher/models/item/fields.yaml b/plugins/vdlp/rssfetcher/models/item/fields.yaml index a65892e7e..1209bb804 100644 --- a/plugins/vdlp/rssfetcher/models/item/fields.yaml +++ b/plugins/vdlp/rssfetcher/models/item/fields.yaml @@ -1,45 +1,41 @@ fields: title: - label: vdlp.rssfetcher::lang.item.title + label: 'vdlp.rssfetcher::lang.item.title' type: text span: left link: - label: vdlp.rssfetcher::lang.item.link + label: 'vdlp.rssfetcher::lang.item.link' type: text span: right description: - label: vdlp.rssfetcher::lang.item.description + label: 'vdlp.rssfetcher::lang.item.description' type: textarea size: small + span: auto + source: + label: Source + nameFrom: name + descriptionFrom: description + span: auto + type: relation author: - label: vdlp.rssfetcher::lang.item.author + label: 'vdlp.rssfetcher::lang.item.author' type: text span: left category: - label: vdlp.rssfetcher::lang.item.category - type: text - span: right - comments: - label: vdlp.rssfetcher::lang.item.comments - type: text - enclosure_url: - label: vdlp.rssfetcher::lang.item.enclosure_url - type: text - enclosure_length: - label: vdlp.rssfetcher::lang.item.enclosure_length - type: number - span: left - enclosure_type: - label: vdlp.rssfetcher::lang.item.enclosure_type + label: 'vdlp.rssfetcher::lang.item.category' type: text span: right pub_date: - label: vdlp.rssfetcher::lang.item.published_at + label: 'vdlp.rssfetcher::lang.item.published_at' type: datepicker mode: datetime - span: left + span: auto + comments: + label: 'vdlp.rssfetcher::lang.item.comments' + type: text is_published: - label: vdlp.rssfetcher::lang.item.is_published + label: 'vdlp.rssfetcher::lang.item.is_published' type: switch - comment: vdlp.rssfetcher::lang.item.is_published_comment + comment: 'vdlp.rssfetcher::lang.item.is_published_comment' span: left diff --git a/themes/modern2/layouts/blog.htm b/themes/modern2/layouts/blog.htm index 1411a5756..bddc7f550 100644 --- a/themes/modern2/layouts/blog.htm +++ b/themes/modern2/layouts/blog.htm @@ -28,6 +28,15 @@ post = "post" + + + \ No newline at end of file diff --git a/themes/modern2/layouts/cms.htm b/themes/modern2/layouts/cms.htm index 49d7906e6..87bb9cb19 100644 --- a/themes/modern2/layouts/cms.htm +++ b/themes/modern2/layouts/cms.htm @@ -31,6 +31,15 @@ forceUrl = 1 + + + \ No newline at end of file diff --git a/themes/modern2/layouts/contacts.htm b/themes/modern2/layouts/contacts.htm index 7d4b0a3b6..54b00f1aa 100644 --- a/themes/modern2/layouts/contacts.htm +++ b/themes/modern2/layouts/contacts.htm @@ -36,5 +36,14 @@ default = 0 {% framework extras %} + + + - + \ No newline at end of file diff --git a/themes/modern2/layouts/master.htm b/themes/modern2/layouts/master.htm index 65295b2ce..eb27d0008 100644 --- a/themes/modern2/layouts/master.htm +++ b/themes/modern2/layouts/master.htm @@ -36,6 +36,15 @@ random = 0 {% scripts %} + + + \ No newline at end of file diff --git a/themes/modern2/layouts/static.htm b/themes/modern2/layouts/static.htm index bf131e2ed..cca4aa773 100644 --- a/themes/modern2/layouts/static.htm +++ b/themes/modern2/layouts/static.htm @@ -28,5 +28,14 @@ default = 0 + + + - + \ No newline at end of file diff --git a/themes/modern2/pages/post.htm b/themes/modern2/pages/post.htm index 2ac977f26..f80ace584 100644 --- a/themes/modern2/pages/post.htm +++ b/themes/modern2/pages/post.htm @@ -49,7 +49,10 @@ post = "post" {% if post.featured_image %} - {{post.title}} + + + + {{post.title}} {% endif %} diff --git a/themes/modern2/pages/problem.htm b/themes/modern2/pages/problem.htm new file mode 100644 index 000000000..0da62b385 --- /dev/null +++ b/themes/modern2/pages/problem.htm @@ -0,0 +1,13 @@ +title = 500 +url = "/error" +layout = "master" +is_hidden = 0 +robot_index = "index" +robot_follow = "follow" + +[viewBag] +localeTitle[en] = "Problem" +== +
+

INTERNAL SERVER PROBLEM

+
\ 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 a71e53694..19c44a68f 100644 --- a/themes/modern2/partials/index/category_posts.htm +++ b/themes/modern2/partials/index/category_posts.htm @@ -1,6 +1,6 @@ [viewBag] == -{% set posts = category.take_posts(3) %} +{% set posts = category.take_posts(5) %}
@@ -10,8 +10,8 @@ {{'page.more'|_}}
- - {{posts.first.title}} + + {{posts.first.title}}
@@ -33,8 +33,8 @@ {{posts.first.title}}
- - {% partial 'index/category_post_item' post = posts[1] %} - {% partial 'index/category_post_item' post = posts.last %} +{% 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/index/top_section.htm b/themes/modern2/partials/index/top_section.htm index 8e5040658..484877540 100644 --- a/themes/modern2/partials/index/top_section.htm +++ b/themes/modern2/partials/index/top_section.htm @@ -14,8 +14,8 @@
- - {{firstPost.title}} + + {{firstPost.title}}
{% partial 'index/post_item' post = firstPost category = category %} @@ -29,4 +29,4 @@
- + \ No newline at end of file diff --git a/themes/modern2/partials/slider.htm b/themes/modern2/partials/slider.htm index a249ee2af..95fd5184b 100644 --- a/themes/modern2/partials/slider.htm +++ b/themes/modern2/partials/slider.htm @@ -1,19 +1,29 @@ [viewBag] -[blogPosts] +[blogPosts marque] pageNumber = "{{ :page }}" -postsPerPage = 8 +featured = yes +postsPerPage = 5 noPostsMessage = "No posts found" sortOrder = "published_at desc" categoryPage = "category" postPage = "post" + +[blogPosts slider] +pageNumber = "{{ :page }}" +postsPerPage = 10 +featured = no +noPostsMessage = "No posts found" +sortOrder = "published_at desc" +categoryPage = 404 +postPage = 404 ==
{{'Главное'|_}}
- {% for post in posts %} + {% for post in marque.posts %} @@ -24,11 +34,11 @@ postPage = "post"
- {% for post in posts.slice(0,3) %} + {% for post in slider.posts.slice(0,4) %}
- +
- {% for post in posts.slice(3) %} + {% for post in slider.posts.slice(4) %}
- {{post.title}} + {{post.title}}