1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-06-16 14:50:48 +03:00

Мелкие доработки и исправления компонентов

* Обновлены модальные окна
This commit is contained in:
Denis Shakhov 2015-02-13 14:35:23 +07:00
parent 70d9683249
commit 192b82c9cf
14 changed files with 157 additions and 200 deletions

View file

@ -237,6 +237,7 @@ class ActionSettings extends Action
$oViewer->Assign('originalHeight', (int) getRequest('original_height'), true);
$oViewer->Assign('width', (int) getRequest('width'), true);
$oViewer->Assign('height', (int) getRequest('height'), true);
$oViewer->Assign('usePreview', true, true);
$this->Viewer_AssignAjax('sText', $oViewer->Fetch("component@user.modal.crop-avatar"));
}

View file

@ -2,31 +2,25 @@
* Модальное окно с формами входа, регистрации и напоминанием пароля
*}
{extends 'Component@modal.modal'}
{block 'modal_options' append}
{$id = 'modal-login'}
{$mods = "$mods auth"}
{$classes = "$classes js-modal-default"}
{$title = $aLang.auth.authorization}
{$options = array_merge( $options|default:[], [ 'center' => 'false' ] )}
{/block}
{block 'modal_content'}
{capture 'modal_content'}
{if ! Config::Get('general.reg.invite')}
{component 'auth' template='registration' assign=auth_tab_reg}
{else}
{component 'auth' template='invite' assign=auth_tab_reg}
{/if}
{component 'auth' template='login' assign=auth_tab_login}
{component 'auth' template='reset' assign=auth_tab_reset}
{component 'tabs' classes='js-tabs-auth' tabs=[
[ 'text' => {lang 'auth.login.title'}, 'content' => $auth_tab_login, 'classes' => 'js-auth-tab-login' ],
[ 'text' => {lang 'auth.login.title'}, 'content' => {component 'auth' template='login'}, 'classes' => 'js-auth-tab-login' ],
[ 'text' => {lang 'auth.registration.title'}, 'content' => $auth_tab_reg, 'classes' => 'js-auth-tab-reg' ],
[ 'text' => {lang 'auth.reset.title'}, 'content' => $auth_tab_reset ]
[ 'text' => {lang 'auth.reset.title'}, 'content' => {component 'auth' template='reset'} ]
]}
{/block}
{/capture}
{block 'modal_footer'}{/block}
{component 'modal'
title = {lang 'auth.authorization'}
tabs = $smarty.capture.modal_content
options = [ 'center' => 'false' ]
showFooter = false
classes = 'js-modal-default'
mods = 'auth'
id = 'modal-login'}

View file

@ -5,19 +5,13 @@
* @param array $blogs
*}
{extends 'Component@modal.modal'}
{block 'modal_options' append}
{$id = "modal-blog-delete"}
{$mods = "$mods blog-delete"}
{$classes = "$classes js-modal-default"}
{$title = $aLang.blog.remove.title}
{/block}
{block 'modal_content'}
{capture 'modal_content'}
{$blog = $smarty.local.blog}
<form action="{router page='blog'}delete/{$blog->getId()}/" method="POST" id="js-blog-remove-form">
{* Скрытые поля *}
{component 'field' template='hidden.security-key'}
{* Переместить топики в блог *}
{$selectBlogs = [
[ 'value' => -1, 'text' => "-- {$aLang.blog.remove.remove_topics} --" ]
@ -34,12 +28,16 @@
name = 'topic_move_to'
label = $aLang.blog.remove.move_to
items = $selectBlogs}
{* Скрытые поля *}
{component 'field' template='hidden.security-key'}
</form>
{/block}
{/capture}
{block 'modal_footer_begin'}
{component 'button' form='js-blog-remove-form' text=$aLang.common.remove mods='primary'}
{/block}
{component 'modal'
title = {lang 'blog.remove.title'}
content = $smarty.capture.modal_content
classes = 'js-modal-default'
mods = 'blog-delete'
id = 'modal-blog-delete'
primaryButton = [
'text' => {lang 'common.remove'},
'form' => 'js-blog-remove-form'
]}

View file

@ -2,16 +2,7 @@
* Модальное с меню "Создать"
*}
{extends 'Component@modal.modal'}
{block 'modal_options' append}
{$id = 'modal-write'}
{$mods = "$mods create"}
{$classes = "$classes js-modal-default"}
{$title = {lang name='modal_create.title'}}
{/block}
{block 'modal_content'}
{capture 'modal_content'}
{function modal_create_item}
<li class="write-item-type-{$item}">
{$url = "{if ! $url}{router page=$item}add{else}{$url}{/if}"}
@ -32,6 +23,11 @@
{hook run='write_item' isPopup=true}
</ul>
{/block}
{/capture}
{block 'modal_footer'}{/block}
{component 'modal'
title = {lang 'modal_create.title'}
content = $smarty.capture.modal_content
classes = 'js-modal-default'
mods = 'create'
id = 'modal-write'}

View file

@ -2,23 +2,14 @@
* Создание опроса
*}
{extends 'Component@modal.modal'}
{block 'modal_options' append}
{$id = "modal-poll-create"}
{$mods = "$mods poll-create"}
{$classes = "$classes js-modal-media"}
{$title = ( $oPoll ) ? {lang 'poll.form.title.edit'} : {lang 'poll.form.title.add'}}
{/block}
{block 'modal_content'}
{component 'poll' template='form'}
{/block}
{block 'modal_footer_begin'}
{component 'button'
form = 'js-poll-form'
text = ($oPoll) ? $aLang.common.save : $aLang.common.add
classes = 'js-poll-form-submit'
mods = 'primary'}
{/block}
{component 'modal'
title = ( $oPoll ) ? {lang 'poll.form.title.edit'} : {lang 'poll.form.title.add'}
content = {component 'poll' template='form'}
classes = 'js-modal-default'
mods = 'poll-create'
id = 'modal-poll-create'
primaryButton = [
'text' => ($oPoll) ? $aLang.common.save : $aLang.common.add,
'form' => 'js-poll-form',
'classes' => 'js-poll-form-submit'
]}

View file

@ -2,15 +2,9 @@
* Модальное окно с предпросмотром видео для свойства с типом video
*}
{extends 'Component@modal.modal'}
{block 'modal_options' append}
{$id = "modal-property-type-video-{$value->getId()}"}
{$mods = "$mods property property-video"}
{$classes = "$classes js-modal-media"}
{$title = 'Предпросмотр видео'}
{/block}
{block 'modal_content'}
{$value->getValueTypeObject()->getVideoCodeFrame()}
{/block}
{component 'modal'
title = {lang 'property.video.preview'}
content = $value->getValueTypeObject()->getVideoCodeFrame()
classes = 'js-modal-default'
mods = 'property property-video'
id = "modal-property-type-video-{$value->getId()}"}

View file

@ -4,40 +4,36 @@
* @param array $types
*}
{extends 'Component@modal.modal'}
{capture 'modal_content'}
<form action="" method="post" id="form-complaint-user">
{component 'field' template='hidden' name='target_id' value=$_aRequest.target_id}
{block 'modal_options' append}
{$id = "modal-complaint-user"}
{$mods = "$mods report"}
{$classes = "$classes js-modal-default"}
{$title = {lang 'report.form.title'}}
{/block}
{component 'field' template='select'
name = 'type'
label = {lang 'report.form.fields.type.label'}
classes = 'width-full'
items = $smarty.local.types}
{block 'modal_content'}
<form action="" method="post" id="form-complaint-user">
{component 'field' template='select'
name = 'type'
label = {lang 'report.form.fields.type.label'}
classes = 'width-full'
items = $smarty.local.types}
{component 'field' template='textarea'
name = 'text'
rows = 5
label = {lang 'report.form.fields.text.label'}
classes = 'width-full'}
{component 'field' template='textarea'
name = 'text'
rows = 5
label = {lang 'report.form.fields.text.label'}
classes = 'width-full'}
{* Каптча *}
{if Config::Get('module.user.complaint_captcha')}
{component 'field' template='captcha' captchaName='complaint_user' name='captcha'}
{/if}
</form>
{/capture}
{* Каптча *}
{if Config::Get('module.user.complaint_captcha')}
{component 'field' template='captcha'
captchaName = 'complaint_user'
name = 'captcha'}
{/if}
{component 'field' template='hidden' name='target_id' value=$_aRequest.target_id}
</form>
{/block}
{block 'modal_footer_begin'}
{component 'button' text={lang 'report.form.submit'} mods='primary' form='form-complaint-user'}
{/block}
{component 'modal'
title = {lang 'report.form.title'}
content = $smarty.capture.modal_content
classes = 'js-modal-default'
mods = 'report'
id = 'modal-complaint-user'
primaryButton = [
'text' => {lang 'report.form.submit'},
'form' => 'form-complaint-user'
]}

View file

@ -20,7 +20,7 @@
name = $smarty.local.inputName|default:'q'}
{if ! $smarty.local.noSubmitButton}
{component 'button' mods='icon' classes="{$component}-submit" icon='icon-search'}
{component 'button' mods='icon' classes="{$component}-submit" icon='search'}
{/if}
{/block}
</form>

View file

@ -2,16 +2,7 @@
* Добавление пользовательских тегов к топику
*}
{extends 'Component@modal.modal'}
{block 'modal_options' append}
{$id = "favourite-form-tags"}
{$mods = "$mods favourite-tags"}
{$classes = "$classes js-modal-default"}
{$title = {lang 'favourite_tags.title'}}
{/block}
{block 'modal_content'}
{capture 'modal_content'}
<form id="js-favourite-form">
{component 'field' template='text'
name = 'tags'
@ -19,12 +10,16 @@
autofocus = true
inputClasses = 'width-full autocomplete-tags-sep js-tags-form-input-list'}
</form>
{/block}
{/capture}
{block 'modal_footer_begin'}
{component 'button'
form = 'js-favourite-form'
text = $aLang.common.save
classes = 'js-tags-form-submit'
mods = 'primary'}
{/block}
{component 'modal'
title = {lang 'favourite_tags.title'}
content = $smarty.capture.modal_content
classes = 'js-modal-default'
mods = 'favourite-tags'
id = 'favourite-form-tags'
primaryButton = [
'text' => {lang 'common.save'},
'classes' => 'js-tags-form-submit',
'form' => 'js-favourite-form'
]}

View file

@ -1,30 +1,21 @@
{**
* Теги
*
* @styles css/blocks.css
*}
{extends 'component@tags.block.tags'}
{block 'block_title'}
{lang 'tags.block_tags.title'}
{/block}
{block 'block_options' append}
{$classes = "{$classes} js-block-default"}
{/block}
{block 'block_content'}
{component 'tags' template='cloud' tags=$smarty.local.tags url='{router page=\'tag\'}{$tag->getText()|escape:\'url\'}/' assign=tags_block_all}
{component 'tags' template='cloud' tags=$smarty.local.tagsUser url='{router page=\'tag\'}{$tag->getText()|escape:\'url\'}/' assign=tags_block_favourite}
{component 'tabs' classes='js-tabs-block' tabs=[
[ 'text' => {lang 'tags.block_tags.nav.all'}, 'content' => $tags_block_all ],
[ 'text' => {lang 'tags.block_tags.nav.favourite'}, 'content' => $tags_block_favourite, 'is_enabled' => !! $oUserCurrent ]
]}
{/block}
{* Подвал *}
{block 'block_footer'}
{component 'tags' template='search-form' mods='light'}
{/block}
{component 'block'
title = {lang 'tags.block_tags.title'}
classes = 'js-block-default'
footer = {component 'tags' template='search-form' mods='light'}
tabs = [
'tabs' => [
[
'text' => {lang 'tags.block_tags.nav.all'},
'content' => {component 'tags' template='cloud' tags=$smarty.local.tags url='{router page=\'tag\'}{$tag->getText()|escape:\'url\'}/'}
],
[
'text' => {lang 'tags.block_tags.nav.favourite'},
'content' => {component 'tags' template='cloud' tags=$smarty.local.tagsUser url='{router page=\'tag\'}{$tag->getText()|escape:\'url\'}/'},
'is_enabled' => !! $oUserCurrent
]
]
]}

View file

@ -2,26 +2,25 @@
* Добавление в друзья
*}
{extends 'Component@modal.modal'}
{capture 'modal_content'}
{* TODO: Form validation (front-end / back-end) *}
<form id="add_friend_form" class="js-user-friend-form">
{component 'field' template='textarea'
name = 'add_friend_text'
rules = [ 'required' => true, 'rangelength' => '[2,200]' ]
rows = 3
noMargin = true
label = {lang name='user.friends.form.fields.text.label'}}
</form>
{/capture}
{block 'modal_options' append}
{$id = "modal-add-friend"}
{$classes = "$classes js-modal-default"}
{$title = {lang 'user.friends.form.title'}}
{/block}
{block 'modal_content'}
{* TODO: Form validation (front-end / back-end) *}
<form id="add_friend_form" class="js-user-friend-form">
{component 'field' template='textarea'
name = 'add_friend_text'
rules = [ 'required' => true, 'rangelength' => '[2,200]' ]
rows = 3
noMargin = true
label = {lang name='user.friends.form.fields.text.label'}}
</form>
{/block}
{block 'modal_footer_begin'}
{component 'button' mods='primary' form='add_friend_form' text={lang name='user.friends.form.fields.submit.text'}}
{/block}
{component 'modal'
title = {lang 'user.friends.form.title'}
content = $smarty.capture.modal_content
classes = 'js-modal-default'
mods = 'user-add-friend'
id = 'modal-add-friend'
primaryButton = [
'text' => {lang 'user.friends.form.fields.submit.text'},
'form' => 'add_friend_form'
]}

View file

@ -6,16 +6,7 @@
* @param string $target
*}
{extends 'Component@modal.modal'}
{block 'modal_options' append}
{$id = "modal-users-select"}
{$mods = "$mods users-select"}
{$classes = "$classes js-modal-default"}
{$title = $title|default:$aLang.user.users|escape}
{/block}
{block 'modal_content'}
{capture 'modal_content'}
{* Экшнбар *}
{if $smarty.local.users && $smarty.local.selectable}
{component 'actionbar' template='item.select'
@ -32,14 +23,17 @@
selectable = $smarty.local.selectable
showEmpty = true
classes = 'js-user-list-select'}
{/block}
{/capture}
{block 'modal_footer_begin'}
{if $smarty.local.users && $smarty.local.selectable}
{component 'button'
text = $aLang.common.add
mods = 'primary'
classes = 'js-user-list-select-add'
attributes = [ 'data-target' => $smarty.local.target ]}
{/if}
{/block}
{component 'modal'
title = $title|default:$aLang.user.users|escape
content = $smarty.capture.modal_content
classes = 'js-modal-default'
mods = 'users-select'
id = 'modal-users-select'
primaryButton = ( $smarty.local.users && $smarty.local.selectable ) ? [
'text' => {lang 'common.add'},
'classes' => 'js-user-list-select-add',
'attributes' => [ 'data-target' => $smarty.local.target ],
'form' => 'form-complaint-user'
] : false}

View file

@ -1470,6 +1470,14 @@ return array(
'label' => 'Перетащите сюда файлы или кликните по этому тексту',
),
),
/**
* Кастомные поля
*/
'property' => array(
'video' => array(
'preview' => 'Предпросмотр видео'
)
),
/**
* Редактор
*/

@ -1 +1 @@
Subproject commit bfabe502d7f1789ea3e9e66e86e8e070d2173c67
Subproject commit 74599fce218e2142ba68eb861ad80d244b62508d