2018-04-23

This commit is contained in:
Visman 2018-04-23 22:33:24 +07:00
parent 009754078b
commit 5d28e0be05
5 changed files with 195 additions and 100 deletions

View file

@ -69,36 +69,37 @@ class Categories extends Admin
], ],
]; ];
$fieldset = [];
foreach ($this->c->categories->getList() as $key => $row) { foreach ($this->c->categories->getList() as $key => $row) {
$fieldset["form[{$key}][cat_name]"] = [ $fields = [];
'class' => ['name', 'adm-inline'], $fields["form[{$key}][cat_name]"] = [
'class' => ['name', 'category'],
'type' => 'text', 'type' => 'text',
'maxlength' => 80, 'maxlength' => 80,
'value' => $row['cat_name'], 'value' => $row['cat_name'],
'caption' => \ForkBB\__('Category name label'), 'caption' => \ForkBB\__('Category name label'),
'required' => true, 'required' => true,
]; ];
$fieldset["form[{$key}][disp_position]"] = [ $fields["form[{$key}][disp_position]"] = [
'class' => ['position', 'adm-inline'], 'class' => ['position', 'category'],
'type' => 'number', 'type' => 'number',
'min' => 0, 'min' => 0,
'max' => 9999999999, 'max' => 9999999999,
'value' => $row['disp_position'], 'value' => $row['disp_position'],
'caption' => \ForkBB\__('Category position label'), 'caption' => \ForkBB\__('Category position label'),
]; ];
$fieldset[] = [ $fields["delete-btn{$key}"] = [
'class' => ['delete', 'adm-inline'], 'class' => ['delete', 'category'],
'type' => 'btn', 'type' => 'btn',
'value' => '❌', 'value' => '❌',
'caption' => \ForkBB\__('Delete'), 'caption' => \ForkBB\__('Delete'),
'link' => $this->c->Router->link('AdminCategoriesDelete', ['id' => $key]), 'link' => $this->c->Router->link('AdminCategoriesDelete', ['id' => $key]),
]; ];
$form['sets']["category{$key}"] = [
'class' => 'category',
'legend' => $row['cat_name'],
'fields' => $fields,
];
} }
$form['sets']['cats'] = [
'class' => 'inline',
'fields' => $fieldset,
];
$form['sets']['new-cat'] = [ $form['sets']['new-cat'] = [
'fields' => [ 'fields' => [
'new' => [ 'new' => [

View file

@ -87,14 +87,14 @@ class Censoring extends Admin
$fieldset = []; $fieldset = [];
foreach ($this->c->censorship->load() as $id => $row) { foreach ($this->c->censorship->load() as $id => $row) {
$fieldset["form[{$id}][search_for]"] = [ $fieldset["form[{$id}][search_for]"] = [
'class' => ['censor', 'adm-inline'], 'class' => ['censor'],
'type' => 'text', 'type' => 'text',
'maxlength' => 60, 'maxlength' => 60,
'value' => $row['search_for'], 'value' => $row['search_for'],
'caption' => \ForkBB\__('Censored word label'), 'caption' => \ForkBB\__('Censored word label'),
]; ];
$fieldset["form[{$id}][replace_with]"] = [ $fieldset["form[{$id}][replace_with]"] = [
'class' => ['censor', 'adm-inline'], 'class' => ['censor'],
'type' => 'text', 'type' => 'text',
'maxlength' => 60, 'maxlength' => 60,
'value' => $row['replace_with'], 'value' => $row['replace_with'],
@ -102,14 +102,14 @@ class Censoring extends Admin
]; ];
} }
$fieldset["form[0][search_for]"] = [ $fieldset["form[0][search_for]"] = [
'class' => ['censor', 'adm-inline'], 'class' => ['censor'],
'type' => 'text', 'type' => 'text',
'maxlength' => 60, 'maxlength' => 60,
'value' => '', 'value' => '',
'caption' => \ForkBB\__('Censored word label'), 'caption' => \ForkBB\__('Censored word label'),
]; ];
$fieldset["form[0][replace_with]"] = [ $fieldset["form[0][replace_with]"] = [
'class' => ['censor', 'adm-inline'], 'class' => ['censor'],
'type' => 'text', 'type' => 'text',
'maxlength' => 60, 'maxlength' => 60,
'value' => '', 'value' => '',
@ -117,7 +117,7 @@ class Censoring extends Admin
]; ];
$form['sets']['cens'] = [ $form['sets']['cens'] = [
'class' => 'inline', 'class' => 'censor',
'fields' => $fieldset, 'fields' => $fieldset,
]; ];

View file

@ -143,20 +143,11 @@ class Forums extends Admin
if ($root instanceof Forum) { if ($root instanceof Forum) {
$list = $this->c->forums->depthList($root, -1); $list = $this->c->forums->depthList($root, -1);
$cid = null;
$fieldset = [];
$cid = null;
foreach ($list as $forum) { foreach ($list as $forum) {
if ($cid !== $forum->cat_id) { if ($cid !== $forum->cat_id) {
if (null !== $cid) { $form['sets']["category{$forum->cat_id}-info"] = [
$form['sets']["cat{$cid}"] = [
'class' => 'inline',
'fields' => $fieldset,
];
$fieldset = [];
}
$form['sets']["cat{$forum->cat_id}-info"] = [
'info' => [ 'info' => [
'info1' => [ 'info1' => [
'type' => '', //???? 'type' => '', //????
@ -167,15 +158,16 @@ class Forums extends Admin
$cid = $forum->cat_id; $cid = $forum->cat_id;
} }
$fieldset["forum{$forum->id}"] = [ $fields = [];
'class' => ['name', 'adm-inline', 'depth' . $forum->depth], $fields["name-btn{$forum->id}"] = [
'class' => ['name', 'forum', 'depth' . $forum->depth],
'type' => 'btn', 'type' => 'btn',
'value' => $forum->forum_name, 'value' => $forum->forum_name,
'caption' => \ForkBB\__('Forum label'), 'caption' => \ForkBB\__('Forum label'),
'link' => $this->c->Router->link('AdminForumsEdit', ['id' => $forum->id]), 'link' => $this->c->Router->link('AdminForumsEdit', ['id' => $forum->id]),
]; ];
$fieldset["form[{$forum->id}][disp_position]"] = [ $fields["form[{$forum->id}][disp_position]"] = [
'class' => ['position', 'adm-inline'], 'class' => ['position', 'forum'],
'type' => 'number', 'type' => 'number',
'min' => 0, 'min' => 0,
'max' => 9999999999, 'max' => 9999999999,
@ -183,20 +175,20 @@ class Forums extends Admin
'caption' => \ForkBB\__('Position label'), 'caption' => \ForkBB\__('Position label'),
]; ];
$disabled = (bool) $forum->subforums; $disabled = (bool) $forum->subforums;
$fieldset["forum{$forum->id}-del"] = [ $fields["delete-btn{$forum->id}"] = [
'class' => ['delete', 'adm-inline'], 'class' => ['delete', 'forum'],
'type' => 'btn', 'type' => 'btn',
'value' => '❌', 'value' => '❌',
'caption' => \ForkBB\__('Delete'), 'caption' => \ForkBB\__('Delete'),
'link' => $disabled ? '#' : $this->c->Router->link('AdminForumsDelete', ['id' => $forum->id]), 'link' => $disabled ? '#' : $this->c->Router->link('AdminForumsDelete', ['id' => $forum->id]),
'disabled' => $disabled, 'disabled' => $disabled,
]; ];
$form['sets']["forum{$forum->id}"] = [
'class' => 'forum',
'legend' => $forum->cat_name . ' / ' . $forum->forum_name,
'fields' => $fields,
];
} }
$form['sets']["cat{$cid}"] = [
'class' => 'inline',
'fields' => $fieldset,
];
} }
$this->nameTpl = 'admin/form'; $this->nameTpl = 'admin/form';
@ -495,11 +487,11 @@ class Forums extends Admin
], ],
]; ];
$aOn = ['cando', 'adm-inline', 'on']; $aOn = ['cando', 'on'];
$aOff = ['cando', 'adm-inline', 'off']; $aOff = ['cando', 'off'];
foreach ($this->c->groups->Perm->get($forum) as $id => $group) { foreach ($this->c->groups->Perm->get($forum) as $id => $group) {
$fieldset = []; $fields = [];
$fieldset["perms[{$id}][read_forum]"] = [ $fields["perms[{$id}][read_forum]"] = [
'class' => $group->def_read_forum ? $aOn : $aOff, 'class' => $group->def_read_forum ? $aOn : $aOff,
'type' => 'checkbox', 'type' => 'checkbox',
'value' => '1', 'value' => '1',
@ -508,7 +500,7 @@ class Forums extends Admin
'checked' => $group->set_read_forum, 'checked' => $group->set_read_forum,
'disabled' => $group->dis_read_forum, 'disabled' => $group->dis_read_forum,
]; ];
$fieldset["perms[{$id}][post_replies]"] = [ $fields["perms[{$id}][post_replies]"] = [
'class' => $group->def_post_replies ? $aOn : $aOff, 'class' => $group->def_post_replies ? $aOn : $aOff,
'type' => 'checkbox', 'type' => 'checkbox',
'value' => '1', 'value' => '1',
@ -517,7 +509,7 @@ class Forums extends Admin
'checked' => $group->set_post_replies, 'checked' => $group->set_post_replies,
'disabled' => $group->dis_post_replies, 'disabled' => $group->dis_post_replies,
]; ];
$fieldset["perms[{$id}][post_topics]"] = [ $fields["perms[{$id}][post_topics]"] = [
'class' => $group->def_post_topics ? $aOn : $aOff, 'class' => $group->def_post_topics ? $aOn : $aOff,
'type' => 'checkbox', 'type' => 'checkbox',
'value' => '1', 'value' => '1',
@ -528,9 +520,9 @@ class Forums extends Admin
]; ];
$form['sets']["perms{$id}"] = [ $form['sets']["perms{$id}"] = [
'class' => 'inline', 'class' => 'permission',
'legend' => \ForkBB\e($group->g_title), 'legend' => \ForkBB\e($group->g_title),
'fields' => $fieldset, 'fields' => $fields,
]; ];
} }

View file

@ -509,7 +509,7 @@ class Users extends Admin
$fields = []; $fields = [];
$fields["l{$number}-username"] = [ $fields["l{$number}-username"] = [
# 'class' => 'pline', 'class' => ['result'],
'type' => 'link', 'type' => 'link',
'caption' => \ForkBB\__('Results username head'), 'caption' => \ForkBB\__('Results username head'),
'value' => $user->username, 'value' => $user->username,
@ -517,7 +517,7 @@ class Users extends Admin
# 'title' => \ForkBB\__('Show posts'), # 'title' => \ForkBB\__('Show posts'),
]; ];
$fields["l{$number}-email"] = [ $fields["l{$number}-email"] = [
# 'class' => 'pline', 'class' => ['result'],
'type' => 'link', 'type' => 'link',
'caption' => \ForkBB\__('Results e-mail head'), 'caption' => \ForkBB\__('Results e-mail head'),
'value' => $user->email, 'value' => $user->email,
@ -525,13 +525,13 @@ class Users extends Admin
# 'title' => \ForkBB\__('Show posts'), # 'title' => \ForkBB\__('Show posts'),
]; ];
$fields["l{$number}-title"] = [ $fields["l{$number}-title"] = [
# 'class' => 'pline', 'class' => ['result'],
'type' => 'str', 'type' => 'str',
'caption' => \ForkBB\__('Results title head'), 'caption' => \ForkBB\__('Results title head'),
'value' => $user->title(), 'value' => $user->title(),
]; ];
$fields["l{$number}-posts"] = [ $fields["l{$number}-posts"] = [
# 'class' => 'pline', 'class' => ['result'],
'type' => $user->num_posts ? 'link' : 'str', 'type' => $user->num_posts ? 'link' : 'str',
'caption' => \ForkBB\__('Results posts head'), 'caption' => \ForkBB\__('Results posts head'),
'value' => \ForkBB\num($user->num_posts), 'value' => \ForkBB\num($user->num_posts),
@ -539,7 +539,7 @@ class Users extends Admin
'title' => \ForkBB\__('Results show posts link'), 'title' => \ForkBB\__('Results show posts link'),
]; ];
$fields["l{$number}-note"] = [ $fields["l{$number}-note"] = [
# 'class' => 'pline', 'class' => ['result'],
'type' => 'str', 'type' => 'str',
'caption' => \ForkBB\__('Примечание админа'), 'caption' => \ForkBB\__('Примечание админа'),
'value' => $user->admin_note, 'value' => $user->admin_note,
@ -549,6 +549,7 @@ class Users extends Admin
$form['sets']["l{$number}"] = [ $form['sets']["l{$number}"] = [
'class' => 'result',
'legend' => $number, 'legend' => $number,
'fields' => $fields, 'fields' => $fields,
]; ];

View file

@ -1663,62 +1663,107 @@ select {
/*********************/ /*********************/
/* Админка/Категории */ /* Админка/Категории */
/* Админка/Разделы */
/*********************/ /*********************/
.f-fs-inline { .f-fs-category {
display: flex; display: flex;
flex-wrap: wrap; align-items: flex-end;
min-width: 0;
} }
.f-fs-inline .f-field-adm-inline, .f-fs-category > legend {
.f-fs-inline .f-field-cando {
display: block;
}
.f-field-adm-inline > dt {
width: 100%;
margin: 0;
display: none; display: none;
} }
.f-field-adm-inline > dd { .f-fs-category .f-child1 {
display: block; font-weight: normal;
}
.f-field-category {
flex-direction: column;
}
.f-field-category > dt {
display: none;
}
.f-field-category > dd {
width: 100%; width: 100%;
} }
.f-field-adm-inline.f-field-name { .f-fs-category:first-of-type .f-field-category > dt {
display: block;
width: 100%;
margin: 0;
white-space: nowrap;
overflow: hidden;
}
.f-field-category.f-field-name {
width: calc(100% - 8rem); width: calc(100% - 8rem);
} }
.f-field-adm-inline.f-field-position { .f-field-category.f-field-position {
width: 5rem; width: 5rem;
} }
.f-field-adm-inline.f-field-delete { .f-field-category.f-field-delete {
width: 3rem; width: 3rem;
overflow: hidden; overflow: hidden;
}
.f-field-adm-inline .f-btn {
margin: 0;
}
.f-field-delete .f-btn {
text-align: center; text-align: center;
} }
.f-field-name .f-btn { /*********************/
/* Админка/Разделы */
/*********************/
.f-fs-forum {
display: flex;
align-items: flex-end;
min-width: 0;
}
.f-fs-forum > legend {
display: none;
}
.f-fs-forum .f-child1 {
font-weight: normal;
}
.f-field-forum {
flex-direction: column;
}
.f-field-forum > dt {
display: none;
}
.f-field-forum > dd {
width: 100%;
}
.f-finfo + .f-fs-forum .f-field-forum > dt {
display: block;
width: 100%;
margin: 0;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis;
} }
.f-field-adm-inline:nth-child(-n+3) > dt { .f-field-forum.f-field-name {
display: block; width: calc(100% - 8rem);
} }
.f-field-adm-inline .f-child1 { .f-field-forum.f-field-position {
font-weight: normal; width: 5rem;
}
.f-field-forum.f-field-delete {
width: 3rem;
overflow: hidden;
text-align: center;
}
.f-field-forum.f-field-name .f-btn {
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
@ -1744,27 +1789,33 @@ select {
padding-left: 3.125rem; padding-left: 3.125rem;
} }
/*********************/ .f-fs-permission {
/* Админка/Разделы */ display: flex;
/*********************/ flex-wrap: wrap;
.f-field-adm-inline.f-field-cando { align-items: flex-end;
min-width: 0;
}
.f-fs-permission > legend {
margin: 0;
}
.f-fs-permission .f-child1 {
font-weight: normal;
}
.f-fs-permission .f-field-cando {
width: 33.333%; width: 33.333%;
text-align: center; text-align: center;
position: relative; position: relative;
display: flex;
flex-direction: column;
} }
.f-field-adm-inline.f-field-cando > dt { .f-fs-permission .f-field-cando > dt,
display: block; .f-fs-permission .f-field-cando > dd {
} width: 100%;
margin: 0;
/* .f-field-adm-inline > dt > label {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
} */
.f-editforum-form legend {
margin-bottom: 0;
} }
.f-field-on input:not(:checked) + span { .f-field-on input:not(:checked) + span {
@ -1813,16 +1864,34 @@ select {
/*********************/ /*********************/
/* Админка/Цензура */ /* Админка/Цензура */
/*********************/ /*********************/
.f-field-adm-inline.f-field-censor { .f-fs-censor {
width: 50%; display: flex;
flex-wrap: wrap;
align-items: flex-end;
min-width: 0;
} }
.f-field-adm-inline.f-field-censor > dt { .f-fs-censor .f-child1 {
font-weight: normal;
}
.f-fs-censor .f-field-censor {
width: 50%;
display: flex;
flex-direction: column;
}
.f-fs-censor .f-field-censor > dt {
display: none; display: none;
} }
.f-field-adm-inline.f-field-censor:nth-child(-n+2) > dt { .f-fs-censor .f-field-censor > dd {
width: 100%;
}
.f-field-censor:nth-child(-n+2) > dt {
display: block; display: block;
width: 100%;
} }
/*************/ /*************/
@ -2208,3 +2277,35 @@ select {
width: 67% width: 67%
} }
} }
/************************/
/* Админка/Пользователи */
/************************/
.f-fs-result {
display: flex;
align-items: flex-end;
min-width: 0;
}
.f-fs-result > legend {
display: none;
}
.f-fs-result .f-field-result {
display: flex;
flex-direction: column;
}
.f-fs-result .f-field-result > dt {
display: none;
}
.f-fs-result .f-field-result > dd {
width: 100%;
}
.f-fs-result:first-of-type .f-field-result > dt {
display: block;
margin: 0;
width: 100%;
}