diff --git a/themes/modern2/pages/new/getby.htm b/themes/modern2/pages/new/getby.htm
new file mode 100644
index 000000000..08f7298dc
--- /dev/null
+++ b/themes/modern2/pages/new/getby.htm
@@ -0,0 +1,88 @@
+title = "new/getBy"
+url = "/get-by/:authorId"
+layout = "new/master-inside"
+is_hidden = 0
+robot_index = "index"
+robot_follow = "follow"
+==
+activeLocale;
+
+ $this['authorId'] = $this->param('authorId');
+ $this['authorName'] = Tps\Tps\Models\Authors::find($this['authorId']);
+
+ $this['blogPosts'] = RainLab\Blog\Models\Post::where('author_id', $this['authorId'])->where('locale', 'ru')->orderBy('published_at', 'DESC')->paginate(10);
+
+
+
+
+
+}
+?>
+==
+{% set records = media.records %}
+{% set displayColumn = media.displayColumn %}
+{% set noRecordsMessage = media.noRecordsMessage %}
+{% set detailsPage = media.detailsPage %}
+{% set detailsKeyColumn = media.detailsKeyColumn %}
+{% set detailsUrlParameter = media.detailsUrlParameter %}
+
+
+
+
+
+
+
+
+
{{ authorName.name }}
+
+
+
+
+
+
+ {% for post in blogPosts %}
+ {% if group == 'poster' %}
+ {% partial 'new/afisha-item' post = post %}
+ {% else %}
+ {% partial 'new/post_list_item' post = post %}
+ {% endif %}
+ {% else %}
+
No posts found
+ {% endfor %}
+
+
+
+
+ {% partial 'new/pagination' items = blogPosts %}
+
+
+
+
+
+
+
+
+
+ {% put scripts %}
+
+ {% endput %}
\ No newline at end of file
diff --git a/themes/modern2/pages/new/group.htm b/themes/modern2/pages/new/group.htm
index 7defa3c26..aa9c5099e 100644
--- a/themes/modern2/pages/new/group.htm
+++ b/themes/modern2/pages/new/group.htm
@@ -71,9 +71,9 @@ function onStart(){
if($this['categorySlug']){
- $this['mediaPostsFilter'] = Tps\Tps\Models\Media::where('type', $this['categorySlug'])->orderBy('created_at', 'DESC')->get();
+ $this['mediaPostsFilter'] = Tps\Tps\Models\Media::where('type', $this['categorySlug'])->orderBy('published_at', 'DESC')->paginate(9);
}else{
- $this['mediaPostsFilter'] = Tps\Tps\Models\Media::orderBy('created_at', 'DESC')->get();
+ $this['mediaPostsFilter'] = Tps\Tps\Models\Media::orderBy('published_at', 'DESC')->paginate(9);
}
@@ -113,6 +113,7 @@ function onStart(){
{{ 'no Records' }}
{% endfor %}
+ {% partial 'new/pagination' items = mediaPostsFilter %}
{% else %}
@@ -126,12 +127,12 @@ function onStart(){
No posts found
{% endfor %}
+
+ {% partial 'new/pagination' items = blogPosts.posts %}
{% endif %}
-
- {% partial 'new/pagination' items = blogPosts.posts %}
-
+
diff --git a/themes/modern2/pages/report/awtor.htm b/themes/modern2/pages/report/awtor.htm
index da52acf88..ee32abfb2 100644
--- a/themes/modern2/pages/report/awtor.htm
+++ b/themes/modern2/pages/report/awtor.htm
@@ -9,8 +9,8 @@ robot_follow = "follow"
function onStart(){
$this['backendUsers'] = Tps\Tps\Models\Authors::all();
$this['yearq'] = $this->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();
+ $this['allPost'] = $this['posts'] = RainLab\Blog\Models\Post::whereHas('awtor')->where('locale', 'ru')->count();
+ $this['allPostYear'] = $this['posts'] = RainLab\Blog\Models\Post::whereHas('awtor')->whereYear('published_at', $this['yearq'])->where('locale', 'ru')->count();
}
?>
==
@@ -27,7 +27,7 @@ function onStart(){
-
{{ yearq }} report
+ {{ yearq }} report by authors
@@ -49,24 +49,24 @@ function onStart(){
| Dekabr |
{% for index, record in backendUsers %}
- {% partial 'report/report' user = record.name index = index userId = record.id year = yearq %}
+ {% partial 'report/awtor' user = record index = index userId = record.id year = yearq %}
{% endfor %}
| HEMMESI |
{{ allPost }} |
{{ allPostYear }} |
- {% 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 %}
+ {% partial 'report/yearAllAwtor' month = 1 %}
+ {% partial 'report/yearAllAwtor' month = 2 %}
+ {% partial 'report/yearAllAwtor' month = 3 %}
+ {% partial 'report/yearAllAwtor' month = 4 %}
+ {% partial 'report/yearAllAwtor' month = 5 %}
+ {% partial 'report/yearAllAwtor' month = 6 %}
+ {% partial 'report/yearAllAwtor' month = 7 %}
+ {% partial 'report/yearAllAwtor' month = 8 %}
+ {% partial 'report/yearAllAwtor' month = 9 %}
+ {% partial 'report/yearAllAwtor' month = 10 %}
+ {% partial 'report/yearAllAwtor' month = 11 %}
+ {% partial 'report/yearAllAwtor' month = 12 %}
\ No newline at end of file
diff --git a/themes/modern2/partials/report/awtor.htm b/themes/modern2/partials/report/awtor.htm
new file mode 100644
index 000000000..433654817
--- /dev/null
+++ b/themes/modern2/partials/report/awtor.htm
@@ -0,0 +1,30 @@
+[viewBag]
+==
+userId;
+ $year = $this->year;
+ //dd($userId);
+ $this['postCount'] = Db::table('rainlab_blog_posts')->where('author_id', $userId)->count();
+}
+?>
+==
+
+ | {{ index + 1 }} |
+ {{user.name}} |
+ {{ postCount == 0 ? "" : postCount }} |
+ {% partial 'report/yearAwtor' year = year userId = userId %}
+ {% partial 'report/monthAwtor' month = 1 year = year userId = userId %}
+ {% partial 'report/monthAwtor' month = 2 year = year userId = userId %}
+ {% partial 'report/monthAwtor' month = 3 year = year userId = userId %}
+ {% partial 'report/monthAwtor' month = 4 year = year userId = userId %}
+ {% partial 'report/monthAwtor' month = 5 year = year userId = userId %}
+ {% partial 'report/monthAwtor' month = 6 year = year userId = userId %}
+ {% partial 'report/monthAwtor' month = 7 year = year userId = userId %}
+ {% partial 'report/monthAwtor' month = 8 year = year userId = userId %}
+ {% partial 'report/monthAwtor' month = 9 year = year userId = userId %}
+ {% partial 'report/monthAwtor' month = 10 year = year userId = userId %}
+ {% partial 'report/monthAwtor' month = 11 year = year userId = userId %}
+ {% partial 'report/monthAwtor' month = 12 year = year userId = userId %}
+
\ No newline at end of file
diff --git a/themes/modern2/partials/report/monthAwtor.htm b/themes/modern2/partials/report/monthAwtor.htm
new file mode 100644
index 000000000..61a8fe6fa
--- /dev/null
+++ b/themes/modern2/partials/report/monthAwtor.htm
@@ -0,0 +1,14 @@
+[viewBag]
+==
+userId;
+ $month = $this->month;
+ $year = $this->year;
+ //dd($userId);
+ $this['countByMonth'] = Db::table('rainlab_blog_posts')->where('author_id', $userId)->whereMonth('published_at', $month)->whereYear('published_at', $year)->where('locale', 'ru')->count();
+}
+?>
+==
+{{ countByMonth == 0 ? '' : countByMonth }} |
\ No newline at end of file
diff --git a/themes/modern2/partials/report/yearAllAwtor.htm b/themes/modern2/partials/report/yearAllAwtor.htm
new file mode 100644
index 000000000..dd8987c22
--- /dev/null
+++ b/themes/modern2/partials/report/yearAllAwtor.htm
@@ -0,0 +1,13 @@
+[viewBag]
+==
+month;
+ $year = $this->param('year');
+ //dd($userId);
+ $this['countByYearAll'] = RainLab\Blog\Models\Post::whereHas('awtor')->whereYear('published_at', $year)->whereMonth('published_at', $month)->where('locale', 'ru')->count();
+}
+?>
+==
+{{ countByYearAll == 0 ? "" : countByYearAll }} |
\ No newline at end of file
diff --git a/themes/modern2/partials/report/yearAwtor.htm b/themes/modern2/partials/report/yearAwtor.htm
new file mode 100644
index 000000000..fe50dc8e4
--- /dev/null
+++ b/themes/modern2/partials/report/yearAwtor.htm
@@ -0,0 +1,13 @@
+[viewBag]
+==
+userId;
+ $year = $this->year;
+ //dd($userId);
+ $this['countByYear'] = Db::table('rainlab_blog_posts')->where('author_id', $userId)->whereYear('published_at', $year)->where('locale', 'ru')->count();
+}
+?>
+==
+{{ countByYear == 0 ? '' : countByYear }} |
\ No newline at end of file