diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index 8c248414..4035893a 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -188,12 +188,33 @@ class UserController extends Controller return json(trans('user.verification.success'), 0); } - public function profile() + public function profile(Filter $filter) { $user = Auth::user(); + $grid = [ + 'layout' => [ + ['md-6', 'md-6'], + ], + 'widgets' => [ + [ + [ + 'user.widgets.profile.avatar', + 'user.widgets.profile.password' + ], + [ + 'user.widgets.profile.nickname', + 'user.widgets.profile.email', + 'user.widgets.profile.delete-account', + ], + ], + ], + ]; + $grid = $filter->apply('grid:user.profile', $grid); + return view('user.profile') ->with('user', $user) + ->with('grid', $grid) ->with('site_name', option_localized('site_name')); } diff --git a/resources/views/shared/grid.twig b/resources/views/shared/grid.twig new file mode 100644 index 00000000..db412d9a --- /dev/null +++ b/resources/views/shared/grid.twig @@ -0,0 +1,12 @@ +{% for row in grid.widgets %} +
{{ trans('user.profile.delete.admin') }}
- - {% else %} -{{ trans('user.profile.delete.notice', { site: site_name }) }}
- - {% endif %} -{{ trans('user.profile.delete.admin') }}
+ + {% else %} +{{ trans('user.profile.delete.notice', { site: site_name }) }}
+ + {% endif %} +