diff --git a/application/frontend/common/js/wall.js b/application/frontend/common/js/wall.js index b00dd560..93f43b4b 100644 --- a/application/frontend/common/js/wall.js +++ b/application/frontend/common/js/wall.js @@ -11,236 +11,281 @@ var ls = ls || {}; ls.wall = (function ($) { + "use strict"; - this.options = { - login: '' - }; - - this.iIdForReply=null; /** - * Добавление записи + * Дефолтные опции + * + * @private */ - this.add = function(sText, iPid) { - $('.js-button-wall-submit').attr('disabled',true); - var url = aRouter['profile']+this.options.login+'/wall/add/'; - var params = {sText: sText, iPid: iPid}; - - ls.hook.marker('addBefore'); - $('#wall-text').addClass('loader'); - ls.ajax.load(url, params, function(result) { - $('.js-button-wall-submit').attr('disabled',false); - if (result.bStateError) { - ls.msg.error(null, result.sMsg); - } else { - $('.js-wall-reply-parent-text').val(''); - $('#wall-note-list-empty').hide(); - this.loadNew(); - ls.hook.run('ls_wall_add_after',[sText, iPid, result]); - } - $('#wall-text').removeClass('loader'); - }.bind(this)); - return false; - }; - - this.addReply = function(sText, iPid) { - $('.js-button-wall-submit').attr('disabled',true); - var url = aRouter['profile']+this.options.login+'/wall/add/'; - var params = {sText: sText, iPid: iPid}; - - ls.hook.marker('addReplyBefore'); - $('#wall-reply-text-' + iPid).addClass('loader'); - ls.ajax.load(url, params, function(result) { - $('.js-button-wall-submit').attr('disabled',false); - if (result.bStateError) { - ls.msg.error(null, result.sMsg); - } else { - $('.js-wall-reply-text').val(''); - this.loadReplyNew(iPid); - ls.hook.run('ls_wall_addreply_after',[sText, iPid, result]); - } - $('#wall-reply-text-' + iPid).removeClass('loader'); - }.bind(this)); - return false; - }; - - this.load = function(iIdLess,iIdMore,callback) { - var url = aRouter['profile']+this.options.login+'/wall/load/'; - var params = {iIdLess: iIdLess ? iIdLess : '', iIdMore: iIdMore ? iIdMore : ''}; - ls.hook.marker('loadBefore'); - ls.ajax.load(url, params, callback); - return false; - }; - - this.loadReply = function(iIdLess,iIdMore,iPid,callback) { - var url = aRouter['profile']+this.options.login+'/wall/load-reply/'; - var params = {iIdLess: iIdLess ? iIdLess : '', iIdMore: iIdMore ? iIdMore : '', iPid: iPid}; - ls.hook.marker('loadReplyBefore'); - ls.ajax.load(url, params, callback); - return false; - }; - - this.loadNext = function() { - var divLast=$('#wall-container').find('.js-wall-item:last-child'); - if (divLast.length) { - var idLess=divLast.attr('id').replace('wall-item-',''); - } else { - return false; + var _defaults = { + // Селекторы + selectors: { + entry: { + self: '.js-wall-comment', + remove: '.js-wall-comment-remove', + reply: '.js-wall-comment-reply' + }, + form: { + self: '.js-wall-form', + text: '.js-wall-form-text', + submit: '.js-wall-form-submit' + }, + get_more: { + self: '.js-wall-get-more', + count: '.js-wall-get-more-count' + }, + comment_wrapper: '.js-wall-comment-wrapper', + entry_container: '.js-wall-entry-container', + empty: '#wall-empty' + }, + // Роуты + routers: { + add: aRouter['profile'] + USER_PROFILE_LOGIN + '/wall/add/', + remove: aRouter['profile'] + USER_PROFILE_LOGIN + '/wall/remove/', + load: aRouter['profile'] + USER_PROFILE_LOGIN + '/wall/load/', + load_comments: aRouter['profile'] + USER_PROFILE_LOGIN + '/wall/load-reply/' } - $('#wall-button-next').addClass('loading'); - this.load(idLess,'',function(result) { - if (result.bStateError) { - ls.msg.error(null, result.sMsg); - } else { - if (result.iCountWall) { - $('#wall-container').append(result.sText); - } - var iCount=result.iCountWall-result.iCountWallReturn; - if (iCount) { - $('#wall-count-next').text(iCount); - } else { - $('#wall-button-next').detach(); - } - ls.hook.run('ls_wall_loadnext_after',[idLess, result]); - } - $('#wall-button-next').removeClass('loading'); - }.bind(this)); - return false; }; - this.loadNew = function() { - var divFirst=$('#wall-container').find('.js-wall-item:first-child'); - if (divFirst.length) { - var idMore=divFirst.attr('id').replace('wall-item-',''); - } else { - var idMore=-1; + /** + * Инициализация + * + * @param {Object} options Опции + */ + this.init = function(options) { + // Иниц-ем модуль только на странице профиля юзера + if ( ! USER_PROFILE_LOGIN ) return; + + var _this = this; + + this.options = $.extend({}, _defaults, options); + + this.elements = { + document: $(document), + empty: $(this.options.selectors.empty) } - this.load('',idMore,function(result) { - if (result.bStateError) { - ls.msg.error(null, result.sMsg); - } else { - if (result.iCountWall) { - $('#wall-container').prepend(result.sText); + + // Добавление + this.elements.document.on('submit', this.options.selectors.form.self, function(e) { + _this.add( $(this) ); + e.preventDefault(); + }); + + this.elements.document + .on('keyup', this.options.selectors.form.text, function(e) { + if (e.ctrlKey && (e.keyCode || e.which) == 13) { + $(this).closest('form').submit(); } - ls.hook.run('ls_wall_loadnew_after',[idMore, result]); - } - }.bind(this)); - return false; - }; - - this.loadReplyNew = function(iPid) { - var divFirst=$('#wall-reply-container-'+iPid).find('.js-wall-reply-item:last-child'); - if (divFirst.length) { - var idMore=divFirst.attr('id').replace('wall-reply-item-',''); - } else { - var idMore=-1; - } - this.loadReply('',idMore,iPid,function(result) { - if (result.bStateError) { - ls.msg.error(null, result.sMsg); - } else { - if (result.iCountWall) { - $('#wall-reply-container-'+iPid).append(result.sText); + }) + .on('click', this.options.selectors.form.text, function(e) { + // TODO: IE8 support + if (e.which == 1) { + _this.form.open($(this).closest('form')); } - ls.hook.run('ls_wall_loadreplynew_after',[iPid, idMore, result]); - } - }.bind(this)); - return false; - }; + }); - this.loadReplyNext = function(iPid) { - var divLast=$('#wall-reply-container-'+iPid).find('.js-wall-reply-item:first-child'); - if (divLast.length) { - var idLess=divLast.attr('id').replace('wall-reply-item-',''); - } else { - return false; - } - $('#wall-reply-button-next-' + iPid).addClass('loading'); - this.loadReply(idLess,'',iPid,function(result) { - if (result.bStateError) { - ls.msg.error(null, result.sMsg); - } else { - if (result.iCountWall) { - $('#wall-reply-container-'+iPid).prepend(result.sText); - } - var iCount=result.iCountWall-result.iCountWallReturn; - if (iCount) { - $('#wall-reply-count-next-'+iPid).text(iCount); - } else { - $('#wall-reply-button-next-'+iPid).detach(); - } - ls.hook.run('ls_wall_loadreplynext_after',[iPid, idLess, result]); - } - $('#wall-reply-button-next-' + iPid).removeClass('loading'); - }.bind(this)); - return false; - }; + // Показать/скрыть форму добавления комментария + this.elements.document.on('click', this.options.selectors.entry.reply, function(e) { + _this.form.toggle( $(_this.options.selectors.form.self + '[data-id=' + $(this).data('id') + ']') ); + e.preventDefault(); + }); - this.toggleReply = function(iId) { - $('#wall-item-' + iId + ' .wall-submit-reply').addClass('active').toggle().children('textarea').focus(); - return false; - }; + // Удаление записи + this.elements.document.on('click', this.options.selectors.entry.remove, function(e) { + _this.remove( $(this).data('id') ); + e.preventDefault(); + }); - this.expandReply = function(iId) { - $('#wall-item-' + iId + ' .wall-submit-reply').addClass('active'); - return false; - }; + // Подгрузка записей + this.elements.document.on('click', this.options.selectors.get_more.self, function(e) { + _this.loadNext( $(this).data('id') ); + e.preventDefault(); + }); - this.init = function(opt) { - if (opt) { - $.extend(true,this.options,opt); - } - jQuery(function($){ - $(document).click(function(e) { - if (e.which==1) { - $('.wall-submit-reply.active').each(function(k,v){ - if (!$(v).find('.js-wall-reply-text').val()) { - $(v).removeClass('active'); + // Сворачиваем открытые формы + this.elements.document.on('click', function(e) { + // TODO: IE8 support + if (e.which == 1) { + $(_this.options.selectors.form.self + '.' + ls.options.classes.states.open).each(function(key, value) { + var oForm = $(value), + iId = oForm.data('id'), + oReply = $(_this.options.selectors.entry.reply + '[data-id=' + iId + ']'); + + if ( ! oForm.is(event.target) && + oForm.has(event.target).length === 0 && + ! oReply.is(event.target) && + ! oForm.find(_this.options.selectors.form.text).val() ) { + if ( $(_this.options.selectors.entry_container + '[data-id=' + iId + ']' ).find(_this.options.selectors.entry.self).length ) { + _this.form.close(oForm); + } else { + _this.form.toggle(oForm); } - }); - } - }); - - $('body').on("click", ".wall-submit-reply, .link-dotted", function(e) { - e.stopPropagation(); - }); - - $('.js-wall-reply-text').bind('keyup', function(e) { - key = e.keyCode || e.which; - if(e.ctrlKey && (key == 13)) { - var id=$(e.target).attr('id').replace('wall-reply-text-',''); - this.addReply($(e.target).val(), id); - return false; - } - }.bind(this)); - $('.js-wall-reply-parent-text').bind('keyup', function(e) { - key = e.keyCode || e.which; - if(e.ctrlKey && (key == 13)) { - this.add($(e.target).val(), 0); - return false; - } - }.bind(this)); - }.bind(this)); - }; - - this.remove = function(iId) { - var url = aRouter['profile']+this.options.login+'/wall/remove/'; - var params = {iId: iId}; - ls.hook.marker('removeBefore'); - ls.ajax.load(url, params, function(result){ - if (result.bStateError) { - ls.msg.error(null, result.sMsg); - } else { - $('#wall-item-'+iId).fadeOut('slow', function() { - ls.hook.run('ls_wall_remove_item_fade',[iId, result],this); + } }); - $('#wall-reply-item-'+iId).fadeOut('slow', function() { - ls.hook.run('ls_wall_remove_reply_item_fade',[iId, result],this); - }); - ls.hook.run('ls_wall_remove_after',[iId, result]); } }); - return false; }; + /** + * Добавляет комментарий к записи + */ + this.add = function(oForm) { + var oTextarea = oForm.find(this.options.selectors.form.text), + oButton = oForm.find(this.options.selectors.form.submit), + iId = oForm.data('id'), + sText = oTextarea.val(); + + ls.hook.marker('addBefore'); + + oButton.prop('disabled', true).addClass(ls.options.classes.states.loading); + oTextarea.prop('disabled', true); + + ls.ajax.load(this.options.routers.add, { sText: sText, iPid: iId }, function(result) { + if (result.bStateError) { + ls.msg.error(null, result.sMsg); + } else { + if (iId === 0) this.elements.empty.hide(); + oTextarea.val(''); + this.loadNew(iId); + + ls.hook.run('ls_wall_add_after', [sText, iId, result]); + } + + oButton.prop('disabled', false).removeClass(ls.options.classes.states.loading); + oTextarea.prop('disabled', false); + }.bind(this)); + }; + + /** + * Удаление записи/комментария + * + * @param {Number} iId ID записи + */ + this.remove = function(iId) { + var _this = this; + + ls.hook.marker('removeBefore'); + + ls.ajax.load(this.options.routers.remove, { iId: iId }, function(result) { + if (result.bStateError) { + ls.msg.error(null, result.sMsg); + } else { + var entry = $(_this.options.selectors.entry.self + '[data-id=' + iId + ']'); + + entry.fadeOut('slow', function() { + if ( ! $(_this.options.selectors.entry.self).length ) _this.elements.empty.show(); + + ls.hook.run('ls_wall_remove_item_fade', [iId, result], this); + }); + entry.next(_this.options.selectors.comment_wrapper).fadeOut('slow'); + + ls.hook.run('ls_wall_remove_after', [iId, result]); + } + }); + }; + + /** + * Подгрузка + */ + this.load = function(iIdLess, iIdMore, iPid, callback) { + var params = { iIdLess: iIdLess ? iIdLess : '', iIdMore: iIdMore ? iIdMore : '', iPid: iPid }; + + ls.hook.marker('loadBefore'); + + ls.ajax.load(iPid === 0 ? this.options.routers.load : this.options.routers.load_comments, params, callback); + }; + + /** + * Подгрузка новых записей + */ + this.loadNew = function(iPid) { + var oContainer = $(this.options.selectors.entry_container + '[data-id=' + iPid + ']'), + iMoreId = oContainer.find(' > ' + this.options.selectors.entry.self + ':' + (iPid === 0 ? 'first' : 'last')).data('id') || -1; + + this.load('', iMoreId, iPid, function(result) { + if (result.bStateError) { + ls.msg.error(null, result.sMsg); + } else { + if (result.iCountWall) { + oContainer[iPid === 0 ? 'prepend' : 'append'](result.sText); + } + + this.form.close( $(this.options.selectors.form.self + '[data-id=' + iPid + ']') ); + + ls.hook.run('ls_wall_loadnew_after', [iPid, iMoreId, result]); + } + }.bind(this)); + }; + + /** + * Подгрузка записей + */ + this.loadNext = function(iPid) { + var oContainer = $(this.options.selectors.entry_container + '[data-id=' + iPid + ']'), + oGetMore = $(this.options.selectors.get_more.self + '[data-id=' + iPid + ']'), + iLessId = oContainer.find(' > ' + this.options.selectors.entry.self + ':' + (iPid === 0 ? 'last' : 'first')).data('id') || undefined; + + oGetMore.addClass(ls.options.classes.states.loading); + + this.load(iLessId, '', iPid, function(result) { + if (result.bStateError) { + ls.msg.error(null, result.sMsg); + } else { + if (result.iCountWall) { + oContainer[ iPid === 0 ? 'append' : 'prepend' ](result.sText); + } + + var iCount = result.iCountWall - result.iCountWallReturn; + + if (iCount) { + oGetMore.find(this.options.selectors.get_more.count).text(iCount); + } else { + oGetMore.remove(); + } + + ls.hook.run('ls_wall_loadnext_after', [iLessId, result]); + } + + oGetMore.removeClass(ls.options.classes.states.loading); + }.bind(this)); + }; + + /** + * Форма + */ + this.form = function(_this) { + /** + * Разворачивает форму + */ + this.open = function(oForm) { + oForm.addClass(ls.options.classes.states.open); + }; + + /** + * Сворачивает форму + */ + this.close = function(oForm) { + oForm.removeClass(ls.options.classes.states.open); + }; + + /** + * Сворачивает/разворачивает форму + */ + this.expandToggle = function(oForm) { + this.form[ oForm.hasClass(ls.options.classes.states.open) ? 'close' : 'open' ](oForm); + }.bind(_this); + + /** + * Показывает/скрывает форму комментирования + */ + this.toggle = function(oForm) { + oForm.toggle().find(this.options.selectors.form.text).focus(); + this.form.expandToggle(oForm); + }.bind(_this); + + return this; + }.call({}, this); + return this; -}).call(ls.wall || {},jQuery); \ No newline at end of file +}).call(ls.wall || {}, jQuery); \ No newline at end of file diff --git a/application/frontend/skin/developer/actions/ActionProfile/wall.comments.tpl b/application/frontend/skin/developer/actions/ActionProfile/wall.comments.tpl index 7b9547c3..6d43d0b1 100644 --- a/application/frontend/skin/developer/actions/ActionProfile/wall.comments.tpl +++ b/application/frontend/skin/developer/actions/ActionProfile/wall.comments.tpl @@ -1,28 +1,9 @@ {** * Список комментариев к записи на стене + * + * @param array $aReplyWall Список комментариев *} -{foreach $aReplyWall as $oReplyWall} - {$oReplyUser = $oReplyWall->getUser()} - -
- avatar - - - -
- {$oReplyWall->getText()} -
-
+{foreach $aReplyWall as $oWallComment} + {include 'actions/ActionProfile/wall.entry.tpl' oWallEntry=$oWallComment bWallEntryShowReply=false sWallEntryClasses='wall-comment'} {/foreach} \ No newline at end of file diff --git a/application/frontend/skin/developer/actions/ActionProfile/wall.entry.tpl b/application/frontend/skin/developer/actions/ActionProfile/wall.entry.tpl new file mode 100644 index 00000000..20a78f5b --- /dev/null +++ b/application/frontend/skin/developer/actions/ActionProfile/wall.entry.tpl @@ -0,0 +1,42 @@ +{** + * Стена / Запись (Пост / Комментарий) + * + * @param object $oWallEntry Комментарий + * @param boolean $bWallEntryShowReply Показывать или нет кнопку комментирования + * @param string $sWallEntryClasses Классы + * + * TODO: Унаследовать от базового шаблона комментария + *} + +{$oUser = $oWallEntry->getUser()} + +
+ + avatar + + + + +
+ {$oWallEntry->getText()} +
+ + {if ( $oUserCurrent && $bWallEntryShowReply ) || $oWallEntry->isAllowDelete()} + + {/if} +
\ No newline at end of file diff --git a/application/frontend/skin/developer/actions/ActionProfile/wall.form.tpl b/application/frontend/skin/developer/actions/ActionProfile/wall.form.tpl new file mode 100644 index 00000000..f1d817d4 --- /dev/null +++ b/application/frontend/skin/developer/actions/ActionProfile/wall.form.tpl @@ -0,0 +1,25 @@ +{** + * Стена / Форма добавления записи + * + * @param integer $iWallFormId ID родительского поста + * @param boolean $bWallFormDisplay Отображать форму или нет + * @param string $sWallFormPlaceholder Плейсхолдер + *} + +{if ! isset($iWallFormId)}{$iWallFormId = 0}{/if} +{if ! isset($bWallFormDisplay)}{$bWallFormDisplay = true}{/if} + +
+ {* Текст *} + {include 'forms/fields/form.field.textarea.tpl' + sFieldPlaceholder = "{if $sWallFormPlaceholder}{$sWallFormPlaceholder}{else}{$aLang.wall_add_title}{/if}" + sFieldClasses = 'width-full js-wall-form-text'} + + {* Подвал формы *} + +
\ No newline at end of file diff --git a/application/frontend/skin/developer/actions/ActionProfile/wall.posts.tpl b/application/frontend/skin/developer/actions/ActionProfile/wall.posts.tpl index 08ce882e..69e981ac 100644 --- a/application/frontend/skin/developer/actions/ActionProfile/wall.posts.tpl +++ b/application/frontend/skin/developer/actions/ActionProfile/wall.posts.tpl @@ -1,66 +1,33 @@ {** - * Список записей на стене + * Список постов на стене + * + * @param array $aWall Список постов *} -{foreach $aWall as $oWall} - {$oWallUser = $oWall->getUser()} - {$aReplyWall = $oWall->getLastReplyWall()} +{foreach $aWall as $oPost} + {$aPostComments = $oPost->getLastReplyWall()} -
-
- - avatar - + {* Запись *} + {include 'actions/ActionProfile/wall.entry.tpl' oWallEntry=$oPost bWallEntryShowReply=!$aPostComments sWallEntryClasses='wall-post'} - - -
- {$oWall->getText()} +
+ {* Кнопка подгрузки комментариев *} + {if count($aPostComments) < $oPost->getCountReply()} +
+ {$aLang.wall_load_reply_more} {$oPost->getCountReply()} {$oPost->getCountReply()|declension:$aLang.comment_declension}
- - {if $oUserCurrent and ! $aReplyWall} - - {/if} -
- - {if count($aReplyWall) < $oWall->getCountReply()} - - - {$aLang.wall_load_reply_more} - {$oWall->getCountReply()} - {$oWall->getCountReply()|declension:$aLang.comment_declension} - - {/if} -
- {if $aReplyWall} - {include file='actions/ActionProfile/wall.comments.tpl'} + {* Комментарии *} +
+ {if $aPostComments} + {include 'actions/ActionProfile/wall.comments.tpl' aReplyWall=$aPostComments} {/if}
+ {* Форма добавления комментария *} {if $oUserCurrent} -
- - -
+ {include 'actions/ActionProfile/wall.form.tpl' iWallFormId=$oPost->getId() bWallFormDisplay=$aPostComments sWallFormPlaceholder=$aLang.wall_reply_placeholder} {/if}
{/foreach} \ No newline at end of file diff --git a/application/frontend/skin/developer/actions/ActionProfile/wall.tpl b/application/frontend/skin/developer/actions/ActionProfile/wall.tpl index 43d398b4..863876b1 100644 --- a/application/frontend/skin/developer/actions/ActionProfile/wall.tpl +++ b/application/frontend/skin/developer/actions/ActionProfile/wall.tpl @@ -7,34 +7,26 @@ {block name='layout_user_page_title'}{$aLang.user_menu_profile_wall}{/block} {block name='layout_content'} - - + {* Форма добавления записи *} {if $oUserCurrent} -
- -

- - -
+ {include 'actions/ActionProfile/wall.form.tpl'} {else} - {include file='alert.tpl' sAlertStyle='info' mAlerts=$aLang.wall_add_quest sAlertAttributes='id="wall-note-list-empty"'} + {include 'alert.tpl' sAlertStyle='info' mAlerts=$aLang.wall_add_quest} {/if} {if ! count($aWall)} - {include file='alert.tpl' mAlerts=$aLang.wall_list_empty sAlertStyle='empty' sAlertAttributes='id="wall-note-list-empty"'} + {include 'alert.tpl' mAlerts=$aLang.wall_list_empty sAlertStyle='empty' sAlertAttributes='id="wall-empty"'} {/if} -
- {include file='actions/ActionProfile/wall.posts.tpl'} + {* Список записей *} +
+ {include 'actions/ActionProfile/wall.posts.tpl'}
+ {* Кнопка подгрузки записей *} {if $iCountWall - count($aWall)} -
- {$aLang.wall_load_more} ({$iCountWall-count($aWall)}) +
+ {$aLang.wall_load_more} ({$iCountWall - count($aWall)})
{/if} {/block} \ No newline at end of file diff --git a/application/frontend/skin/developer/assets/css/wall.css b/application/frontend/skin/developer/assets/css/wall.css index 3d58377e..605926b2 100644 --- a/application/frontend/skin/developer/assets/css/wall.css +++ b/application/frontend/skin/developer/assets/css/wall.css @@ -1,7 +1,7 @@ /** * Стена * - * @template actions/ActionProfile/wall_*.tpl + * @template actions/ActionProfile/wall.*.tpl * @scripts /common/js/wall.js * * @license GNU General Public License, version 2 @@ -13,32 +13,32 @@ /** * Форма добавления сообщения на стену */ -.wall-submit { margin-bottom: 30px; } -.wall-submit.wall-submit-reply { margin: 2px 0 2px 25px; padding: 7px; background: #fafafa; } -.wall-submit.wall-submit-reply textarea { height: 28px; margin: 0; } -.wall-submit.wall-submit-reply button { display: none; } -.wall-submit.wall-submit-reply.active textarea { height: 80px; margin-bottom: 5px; } -.wall-submit.wall-submit-reply.active button { display: block; } -.wall-submit p { margin-bottom: 5px; } +.wall-form { margin-bottom: 0; padding: 15px; background: #fafafa; } +.wall-form .form-field { margin-bottom: 0; } +.wall-form textarea { height: 30px; min-height: 30px; max-height: 30px; resize: none; } + +.wall-form-footer { display: none; } + +/* Open */ +.wall-form.open .form-field { margin-bottom: 15px; } +.wall-form.open textarea { height: 90px; max-height: 300px; resize: vertical; } + +.wall-form.open .wall-form-footer { display: block; } /** * Сообщения */ -.comments.wall, -.wall .comment { margin-bottom: 2px; } -.wall .comment .comment-info { padding-bottom: 0; } -.wall .comment .comment-content { margin-bottom: 3px; } +.comment.wall-post { padding-left: 70px; } +.comment.wall-comment { padding-left: 50px; } +.comment.wall-comment .comment-content { margin-bottom: 3px; } +.comment.wall-comment .comment-avatar { width: 30px; height: 30px; } -/** - * Комментарии - */ -.comment.wall-comment-reply { min-height: 0; padding-left: 48px; } -.comment.wall-comment-reply .comment-avatar { width: 30px; height: 30px; } +.wall-comments { padding-left: 70px; } /** * Кнопка подгрузки комментариев */ -.get-more.get-more-wall-comments { border: none; margin: 0 0 0 25px; } \ No newline at end of file +.get-more.get-more-wall-comments { border: none; margin: 0; } \ No newline at end of file diff --git a/application/frontend/skin/developer/assets/js/init.js b/application/frontend/skin/developer/assets/js/init.js index b1e53c8c..aea17d9c 100644 --- a/application/frontend/skin/developer/assets/js/init.js +++ b/application/frontend/skin/developer/assets/js/init.js @@ -242,6 +242,12 @@ jQuery(document).ready(function($){ //ls.media.init(); + /** + * Стена + */ + ls.wall.init(); + + // Временный костыль для сабмита форм // TODO: Перенести в плагин button $('button[data-button-submit-form]').on('click', function () { diff --git a/application/frontend/skin/developer/layouts/layout.base.tpl b/application/frontend/skin/developer/layouts/layout.base.tpl index ba923492..ca4e04be 100644 --- a/application/frontend/skin/developer/layouts/layout.base.tpl +++ b/application/frontend/skin/developer/layouts/layout.base.tpl @@ -58,7 +58,8 @@ SESSION_ID = '{$_sPhpSessionId}', SESSION_NAME = '{$_sPhpSessionName}', LANGUAGE = '{$oConfig->GetValue('lang.current')}', - WYSIWYG = {if $oConfig->GetValue('view.wysiwyg')}true{else}false{/if}; + WYSIWYG = {if $oConfig->GetValue('view.wysiwyg')}true{else}false{/if}, + USER_PROFILE_LOGIN = {if $oUserProfile}'{$oUserProfile->getLogin()}'{else}''{/if}; var aRouter = []; {foreach $aRouter as $sPage => $sPath}