2018-03-24
This commit is contained in:
parent
11345fb3c6
commit
e00175401d
5 changed files with 114 additions and 40 deletions
|
@ -80,14 +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', 'POST'], '/user/{id:[2-9]|[1-9]\d+}/edit/profile', 'Profile:edit', 'EditUserProfile');
|
||||
$r->add(['GET', 'POST'], '/user/{id:[2-9]|[1-9]\d+}/edit/settings', 'Profile:settings', 'EditUserSettings');
|
||||
$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:edit', 'EditUserProfile');
|
||||
$r->add(['GET', 'POST'], '/user/{id:[2-9]|[1-9]\d+}/edit/config', 'Profile:config', 'EditBoardConfig');
|
||||
} elseif (! $user->isGuest) {
|
||||
// только свой профиль
|
||||
$r->add('GET', '/user/{id:' . $user->id . '}/{name}', 'Profile:view', 'User');
|
||||
$r->add(['GET', 'POST'], '/user/{id:' . $user->id . '}/edit/profile', 'Profile:edit', 'EditUserProfile');
|
||||
$r->add(['GET', 'POST'], '/user/{id:' . $user->id . '}/edit/settings', 'Profile:settings', 'EditUserSettings');
|
||||
$r->add('GET', '/user/{id:' . $user->id . '}/{name}', 'Profile:view', 'User');
|
||||
$r->add(['GET', 'POST'], '/user/{id:' . $user->id . '}/edit/profile', 'Profile:edit', 'EditUserProfile');
|
||||
$r->add(['GET', 'POST'], '/user/{id:' . $user->id . '}/edit/config', 'Profile:config', 'EditBoardConfig');
|
||||
}
|
||||
// пометка разделов прочитанными
|
||||
if (! $user->isGuest) {
|
||||
|
|
|
@ -43,7 +43,7 @@ class Profile extends Page
|
|||
$isAdmin = $this->user->isAdmin && ($myProf || ! $curUser->isAdmin);
|
||||
$isModer = $this->user->isAdmMod && ($myProf || ! $curUser->isAdmMod);
|
||||
$canEditProf = $myProf || $isAdmin || ($isModer && '1' == $this->user->g_mod_edit_users);
|
||||
$canEditSets = $myProf || $isAdmin || ($isModer && '1' == $this->user->g_mod_edit_users); // ????
|
||||
$canEditConf = $myProf || $isAdmin || ($isModer && '1' == $this->user->g_mod_edit_users); // ????
|
||||
|
||||
if ($isEdit) {
|
||||
if (! $canEditProf) {
|
||||
|
@ -122,13 +122,23 @@ class Profile extends Page
|
|||
$fieldset[] = [
|
||||
'type' => 'endwrap',
|
||||
];
|
||||
if ('1' == $this->c->config->o_avatars && $curUser->avatar) {
|
||||
$fieldset['avatar'] = [
|
||||
'id' => 'avatar',
|
||||
'type' => 'yield',
|
||||
'caption' => \ForkBB\__('Avatar'),
|
||||
'value' => 'avatar',
|
||||
];
|
||||
if ('1' == $this->c->config->o_avatars) {
|
||||
if ($isEdit && ! $curUser->avatar) { //// может стоит поле для загрузки вставить????
|
||||
$fieldset['avatar'] = [
|
||||
'id' => 'avatar',
|
||||
'class' => 'pline',
|
||||
'type' => 'str',
|
||||
'caption' => \ForkBB\__('Avatar'),
|
||||
'value' => \ForkBB\__('Not uploaded'),
|
||||
];
|
||||
} elseif ($curUser->avatar) {
|
||||
$fieldset['avatar'] = [
|
||||
'id' => 'avatar',
|
||||
'type' => 'yield',
|
||||
'caption' => \ForkBB\__('Avatar'),
|
||||
'value' => 'avatar',
|
||||
];
|
||||
}
|
||||
}
|
||||
$form['sets'][] = [
|
||||
'id' => 'header',
|
||||
|
@ -194,6 +204,7 @@ class Profile extends Page
|
|||
if ($isEdit) {
|
||||
$fieldset['gender'] = [
|
||||
'id' => 'gender',
|
||||
'class' => 'block',
|
||||
'type' => 'radio',
|
||||
'value' => $curUser->gender,
|
||||
'values' => $genders,
|
||||
|
@ -420,41 +431,57 @@ class Profile extends Page
|
|||
'fields' => $fieldset,
|
||||
];
|
||||
|
||||
if ($isEdit) {
|
||||
$this->robots = 'noindex';
|
||||
$this->crumbs = $this->crumbs(
|
||||
\ForkBB\__('Editing profile'),
|
||||
[$curUser->link, \ForkBB\__('User %s', $curUser->username)],
|
||||
[$this->c->Router->link('Userlist'), \ForkBB\__('User list')]
|
||||
);
|
||||
} else {
|
||||
$this->canonical = $curUser->link;
|
||||
$this->crumbs = $this->crumbs(
|
||||
[$curUser->link, \ForkBB\__('User %s', $curUser->username)],
|
||||
[$this->c->Router->link('Userlist'), \ForkBB\__('User list')]
|
||||
);
|
||||
}
|
||||
|
||||
$this->fIndex = $myProf ? 'profile' : 'userlist';
|
||||
$this->nameTpl = 'profile';
|
||||
$this->onlinePos = 'profile-' . $curUser->id; // ????
|
||||
$this->canonical = $curUser->link;
|
||||
$this->title = \ForkBB\__('%s\'s profile', $curUser->username);
|
||||
$this->crumbs = $this->crumbs(
|
||||
[$curUser->link, \ForkBB\__('User %s', $curUser->username)],
|
||||
[$this->c->Router->link('Userlist'), \ForkBB\__('User list')]
|
||||
);
|
||||
$this->form = $form;
|
||||
$this->curUser = $curUser;
|
||||
|
||||
$btns = [];
|
||||
if ($isAdmin || ($isModer && '1' == $this->user->g_mod_ban_users)) {
|
||||
if (! $myProf && ($isAdmin || ($isModer && '1' == $this->user->g_mod_ban_users))) {
|
||||
$btns['ban-user'] = [
|
||||
$this->c->Router->link('', ['id' => $curUser->id]),
|
||||
\ForkBB\__('Ban user'),
|
||||
];
|
||||
}
|
||||
if ($isAdmin || $isModer) { // ????
|
||||
if (! $myProf && ($isAdmin || $isModer)) { // ????
|
||||
$btns['delete-user'] = [
|
||||
$this->c->Router->link('', ['id' => $curUser->id]),
|
||||
\ForkBB\__('Delete user'),
|
||||
];
|
||||
}
|
||||
if ($canEditProf) {
|
||||
if (!$isEdit && $canEditProf) {
|
||||
$btns['edit-profile'] = [
|
||||
$this->c->Router->link('EditUserProfile', ['id' => $curUser->id]),
|
||||
\ForkBB\__('Edit profile'),
|
||||
\ForkBB\__('Edit '),
|
||||
];
|
||||
}
|
||||
if ($canEditSets) {
|
||||
if ($isEdit) {
|
||||
$btns['view-profile'] = [
|
||||
$curUser->link,
|
||||
\ForkBB\__('View '),
|
||||
];
|
||||
}
|
||||
if ($canEditConf) {
|
||||
$btns['edit-settings'] = [
|
||||
$this->c->Router->link('EditUserSettings', ['id' => $curUser->id]),
|
||||
\ForkBB\__('Edit settings'),
|
||||
$this->c->Router->link('EditBoardConfig', ['id' => $curUser->id]),
|
||||
\ForkBB\__('Configure '),
|
||||
];
|
||||
}
|
||||
$this->actionBtns = $btns;
|
||||
|
|
|
@ -384,12 +384,6 @@ msgstr "Gender"
|
|||
msgid "Unknown"
|
||||
msgstr "Unknown"
|
||||
|
||||
msgid "Edit profile"
|
||||
msgstr "Edit"
|
||||
|
||||
msgid "Edit settings"
|
||||
msgstr "Settings"
|
||||
|
||||
msgid "Contact details"
|
||||
msgstr "Contact details"
|
||||
|
||||
|
@ -401,3 +395,21 @@ msgstr "%s"
|
|||
|
||||
msgid "Email settings label"
|
||||
msgstr "Email settings"
|
||||
|
||||
msgid "View "
|
||||
msgstr "View"
|
||||
|
||||
msgid "Edit "
|
||||
msgstr "Edit"
|
||||
|
||||
msgid "Editing profile"
|
||||
msgstr "Editing profile"
|
||||
|
||||
msgid "Configure "
|
||||
msgstr "Configure"
|
||||
|
||||
msgid "Board configuration"
|
||||
msgstr "Board configuration"
|
||||
|
||||
msgid "Not uploaded"
|
||||
msgstr "Not uploaded"
|
||||
|
|
|
@ -384,12 +384,6 @@ msgstr "Пол"
|
|||
msgid "Unknown"
|
||||
msgstr "Неизвестно"
|
||||
|
||||
msgid "Edit profile"
|
||||
msgstr "Редактировать"
|
||||
|
||||
msgid "Edit settings"
|
||||
msgstr "Настройки"
|
||||
|
||||
msgid "Contact details"
|
||||
msgstr "Контактная информация"
|
||||
|
||||
|
@ -401,3 +395,21 @@ msgstr "%s"
|
|||
|
||||
msgid "Email settings label"
|
||||
msgstr "Настройки email"
|
||||
|
||||
msgid "View "
|
||||
msgstr "Просмотреть"
|
||||
|
||||
msgid "Edit "
|
||||
msgstr "Редактировать"
|
||||
|
||||
msgid "Editing profile"
|
||||
msgstr "Редактирование профиля"
|
||||
|
||||
msgid "Configure "
|
||||
msgstr "Настроить"
|
||||
|
||||
msgid "Board configuration"
|
||||
msgstr "Настрйока форума"
|
||||
|
||||
msgid "Not uploaded"
|
||||
msgstr "Не загружена"
|
||||
|
|
|
@ -2128,6 +2128,10 @@ select {
|
|||
.f-fs-data dd {
|
||||
width: 67%
|
||||
}
|
||||
|
||||
.f-field-pline .f-child1:after {
|
||||
content: "";
|
||||
}
|
||||
}
|
||||
|
||||
/****************************/
|
||||
|
@ -2160,6 +2164,25 @@ select {
|
|||
height: 11rem;
|
||||
}
|
||||
|
||||
#id-fs-activity.f-fs-data-edit .f-child1:after {
|
||||
content: ": ";
|
||||
.f-fs-data-edit #id-admin_note {
|
||||
background-color: #FFBABA;
|
||||
}
|
||||
|
||||
@media screen and (min-width: 40rem) {
|
||||
.f-fs-header-edit dl,
|
||||
.f-fs-data-edit dl {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.f-fs-header-edit dt,
|
||||
.f-fs-data-edit dt {
|
||||
width: 33%;
|
||||
text-align: right;
|
||||
padding-right: 0.625rem;
|
||||
}
|
||||
|
||||
.f-fs-header-edit dd,
|
||||
.f-fs-data-edit dd {
|
||||
width: 67%
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue