mirror of
https://github.com/Oreolek/ifhub.club.git
synced 2024-07-01 05:55:02 +03:00
Доработка компонентов
This commit is contained in:
parent
2bd4ac36ba
commit
eda4843dca
|
@ -171,7 +171,7 @@ class ActionAjax extends Action
|
||||||
$oViewer = $this->Viewer_GetLocalViewer();
|
$oViewer = $this->Viewer_GetLocalViewer();
|
||||||
|
|
||||||
|
|
||||||
$oViewer->Assign('sImageSrc', getRequestStr('image_src'));
|
$oViewer->Assign('image', getRequestStr('image_src'), true);
|
||||||
|
|
||||||
$this->Viewer_AssignAjax('sText', $oViewer->Fetch("components/crop/crop.tpl"));
|
$this->Viewer_AssignAjax('sText', $oViewer->Fetch("components/crop/crop.tpl"));
|
||||||
}
|
}
|
||||||
|
|
|
@ -146,9 +146,9 @@ class ActionPeople extends Action
|
||||||
* Формируем ответ
|
* Формируем ответ
|
||||||
*/
|
*/
|
||||||
$oViewer = $this->Viewer_GetLocalViewer();
|
$oViewer = $this->Viewer_GetLocalViewer();
|
||||||
$oViewer->Assign('usersList', $aResult['collection'], true);
|
$oViewer->Assign('users', $aResult['collection'], true);
|
||||||
$oViewer->Assign('oUserCurrent', $this->User_GetUserCurrent());
|
$oViewer->Assign('oUserCurrent', $this->User_GetUserCurrent());
|
||||||
$oViewer->Assign('userListEmpty', $this->Lang_Get('search.alerts.empty'), true);
|
$oViewer->Assign('textEmpty', $this->Lang_Get('search.alerts.empty'), true);
|
||||||
$oViewer->Assign('useMore', true, true);
|
$oViewer->Assign('useMore', true, true);
|
||||||
$oViewer->Assign('hideMore', $bHideMore, true);
|
$oViewer->Assign('hideMore', $bHideMore, true);
|
||||||
$oViewer->Assign('searchCount', $aResult['count'], true);
|
$oViewer->Assign('searchCount', $aResult['count'], true);
|
||||||
|
|
|
@ -67,7 +67,7 @@
|
||||||
<section class = "{$component} {mod name=$component mods=$mods} {$smarty.local.classes} open js-{$component}"
|
<section class = "{$component} {mod name=$component mods=$mods} {$smarty.local.classes} open js-{$component}"
|
||||||
id = "comment{$commentId}"
|
id = "comment{$commentId}"
|
||||||
data-id = "{$commentId}"
|
data-id = "{$commentId}"
|
||||||
{$smarty.local.attributes}>
|
{foreach $smarty.local.attributes as $attr}{$attr@key}="{$attr@value}" {/foreach}>
|
||||||
|
|
||||||
{* Показываем удаленные комментарии только администраторам *}
|
{* Показываем удаленные комментарии только администраторам *}
|
||||||
{if ! $isDeleted || ( $oUserCurrent && $oUserCurrent->isAdministrator() )}
|
{if ! $isDeleted || ( $oUserCurrent && $oUserCurrent->isAdministrator() )}
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
{**
|
{**
|
||||||
* Ресайз загруженного изображения
|
* Ресайз загруженного изображения
|
||||||
|
*
|
||||||
|
* @param string $image
|
||||||
|
* @param array $sizes
|
||||||
*}
|
*}
|
||||||
|
|
||||||
{extends 'components/modal/modal.tpl'}
|
{extends 'components/modal/modal.tpl'}
|
||||||
|
@ -9,15 +12,19 @@
|
||||||
{block 'modal_title'}{lang 'modal_image_crop.title'}{/block}
|
{block 'modal_title'}{lang 'modal_image_crop.title'}{/block}
|
||||||
|
|
||||||
{block 'modal_content'}
|
{block 'modal_content'}
|
||||||
|
{$image = "{$smarty.local.image|escape}?v{rand( 0, 10e10 )}"}
|
||||||
|
|
||||||
<div class="crop">
|
<div class="crop">
|
||||||
|
{* Изображение *}
|
||||||
<div class="crop-image-holder js-crop-image-holder">
|
<div class="crop-image-holder js-crop-image-holder">
|
||||||
<img src="{$sImageSrc|escape}" style="width: 370px;" class="crop-image js-crop-image">
|
<img src="{$image}" style="width: 370px;" class="crop-image js-crop-image">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{* Превью *}
|
||||||
<div class="crop-previews js-crop-previews">
|
<div class="crop-previews js-crop-previews">
|
||||||
{foreach [ 100, 64, 48 ] as $size}
|
{foreach [ 100, 64, 48 ] as $size}
|
||||||
<div style="width: {$size}px; height: {$size}px;" class="crop-preview js-crop-preview">
|
<div style="width: {$size}px; height: {$size}px;" class="crop-preview js-crop-preview">
|
||||||
<img src="{$sImageSrc|escape}" class="js-crop-preview-image" data-size="{$size}">
|
<img src="{$image}" class="js-crop-preview-image" data-size="{$size}">
|
||||||
</div>
|
</div>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -96,5 +96,5 @@ form .icon-question-sign { cursor: help; }
|
||||||
|
|
||||||
|
|
||||||
/* Input File Replacer */
|
/* Input File Replacer */
|
||||||
.form-input-file { position: relative; overflow: hidden; cursor: pointer; display: inline; }
|
.form-input-file { position: relative; overflow: hidden; cursor: pointer; display: block; }
|
||||||
.form-input-file input[type=file] { position: absolute; top: -999px; left: -999px; }
|
.form-input-file input[type=file] { position: absolute; top: 0; left: -200%; }
|
|
@ -13,19 +13,19 @@
|
||||||
{/block}
|
{/block}
|
||||||
|
|
||||||
{block 'block_content'}
|
{block 'block_content'}
|
||||||
<div class="profile-photo-wrapper">
|
<div class="user-photo {if ! $oUserProfile->getProfileFoto()}user-photo--nophoto{/if} js-user-photo">
|
||||||
{* Статус онлайн\оффлайн *}
|
{* Статус онлайн\оффлайн *}
|
||||||
{if $oSession}
|
{if $oSession}
|
||||||
{if $oUserProfile->isOnline() && $smarty.now - strtotime($oSession->getDateLast()) < 60*5}
|
{if $oUserProfile->isOnline() && $smarty.now - strtotime($oSession->getDateLast()) < 60*5}
|
||||||
<div class="status status-online">{$aLang.user.status.online}</div>
|
<div class="user-status user-status--online">{$aLang.user.status.online}</div>
|
||||||
{else}
|
{else}
|
||||||
<div class="status status-offline">
|
<div class="user-status user-status--offline">
|
||||||
{$date = {date_format date=$oSession->getDateLast() hours_back="12" minutes_back="60" day_back="8" now="60*5" day="day H:i" format="j F в G:i"}}
|
{$date = {date_format date=$oSession->getDateLast() hours_back="12" minutes_back="60" day_back="8" now="60*5" day="day H:i" format="j F в G:i"}}
|
||||||
|
|
||||||
{if $oUserProfile->getProfileSex() != 'woman'}
|
{if $oUserProfile->getProfileSex() != 'woman'}
|
||||||
{lang name='user.status.was_online_male' date=$date}
|
{lang 'user.status.was_online_male' date=$date}
|
||||||
{else}
|
{else}
|
||||||
{lang name='user.status.was_online_female' date=$date}
|
{lang 'user.status.was_online_female' date=$date}
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
@ -33,18 +33,31 @@
|
||||||
|
|
||||||
{* Фото *}
|
{* Фото *}
|
||||||
<a href="{$oUserProfile->getUserWebPath()}">
|
<a href="{$oUserProfile->getUserWebPath()}">
|
||||||
<img src="{$oUserProfile->getProfileFotoPath()}" alt="{$oUserProfile->getDisplayName()} photo" class="profile-photo js-ajax-user-photo-image" />
|
<img src="{$oUserProfile->getProfileFotoPath()}" alt="{$oUserProfile->getDisplayName()} photo" class="user-photo-image js-ajax-user-photo-image" />
|
||||||
</a>
|
</a>
|
||||||
</div>
|
|
||||||
|
|
||||||
|
{* Действия (редактировать/удалить) *}
|
||||||
{if $oUserProfile->isAllowEdit()}
|
{if $oUserProfile->isAllowEdit()}
|
||||||
<p class="upload-photo">
|
<ul class="user-photo-actions">
|
||||||
<label for="photo" class="form-input-file">
|
<li>
|
||||||
<span class="js-ajax-user-photo-upload-choose link-dotted">{if $oUserProfile->getProfileFoto()}{lang 'user.blocks.photo.change_photo'}{else}{lang 'user.blocks.photo.upload_photo'}{/if}</span>
|
<label class="form-input-file">
|
||||||
<input type="file" name="photo" id="photo" class="js-ajax-user-photo-upload" data-user-id="{$oUserProfile->getId()}">
|
<span class="js-ajax-user-photo-upload-choose">
|
||||||
</label>
|
{if $oUserProfile->getProfileFoto()}
|
||||||
<a href="#" data-user-id="{$oUserProfile->getId()}" class="js-ajax-user-avatar-change link-dotted" style="{if !$oUserProfile->getProfileFoto()}display:none;{/if}">{lang 'user.blocks.photo.change_avatar'}</a>
|
{lang 'user.blocks.photo.change_photo'}
|
||||||
<a href="#" data-user-id="{$oUserProfile->getId()}" class="js-ajax-user-photo-upload-remove link-dotted" style="{if !$oUserProfile->getProfileFoto()}display:none;{/if}">{lang 'user.blocks.photo.remove'}</a>
|
{else}
|
||||||
</p>
|
{lang 'user.blocks.photo.upload_photo'}
|
||||||
{/if}
|
{/if}
|
||||||
|
</span>
|
||||||
|
<input type="file" name="photo" class="js-ajax-user-photo-upload" data-user-id="{$oUserProfile->getId()}">
|
||||||
|
</label>
|
||||||
|
</li>
|
||||||
|
<li data-user-id="{$oUserProfile->getId()}" class="js-ajax-user-avatar-change" style="{if !$oUserProfile->getProfileFoto()}display:none;{/if}">
|
||||||
|
{lang 'user.blocks.photo.change_avatar'}
|
||||||
|
</li>
|
||||||
|
<li data-user-id="{$oUserProfile->getId()}" class="js-ajax-user-photo-upload-remove" style="{if !$oUserProfile->getProfileFoto()}display:none;{/if}">
|
||||||
|
{lang 'user.blocks.photo.remove'}
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
{/block}
|
{/block}
|
|
@ -4,15 +4,62 @@
|
||||||
* @modifier user
|
* @modifier user
|
||||||
* @template blocks/block.userPhoto.tpl
|
* @template blocks/block.userPhoto.tpl
|
||||||
*/
|
*/
|
||||||
.block--user-photo .block-content { padding: 0; }
|
.block--user-photo .block-content {
|
||||||
.block--user-photo .profile-photo-wrapper { position: relative; min-width: 100%; min-height: 50px; display: inline-block; }
|
padding: 0;
|
||||||
.block--user-photo .profile-photo { vertical-align: top; min-width: 100%; }
|
}
|
||||||
|
.user-photo {
|
||||||
|
position: relative;
|
||||||
|
min-width: 100%;
|
||||||
|
min-height: 50px;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
.user-photo-image {
|
||||||
|
vertical-align: top;
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
.user-photo--nophoto .user-photo-image {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
.block--user-photo .status { position: absolute; top: 20px; left: 0; padding: 12px 15px; font: 300 16px/1em 'Open Sans'; }
|
/* Статус (онлайн/оффлайн) */
|
||||||
.block--user-photo .status.status-online { background: #b7bc1c; background: rgba(183, 188, 28, .8); color: #fff; }
|
.user-status {
|
||||||
.block--user-photo .status.status-offline { background: #333; background: rgba(0, 0, 0, .6); color: #fff; }
|
position: absolute;
|
||||||
|
top: 20px;
|
||||||
|
left: 0;
|
||||||
|
padding: 12px 15px;
|
||||||
|
font: 300 16px/1em 'Open Sans';
|
||||||
|
}
|
||||||
|
.user-status--online {
|
||||||
|
background: #b7bc1c;
|
||||||
|
background: rgba(183, 188, 28, .8);
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
.user-status--offline {
|
||||||
|
background: #333;
|
||||||
|
background: rgba(0, 0, 0, .6);
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
.block--user-photo .upload-photo { padding: 7px 10px 10px; background: #f7f7f7; }
|
/* Действия */
|
||||||
|
.user-photo-actions {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
padding: 5px 0;
|
||||||
|
background: rgba( 0, 0, 0, .7 );
|
||||||
|
}
|
||||||
|
.user-photo-actions li {
|
||||||
|
padding: 7px 15px;
|
||||||
|
color: #bbb;
|
||||||
|
font-size: 13px;
|
||||||
|
cursor: pointer;
|
||||||
|
-webkit-transition: color .2s;
|
||||||
|
transition: color .2s;
|
||||||
|
}
|
||||||
|
.user-photo-actions li:hover {
|
||||||
|
color: #eee;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Блок управления на странице пользователя
|
* Блок управления на странице пользователя
|
||||||
|
|
|
@ -118,7 +118,7 @@ ls.user = (function ($) {
|
||||||
|
|
||||||
// Мержим логины
|
// Мержим логины
|
||||||
oInput.val( $.richArray.unique($.merge(aLoginsOld, aLoginsAdd)).join(', ') );
|
oInput.val( $.richArray.unique($.merge(aLoginsOld, aLoginsAdd)).join(', ') );
|
||||||
console.log($('#modal-users-select'))
|
|
||||||
$('#modal-users-select').lsModal('hide');
|
$('#modal-users-select').lsModal('hide');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -212,6 +212,7 @@ console.log($('#modal-users-select'))
|
||||||
if (result.bStateError) {
|
if (result.bStateError) {
|
||||||
ls.msg.error(null,result.sMsg);
|
ls.msg.error(null,result.sMsg);
|
||||||
} else {
|
} else {
|
||||||
|
$('.js-user-photo').addClass('user-photo--nophoto');
|
||||||
$('.js-ajax-user-photo-image').attr('src',result.sFile);
|
$('.js-ajax-user-photo-image').attr('src',result.sFile);
|
||||||
$('.js-ajax-user-photo-upload-choose').html(result.sChooseText);
|
$('.js-ajax-user-photo-upload-choose').html(result.sChooseText);
|
||||||
$('.js-ajax-user-photo-upload-remove').hide();
|
$('.js-ajax-user-photo-upload-remove').hide();
|
||||||
|
@ -231,6 +232,7 @@ console.log($('#modal-users-select'))
|
||||||
},
|
},
|
||||||
save_url : aRouter.settings+'ajax-crop-photo/',
|
save_url : aRouter.settings+'ajax-crop-photo/',
|
||||||
save_callback : function(result, modal, image, previews) {
|
save_callback : function(result, modal, image, previews) {
|
||||||
|
$('.js-user-photo').removeClass('user-photo--nophoto');
|
||||||
$('.js-ajax-user-photo-image').attr('src',result.sFile);
|
$('.js-ajax-user-photo-image').attr('src',result.sFile);
|
||||||
$('.js-ajax-user-photo-upload-choose').html(result.sChooseText);
|
$('.js-ajax-user-photo-upload-choose').html(result.sChooseText);
|
||||||
$('.js-ajax-user-photo-upload-remove').show();
|
$('.js-ajax-user-photo-upload-remove').show();
|
||||||
|
|
Loading…
Reference in a new issue