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:
Alexander Yakovlev 2017-03-25 17:07:17 +07:00
commit ec525431e7
30 changed files with 118 additions and 73 deletions

View file

@ -5,3 +5,6 @@
### Лицензия
LiveStreet - open-source проект под лицензией [GPL-2.0](http://opensource.org/licenses/GPL-2.0).

View file

@ -833,11 +833,6 @@ class ActionBlog extends Action
if (Config::Get('module.comment.use_nested') and Config::Get('module.comment.nested_per_page')) {
$aPaging = $this->Viewer_MakePaging($aReturn['count'], $iPage,
Config::Get('module.comment.nested_per_page'), Config::Get('pagination.pages.count'), '');
if (!Config::Get('module.comment.nested_page_reverse') and $aPaging) {
// переворачиваем страницы в обратном порядке
$aPaging['aPagesLeft'] = array_reverse($aPaging['aPagesLeft']);
$aPaging['aPagesRight'] = array_reverse($aPaging['aPagesRight']);
}
$this->Viewer_Assign('pagingComments', $aPaging);
}
/**

View file

@ -156,6 +156,7 @@ class ActionIndex extends Action
$this->Viewer_Assign('topics', $aTopics);
$this->Viewer_Assign('paging', $aPaging);
$this->Viewer_Assign('periodSelectCurrent', $sPeriod);
$this->Viewer_Assign('periodSelectCurrentTitle', $this->Lang_Get('blog.menu.top_period_' . $sPeriod));
$this->Viewer_Assign('periodSelectRoot', Router::GetPath('index') . 'top/');
/**
* Устанавливаем шаблон вывода
@ -217,6 +218,7 @@ class ActionIndex extends Action
$this->Viewer_Assign('topics', $aTopics);
$this->Viewer_Assign('paging', $aPaging);
$this->Viewer_Assign('periodSelectCurrent', $sPeriod);
$this->Viewer_Assign('periodSelectCurrentTitle', $this->Lang_Get('blog.menu.top_period_' . $sPeriod));
$this->Viewer_Assign('periodSelectRoot', Router::GetPath('index') . 'discussed/');
/**
* Устанавливаем шаблон вывода

View file

@ -77,6 +77,7 @@ class HookMain extends Hook
'recaptcha.site_key' => Config::Get('module.validate.recaptcha.site_key'),
'comment_max_tree' => Config::Get('module.comment.max_tree'),
'comment_show_form' => Config::Get('module.comment.show_form'),
'comment_use_paging' => Config::Get('module.comment.use_nested'),
'topic_max_blog_count' => Config::Get('module.topic.max_blog_count'),
'block_stream_show_tip' => Config::Get('block.stream.show_tip'),
'poll_max_answers' => Config::Get('module.poll.max_answers'),

View file

@ -454,28 +454,38 @@ class ModuleMedia extends ModuleORM
*/
$sFileResult = null;
$mOriginalSize = $this->GetConfigParam('image.original', $sTargetType);
if ($mOriginalSize === true) {
if (!$sFileResult = $oImage->saveSmart($sPath, $sFileName, array('skip_watermark' => true))) {
$this->Fs_RemoveFileLocal($sFileTmp);
return $this->Image_GetLastError();
}
} elseif (is_string($mOriginalSize)) {
if ($mOriginalSize !== false && $oImage->getFormat() == 'gif') {
/**
* Ресайзим оригинал
* Если gif, то сохраняем без изменений
*/
$aOriginalSize = $this->ParsedImageSize($mOriginalSize);
if ($aOriginalSize['crop']) {
$oImage->cropProportion($aOriginalSize['w'] / $aOriginalSize['h'], 'center');
}
if (!$sFileResult = $oImage->resize($aOriginalSize['w'], $aOriginalSize['h'], true)->saveSmart($sPath, $sFileName, array('skip_watermark' => true))
) {
if (!$sFileResult = $oImage->saveOriginalSmart($sPath, $sFileName)) {
$this->Fs_RemoveFileLocal($sFileTmp);
return $this->Image_GetLastError();
}
$iFileSize = $this->Fs_GetFileSize($sFileResult);
} else {
if ($mOriginalSize === true) {
if (!$sFileResult = $oImage->saveSmart($sPath, $sFileName, array('skip_watermark' => true))) {
$this->Fs_RemoveFileLocal($sFileTmp);
return $this->Image_GetLastError();
}
} elseif (is_string($mOriginalSize)) {
/**
* Ресайзим оригинал
*/
$aOriginalSize = $this->ParsedImageSize($mOriginalSize);
if ($aOriginalSize['crop']) {
$oImage->cropProportion($aOriginalSize['w'] / $aOriginalSize['h'], 'center');
}
if (!$sFileResult = $oImage->resize($aOriginalSize['w'], $aOriginalSize['h'], true)->saveSmart($sPath, $sFileName,
array('skip_watermark' => true))
) {
$this->Fs_RemoveFileLocal($sFileTmp);
return $this->Image_GetLastError();
}
$iFileSize = $this->Fs_GetFileSize($sFileResult);
}
}
$aSizes = $this->GetConfigParam('image.sizes', $sTargetType);
/**
* Перед запуском генерации подчищаем память

View file

@ -434,13 +434,6 @@ class ModuleProperty extends ModuleORM
if (!$oEntityFirst->property) {
return;
}
$sTargetType = $oEntityFirst->property->getPropertyTargetType();
/**
* Проверяем зарегистрирован ли такой тип
*/
if (!$this->IsAllowTargetType($sTargetType)) {
return;
}
/**
* Проверяем необходимость цеплять свойства
*/
@ -448,8 +441,11 @@ class ModuleProperty extends ModuleORM
$aEntitiesId = array();
$aTargetTypes = array();
foreach ($aEntitiesWork as $oEntity) {
$aEntitiesId[] = $oEntity->getId();
$aTargetTypes[] = $oEntity->getPropertyTargetType();
$sTargetType = $oEntity->property->getPropertyTargetType();
if ($this->IsAllowTargetType($sTargetType)) {
$aEntitiesId[] = $oEntity->getId();
$aTargetTypes[] = $sTargetType;
}
}
$aTargetTypes = array_unique($aTargetTypes);
/**
@ -488,6 +484,9 @@ class ModuleProperty extends ModuleORM
foreach ($aEntitiesWork as $oEntity) {
$aPropertiesClone = array();
foreach ($aProperties as $oProperty) {
if ($oEntity->property->getPropertyTargetType() != $oProperty->getTargetType()) {
continue;
}
$oPropertyNew = clone $oProperty;
$sKey = $oProperty->getId() . '_' . $oEntity->getId();
if (isset($aValues[$sKey])) {

View file

@ -909,6 +909,9 @@ class ModuleTopic_EntityTopic extends Entity
if (is_null($this->aExtra)) {
$this->aExtra = @unserialize($this->getExtra());
}
if (!is_array($this->aExtra)) {
$this->aExtra = array();
}
}
/**

View file

@ -484,7 +484,7 @@ class ModuleUser_EntityUser extends Entity
}
if ($this->getProfileAvatar()) {
return $this->Media_GetImageWebPath($this->getProfileAvatar(), $iSize);
return $this->Media_GetImageWebPath($this->getProfileAvatar(), $iSize) . '?' . date('His', strtotime($this->getProfileDate()));
} else {
return $this->Media_GetImagePathBySize(Router::GetFixPathWeb(Config::Get('path.skin.assets.web')) . '/images/avatars/avatar_' . ($this->getProfileSex() == 'woman' ? 'female' : 'male') . '.png',
$iSize);

View file

@ -11,8 +11,13 @@
{component 'activity' template='recent-item'
user = $comment->getUser()
comment = $comment
topic = $topic
date = $comment->getDate()}
date = $comment->getDate()
classes = 'js-title-comment'
attributes = [
title => {$comment->getText()|strip_tags|trim|truncate:100:'...'|escape}
]}
{foreachelse}
{component 'blankslate' text={lang 'common.empty'} mods='no-background'}
{/foreach}

View file

@ -23,4 +23,5 @@
image=[
'path' => $user->getProfileAvatarPath(48),
'url' => $user->getUserWebPath()
]}
]
params=$params}

View file

@ -10,7 +10,11 @@
{component 'activity' template='recent-item'
user = $topic->getUser()
topic = $topic
date = $topic->getDatePublish()}
date = $topic->getDatePublish()
classes = 'js-title-topic'
attributes = [
title => {$topic->getText()|strip_tags|trim|truncate:150:'...'|escape}
]}
{foreachelse}
{component 'blankslate' text={lang 'common.empty'} mods='no-background'}
{/foreach}

View file

@ -26,7 +26,7 @@
{component 'field' template='text'
name = 'password'
type = 'password'
rules = [ 'required' => true, 'minlength' => '5' ]
rules = [ 'required' => true, 'minlength' => '5', 'trigger' => 'input' ]
label = $aLang.auth.labels.password
inputClasses = 'js-input-password-reg'}
@ -34,7 +34,7 @@
{component 'field' template='text'
name = 'password_confirm'
type = 'password'
rules = [ 'required' => true, 'minlength' => '5', 'equalto' => '.js-input-password-reg', 'equalto-message' => {lang 'auth.registration.notices.error_password_equal'} ]
rules = [ 'required' => true, 'minlength' => '5', 'trigger' => 'input', 'equalto' => '.js-input-password-reg', 'equalto-message' => {lang 'auth.registration.notices.error_password_equal'} ]
label = $aLang.auth.registration.form.fields.password_confirm.label}
{* Каптча *}

View file

@ -14,7 +14,7 @@
{$items[] = [
'title' => $blog->getTitle()|escape,
'titleUrl' => $blog->getUrlFull(),
'mods' => $blog->getUrlFull(),
'mods' => 'blog',
'content' => $smarty.capture.item_content,
'image' => [
'path' => $blog->getAvatarPath(48),
@ -24,4 +24,4 @@
]}
{/foreach}
{component 'item' template='group' items=$items}
{component 'item' template='group' items=$items}

View file

@ -57,6 +57,8 @@
folding: true,
// Показать/скрыть форму по умолчанию
show_form: false,
// Включена или нет пагинация
use_paging: false,
// Ajax параметры
params: {},
i18n: {
@ -171,7 +173,7 @@
target_type: this._targetType,
last_comment_id: this.getLastCommentId(),
self_comment_id: commentSelfId || undefined,
use_paging: false
use_paging: this.option( 'use_paging' )
};
this._load( 'load', params, function( response ) {

View file

@ -37,6 +37,7 @@
*/
_create: function () {
this._super();
var _this = this;
// Экшнбар
$('.js-talk-actionbar-select').lsActionbarItemSelect({
@ -46,8 +47,8 @@
});
this.elements.buttonMarkAsRead.on('click', function (e) {
this.setAction( $(this).data('action') );
}.bind(this));
_this.setAction( $(this).data('action') );
});
this.elements.buttonRemove.lsConfirm({
message: this._i18n('remove_confirm'),

View file

@ -10,7 +10,7 @@
{component_define_params params=[ 'topic', 'type', 'skipBlogs', 'blogs', 'classes' ]}
<form action="" method="POST" enctype="multipart/form-data" id="topic-add-form" class="{$classes} js-form-validate" data-content-action="{( $topic ) ? 'edit' : 'add'}">
{hook run="form_add_topic_begin"}
{hook run="form_add_topic_begin" topic=$topic}
{block 'add_topic_form_begin'}{/block}
{* Выбор блога *}
@ -49,7 +49,7 @@
label = $aLang.topic.add.fields.blog.label
name = ''
placeholder = $aLang.topic.add.fields.blog.placeholder
inputClasses = 'js-topic-add-blogs'
inputClasses = 'js-topic-add-blogs ls-hidden'
isMultiple = true
selectedValue = $blogsSelectedId
inputAttributes = [ 'data-chosen-order' => {$chosenOrder} ]
@ -158,7 +158,7 @@
{block 'add_topic_form_end'}{/block}
{hook run="form_add_topic_end"}
{hook run="form_add_topic_end" topic=$topic}
{* Скрытые поля *}

View file

@ -20,7 +20,7 @@
{component 'field.autocomplete'
label = $label
name = $name
inputClasses = 'js-user-field-choose-users'
inputClasses = 'js-user-field-choose-users ls-hidden'
isMultiple = true
placeholder = " "
note = $smarty.capture.user_field_choose

View file

@ -155,7 +155,7 @@ jQuery(document).ready(function($){
$('.js-popover-default').lsTooltip({
useAttrTitle: false,
trigger: 'click',
classes: 'tooltip-light'
classes: 'ls-tooltip-light'
});
if (ls.registry.get('block_stream_show_tip')) {
@ -163,7 +163,7 @@ jQuery(document).ready(function($){
$(this).lsTooltip({
position: {
my: "right center",
at: "left left"
at: "left center"
},
show: {
delay: 1500
@ -392,7 +392,7 @@ jQuery(document).ready(function($){
},
changeavatar: function ( event, _this, avatars ) {
$( '.js-user-profile-avatar, .js-wall-entry[data-user-id=' + _this.option( 'params.target_id' ) + '] .ls-comment-avatar img' ).attr( 'src', avatars[ '64crop' ] + '?' + Math.random() );
$( '.nav-item--userbar-username img' ).attr( 'src', avatars[ '24crop' ] + '?' + Math.random() );
$( '.ls-nav-item--userbar-username img' ).attr( 'src', avatars[ '24crop' ] + '?' + Math.random() );
}
});
@ -596,7 +596,8 @@ jQuery(document).ready(function($){
add: aRouter['blog'] + 'ajaxaddcomment/',
load: aRouter['blog'] + 'ajaxresponsecomment/'
},
show_form: ls.registry.get('comment_show_form')
show_form: ls.registry.get('comment_show_form'),
use_paging: ls.registry.get('comment_use_paging')
});
// Кнопка обновления комментариев

View file

@ -76,12 +76,14 @@
* Основная навигация
*}
<nav class="ls-grid-row layout-nav">
{component 'nav' hook='main' activeItem=$sMenuHeadItemSelect mods='main' items=[
[ 'text' => $aLang.topic.topics, 'url' => {router page='/'}, 'name' => 'blog' ],
[ 'text' => $aLang.blog.blogs, 'url' => {router page='blogs'}, 'name' => 'blogs' ],
[ 'text' => $aLang.user.users, 'url' => {router page='people'}, 'name' => 'people' ],
[ 'text' => $aLang.activity.title, 'url' => {router page='stream'}, 'name' => 'stream' ]
]}
{block 'nav_main'}
{component 'nav' hook='main' activeItem=$sMenuHeadItemSelect mods='main' items=[
[ 'text' => $aLang.topic.topics, 'url' => {router page='/'}, 'name' => 'blog' ],
[ 'text' => $aLang.blog.blogs, 'url' => {router page='blogs'}, 'name' => 'blogs' ],
[ 'text' => $aLang.user.users, 'url' => {router page='people'}, 'name' => 'people' ],
[ 'text' => $aLang.activity.title, 'url' => {router page='stream'}, 'name' => 'stream' ]
]}
{/block}
</nav>

View file

@ -29,8 +29,7 @@
activeItem => $periodSelectCurrent,
items => [
[
'name' => 'good',
'text' => {lang name='blog.menu.all_good'},
'text' => $periodSelectCurrentTitle|escape,
'menu' => [
activeItem => $periodSelectCurrent,
items => [

View file

@ -141,15 +141,15 @@ jQuery(document).ready(function($){
$('.js-popover-default').lsTooltip({
useAttrTitle: false,
trigger: 'click',
classes: 'tooltip-light'
classes: 'ls-tooltip-light'
});
if (ls.registry.get('block_stream_show_tip')) {
$('.js-title-comment, .js-title-topic').livequery(function () {
$(this).lsTooltip({
position: {
my: "right center",
at: "left left"
my: "right-15 center",
at: "left center"
},
show: {
delay: 1500
@ -589,6 +589,7 @@ jQuery(document).ready(function($){
load: aRouter['blog'] + 'ajaxresponsecomment/'
},
show_form: ls.registry.get('comment_show_form'),
use_paging: ls.registry.get('comment_use_paging'),
loaded: function () {
if (activityBlockRecent.length) {
activityBlockRecent.lsBlock('getElement', 'tabs').lsTabs('getActiveTab').lsTab('activate');

View file

@ -11,8 +11,13 @@
{component 'activity' template='recent-item'
user = $comment->getUser()
comment = $comment
topic = $topic
date = $comment->getDate()}
date = $comment->getDate()
classes = 'js-title-comment'
attributes = [
title => {$comment->getText()|strip_tags|trim|truncate:100:'...'|escape}
]}
{foreachelse}
{component 'blankslate' text={lang 'common.empty'} mods='no-background'}
{/foreach}

View file

@ -1,6 +1,6 @@
{component_define_params params=[ 'user', 'topic', 'date' ]}
{component_define_params params=[ 'user', 'topic', 'date', 'classes', 'attributes' ]}
<div class="ls-activity-block-recent-item">
<div class="ls-activity-block-recent-item {$classes}" {cattr list=$attributes}>
<a href="{$user->getUserWebPath()}" class="ls-activity-block-recent-user">{$user->getDisplayName()}</a>
<time datetime="{date_format date=$date format='c'}" class="ls-activity-block-recent-date">

View file

@ -10,7 +10,11 @@
{component 'activity' template='recent-item'
user = $topic->getUser()
topic = $topic
date = $topic->getDatePublish()}
date = $topic->getDatePublish()
classes = 'js-title-topic'
attributes = [
title => {$topic->getText()|strip_tags|trim|truncate:150:'...'|escape}
]}
{foreachelse}
{component 'blankslate' text={lang 'common.empty'} mods='no-background'}
{/foreach}

View file

@ -48,6 +48,8 @@
mediaTargetType = 'blog'
mediaTargetId = $_aRequest.blog_id
name = 'blog_description'
value = ( $_aRequest ) ? $_aRequest.blog_description : ''
escape = false
rules = [ 'required' => true, 'length' => '[10,3000]' ]
inputClasses = 'js-editor-default'
label = $aLang.blog.add.fields.description.label}

View file

@ -36,7 +36,9 @@
font-family: Verdana, sans-serif;
}
.ls-button:active,
.ls-button.active {
.ls-button.active,
.ls-button:hover,
.ls-button:focus {
outline: none;
-webkit-box-shadow: inset 0 0px 7px rgba(0,0,0,.2);
box-shadow: inset 0 0 7px rgba(0,0,0,.2);

View file

@ -22,6 +22,8 @@
line-height: 49px;
margin: 0 30px 0 18px;
font-family: 'PT Sans';
max-width: 300px;
height: 51px;
}
.ls-userbar-logo a {
color: #fff;

View file

@ -9,12 +9,14 @@
</h1>
{* Главное меню *}
{component 'nav' hook='main' activeItem=$sMenuHeadItemSelect classes='ls-userbar-nav' items=[
[ 'text' => $aLang.topic.topics, 'url' => {router page='/'}, 'name' => 'blog' ],
[ 'text' => $aLang.blog.blogs, 'url' => {router page='blogs'}, 'name' => 'blogs' ],
[ 'text' => $aLang.user.users, 'url' => {router page='people'}, 'name' => 'people' ],
[ 'text' => $aLang.activity.title, 'url' => {router page='stream'}, 'name' => 'stream' ]
]}
{block 'nav_main'}
{component 'nav' hook='main' activeItem=$sMenuHeadItemSelect classes='ls-userbar-nav' items=[
[ 'text' => $aLang.topic.topics, 'url' => {router page='/'}, 'name' => 'blog' ],
[ 'text' => $aLang.blog.blogs, 'url' => {router page='blogs'}, 'name' => 'blogs' ],
[ 'text' => $aLang.user.users, 'url' => {router page='people'}, 'name' => 'people' ],
[ 'text' => $aLang.activity.title, 'url' => {router page='stream'}, 'name' => 'stream' ]
]}
{/block}
{if $oUserCurrent}
<div class="ls-userbar-notifications">

View file

@ -9,7 +9,7 @@
{$layoutNav = [[
name => 'topics',
activeItem => $sMenuItemSelect,
showSingle => false,
showSingle => true,
items => [
[ 'name' => 'index', 'url' => {router page='/'}, 'text' => {lang name='blog.menu.all'}, 'count' => $iCountTopicsNew ],
[ 'name' => 'feed', 'url' => {router page='feed'}, 'text' => $aLang.feed.title, 'is_enabled' => !! $oUserCurrent ]

View file

@ -29,8 +29,7 @@
activeItem => $periodSelectCurrent,
items => [
[
'name' => 'good',
'text' => {lang name='blog.menu.all_good'},
'text' => $periodSelectCurrentTitle|escape,
'menu' => [
activeItem => $periodSelectCurrent,
items => [