2018-03-19

This commit is contained in:
Visman 2018-03-19 14:39:39 +07:00
parent e5a7828be9
commit 5d17bbd019
13 changed files with 539 additions and 99 deletions

View file

@ -43,7 +43,7 @@ class Routing
$r->add(['GET', 'POST'], '/login/{email}/{key}/{hash}', 'Auth:changePass', 'ChangePassword');
// регистрация
if ($config->o_regs_allow == '1') {
if ('1' == $config->o_regs_allow) {
$r->add('GET', '/registration', 'Rules:confirmation', 'Register');
$r->add('POST', '/registration/agree', 'Register:reg', 'RegisterForm');
$r->add('GET', '/registration/activate/{id:\d+}/{key}/{hash}', 'Register:activate', 'RegActivate');
@ -57,15 +57,15 @@ class Routing
$r->add('GET', '/registration[/{tail:.*}]', 'Redirect:toIndex');
}
// просмотр разрешен
if ($user->g_read_board == '1') {
if ('1' == $user->g_read_board) {
// главная
$r->add('GET', '/', 'Index:view', 'Index');
// правила
if ($config->o_rules == '1' && (! $user->isGuest || $config->o_regs_allow == '1')) {
if ('1' == $config->o_rules && (! $user->isGuest || '1' == $config->o_regs_allow)) {
$r->add('GET', '/rules', 'Rules:view', 'Rules');
}
// поиск
if ($user->g_search == '1') {
if ('1' == $user->g_search) {
$r->add('GET', '/search[/simple/{keywords}[/{page:[1-9]\d*}]]', 'Search:view', 'Search');
$r->add('POST', '/search', 'Search:view');
@ -75,7 +75,7 @@ class Routing
$r->add('GET', '/search/{action:(?!search)\w+}[/{page:[1-9]\d*}]', 'Search:action', 'SearchAction');
}
// юзеры
if ($user->g_view_users == '1') {
if ($user->viewUsers) {
// список пользователей
$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');

View file

@ -918,7 +918,7 @@ class Install extends Page
'warning_flag' => ['TINYINT(1)', false, 0],
'warning_all' => ['INT(10) UNSIGNED', false, 0],
'gender' => ['TINYINT(4) UNSIGNED', false, 0],
'u_mark_all_read' => ['INT(10) UNSIGNED', true],
'u_mark_all_read' => ['INT(10) UNSIGNED', false, 0],
],
'PRIMARY KEY' => ['id'],
'UNIQUE KEYS' => [

View file

@ -0,0 +1,232 @@
<?php
namespace ForkBB\Models\Pages;
use ForkBB\Models\Page;
use ForkBB\Models\User\Model as User;
class Profile extends Page
{
use CrumbTrait;
/**
* Подготавливает данные для шаблона
*
* @param array $args
* @param string $method
*
* @return Page
*/
public function view(array $args, $method)
{
$curUser = $this->c->users->load((int) $args['id']);
if (! $curUser instanceof User || ($curUser->isUnverified && ! $this->user->isAdmMod)) {
return $this->c->Message->message('Bad request');
}
$this->c->Lang->load('profile');
$isEdit = false;
$clSuffix = $isEdit ? '-edit' : '';
if ($isEdit) {
$form = [
'action' => $this->c->Router->link(''),
'hidden' => [
'token' => $this->c->Csrf->create(''),
],
'sets' => [],
'btns' => [
'save' => [
'type' => 'submit',
'value' => \ForkBB\__('Save changes'),
'accesskey' => 's',
],
],
];
} else {
$form = ['sets' => []];
}
$fieldset = [];
$fieldset[] = [
'class' => 'usertitle',
'type' => 'wrap',
];
$fieldset['username'] = [
'id' => 'username',
'type' => 'text',
'maxlength' => 25,
'title' => \ForkBB\__('Username'),
'required' => true,
'pattern' => '^.{2,25}$',
'value' => $curUser->username,
];
$fieldset['title'] = [
'id' => 'title',
'type' => 'text',
'maxlength' => 50,
'title' => \ForkBB\__('Title'),
'value' => $isEdit ? $curUser->title : $curUser->title(),
];
$fieldset[] = [
'type' => 'endwrap',
];
if ('1' == $this->c->config->o_avatars && $curUser->avatar) {
$fieldset['avatar'] = [
'id' => 'avatar',
'type' => 'yield',
'title' => \ForkBB\__('Avatar'),
'value' => 'avatar',
];
}
$form['sets'][] = [
'id' => 'header',
'class' => 'header' . $clSuffix,
# 'legend' => \ForkBB\__('Options'),
'fields' => $fieldset,
];
$fieldset = [];
if ($isEdit || $curUser->realname) {
$fieldset['realname'] = [
'id' => 'realname',
'type' => 'text',
'maxlength' => 40,
'title' => \ForkBB\__('Realname'),
'value' => $isEdit ? $curUser->realname : \ForkBB\cens($curUser->realname),
];
}
if ($isEdit || $curUser->gender) {
$fieldset['gender'] = [
'id' => 'gender',
'type' => 'radio',
'value' => $curUser->gender,
'values' => [
0 => \ForkBB\__('Unknown'),
1 => \ForkBB\__('Male'),
2 => \ForkBB\__('Female'),
],
'title' => \ForkBB\__('Gender'),
];
}
if ($isEdit || $curUser->location) {
$fieldset['location'] = [
'id' => 'location',
'type' => 'text',
'maxlength' => 40,
'title' => \ForkBB\__('Location'),
'value' => $isEdit ? $curUser->location : \ForkBB\cens($curUser->location),
];
}
if ($isEdit || $curUser->url) {
$fieldset['url'] = [
'id' => 'website',
'type' => 'text',
'maxlength' => 100,
'title' => \ForkBB\__('Website'),
'value' => $isEdit ? $curUser->url : \ForkBB\cens($curUser->url),
];
}
if (! empty($fieldset)) {
$form['sets'][] = [
'id' => 'personal',
'class' => 'data' . $clSuffix,
'legend' => \ForkBB\__('Section personal'),
'fields' => $fieldset,
];
}
$fieldset = [];
if ($isEdit) {
$fieldset['signature'] = [
'id' => 'signature',
'type' => 'textarea',
'value' => $curUser->signature,
'title' => \ForkBB\__('Signature'),
];
} elseif ($curUser->signature) { //????
$fieldset['signature'] = [
'id' => 'signature',
'type' => 'yield',
'title' => \ForkBB\__('Signature'),
'value' => 'signature',
];
}
if (! empty($fieldset)) {
$form['sets'][] = [
'id' => 'signature',
'class' => 'data' . $clSuffix,
'legend' => \ForkBB\__('Signature'),
'fields' => $fieldset,
];
}
$fieldset = [];
$fieldset['registered'] = [
'id' => 'registered',
'type' => 'str',
'value' => \ForkBB\dt($curUser->registered, true),
'title' => \ForkBB\__('Registered info'),
];
$fieldset['lastvisit'] = [
'id' => 'lastvisit',
'type' => 'str',
'value' => \ForkBB\dt($curUser->last_visit, true),
'title' => \ForkBB\__('Last visit info'),
];
$fieldset['lastpost'] = [
'id' => 'lastpost',
'type' => 'str',
'value' => \ForkBB\dt($curUser->last_post, true),
'title' => \ForkBB\__('Last post info'),
];
if ($curUser->num_posts) {
if ('1' == $this->user->g_search && $this->user->showPostCount) {
$fieldset['posts'] = [
'id' => 'posts',
'type' => 'yield',
'title' => \ForkBB\__('Posts info'),
'value' => 'totalposts',
];
$fieldset['topics'] = [
'id' => 'topics',
'type' => 'yield',
'title' => \ForkBB\__('Topics info'),
'value' => 'totaltopics',
];
} elseif ($this->user->showPostCount) {
$fieldset['posts'] = [
'id' => 'posts',
'type' => 'str',
'title' => \ForkBB\__('Posts info'),
'value' => \ForkBB\num($curUser->num_posts),
];
$fieldset['topics'] = [
'id' => 'topics',
'type' => 'str',
'title' => \ForkBB\__('Topics info'),
'value' => \ForkBB\num($curUser->num_topics),
];
}
}
$form['sets'][] = [
'id' => 'activity',
'class' => 'data' . $clSuffix,
'legend' => \ForkBB\__('User activity'),
'fields' => $fieldset,
];
$this->fIndex = $curUser->id === $this->user->id ? '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, $this->title]);
$this->form = $form;
$this->curUser = $curUser;
return $this;
}
}

View file

@ -185,6 +185,8 @@ class Model extends DataModel
return \ForkBB\cens($this->g_user_title);
} elseif ($this->isGuest) {
return \ForkBB\__('Guest');
} elseif ($this->isUnverified) {
return \ForkBB\__('Unverified');
} else {
return \ForkBB\__('Member');
}

View file

@ -136,6 +136,7 @@ return [
'Ban' => \ForkBB\Models\Pages\Ban::class,
'Debug' => \ForkBB\Models\Pages\Debug::class,
'Misc' => \ForkBB\Models\Pages\Misc::class,
'Profile' => \ForkBB\Models\Pages\Profile::class,
'AdminIndex' => \ForkBB\Models\Pages\Admin\Index::class,
'AdminStatistics' => \ForkBB\Models\Pages\Admin\Statistics::class,
'AdminOptions' => \ForkBB\Models\Pages\Admin\Options::class,

View file

@ -98,7 +98,7 @@ function num($number, $decimals = 0)
{
return \is_numeric($number)
? \number_format($number, $decimals, __('lang_decimal_point'), __('lang_thousands_sep'))
: 'not a number';
: '-';
}
/**

View file

@ -259,6 +259,9 @@ msgstr "Banned"
msgid "Guest"
msgstr "Guest"
msgid "Unverified"
msgstr "Непроверенный"
msgid "BBCode error no opening tag"
msgstr "[/%1$s] was found without a matching [%1$s]"
@ -483,3 +486,9 @@ msgstr "Topics with your posts"
msgid "Find topics with your posts"
msgstr "Find topics with your posts"
msgid "Male"
msgstr "Male"
msgid "Female"
msgstr "Female"

View file

@ -171,8 +171,8 @@ msgstr "The title you entered contains a forbidden word. You must choose a diffe
msgid "Profile redirect"
msgstr "Profile updated. Redirecting …"
msgid "Users profile"
msgstr "%s\"s profile"
msgid "%s's profile"
msgstr "%s's profile"
msgid "Username info"
msgstr "Username: %s"
@ -180,23 +180,26 @@ msgstr "Username: %s"
msgid "Email info"
msgstr "Email: %s"
msgid "Posts info"
msgstr "Posts: %s"
msgid "Registered info"
msgstr "Registered: %s"
msgstr "Registered"
msgid "Last post info"
msgstr "Last post: %s"
msgstr "Last post"
msgid "Last visit info"
msgstr "Last visit: %s"
msgstr "Last visit"
msgid "Posts info"
msgstr "Total posts"
msgid "Show posts"
msgstr "Show all posts"
msgstr "Show user's posts"
msgid "Topics info"
msgstr "Total topics"
msgid "Show topics"
msgstr "Show all topics"
msgstr "Show user's topics"
msgid "Show subscriptions"
msgstr "Show all subscriptions"
@ -377,3 +380,9 @@ msgstr "Redirecting …"
msgid "No delete admin message"
msgstr "Administrators cannot be deleted. In order to delete this user, you must first move him/her to a different user group."
msgid "Gender"
msgstr "Gender"
msgid "Unknown"
msgstr "Unknown"

View file

@ -261,6 +261,9 @@ msgstr "Забанен"
msgid "Guest"
msgstr "Гость"
msgid "Unverified"
msgstr "Непроверенный"
msgid "BBCode error no opening tag"
msgstr "Обнаружен парный тег [/%1$s] без соответствующего начального тега [%1$s]"
@ -485,3 +488,9 @@ msgstr "Темы с вашим участием"
msgid "Find topics with your posts"
msgstr "Найти темы с вашим участием"
msgid "Male"
msgstr "Мужской"
msgid "Female"
msgstr "Женский"

View file

@ -171,7 +171,7 @@ msgstr "В вашем титуле содержится запрещенное
msgid "Profile redirect"
msgstr "Профиль обновлен. Переадресация &hellip;"
msgid "Users profile"
msgid "%s's profile"
msgstr "Профиль пользователя %s"
msgid "Username info"
@ -180,23 +180,26 @@ msgstr "Пользователь: %s"
msgid "Email info"
msgstr "Email: %s"
msgid "Posts info"
msgstr "Сообщений: %s"
msgid "Registered info"
msgstr "Дата регистрации: %s"
msgstr "Дата регистрации"
msgid "Last post info"
msgstr "Последнее сообщение: %s"
msgstr "Последнее сообщение"
msgid "Last visit info"
msgstr "Последний визит: %s"
msgstr "Последний визит"
msgid "Posts info"
msgstr "Всего сообщений"
msgid "Show posts"
msgstr "Просмотреть все сообщения"
msgstr "Показать сообщения пользователя"
msgid "Topics info"
msgstr "Всего тем"
msgid "Show topics"
msgstr "Просмотреть все темы"
msgstr "Показать темы пользователя"
msgid "Show subscriptions"
msgstr "Просмотреть все подписки"
@ -205,7 +208,7 @@ msgid "Realname"
msgstr "Настоящее имя"
msgid "Location"
msgstr "Местоположение"
msgstr "Откуда"
msgid "Website"
msgstr "Сайт"
@ -377,3 +380,9 @@ msgstr "Переадресация &hellip;"
msgid "No delete admin message"
msgstr "Учетная запись администратора не может быть удалена. Чтобы удалить эту учетную запись, надо переместить пользователя в группу с более низкими правами."
msgid "Gender"
msgstr "Пол"
msgid "Unknown"
msgstr "Неизвестно"

View file

@ -1,109 +1,129 @@
@if ($form['action'])
<form class="f-form" method="post" action="{!! $form['action'] !!}">
@if ($form['hidden'])
@foreach ($form['hidden'] as $key => $val)
@if ($form['hidden'])
@foreach ($form['hidden'] as $key => $val)
<input type="hidden" name="{{ $key }}" value="{{ $val }}">
@endforeach
@endforeach
@endif
@endif
@foreach ($form['sets'] as $set)
@if ($set['info'])
@foreach ($set['info'] as $key => $cur)
@if ($set['info'])
@foreach ($set['info'] as $key => $cur)
<p class="f-finfo"> @if ($cur['html']){!! $cur['value'] !!} @else{{ $cur['value'] }} @endif</p>
@endforeach
@elseif ($set['fields'])
<fieldset @if ($set['id']) id="{{ $set['id'] }}" @endif @if ($set['class']) class="f-fs-{!! implode(' f-fs-', (array) $set['class']) !!}" @endif>
@if ($set['legend'])
@endforeach
@elseif ($set['fields'])
<fieldset @if ($set['id']) id="id-fs-{{ $set['id'] }}" @endif @if ($set['class']) class="f-fs-{!! implode(' f-fs-', (array) $set['class']) !!}" @endif>
@if ($set['legend'])
<legend>{!! $set['legend'] !!}</legend>
@endif
@foreach ($set['fields'] as $key => $cur)
@if ('info' === $cur['type'])
@endif
@foreach ($set['fields'] as $key => $cur)
@if ('info' === $cur['type'])
<p class="f-child6"> @if ($cur['html']){!! $cur['value'] !!} @else{{ $cur['value'] }} @endif</p>
@else
<dl @if ($cur['class']) class="f-field-{!! implode(' f-field-', (array) $cur['class']) !!}" @endif>
<dt> @if ($cur['title'])<label class="f-child1 @if ($cur['required']) f-req @endif" @if (is_string($key) && 'radio' !== $cur['type']) for="id-{{ $key }}" @endif>{!! $cur['title'] !!}</label> @endif</dt>
@elseif ('wrap' === $cur['type'])
<div @if ($cur['id']) id="id-{{ $cur['id'] }}" @endif @if ($cur['class']) class="f-wrap-{!! implode(' f-wrap-', (array) $cur['class']) !!}" @endif>
@elseif ('endwrap' === $cur['type'])
</div>
@else
<dl @if ($cur['id']) id="id-dl-{{ $cur['id'] }}" @endif @if ($cur['class']) class="f-field-{!! implode(' f-field-', (array) $cur['class']) !!}" @endif>
<dt> @if ($cur['title'])<label class="f-child1 @if ($cur['required']) f-req @endif" @if (is_string($key) && 'radio' !== $cur['type'] && 'yield' !== $cur['type']) for="id-{{ $key }}" @endif>{!! $cur['title'] !!}</label> @endif</dt>
<dd>
@if ('text' === $cur['type'])
@if ('text' === $cur['type'])
@if ($form['action'])
<input @if ($cur['required']) required @endif @if ($cur['disabled']) disabled @endif @if ($cur['autofocus']) autofocus @endif class="f-ctrl" id="id-{{ $key }}" name="{{ $key }}" type="text" @if ($cur['maxlength']) maxlength="{{ $cur['maxlength'] }}" @endif @if ($cur['pattern']) pattern="{{ $cur['pattern'] }}" @endif @if (isset($cur['value'])) value="{{ $cur['value'] }}" @endif>
@elseif ('textarea' === $cur['type'])
@else
<p class="f-ctrl" id="id-{{ $key }}">{{ $cur['value'] or '' }}</p>
@endif
@elseif ('textarea' === $cur['type'])
<textarea @if ($cur['required']) required @endif @if ($cur['disabled']) disabled @endif @if ($cur['autofocus']) autofocus @endif class="f-ctrl" id="id-{{ $key }}" name="{{ $key }}">{{ $cur['value'] or '' }}</textarea>
@if ($cur['bb'])
@if ($cur['bb'])
<ul class="f-child5">
@foreach ($cur['bb'] as $val)
@foreach ($cur['bb'] as $val)
<li><span><a href="{!! $val[0] !!}">{!! $val[1] !!}</a> {!! $val[2] !!}</span></li>
@endforeach
@endforeach
</ul>
@endif
@elseif ('select' === $cur['type'])
@endif
@elseif ('select' === $cur['type'])
<select @if ($cur['required']) required @endif @if ($cur['disabled']) disabled @endif @if ($cur['autofocus']) autofocus @endif class="f-ctrl" id="id-{{ $key }}" name="{{ $key }}">
@if (null === ($count = null) && is_array(reset($cur['options'])) && 1 === count(reset($cur['options'])) && $count = 0) @endif
@foreach ($cur['options'] as $v => $option)
@if (is_array($option))
@if (null !== $count && 1 === count($option))
@if (++$count > 1)
@if (null === ($count = null) && is_array(reset($cur['options'])) && 1 === count(reset($cur['options'])) && $count = 0) @endif
@foreach ($cur['options'] as $v => $option)
@if (is_array($option))
@if (null !== $count && 1 === count($option))
@if (++$count > 1)
</optgroup>
@endif
@endif
<optgroup label="{{ $option[0] }}">
@else
@else
<option value="{{ $option[0] }}" @if ($option[0] == $cur['value']) selected @endif @if ($option[2]) disabled @endif>{{ $option[1] }}</option>
@endif
@else
@endif
@else
<option value="{{ $v }}" @if ($v == $cur['value']) selected @endif>{{ $option }}</option>
@endif
@endforeach
@if (null !== $count)
@endif
@endforeach
@if (null !== $count)
</optgroup>
@endif
@endif
</select>
@elseif ('multiselect' === $cur['type'])
@elseif ('multiselect' === $cur['type'])
<select @if ($cur['required']) required @endif @if ($cur['disabled']) disabled @endif @if ($cur['autofocus']) autofocus @endif @if ($cur['size']) size="{{ $cur['size'] }}" @endif multiple class="f-ctrl" id="id-{{ $key }}" name="{{ $key }}[]">
@if (null === ($count = null) && is_array(reset($cur['options'])) && 1 === count(reset($cur['options'])) && $count = 0) @endif
@foreach ($cur['options'] as $v => $option)
@if (is_array($option))
@if (null !== $count && 1 === count($option))
@if (++$count > 1)
@if (null === ($count = null) && is_array(reset($cur['options'])) && 1 === count(reset($cur['options'])) && $count = 0) @endif
@foreach ($cur['options'] as $v => $option)
@if (is_array($option))
@if (null !== $count && 1 === count($option))
@if (++$count > 1)
</optgroup>
@endif
@endif
<optgroup label="{{ $option[0] }}">
@else
@else
<option value="{{ $option[0] }}" @if ((is_array($cur['value']) && in_array($option[0], $cur['value'])) || $option[0] == $cur['value']) selected @endif @if ($option[2]) disabled @endif>{{ $option[1] }}</option>
@endif
@else
@endif
@else
<option value="{{ $v }}" @if ((is_array($cur['value']) && in_array($v, $cur['value'])) || $v == $cur['value']) selected @endif>{{ $option }}</option>
@endif
@endforeach
@if (null !== $count)
@endif
@endforeach
@if (null !== $count)
</optgroup>
@endif
@endif
</select>
@elseif ('number' === $cur['type'])
@elseif ('number' === $cur['type'])
<input @if ($cur['required']) required @endif @if ($cur['disabled']) disabled @endif @if ($cur['autofocus']) autofocus @endif class="f-ctrl" id="id-{{ $key }}" name="{{ $key }}" type="number" min="{{ $cur['min'] }}" max="{{ $cur['max'] }}" @if (isset($cur['value'])) value="{{ $cur['value'] }}" @endif>
@elseif ('checkbox' === $cur['type'])
@elseif ('checkbox' === $cur['type'])
<label class="f-child2"><input @if ($cur['autofocus']) autofocus @endif @if ($cur['disabled']) disabled @endif type="checkbox" id="id-{{ $key }}" name="{{ $key }}" value="{{ $cur['value'] or '1' }}" @if ($cur['checked']) checked @endif>{!! $cur['label'] !!}</label>
@elseif ('radio' === $cur['type'])
@foreach ($cur['values'] as $v => $n)
@elseif ('radio' === $cur['type'])
@if ($form['action'])
@foreach ($cur['values'] as $v => $n)
<label class="f-label"><input @if ($cur['autofocus']) autofocus @endif @if ($cur['disabled']) disabled @endif type="radio" id="id-{{ $key }}-{{ $v }}" name="{{ $key }}" value="{{ $v }}" @if ($v == $cur['value']) checked @endif>{{ $n }}</label>
@endforeach
@elseif ('password' === $cur['type'])
@endforeach
@else
<p class="f-ctrl" id="id-{{ $key }}">{{ $cur['values'][$cur['value']] or '' }}</p>
@endif
@elseif ('password' === $cur['type'])
<input @if ($cur['required']) required @endif @if ($cur['disabled']) disabled @endif @if ($cur['autofocus']) autofocus @endif class="f-ctrl" id="id-{{ $key }}" name="{{ $key }}" type="password" @if ($cur['maxlength']) maxlength="{{ $cur['maxlength'] }}" @endif @if ($cur['pattern']) pattern="{{ $cur['pattern'] }}" @endif @if (isset($cur['value'])) value="{{ $cur['value'] }}" @endif>
@elseif ('btn' === $cur['type'])
@elseif ('btn' === $cur['type'])
<a class="f-btn @if ($cur['disabled']) f-disabled @endif" href="{!! $cur['link'] !!}" @if ($cur['disabled']) tabindex="-1" @endif>{{ $cur['value'] }}</a>
@endif
@if ($cur['info'])
@elseif ('yield' === $cur['type'])
{!! $this->block($cur['value']) !!}
@elseif ('str' === $cur['type'])
<p class="f-ctrl" id="id-{{ $key }}">{{ $cur['value'] }}</p>
@endif
@if ($cur['info'])
<p class="f-child4">{!! $cur['info'] !!}</p>
@endif
@endif
</dd>
</dl>
@endif
@endforeach
@endif
@endforeach
</fieldset>
@endif
@endif
@endforeach
@if ($form['action'])
<p class="f-btns">
@foreach ($form['btns'] as $key => $cur)
@if ('submit' === $cur['type'])
@foreach ($form['btns'] as $key => $cur)
@if ('submit' === $cur['type'])
<input class="f-btn @if($cur['class']) {{ $cur['class'] }} @endif" type="{{ $cur['type'] }}" name="{{ $key }}" value="{{ $cur['value'] }}" @if (isset($cur['accesskey'])) accesskey="{{ $cur['accesskey'] }}" @endif>
@elseif ('btn'=== $cur['type'])
@elseif ('btn'=== $cur['type'])
<a class="f-btn @if($cur['class']) {{ $cur['class'] }} @endif" data-name="{{ $key }}" href="{!! $cur['link'] !!}" @if (isset($cur['accesskey'])) accesskey="{{ $cur['accesskey'] }}" @endif>{{ $cur['value'] }}</a>
@endif
@endforeach
@endif
@endforeach
</p>
</form>
@endif

View file

@ -0,0 +1,29 @@
@section ('crumbs')
<ul class="f-crumbs">
@foreach ($p->crumbs as $cur)
<li class="f-crumb"><!-- inline -->
@if ($cur[0])
<a href="{!! $cur[0] !!}" @if ($cur[2]) class="active" @endif>{{ $cur[1] }}</a>
@else
<span @if ($cur[2]) class="active" @endif>{{ $cur[1] }}</span>
@endif
</li><!-- endinline -->
@endforeach
</ul>
@endsection
@section ('avatar')<img class="f-avatar-img" src="{!! $p->curUser->avatar !!}" alt="{{ $p->curUser->username }}"> @endsection
@section ('signature'){!! $p->curUser->htmlSign !!} @endsection
@section ('totalposts')<a href="" title="{{ __('Show posts') }}">{!! num($p->curUser->num_posts) !!}</a> @endsection
@section ('totaltopics')<a href="" title="{{ __('Show topics') }}">{!! num($p->curUser->num_topics) !!}</a> @endsection
@extends ('layouts/main')
<div class="f-nav-links">
@yield ('crumbs')
</div>
@if ($form = $p->form)
<section class="f-main f-profile">
<h2>{!! $p->title !!}</h2>
<div class="f-fdiv">
@include ('layouts/form')
</div>
</section>
@endif

View file

@ -48,6 +48,7 @@ article {
margin: 0;
padding: 0;
box-sizing: border-box;
word-wrap: break-word;
}
ul,
@ -643,7 +644,7 @@ select {
width: 100%;
border: 0.0625rem solid #AA7939;
border-collapse: collapse;
word-break: break-all;
/* word-break: break-all; */
}
.f-debug thead {
@ -678,7 +679,7 @@ select {
display: inline;
/* float: left;
word-break: break-all; */
word-wrap: break-word;
/* word-wrap: break-word; */
max-width: 100%;
}
@ -1507,7 +1508,7 @@ select {
.f-post-main ol,
.f-post-main ul {
margin-bottom: 0.625rem;
word-wrap: break-word;
/* word-wrap: break-word; */
}
@media screen and (min-width: 50rem) {
@ -1549,7 +1550,7 @@ select {
.f-user-info-add {
display: block;
font-size: 0.875rem;
word-break: break-all;
/* word-break: break-all; */
}
.f-username, .f-avatar {
@ -1873,7 +1874,7 @@ select {
display: block;
font-size: 0.875rem;
padding-top: 0.625rem;
word-break: break-all;
/* word-break: break-all; */
}
}
@ -2003,3 +2004,122 @@ select {
padding-bottom: 0.3125rem;
}
}
/***********/
/* Профиль */
/***********/
.f-profile > h2 {
display: none;
}
.f-fs-header {
display: flex;
min-width: 0;
align-items: center;
}
.f-fs-header .f-wrap-usertitle,
.f-fs-data {
display: flex;
flex-direction: column;
min-width: 0;
}
.f-fs-header .f-wrap-usertitle {
width: 100%;
}
.f-fs-header .f-ctrl {
border: 0;
padding: 0;
}
.f-fs-header .f-avatar-img {
max-width: 4.6875rem;
height: auto;
}
.f-fs-header #id-dl-avatar {
padding: 0.3125rem 0.3125rem 0.3125rem 0.625rem;
}
.f-fs-header #id-dl-username {
border-bottom: 0.0625rem solid #AA7939;
}
.f-fs-header #id-username {
font-weight: bold;
font-size: 1.5rem;
text-align: center;
}
.f-fs-header #id-title {
font-size: 0.875rem;
text-align: center;
}
.f-fs-header .f-child1,
.f-fs-header legend,
.f-fs-data legend {
display: none;
}
.f-fs-data .f-child1,
.f-fs-data .f-ctrl,
.f-fs-data dt,
.f-fs-data dd {
display: inline;
border: 0;
padding: 0;
margin: 0;
}
.f-fs-data .f-child1:after {
content: ": ";
}
.f-fs-header,
.f-fs-data {
border-bottom: 0.0625rem dotted #AA7939;
}
@media screen and (min-width: 40rem) {
.f-fs-header .f-wrap-usertitle {
order: 1;
width: 67%;
margin-left: auto;
}
.f-fs-header #id-username {
text-align: left;
}
.f-fs-header #id-title {
text-align: left;
}
.f-fs-header .f-avatar-img {
max-width: 11.75rem;
}
.f-fs-header #id-dl-avatar {
width: 33%;
text-align: right;
padding: 0.3125rem 0.625rem 0.3125rem 0.3125rem;
}
.f-fs-data dl {
display: flex;
}
.f-fs-data dt {
width: 33%;
text-align: right;
padding-right: 0.625rem;
}
.f-fs-data dd {
width: 67%
}
}