diff --git a/plugins/rainlab/blog/models/Post.php b/plugins/rainlab/blog/models/Post.php index f923139c6..40aad264f 100644 --- a/plugins/rainlab/blog/models/Post.php +++ b/plugins/rainlab/blog/models/Post.php @@ -43,7 +43,6 @@ class Post extends Model 'powerseo_description' => 'required', 'powerseo_keywords' => 'required', 'excerpt' => 'required', - 'category_groups' => 'required', 'awtor' => 'required', 'img_source' => 'required' ]; @@ -177,16 +176,16 @@ class Post extends Model public function filterFields($fields, $context = null) { - if($this->awtor){ + if(isset($this->awtor)){ if($this->awtor->type == 'other'){ $fields->author_name->hidden = false; - }else{ - $fields->author_name->value = null; + }elseif(isset($fields->author_name)){ + //$fields->author_name->value = null; $fields->author_name->hidden = true; } }else{ - $fields->author_name->value = null; - $fields->author_name->hidden = true; + //$fields->author_name->hidden = true; + return; } if(isset($fields->category_groups)){ diff --git a/themes/modern2/layouts/new/master-inside.htm b/themes/modern2/layouts/new/master-inside.htm index 5b38b2185..c623a7f2b 100644 --- a/themes/modern2/layouts/new/master-inside.htm +++ b/themes/modern2/layouts/new/master-inside.htm @@ -26,7 +26,7 @@ default = 0 -{% partial 'snowfall' %} + {% partial 'new/mobile-search' %}
@@ -57,7 +57,8 @@ default = 0

{{'site.slogan'|_}}

diff --git a/themes/modern2/layouts/new/master.htm b/themes/modern2/layouts/new/master.htm index d253bf6b7..f51a03036 100644 --- a/themes/modern2/layouts/new/master.htm +++ b/themes/modern2/layouts/new/master.htm @@ -28,7 +28,7 @@ random = 0 -{% partial 'snowfall' %} + {% partial 'new/mobile-search' %} @@ -61,7 +61,9 @@ random = 0

{{'site.slogan'|_}}

diff --git a/themes/modern2/pages/new/group.htm b/themes/modern2/pages/new/group.htm index 4a60d2d27..7defa3c26 100644 --- a/themes/modern2/pages/new/group.htm +++ b/themes/modern2/pages/new/group.htm @@ -73,7 +73,7 @@ function onStart(){ if($this['categorySlug']){ $this['mediaPostsFilter'] = Tps\Tps\Models\Media::where('type', $this['categorySlug'])->orderBy('created_at', 'DESC')->get(); }else{ - $this['mediaPostsFilter'] = Tps\Tps\Models\Media::all(); + $this['mediaPostsFilter'] = Tps\Tps\Models\Media::orderBy('created_at', 'DESC')->get(); } @@ -130,7 +130,7 @@ function onStart(){ - {% partial 'new/pagination' items = blogPosts.posts %} + {% partial 'new/pagination' items = blogPosts.posts %} diff --git a/themes/modern2/pages/new/newPost.htm b/themes/modern2/pages/new/newPost.htm index d82b5eb68..750f454ff 100644 --- a/themes/modern2/pages/new/newPost.htm +++ b/themes/modern2/pages/new/newPost.htm @@ -116,9 +116,12 @@ function onStart(){ + --> + {% if post.img_source %} +
{{ 'Фото'|_ }}: {{ post.img_source }}
+ {% endif %} - + {% partial 'new/social' %} diff --git a/themes/modern2/pages/report/awtor.htm b/themes/modern2/pages/report/awtor.htm new file mode 100644 index 000000000..da52acf88 --- /dev/null +++ b/themes/modern2/pages/report/awtor.htm @@ -0,0 +1,72 @@ +title = "report/awtor" +url = "/report/qawtorq/:year" +layout = "report" +is_hidden = 0 +robot_index = "index" +robot_follow = "follow" +== +param('year'); + $this['allPost'] = $this['posts'] = RainLab\Blog\Models\Post::count(); + $this['allPostYear'] = $this['posts'] = RainLab\Blog\Models\Post::whereYear('published_at', $this['yearq'])->count(); +} +?> +== + +
+
+

{{ yearq }} report

+
+ + + + + + + + + + + + + + + + + + + + {% for index, record in backendUsers %} + {% partial 'report/report' user = record.name index = index userId = record.id year = yearq %} + {% endfor %} + + + + + {% partial 'report/yearAll' month = 1 %} + {% partial 'report/yearAll' month = 2 %} + {% partial 'report/yearAll' month = 3 %} + {% partial 'report/yearAll' month = 4 %} + {% partial 'report/yearAll' month = 5 %} + {% partial 'report/yearAll' month = 6 %} + {% partial 'report/yearAll' month = 7 %} + {% partial 'report/yearAll' month = 8 %} + {% partial 'report/yearAll' month = 9 %} + {% partial 'report/yearAll' month = 10 %} + {% partial 'report/yearAll' month = 11 %} + {% partial 'report/yearAll' month = 12 %} + +
NO:UsersALLALL ({{ yearq }})YanwarFewralMartAprelMayIyunIyulAwgustSentyabrOktyabrNoyabrDekabr
HEMMESI{{ allPost }}{{ allPostYear }}
+
\ No newline at end of file diff --git a/themes/modern2/partials/newHome/photo-item.htm b/themes/modern2/partials/newHome/photo-item.htm index 0c0c715c0..8d796e418 100644 --- a/themes/modern2/partials/newHome/photo-item.htm +++ b/themes/modern2/partials/newHome/photo-item.htm @@ -10,7 +10,7 @@ {% for photo in post.media_file %}
- +
{% endfor %}