|
21 | 21 |
|
22 | 22 | @if(!is_null($statistics['news_count'])) |
23 | 23 | <li class="statistic__item list-group-item"> |
24 | | - Общее количество новостей : |
| 24 | + Общее количество новостей на сайте : |
25 | 25 | <strong>{{ $statistics['news_count'] }}</strong> |
26 | 26 | </li> |
27 | 27 | @endif |
28 | 28 |
|
29 | | - <li class="statistic__item list-group-item"> |
30 | | - ФИО автора, у которого больше всего статей на сайте : |
31 | | -{{-- @foreach()--}} |
| 29 | + @if(!is_null($statistics['users_with_most_posts'])) |
| 30 | + <li class="statistic__item list-group-item"> |
| 31 | + Авторы с наибольшим количеством статей на сайте : |
| 32 | + @foreach($statistics['users_with_most_posts'] as $key => $user) |
| 33 | + <div class="values"> |
| 34 | + {{ $key + 1 }}. <span>{{ $user->name }}</span> |
32 | 35 |
|
33 | | -{{-- @endforeach--}} |
34 | | - </li> |
| 36 | + <a href="" class="text-primary">{{ $user->email }}</a> - |
35 | 37 |
|
36 | | - <li class="statistic__item list-group-item"> |
37 | | - Самая длинная статья - название, ссылка на статью и длина статьи в символах |
38 | | - </li> |
| 38 | + <strong>{{ $user->posts_count }}</strong> |
| 39 | + </div> |
| 40 | + @endforeach |
| 41 | + </li> |
| 42 | + @endif |
39 | 43 |
|
40 | | - <li class="statistic__item list-group-item"> |
41 | | - Самая короткая статья - название, ссылка на статью и длина статьи в символах |
42 | | - </li> |
| 44 | + @if(!is_null($statistics['the_longest_posts'])) |
| 45 | + <li class="statistic__item list-group-item"> |
| 46 | + Самая длинная статья на сайте. |
| 47 | + @foreach($statistics['the_longest_posts'] as $key => $post) |
| 48 | + <div class="values"> |
| 49 | + {{ $key + 1 }}. |
| 50 | + <span>Название статьи: |
| 51 | + <a href="{{ route('posts.show', $post) }}">{{ $post->name }}</a> - |
| 52 | + <strong>{{ mb_strlen($post->text) }}</strong> |
| 53 | + </span> |
| 54 | + </div> |
| 55 | + @endforeach |
| 56 | + </li> |
| 57 | + @endif |
43 | 58 |
|
44 | | - <li class="statistic__item list-group-item"> |
45 | | - Средние количество статей у “активных” пользователей, при этом активным пользователь считается, если у него есть более 1-й статьи |
46 | | - </li> |
| 59 | + @if(!is_null($statistics['the_shortest_posts'])) |
| 60 | + <li class="statistic__item list-group-item"> |
| 61 | + Самая короткая статья на сайте. |
| 62 | + @foreach($statistics['the_shortest_posts'] as $key => $post) |
| 63 | + <div class="values"> |
| 64 | + {{ $key + 1 }}. |
| 65 | + <span>Название статьи: |
| 66 | + <a href="{{ route('posts.show', $post) }}">{{ $post->name }}</a> - |
| 67 | + <strong>{{ mb_strlen($post->text) }}</strong> |
| 68 | + </span> |
| 69 | + </div> |
| 70 | + @endforeach |
| 71 | + </li> |
| 72 | + @endif |
47 | 73 |
|
48 | | - <li class="statistic__item list-group-item"> |
49 | | - Самая непостоянная - название, ссылка на статью, которую меняли больше всего раз |
50 | | - </li> |
| 74 | + @if(!is_null($statistics['avg_posts_have_active_users'])) |
| 75 | + <li class="statistic__item list-group-item"> |
| 76 | + Среднее количество статей у "активных" пользователей - |
| 77 | + <strong>{{ $statistics['avg_posts_have_active_users'] }}</strong> |
| 78 | + </li> |
| 79 | + @endif |
51 | 80 |
|
52 | | - <li class="statistic__item list-group-item"> |
53 | | - Самая обсуждаемая статья - название, ссылка на статью, у которой больше всего комментариев. |
54 | | - </li> |
| 81 | + @if(!is_null($statistics['most_changing_posts'])) |
| 82 | + <li class="statistic__item list-group-item"> |
| 83 | + Самая часто изменяемая статья на сайте. |
| 84 | + @foreach($statistics['most_changing_posts'] as $key => $post) |
| 85 | + <div class="values"> |
| 86 | + {{ $key + 1 }}. |
| 87 | + <span>Название статьи: |
| 88 | + <a href="{{ route('posts.show', $post) }}">{{ $post->name }}</a> - |
| 89 | + <strong>{{ $post->history_count }}</strong> |
| 90 | + </span> |
| 91 | + </div> |
| 92 | + @endforeach |
| 93 | + </li> |
| 94 | + @endif |
| 95 | + |
| 96 | + @if(!is_null($statistics['most_comment_posts'])) |
| 97 | + <li class="statistic__item list-group-item"> |
| 98 | + Самая обсуждаемая статья на сайте. |
| 99 | + @foreach($statistics['most_comment_posts'] as $key => $post) |
| 100 | + <div class="values"> |
| 101 | + {{ $key + 1 }}. |
| 102 | + <span>Название статьи: |
| 103 | + <a href="{{ route('posts.show', $post) }}">{{ $post->name }}</a> - |
| 104 | + <strong>{{ $post->comments_count }}</strong> |
| 105 | + </span> |
| 106 | + </div> |
| 107 | + @endforeach |
| 108 | + </li> |
| 109 | + @endif |
55 | 110 | </ul> |
56 | 111 | </div> |
57 | 112 | </section> |
|
0 commit comments