|
1 | 1 | @extends('layouts.app') |
2 | 2 |
|
3 | 3 | @php |
4 | | - /** |
5 | | - * @var \App\Models\Chapter $chapter |
6 | | - * @var string $userRatingPosition |
7 | | - * @var int $points |
8 | | - * @var \App\Models\User $user |
9 | | - */ |
| 4 | + /** |
| 5 | + * @var Chapter $chapter |
| 6 | + * @var string $userRatingPosition |
| 7 | + * @var int $points |
| 8 | + * @var User $user |
| 9 | + */ |
| 10 | +
|
| 11 | + use App\Models\Chapter; |
| 12 | + use App\Models\User; |
10 | 13 | @endphp |
11 | 14 | @section('description', $user->name) |
12 | 15 | @push('styles') |
13 | | - @vite('resources/sass/_activity_chart.scss') |
| 16 | + @vite('resources/sass/_activity_chart.scss') |
14 | 17 | @endpush |
15 | 18 | @section('content') |
16 | | - <div class="row my-4"> |
17 | | - <div class="col-12 col-md-3"> |
18 | | - <div class="sticky-top pt-4 mb-2 x-z-index-0"> |
19 | | - <img class="w-100 img-fluid" src="{{ $user->present()->getProfileImageLink() }}" alt="User avatar"> |
20 | | - <h1 class="h4 text-break my-2">{{ $user->name }}</h1> |
21 | | - <div class="h5"> |
22 | | - <span class="bi bi-trophy-fill"></span> |
23 | | - <span>{{ $position }}</span> |
24 | | - <a class="h6" href="{{ route('top.index') }}"> |
25 | | - {{ __('user.show.statistics.rating') }} |
26 | | - </a> |
27 | | - </div> |
28 | | - <div class="h5"> |
29 | | - <span class="bi bi-award"></span> |
30 | | - <span>{{ $points }}</span> |
31 | | - <span class="h6 text-secondary"> {{ trans_choice('user.show.statistics.points', $points) }}</span> |
32 | | - </div> |
33 | | - <div class="text-secondary"> |
34 | | - {{ __('user.show.statistics.created_at') }} |
35 | | - @if (App::isLocale('ru')) |
36 | | - {{ $user->created_at->isoFormat('DD MMMM YYYY') }} |
37 | | - @else |
38 | | - {{ $user->created_at->isoFormat('MMMM Do YYYY') }} |
39 | | - @endif |
40 | | - </div> |
41 | | - <div class="mt-3"> |
42 | | - @if ($user->github_name) |
43 | | - <span> |
| 19 | + <div class="row my-4"> |
| 20 | + <div class="col-12 col-md-3"> |
| 21 | + <div class="sticky-top pt-4 mb-2 x-z-index-0"> |
| 22 | + <img class="w-100 img-fluid" src="{{ $user->present()->getProfileImageLink() }}" alt="User avatar"> |
| 23 | + <h1 class="h4 text-break my-2">{{ $user->name }}</h1> |
| 24 | + <div class="h5"> |
| 25 | + <span class="bi bi-trophy-fill"></span> |
| 26 | + <span>{{ $position }}</span> |
| 27 | + <a class="h6" href="{{ route('top.index') }}"> |
| 28 | + {{ __('user.show.statistics.rating') }} |
| 29 | + </a> |
| 30 | + </div> |
| 31 | + <div class="h5"> |
| 32 | + <span class="bi bi-award"></span> |
| 33 | + <span>{{ $points }}</span> |
| 34 | + <span class="h6 text-secondary"> {{ trans_choice('user.show.statistics.points', $points) }}</span> |
| 35 | + </div> |
| 36 | + <div class="text-secondary"> |
| 37 | + {{ __('user.show.statistics.created_at') }} |
| 38 | + @if (App::isLocale('ru')) |
| 39 | + {{ $user->created_at->isoFormat('DD MMMM YYYY') }} |
| 40 | + @else |
| 41 | + {{ $user->created_at->isoFormat('MMMM Do YYYY') }} |
| 42 | + @endif |
| 43 | + </div> |
| 44 | + <div class="mt-3"> |
| 45 | + @if ($user->github_name) |
| 46 | + <span> |
44 | 47 | <a class="x-link-without-decoration mr-3 mb-2 text-dark" target="_blank" rel="noopener noreferrer" |
45 | | - href="https://github.com/{{ $user->github_name }}"> |
| 48 | + href="https://github.com/{{ $user->github_name }}"> |
46 | 49 | <i class="bi bi-github icon-2x"></i> |
47 | 50 | </a> |
48 | 51 | </span> |
49 | | - @endif |
50 | | - @if ($user->hexlet_nickname) |
51 | | - <span> |
| 52 | + @endif |
| 53 | + @if ($user->hexlet_nickname) |
| 54 | + <span> |
52 | 55 | <a class="x-link-without-decoration mr-2 text-dark" target="_blank" rel="noopener noreferrer" |
53 | | - href="https://ru.hexlet.io/u/{{ $user->hexlet_nickname }}"> |
| 56 | + href="https://ru.hexlet.io/u/{{ $user->hexlet_nickname }}"> |
54 | 57 | <img class="mb-3" src={{ Vite::asset('resources/assets/images/hexlet_logo.png') }} width="20" |
55 | | - height="30" alt="Hexlet logo"> |
| 58 | + height="30" alt="Hexlet logo"> |
56 | 59 | </a> |
57 | 60 | </span> |
58 | | - @endif |
59 | | - </div> |
60 | | - @can('update', $user) |
61 | | - <div class="small mt-4"> |
62 | | - <a class="text-muted" href="{{ route('settings.profile.index') }}"> |
63 | | - {{ __('user.show.statistics.edit_profile') }} |
64 | | - </a> |
65 | | - </div> |
66 | | - @endcan |
67 | | - </div> |
68 | | - </div> |
69 | | - <div class="col-12 col-md-9 my-4"> |
70 | | - <div class="shadow rounded p-3 mb-5"> |
71 | | - <div class="h2 text-center text-secondary mb-2"> |
72 | | - {{ __('user.show.statistics.statistics') }} |
73 | | - </div> |
74 | | - <div class="row no-gutters my-2"> |
75 | | - <div class="col-4 col-md text-center my-2"> |
76 | | - <div class="h2 text-info"> |
77 | | - {{ $user->chapterMembers->count() }} |
78 | | - </div> |
79 | | - <div class="text-secondary"> |
80 | | - {{ trans_choice('user.show.statistics.chapter_members', $user->chapterMembers->count()) }} |
| 61 | + @endif |
| 62 | + </div> |
| 63 | + @can('update', $user) |
| 64 | + <div class="small mt-4"> |
| 65 | + <a class="text-muted" href="{{ route('settings.profile.index') }}"> |
| 66 | + {{ __('user.show.statistics.edit_profile') }} |
| 67 | + </a> |
| 68 | + </div> |
| 69 | + @endcan |
81 | 70 | </div> |
82 | | - </div> |
83 | | - <div class="col-4 col-md text-center my-2"> |
84 | | - <div class="h2 text-info"> |
85 | | - {{ $user->exerciseMembers()->finished()->count() }} |
| 71 | + </div> |
| 72 | + <div class="col-12 col-md-9 my-4"> |
| 73 | + <div class="shadow rounded p-3 mb-5"> |
| 74 | + <div class="h2 text-center text-secondary mb-2"> |
| 75 | + {{ __('user.show.statistics.statistics') }} |
| 76 | + </div> |
| 77 | + <div class="row no-gutters my-2"> |
| 78 | + <div class="col-4 col-md text-center my-2"> |
| 79 | + <div class="h2 text-info"> |
| 80 | + {{ $user->chapterMembers->count() }} |
| 81 | + </div> |
| 82 | + <div class="text-secondary"> |
| 83 | + {{ trans_choice('user.show.statistics.chapter_members', $user->chapterMembers->count()) }} |
| 84 | + </div> |
| 85 | + </div> |
| 86 | + <div class="col-4 col-md text-center my-2"> |
| 87 | + <div class="h2 text-info"> |
| 88 | + {{ $user->exerciseMembers()->finished()->count() }} |
| 89 | + </div> |
| 90 | + <div class="text-secondary"> |
| 91 | + {{ trans_choice('user.show.statistics.exercise_members', $user->exerciseMembers->count()) }} |
| 92 | + </div> |
| 93 | + </div> |
| 94 | + <div class="col-4 col-md text-center my-2"> |
| 95 | + <a class="text-decoration-none" href="{{ route('users.comments.index', [$user]) }}"> |
| 96 | + <div class="h2 text-info"> |
| 97 | + {{ $user->comments->count() }} |
| 98 | + </div> |
| 99 | + <div class="text-secondary"> |
| 100 | + {{ trans_choice('user.show.statistics.comments', $user->comments->count()) }} |
| 101 | + </div> |
| 102 | + </a> |
| 103 | + </div> |
| 104 | + </div> |
| 105 | + <div class="col-md-12"> |
| 106 | + @include('components.activity_chart') |
| 107 | + </div> |
86 | 108 | </div> |
87 | | - <div class="text-secondary"> |
88 | | - {{ trans_choice('user.show.statistics.exercise_members', $user->exerciseMembers->count()) }} |
| 109 | + |
| 110 | + <div class="shadow rounded p-3 mb-5"> |
| 111 | + <div class="h3 text-center text-secondary mb-3"> |
| 112 | + {{ __('user.show.statistics.chapters_progress') }} |
| 113 | + </div> |
| 114 | + <div class="chapter-progress"> |
| 115 | + @foreach($allChapters as $chapter) |
| 116 | + @include( |
| 117 | + 'partials.user_chapter_partial', |
| 118 | + [ |
| 119 | + 'chapters' => $chapters, |
| 120 | + 'chapter' => $chapter, |
| 121 | + 'chapterMembers' => $chapterMembers, |
| 122 | + 'exerciseMembers' => $exerciseMembers, |
| 123 | + 'level' => 0 |
| 124 | + ] |
| 125 | + ) |
| 126 | + @endforeach |
| 127 | + </div> |
89 | 128 | </div> |
90 | | - </div> |
91 | | - <div class="col-4 col-md text-center my-2"> |
92 | | - <a class="text-decoration-none" href="{{ route('users.comments.index', [$user]) }}"> |
93 | | - <div class="h2 text-info"> |
94 | | - {{ $user->comments->count() }} |
95 | | - </div> |
96 | | - <div class="text-secondary"> |
97 | | - {{ trans_choice('user.show.statistics.comments', $user->comments->count()) }} |
98 | | - </div> |
99 | | - </a> |
100 | | - </div> |
101 | | - </div> |
102 | | - <div class="col-md-12"> |
103 | | - @include('components.activity_chart') |
104 | 129 | </div> |
105 | | - </div> |
106 | 130 | </div> |
107 | | - </div> |
108 | 131 | @endsection |
0 commit comments