Skip to content

Commit 8767add

Browse files
authored
Merge pull request #1732 from ddm14159/#1680/profile-pagination-bug
#1680 tab switch bag fixed
2 parents ab7b645 + 79104b5 commit 8767add

19 files changed

+156
-91
lines changed

app/Http/Controllers/Auth/LoginController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function __construct()
1919
public function redirectTo()
2020
{
2121
flash(__('auth.logged_in'))->success();
22-
return route('my');
22+
return route('my.show');
2323
}
2424

2525
public function devLogin()

app/Http/Controllers/Auth/RegisterController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public function __construct()
2020

2121
public function redirectTo()
2222
{
23-
return route('my');
23+
return route('my.show');
2424
}
2525

2626
protected function validator(array $data): ValidatorContract

app/Http/Controllers/Auth/ResetPasswordController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public function __construct()
1717
public function redirectTo()
1818
{
1919
flash(__('passwords.reset'))->success();
20-
return route('my');
20+
return route('my.show');
2121
}
2222

2323
protected function rules()

app/Http/Controllers/Auth/Social/GithubController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public function handleProviderCallback(): RedirectResponse
6767
Auth::login($user, true);
6868
flash()->success(__('auth.logged_in'));
6969

70-
return redirect()->route('my');
70+
return redirect()->route('my.show');
7171
}
7272

7373
private function sendFailedResponse($msg = null): RedirectResponse

app/Http/Controllers/Auth/VerificationController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public function __construct()
2121

2222
public function redirectTo()
2323
{
24-
return route('my');
24+
return route('my.show');
2525
}
2626

2727
public function verify(Request $request)
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?php
2+
3+
namespace App\Http\Controllers\My;
4+
5+
use App\Http\Controllers\Controller;
6+
use App\Models\User;
7+
use Auth;
8+
use Illuminate\View\View;
9+
10+
class SolutionController extends Controller
11+
{
12+
public function __construct()
13+
{
14+
$this->middleware('auth');
15+
}
16+
17+
public function index(): View
18+
{
19+
/** @var User $user */
20+
$user = Auth::user();
21+
$user->load('exerciseMembers');
22+
23+
$exerciseMembers = $user->exerciseMembers->keyBy('exercise_id');
24+
$savedSolutionsExercises = $user->solutions()
25+
->versioned()
26+
->with([
27+
'exercise',
28+
'exercise.chapter',
29+
])
30+
->paginate(10);
31+
32+
return view('my.solutions', compact(
33+
'user',
34+
'exerciseMembers',
35+
'savedSolutionsExercises'
36+
));
37+
}
38+
}

app/Http/Controllers/MyController.php

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,23 @@ public function __construct()
1414
$this->middleware('auth');
1515
}
1616

17-
public function __invoke(): View
17+
public function show(): View
1818
{
1919
/** @var User $user */
2020
$user = Auth::user();
21-
$user->load('chapterMembers', 'exerciseMembers');
21+
$user->load('exerciseMembers', 'chapterMembers');
2222

2323
$chapters = Chapter::with('children', 'exercises')->get();
2424
$mainChapters = $chapters->where('parent_id', null);
2525
$chapterMembers = $user->chapterMembers->keyBy('chapter_id');
2626
$exerciseMembers = $user->exerciseMembers->keyBy('exercise_id');
27-
$savedSolutionsExercises = $user->solutions()
28-
->versioned()
29-
->with([
30-
'exercise',
31-
'exercise.chapter',
32-
])
33-
->paginate(10);
3427

3528
return view('my.index', compact(
3629
'user',
3730
'chapters',
31+
'exerciseMembers',
3832
'mainChapters',
3933
'chapterMembers',
40-
'exerciseMembers',
41-
'savedSolutionsExercises'
4234
));
4335
}
4436
}

resources/lang/ru/progresses.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
return [
44
'chapter' => 'Глава',
5-
'сhapters' => 'Главы',
5+
'chapters' => 'Главы',
66
'my_solutions' => 'Мои Решения',
77
'exercise' => 'Упражнение',
88
'see_details' => 'Подробнее',

resources/views/home/index.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
<li>{{ __(sprintf('welcome.features_list.%s', $key)) }}</li>
7676
@endforeach
7777
</ul>
78-
<a class="btn btn-primary btn-lg" href="{{ route('my') }}">{{ __('layout.welcome.start_learning') }}</a>
78+
<a class="btn btn-primary btn-lg" href="{{ route('my.show') }}">{{ __('layout.welcome.start_learning') }}</a>
7979
</div>
8080
</div>
8181

resources/views/layouts/_nav.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class="nav-link p-2">{{ __('layout.nav.register') }}</a>
6464
<a class="dropdown-item" href="{{ route('settings.account.index') }}">{{ __('account.settings') }}</a>
6565
</li>
6666
<li>
67-
<a class="dropdown-item" href="{{ route('my') }}">
67+
<a class="dropdown-item" href="{{ route('my.show') }}">
6868
{{ __('layout.nav.my_progress') }}
6969
</a>
7070
</li>

0 commit comments

Comments
 (0)