2018-03-23
This commit is contained in:
parent
86d18106f7
commit
04bf4e0505
5 changed files with 33 additions and 2 deletions
|
@ -80,10 +80,14 @@ class Routing
|
|||
$r->add('GET', '/userlist[/{sort:username|registered|num_posts}/{dir:ASC|DESC}/{group:\-1|[1-9]\d*}/{name}][/{page:[1-9]\d*}]', 'Userlist:view', 'Userlist');
|
||||
$r->add('POST', '/userlist', 'Userlist:view');
|
||||
// юзеры
|
||||
$r->add('GET', '/user/{id:[2-9]|[1-9]\d+}/{name}', 'Profile:view', 'User'); //????
|
||||
$r->add('GET', '/user/{id:[2-9]|[1-9]\d+}/{name}', 'Profile:view', 'User');
|
||||
$r->add(['GET', 'POST'], '/user/{id:[2-9]|[1-9]\d+}/edit/profile', 'Profile:profile', 'EditUserProfile');
|
||||
$r->add(['GET', 'POST'], '/user/{id:[2-9]|[1-9]\d+}/edit/settings', 'Profile:settings', 'EditUserSettings');
|
||||
} elseif (! $user->isGuest) {
|
||||
// только свой профиль
|
||||
$r->add('GET', '/user/{id:' . $user->id . '}/{name}', 'Profile:view', 'User');
|
||||
$r->add('GET', '/user/{id:' . $user->id . '}/{name}', 'Profile:view', 'User');
|
||||
$r->add(['GET', 'POST'], '/user/{id:' . $user->id . '}/edit/profile', 'Profile:profile', 'EditUserProfile');
|
||||
$r->add(['GET', 'POST'], '/user/{id:' . $user->id . '}/edit/settings', 'Profile:settings', 'EditUserSettings');
|
||||
}
|
||||
// пометка разделов прочитанными
|
||||
if (! $user->isGuest) {
|
||||
|
|
|
@ -258,6 +258,9 @@ class Profile extends Page
|
|||
$this->form = $form;
|
||||
$this->curUser = $curUser;
|
||||
|
||||
$this->linkEditProfile = $this->c->Router->link('EditUserProfile', ['id' => $curUser->id]);
|
||||
$this->linkEditSettings = $this->c->Router->link('EditUserSettings', ['id' => $curUser->id]);
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -386,3 +386,9 @@ msgstr "Gender"
|
|||
|
||||
msgid "Unknown"
|
||||
msgstr "Unknown"
|
||||
|
||||
msgid "Edit profile"
|
||||
msgstr "Edit"
|
||||
|
||||
msgid "Edit settings"
|
||||
msgstr "Settings"
|
||||
|
|
|
@ -386,3 +386,9 @@ msgstr "Пол"
|
|||
|
||||
msgid "Unknown"
|
||||
msgstr "Неизвестно"
|
||||
|
||||
msgid "Edit profile"
|
||||
msgstr "Редактировать"
|
||||
|
||||
msgid "Edit settings"
|
||||
msgstr "Настройки"
|
||||
|
|
|
@ -16,6 +16,18 @@
|
|||
@extends ('layouts/main')
|
||||
<div class="f-nav-links">
|
||||
@yield ('crumbs')
|
||||
@if ($p->linkEditProfile || $p->linkEditSettings)
|
||||
<div class="f-nlinks-b">
|
||||
<div class="f-actions-links">
|
||||
@if ($p->linkEditProfile)
|
||||
<a class="f-btn f-btn-edit-profile" href="{!! $p->linkEditProfile !!}">{!! __('Edit profile') !!}</a>
|
||||
@endif
|
||||
@if ($p->linkEditSettings)
|
||||
<a class="f-btn f-btn-edit-settings" href="{!! $p->linkEditSettings !!}">{!! __('Edit settings') !!}</a>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
@if ($form = $p->form)
|
||||
<section class="f-main f-profile">
|
||||
|
|
Loading…
Add table
Reference in a new issue