mirror of
https://github.com/Oreolek/ifhub.club.git
synced 2024-06-17 07:10:48 +03:00
Tabs -> Spaces
This commit is contained in:
parent
738e878b73
commit
a4a8dfcb8b
|
@ -9,43 +9,43 @@
|
|||
*/
|
||||
|
||||
(function($) {
|
||||
"use strict";
|
||||
"use strict";
|
||||
|
||||
$.widget( "livestreet.lsActivitySettings", $.livestreet.lsComponent, {
|
||||
/**
|
||||
* Дефолтные опции
|
||||
*/
|
||||
options: {
|
||||
// Ссылки
|
||||
urls: {
|
||||
toggle_type: null
|
||||
},
|
||||
$.widget( "livestreet.lsActivitySettings", $.livestreet.lsComponent, {
|
||||
/**
|
||||
* Дефолтные опции
|
||||
*/
|
||||
options: {
|
||||
// Ссылки
|
||||
urls: {
|
||||
toggle_type: null
|
||||
},
|
||||
|
||||
// Селекторы
|
||||
selectors: {
|
||||
type_checkbox: '.js-activity-settings-type-checkbox'
|
||||
}
|
||||
},
|
||||
// Селекторы
|
||||
selectors: {
|
||||
type_checkbox: '.js-activity-settings-type-checkbox'
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Конструктор
|
||||
*
|
||||
* @constructor
|
||||
* @private
|
||||
*/
|
||||
_create: function () {
|
||||
this._super();
|
||||
/**
|
||||
* Конструктор
|
||||
*
|
||||
* @constructor
|
||||
* @private
|
||||
*/
|
||||
_create: function () {
|
||||
this._super();
|
||||
|
||||
this._on( this.elements.type_checkbox, { change: 'toggleEventType' } );
|
||||
},
|
||||
this._on( this.elements.type_checkbox, { change: 'toggleEventType' } );
|
||||
},
|
||||
|
||||
/**
|
||||
* Сохранение настроек
|
||||
*/
|
||||
toggleEventType: function( event ) {
|
||||
this.option( 'params.type', $( event.target ).data( 'type' ) );
|
||||
/**
|
||||
* Сохранение настроек
|
||||
*/
|
||||
toggleEventType: function( event ) {
|
||||
this.option( 'params.type', $( event.target ).data( 'type' ) );
|
||||
|
||||
this._load( 'toggle_type', function( response ) {} );
|
||||
}
|
||||
});
|
||||
this._load( 'toggle_type', function( response ) {} );
|
||||
}
|
||||
});
|
||||
})(jQuery);
|
|
@ -9,56 +9,56 @@
|
|||
*/
|
||||
|
||||
(function($) {
|
||||
"use strict";
|
||||
"use strict";
|
||||
|
||||
$.widget( "livestreet.lsActivity", $.livestreet.lsComponent, {
|
||||
/**
|
||||
* Дефолтные опции
|
||||
*/
|
||||
options: {
|
||||
// Ссылки
|
||||
urls: {
|
||||
// Подгрузка событий
|
||||
more: null
|
||||
},
|
||||
$.widget( "livestreet.lsActivity", $.livestreet.lsComponent, {
|
||||
/**
|
||||
* Дефолтные опции
|
||||
*/
|
||||
options: {
|
||||
// Ссылки
|
||||
urls: {
|
||||
// Подгрузка событий
|
||||
more: null
|
||||
},
|
||||
|
||||
// Селекторы
|
||||
selectors: {
|
||||
// Список событий
|
||||
list: '.js-activity-event-list',
|
||||
// Событие
|
||||
event: '.js-activity-event',
|
||||
// Кнопка подгрузки событий
|
||||
more: '.js-activity-more'
|
||||
}
|
||||
},
|
||||
// Селекторы
|
||||
selectors: {
|
||||
// Список событий
|
||||
list: '.js-activity-event-list',
|
||||
// Событие
|
||||
event: '.js-activity-event',
|
||||
// Кнопка подгрузки событий
|
||||
more: '.js-activity-more'
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Конструктор
|
||||
*
|
||||
* @constructor
|
||||
* @private
|
||||
*/
|
||||
_create: function () {
|
||||
this._super();
|
||||
/**
|
||||
* Конструктор
|
||||
*
|
||||
* @constructor
|
||||
* @private
|
||||
*/
|
||||
_create: function () {
|
||||
this._super();
|
||||
|
||||
// Подгрузка событий
|
||||
this.elements.more.lsMore({
|
||||
urls: {
|
||||
load: this.option( 'urls.more' ),
|
||||
},
|
||||
target: this.elements.list,
|
||||
beforeload: function (e, context) {
|
||||
context._setParam( 'date_last', this.getDateLast() );
|
||||
}.bind( this )
|
||||
});
|
||||
},
|
||||
// Подгрузка событий
|
||||
this.elements.more.lsMore({
|
||||
urls: {
|
||||
load: this.option( 'urls.more' ),
|
||||
},
|
||||
target: this.elements.list,
|
||||
beforeload: function (e, context) {
|
||||
context._setParam( 'date_last', this.getDateLast() );
|
||||
}.bind( this )
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Получает дату последнего подгруженного события
|
||||
*/
|
||||
getDateLast: function() {
|
||||
return this.elements.list.find( this.option( 'selectors.event' ) ).last().find( 'time' ).attr( 'datetime' );
|
||||
}
|
||||
});
|
||||
/**
|
||||
* Получает дату последнего подгруженного события
|
||||
*/
|
||||
getDateLast: function() {
|
||||
return this.elements.list.find( this.option( 'selectors.event' ) ).last().find( 'time' ).attr( 'datetime' );
|
||||
}
|
||||
});
|
||||
})(jQuery);
|
|
@ -7,27 +7,27 @@
|
|||
*/
|
||||
|
||||
.ls-favourite {
|
||||
cursor: pointer;
|
||||
display: inline-block;
|
||||
cursor: pointer;
|
||||
display: inline-block;
|
||||
}
|
||||
.ls-favourite:hover {
|
||||
opacity: .8;
|
||||
filter: alpha(opacity=80);
|
||||
opacity: .8;
|
||||
filter: alpha(opacity=80);
|
||||
}
|
||||
.ls-favourite-toggle {
|
||||
display: inline-block;
|
||||
opacity: .3;
|
||||
filter: alpha(opacity=30);
|
||||
display: inline-block;
|
||||
opacity: .3;
|
||||
filter: alpha(opacity=30);
|
||||
}
|
||||
.ls-favourite--added .ls-favourite-toggle {
|
||||
opacity: 1;
|
||||
filter: alpha(opacity=100);
|
||||
opacity: 1;
|
||||
filter: alpha(opacity=100);
|
||||
}
|
||||
.ls-favourite-count {
|
||||
display: none;
|
||||
margin-left: 0;
|
||||
font-weight: bold;
|
||||
display: none;
|
||||
margin-left: 0;
|
||||
font-weight: bold;
|
||||
}
|
||||
.ls-favourite--has-counter .ls-favourite-count {
|
||||
display: inline-block;
|
||||
display: inline-block;
|
||||
}
|
|
@ -35,17 +35,17 @@
|
|||
|
||||
|
||||
<div class="{$component} {cmods name=$component mods=$mods} {if $isActive}active{/if} {$smarty.local.classes}"
|
||||
data-param-i-target-id="{$target->getId()}"
|
||||
title="{$aLang.$component[ ($isActive) ? 'remove' : 'add' ]}"
|
||||
{cattr list=$smarty.local.attributes}>
|
||||
data-param-i-target-id="{$target->getId()}"
|
||||
title="{$aLang.$component[ ($isActive) ? 'remove' : 'add' ]}"
|
||||
{cattr list=$smarty.local.attributes}>
|
||||
|
||||
{* Кнопка добавления/удаления из избранного *}
|
||||
{component 'icon' icon='heart' classes="{$component}-toggle js-favourite-toggle"}
|
||||
{* Кнопка добавления/удаления из избранного *}
|
||||
{component 'icon' icon='heart' classes="{$component}-toggle js-favourite-toggle"}
|
||||
|
||||
{* Кол-во объектов в избранном *}
|
||||
{if isset( $count )}
|
||||
<span class="{$component}-count js-favourite-count" {if ! $count && $smarty.local.hideZeroCounter|default:true}style="display: none;"{/if}>
|
||||
{$count}
|
||||
</span>
|
||||
{/if}
|
||||
{* Кол-во объектов в избранном *}
|
||||
{if isset( $count )}
|
||||
<span class="{$component}-count js-favourite-count" {if ! $count && $smarty.local.hideZeroCounter|default:true}style="display: none;"{/if}>
|
||||
{$count}
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
|
@ -9,46 +9,46 @@
|
|||
*/
|
||||
|
||||
(function($) {
|
||||
"use strict";
|
||||
"use strict";
|
||||
|
||||
$.widget( "livestreet.lsFeedBlogs", $.livestreet.lsComponent, {
|
||||
/**
|
||||
* Дефолтные опции
|
||||
*/
|
||||
options: {
|
||||
// Ссылки
|
||||
urls: {
|
||||
subscribe: null,
|
||||
unsubscribe: null
|
||||
},
|
||||
$.widget( "livestreet.lsFeedBlogs", $.livestreet.lsComponent, {
|
||||
/**
|
||||
* Дефолтные опции
|
||||
*/
|
||||
options: {
|
||||
// Ссылки
|
||||
urls: {
|
||||
subscribe: null,
|
||||
unsubscribe: null
|
||||
},
|
||||
|
||||
// Селекторы
|
||||
selectors: {
|
||||
checkbox: '.js-feed-blogs-subscribe'
|
||||
},
|
||||
// Селекторы
|
||||
selectors: {
|
||||
checkbox: '.js-feed-blogs-subscribe'
|
||||
},
|
||||
|
||||
params: {}
|
||||
},
|
||||
params: {}
|
||||
},
|
||||
|
||||
/**
|
||||
* Конструктор
|
||||
*
|
||||
* @constructor
|
||||
* @private
|
||||
*/
|
||||
_create: function () {
|
||||
this._super();
|
||||
/**
|
||||
* Конструктор
|
||||
*
|
||||
* @constructor
|
||||
* @private
|
||||
*/
|
||||
_create: function () {
|
||||
this._super();
|
||||
|
||||
this._on( this.getElement( 'checkbox' ), { change: this.toggleSubscribe } );
|
||||
},
|
||||
this._on( this.getElement( 'checkbox' ), { change: this.toggleSubscribe } );
|
||||
},
|
||||
|
||||
/**
|
||||
* Сохранение настроек
|
||||
*/
|
||||
toggleSubscribe: function( event ) {
|
||||
var checkbox = $( event.target );
|
||||
/**
|
||||
* Сохранение настроек
|
||||
*/
|
||||
toggleSubscribe: function( event ) {
|
||||
var checkbox = $( event.target );
|
||||
|
||||
this._load( checkbox.is(':checked') ? 'subscribe' : 'unsubscribe', { type: 'blogs', id: checkbox.data( 'id' ) } );
|
||||
}
|
||||
});
|
||||
this._load( checkbox.is(':checked') ? 'subscribe' : 'unsubscribe', { type: 'blogs', id: checkbox.data( 'id' ) } );
|
||||
}
|
||||
});
|
||||
})(jQuery);
|
|
@ -11,338 +11,338 @@
|
|||
*/
|
||||
|
||||
(function($) {
|
||||
"use strict";
|
||||
"use strict";
|
||||
|
||||
$.widget( "livestreet.lsMedia", $.livestreet.lsComponent, {
|
||||
/**
|
||||
* Дефолтные опции
|
||||
*/
|
||||
options: {
|
||||
// Редактор к которому привязано текущее окно
|
||||
editor: $(),
|
||||
$.widget( "livestreet.lsMedia", $.livestreet.lsComponent, {
|
||||
/**
|
||||
* Дефолтные опции
|
||||
*/
|
||||
options: {
|
||||
// Редактор к которому привязано текущее окно
|
||||
editor: $(),
|
||||
|
||||
// Ссылки
|
||||
urls: {
|
||||
// Вставка файла
|
||||
insert: aRouter.ajax + 'media/submit-insert/',
|
||||
// Вставка фотосета
|
||||
photoset: aRouter.ajax + 'media/submit-create-photoset',
|
||||
// Загрузка файла по ссылке
|
||||
url_upload: aRouter.ajax + 'media/upload-link/',
|
||||
// Вставка файла по ссылке
|
||||
url_insert: aRouter.ajax + 'media/upload-insert/'
|
||||
},
|
||||
// Ссылки
|
||||
urls: {
|
||||
// Вставка файла
|
||||
insert: aRouter.ajax + 'media/submit-insert/',
|
||||
// Вставка фотосета
|
||||
photoset: aRouter.ajax + 'media/submit-create-photoset',
|
||||
// Загрузка файла по ссылке
|
||||
url_upload: aRouter.ajax + 'media/upload-link/',
|
||||
// Вставка файла по ссылке
|
||||
url_insert: aRouter.ajax + 'media/upload-insert/'
|
||||
},
|
||||
|
||||
// Селекторы
|
||||
selectors: {
|
||||
nav: '.js-media-nav',
|
||||
uploader: '.js-media-uploader',
|
||||
block: '.js-media-info-block',
|
||||
insert_submit: '.js-media-insert-submit',
|
||||
photoset_submit: '.js-media-photoset-submit',
|
||||
url: {
|
||||
form: '.js-media-url-form',
|
||||
url: '.js-media-url-form-url',
|
||||
block_container: '.js-media-url-settings-blocks',
|
||||
submit_upload: '.js-media-url-submit-upload',
|
||||
submit_insert: '.js-media-url-submit-insert',
|
||||
image_preview: '.js-media-url-image-preview'
|
||||
}
|
||||
},
|
||||
// Селекторы
|
||||
selectors: {
|
||||
nav: '.js-media-nav',
|
||||
uploader: '.js-media-uploader',
|
||||
block: '.js-media-info-block',
|
||||
insert_submit: '.js-media-insert-submit',
|
||||
photoset_submit: '.js-media-photoset-submit',
|
||||
url: {
|
||||
form: '.js-media-url-form',
|
||||
url: '.js-media-url-form-url',
|
||||
block_container: '.js-media-url-settings-blocks',
|
||||
submit_upload: '.js-media-url-submit-upload',
|
||||
submit_insert: '.js-media-url-submit-insert',
|
||||
image_preview: '.js-media-url-image-preview'
|
||||
}
|
||||
},
|
||||
|
||||
uploader_options: {},
|
||||
uploader_options: {},
|
||||
|
||||
params: {}
|
||||
},
|
||||
params: {}
|
||||
},
|
||||
|
||||
/**
|
||||
* Конструктор
|
||||
*
|
||||
* @constructor
|
||||
* @private
|
||||
*/
|
||||
_create: function () {
|
||||
this._super();
|
||||
/**
|
||||
* Конструктор
|
||||
*
|
||||
* @constructor
|
||||
* @private
|
||||
*/
|
||||
_create: function () {
|
||||
this._super();
|
||||
|
||||
// Получаем редактор
|
||||
! this.option( 'editor' ).length && this.option( 'editor', $( '#' + this.element.data( 'media-editor') ) );
|
||||
// Получаем редактор
|
||||
! this.option( 'editor' ).length && this.option( 'editor', $( '#' + this.element.data( 'media-editor') ) );
|
||||
|
||||
$.extend(this.elements, {
|
||||
blocks: this.element.find( this.option( 'selectors.uploader' ) + ' ' + this.option( 'selectors.block' ) ),
|
||||
url: {
|
||||
form: this.element.find( this.option( 'selectors.url.form' ) ),
|
||||
url: this.element.find( this.option( 'selectors.url.url' ) ),
|
||||
block_container: this.element.find( this.option( 'selectors.url.block_container' ) ),
|
||||
submit_upload: this.element.find( this.option( 'selectors.url.submit_upload' ) ),
|
||||
submit_insert: this.element.find( this.option( 'selectors.url.submit_insert' ) ),
|
||||
image_preview: this.element.find( this.option( 'selectors.url.image_preview' ) )
|
||||
}
|
||||
});
|
||||
$.extend(this.elements, {
|
||||
blocks: this.element.find( this.option( 'selectors.uploader' ) + ' ' + this.option( 'selectors.block' ) ),
|
||||
url: {
|
||||
form: this.element.find( this.option( 'selectors.url.form' ) ),
|
||||
url: this.element.find( this.option( 'selectors.url.url' ) ),
|
||||
block_container: this.element.find( this.option( 'selectors.url.block_container' ) ),
|
||||
submit_upload: this.element.find( this.option( 'selectors.url.submit_upload' ) ),
|
||||
submit_insert: this.element.find( this.option( 'selectors.url.submit_insert' ) ),
|
||||
image_preview: this.element.find( this.option( 'selectors.url.image_preview' ) )
|
||||
}
|
||||
});
|
||||
|
||||
this.elements.url.blocks = this.elements.url.block_container.find( this.option( 'selectors.block' ) );
|
||||
this.elements.url.blocks = this.elements.url.block_container.find( this.option( 'selectors.block' ) );
|
||||
|
||||
// Иниц-ия загрузчика
|
||||
this.elements.uploader.lsUploader( $.extend( {}, this.option( 'uploader_options' ), {
|
||||
autoload: false,
|
||||
params: {
|
||||
security_ls_key: LIVESTREET_SECURITY_KEY
|
||||
},
|
||||
filebeforeactivate: this._onFileBeforeActivate.bind( this )
|
||||
}));
|
||||
// Иниц-ия загрузчика
|
||||
this.elements.uploader.lsUploader( $.extend( {}, this.option( 'uploader_options' ), {
|
||||
autoload: false,
|
||||
params: {
|
||||
security_ls_key: LIVESTREET_SECURITY_KEY
|
||||
},
|
||||
filebeforeactivate: this._onFileBeforeActivate.bind( this )
|
||||
}));
|
||||
|
||||
this._list = this.elements.uploader.lsUploader( 'getElement', 'list' );
|
||||
this._originalTargetType = this.elements.uploader.lsUploader( 'option', 'params.target_type' );
|
||||
this._list = this.elements.uploader.lsUploader( 'getElement', 'list' );
|
||||
this._originalTargetType = this.elements.uploader.lsUploader( 'option', 'params.target_type' );
|
||||
|
||||
// Табы
|
||||
this.elements.nav.lsTabs({
|
||||
tabactivate: this._onTabActivate.bind( this )
|
||||
});
|
||||
// Табы
|
||||
this.elements.nav.lsTabs({
|
||||
tabactivate: this._onTabActivate.bind( this )
|
||||
});
|
||||
|
||||
// Иниц-ия модального окна
|
||||
this.element.lsModal({
|
||||
aftershow: this.reload.bind( this )
|
||||
});
|
||||
// Иниц-ия модального окна
|
||||
this.element.lsModal({
|
||||
aftershow: this.reload.bind( this )
|
||||
});
|
||||
|
||||
//
|
||||
// INSERT
|
||||
//
|
||||
//
|
||||
// INSERT
|
||||
//
|
||||
|
||||
this._on( this.elements.insert_submit, { click: '_onInsertSubmit' } );
|
||||
this._on( this.elements.photoset_submit, { click: '_onPhotosetSubmit' } );
|
||||
this._on( this.elements.insert_submit, { click: '_onInsertSubmit' } );
|
||||
this._on( this.elements.photoset_submit, { click: '_onPhotosetSubmit' } );
|
||||
|
||||
//
|
||||
// INSERT FROM URL
|
||||
//
|
||||
//
|
||||
// INSERT FROM URL
|
||||
//
|
||||
|
||||
this._on( this.elements.url.type, { click: 'onUrlTypeChange' } );
|
||||
this._on( this.elements.url.url, { keyup: 'onUrlChange', change: 'onUrlChange' } );
|
||||
this._on( this.elements.url.submit_upload, { click: this.urlInsert.bind( this, true ) } );
|
||||
this._on( this.elements.url.submit_insert, { click: this.urlInsert.bind( this, false ) } );
|
||||
},
|
||||
this._on( this.elements.url.type, { click: 'onUrlTypeChange' } );
|
||||
this._on( this.elements.url.url, { keyup: 'onUrlChange', change: 'onUrlChange' } );
|
||||
this._on( this.elements.url.submit_upload, { click: this.urlInsert.bind( this, true ) } );
|
||||
this._on( this.elements.url.submit_insert, { click: this.urlInsert.bind( this, false ) } );
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
_onInsertSubmit: function( event ) {
|
||||
this.insertSelectedFiles( 'insert', this.getSettings() );
|
||||
},
|
||||
/**
|
||||
*
|
||||
*/
|
||||
_onInsertSubmit: function( event ) {
|
||||
this.insertSelectedFiles( 'insert', this.getSettings() );
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
_onPhotosetSubmit: function( event ) {
|
||||
this.insertSelectedFiles( 'photoset', this.getSettings() );
|
||||
},
|
||||
/**
|
||||
*
|
||||
*/
|
||||
_onPhotosetSubmit: function( event ) {
|
||||
this.insertSelectedFiles( 'photoset', this.getSettings() );
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
_onFileBeforeActivate: function( event, data ) {
|
||||
this.activateInfoBlock( data.element );
|
||||
},
|
||||
/**
|
||||
*
|
||||
*/
|
||||
_onFileBeforeActivate: function( event, data ) {
|
||||
this.activateInfoBlock( data.element );
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
_onTabActivate: function( event, data ) {
|
||||
var type = data.element.data( 'media-name' );
|
||||
/**
|
||||
*
|
||||
*/
|
||||
_onTabActivate: function( event, data ) {
|
||||
var type = data.element.data( 'media-name' );
|
||||
|
||||
this.moveUploader( data );
|
||||
this.moveUploader( data );
|
||||
|
||||
if ( type === 'photoset' ) {
|
||||
this._list.lsUploaderFileList( 'option', 'multiselect_ctrl', false );
|
||||
this.elements.uploader.lsUploader( 'filterFilesByType', [ '1' ] );
|
||||
}
|
||||
},
|
||||
if ( type === 'photoset' ) {
|
||||
this._list.lsUploaderFileList( 'option', 'multiselect_ctrl', false );
|
||||
this.elements.uploader.lsUploader( 'filterFilesByType', [ '1' ] );
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Перемещение uploader'а из одного таба в другой
|
||||
*/
|
||||
moveUploader: function( tab ) {
|
||||
this.resetUploader();
|
||||
/**
|
||||
* Перемещение uploader'а из одного таба в другой
|
||||
*/
|
||||
moveUploader: function( tab ) {
|
||||
this.resetUploader();
|
||||
|
||||
// Перемещение
|
||||
if ( tab.element.hasClass( 'js-tab-show-gallery' ) ) {
|
||||
this.elements.uploader
|
||||
.lsUploader( 'resetFilter' )
|
||||
.lsUploader( 'unselectAll' )
|
||||
.appendTo( this.getPaneContent( tab ) );
|
||||
}
|
||||
},
|
||||
// Перемещение
|
||||
if ( tab.element.hasClass( 'js-tab-show-gallery' ) ) {
|
||||
this.elements.uploader
|
||||
.lsUploader( 'resetFilter' )
|
||||
.lsUploader( 'unselectAll' )
|
||||
.appendTo( this.getPaneContent( tab ) );
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
resetUploader: function() {
|
||||
this._list.lsUploaderFileList( 'option', 'params.target_type', this._originalTargetType );
|
||||
this._list.lsUploaderFileList( 'option', 'multiselect_ctrl', true );
|
||||
},
|
||||
/**
|
||||
*
|
||||
*/
|
||||
resetUploader: function() {
|
||||
this._list.lsUploaderFileList( 'option', 'params.target_type', this._originalTargetType );
|
||||
this._list.lsUploaderFileList( 'option', 'multiselect_ctrl', true );
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
getPaneContent: function( tab ) {
|
||||
return tab.getPane().find( '.js-media-pane-content' );
|
||||
},
|
||||
/**
|
||||
*
|
||||
*/
|
||||
getPaneContent: function( tab ) {
|
||||
return tab.getPane().find( '.js-media-pane-content' );
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
show: function() {
|
||||
this.element.lsModal( 'show' );
|
||||
},
|
||||
/**
|
||||
*
|
||||
*/
|
||||
show: function() {
|
||||
this.element.lsModal( 'show' );
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
hide: function() {
|
||||
this.element.lsModal( 'hide' );
|
||||
},
|
||||
/**
|
||||
*
|
||||
*/
|
||||
hide: function() {
|
||||
this.element.lsModal( 'hide' );
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
getSettings: function() {
|
||||
return this.elements.blocks
|
||||
.filter( ':visible' )
|
||||
.find( 'form' )
|
||||
.serializeJSON();
|
||||
},
|
||||
/**
|
||||
*
|
||||
*/
|
||||
getSettings: function() {
|
||||
return this.elements.blocks
|
||||
.filter( ':visible' )
|
||||
.find( 'form' )
|
||||
.serializeJSON();
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
insertSelectedFiles: function( url, params ) {
|
||||
this.insertFiles( url, params, this.elements.uploader.lsUploader( 'getSelectedFiles' ) );
|
||||
},
|
||||
/**
|
||||
*
|
||||
*/
|
||||
insertSelectedFiles: function( url, params ) {
|
||||
this.insertFiles( url, params, this.elements.uploader.lsUploader( 'getSelectedFiles' ) );
|
||||
},
|
||||
|
||||
/**
|
||||
* Вставляет выделенные файлы в редактор
|
||||
*/
|
||||
insertFiles: function( url, params, files ) {
|
||||
if ( ! files.length ) return;
|
||||
/**
|
||||
* Вставляет выделенные файлы в редактор
|
||||
*/
|
||||
insertFiles: function( url, params, files ) {
|
||||
if ( ! files.length ) return;
|
||||
|
||||
// Формируем список ID файлов
|
||||
var ids = $.map( files, function ( file ) {
|
||||
return $( file ).lsUploaderFile( 'getProperty', 'id' );
|
||||
});
|
||||
// Формируем список ID файлов
|
||||
var ids = $.map( files, function ( file ) {
|
||||
return $( file ).lsUploaderFile( 'getProperty', 'id' );
|
||||
});
|
||||
|
||||
this._load( url, $.extend( true, {}, { ids: ids }, params || {} ), function( response ) {
|
||||
this.option( 'editor' ).lsEditor( 'insert', response.sTextResult );
|
||||
this.element.lsModal( 'hide' );
|
||||
});
|
||||
},
|
||||
this._load( url, $.extend( true, {}, { ids: ids }, params || {} ), function( response ) {
|
||||
this.option( 'editor' ).lsEditor( 'insert', response.sTextResult );
|
||||
this.element.lsModal( 'hide' );
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
activateInfoBlock: function( file ) {
|
||||
this.elements.blocks.hide();
|
||||
/**
|
||||
*
|
||||
*/
|
||||
activateInfoBlock: function( file ) {
|
||||
this.elements.blocks.hide();
|
||||
|
||||
var block = this.elements.blocks.filter( '[data-type=' + this.getActiveTabName() + ']' ).show();
|
||||
var block = this.elements.blocks.filter( '[data-type=' + this.getActiveTabName() + ']' ).show();
|
||||
|
||||
// Показываем блок настроек только для активного типа файла
|
||||
this.elements.blocks
|
||||
.filter( '[data-filetype]' )
|
||||
.filter( ':not([data-filetype=' + file.lsUploaderFile( 'getProperty', 'type' ) + '])' )
|
||||
.hide();
|
||||
// Показываем блок настроек только для активного типа файла
|
||||
this.elements.blocks
|
||||
.filter( '[data-filetype]' )
|
||||
.filter( ':not([data-filetype=' + file.lsUploaderFile( 'getProperty', 'type' ) + '])' )
|
||||
.hide();
|
||||
|
||||
// Обновляем настройки
|
||||
if ( file.lsUploaderFile( 'getProperty', 'type' ) == '1' ) {
|
||||
var sizes = block.find( 'select[name=size]' );
|
||||
// Обновляем настройки
|
||||
if ( file.lsUploaderFile( 'getProperty', 'type' ) == '1' ) {
|
||||
var sizes = block.find( 'select[name=size]' );
|
||||
|
||||
sizes.find( 'option:not([value=original])' ).remove();
|
||||
sizes.append($.map( file.data('mediaImageSizes'), function ( v, k ) {
|
||||
// Расчитываем пропорциональную высоту изображения
|
||||
var height = v.h || parseInt( v.w * file.lsUploaderFile( 'getProperty', 'height' ) / file.lsUploaderFile( 'getProperty', 'width' ) );
|
||||
sizes.find( 'option:not([value=original])' ).remove();
|
||||
sizes.append($.map( file.data('mediaImageSizes'), function ( v, k ) {
|
||||
// Расчитываем пропорциональную высоту изображения
|
||||
var height = v.h || parseInt( v.w * file.lsUploaderFile( 'getProperty', 'height' ) / file.lsUploaderFile( 'getProperty', 'width' ) );
|
||||
|
||||
return '<option value="' + v.w + 'x' + ( v.h ? v.h : '' ) + ( v.crop ? 'crop' : '' ) + '">' + v.w + ' × ' + height + '</option>';
|
||||
}).join( '' ));
|
||||
}
|
||||
return '<option value="' + v.w + 'x' + ( v.h ? v.h : '' ) + ( v.crop ? 'crop' : '' ) + '">' + v.w + ' × ' + height + '</option>';
|
||||
}).join( '' ));
|
||||
}
|
||||
|
||||
// TODO: Add hook
|
||||
},
|
||||
// TODO: Add hook
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
reload: function() {
|
||||
this.elements.uploader.lsUploader( 'reload' );
|
||||
},
|
||||
/**
|
||||
*
|
||||
*/
|
||||
reload: function() {
|
||||
this.elements.uploader.lsUploader( 'reload' );
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
getActiveTab: function() {
|
||||
return this.elements.nav.lsTabs( 'getActiveTab' );
|
||||
},
|
||||
/**
|
||||
*
|
||||
*/
|
||||
getActiveTab: function() {
|
||||
return this.elements.nav.lsTabs( 'getActiveTab' );
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
getActiveTabName: function() {
|
||||
return this.getActiveTab().data( 'media-name' );
|
||||
},
|
||||
/**
|
||||
*
|
||||
*/
|
||||
getActiveTabName: function() {
|
||||
return this.getActiveTab().data( 'media-name' );
|
||||
},
|
||||
|
||||
//
|
||||
// INSERT FROM URL
|
||||
//
|
||||
//
|
||||
// INSERT FROM URL
|
||||
//
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
onUrlTypeChange: function ( event ) {
|
||||
this.elements.url.blocks.hide();
|
||||
this.elements.url.blocks.filter( '[data-filetype=' + this.elements.url.type.val() + ']' ).show();
|
||||
this.elements.url.url.val( '' );
|
||||
this.elements.url.image_preview.hide().empty();
|
||||
},
|
||||
/**
|
||||
*
|
||||
*/
|
||||
onUrlTypeChange: function ( event ) {
|
||||
this.elements.url.blocks.hide();
|
||||
this.elements.url.blocks.filter( '[data-filetype=' + this.elements.url.type.val() + ']' ).show();
|
||||
this.elements.url.url.val( '' );
|
||||
this.elements.url.image_preview.hide().empty();
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
onUrlChange: function ( event ) {
|
||||
var _this = this,
|
||||
url = this.elements.url.url.val();
|
||||
/**
|
||||
*
|
||||
*/
|
||||
onUrlChange: function ( event ) {
|
||||
var _this = this,
|
||||
url = this.elements.url.url.val();
|
||||
|
||||
$('<img />', {
|
||||
src: url,
|
||||
style: 'max-width: 50%',
|
||||
error: function () {
|
||||
_this.elements.url.image_preview.hide().empty();
|
||||
},
|
||||
load: function () {
|
||||
_this.elements.url.image_preview.show().html( $( this ) );
|
||||
}
|
||||
});
|
||||
},
|
||||
$('<img />', {
|
||||
src: url,
|
||||
style: 'max-width: 50%',
|
||||
error: function () {
|
||||
_this.elements.url.image_preview.hide().empty();
|
||||
},
|
||||
load: function () {
|
||||
_this.elements.url.image_preview.show().html( $( this ) );
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
urlInsert: function ( upload ) {
|
||||
var upload = upload || false,
|
||||
params = $.extend(
|
||||
{},
|
||||
{ upload: upload },
|
||||
this.elements.url.form.serializeJSON(),
|
||||
this.elements.url.blocks.filter( ':visible' ).find('form').serializeJSON(),
|
||||
this.elements.uploader.lsUploader( 'option', 'params' )
|
||||
);
|
||||
/**
|
||||
*
|
||||
*/
|
||||
urlInsert: function ( upload ) {
|
||||
var upload = upload || false,
|
||||
params = $.extend(
|
||||
{},
|
||||
{ upload: upload },
|
||||
this.elements.url.form.serializeJSON(),
|
||||
this.elements.url.blocks.filter( ':visible' ).find('form').serializeJSON(),
|
||||
this.elements.uploader.lsUploader( 'option', 'params' )
|
||||
);
|
||||
|
||||
this._load( 'url_upload', params, function ( response ) {
|
||||
if ( response.bStateError ) {
|
||||
ls.msg.error( response.sMsgTitle, response.sMsg );
|
||||
} else {
|
||||
this.option( 'editor' ).lsEditor( 'insert', response.sText );
|
||||
this.element.lsModal( 'hide' );
|
||||
this.reload();
|
||||
}
|
||||
}, {
|
||||
// TODO: Fix validation
|
||||
validate: false,
|
||||
submitButton: this.elements.url[ upload ? 'submit_upload' : 'submit_insert' ]
|
||||
});
|
||||
}
|
||||
});
|
||||
this._load( 'url_upload', params, function ( response ) {
|
||||
if ( response.bStateError ) {
|
||||
ls.msg.error( response.sMsgTitle, response.sMsg );
|
||||
} else {
|
||||
this.option( 'editor' ).lsEditor( 'insert', response.sText );
|
||||
this.element.lsModal( 'hide' );
|
||||
this.reload();
|
||||
}
|
||||
}, {
|
||||
// TODO: Fix validation
|
||||
validate: false,
|
||||
submitButton: this.elements.url[ upload ? 'submit_upload' : 'submit_insert' ]
|
||||
});
|
||||
}
|
||||
});
|
||||
})(jQuery);
|
|
@ -1,22 +1,22 @@
|
|||
{extends './pane.tpl'}
|
||||
|
||||
{block 'media_pane_options' append}
|
||||
{$id = 'tab-media-insert'}
|
||||
{$id = 'tab-media-insert'}
|
||||
{/block}
|
||||
|
||||
{block 'media_pane_content'}
|
||||
{component 'media' template='uploader'
|
||||
attributes = [ 'id' => 'media-uploader' ]
|
||||
classes = 'js-media-uploader'
|
||||
targetParams = $aTargetParams
|
||||
targetType = $sMediaTargetType
|
||||
targetId = $sMediaTargetId
|
||||
targetTmp = $sMediaTargetTmp}
|
||||
{component 'media' template='uploader'
|
||||
attributes = [ 'id' => 'media-uploader' ]
|
||||
classes = 'js-media-uploader'
|
||||
targetParams = $aTargetParams
|
||||
targetType = $sMediaTargetType
|
||||
targetId = $sMediaTargetId
|
||||
targetTmp = $sMediaTargetTmp}
|
||||
{/block}
|
||||
|
||||
{block 'media_pane_footer' prepend}
|
||||
{component 'button'
|
||||
mods = 'primary'
|
||||
classes = 'js-media-insert-submit'
|
||||
text = {lang name='media.insert.submit'}}
|
||||
{component 'button'
|
||||
mods = 'primary'
|
||||
classes = 'js-media-insert-submit'
|
||||
text = {lang name='media.insert.submit'}}
|
||||
{/block}
|
|
@ -1,12 +1,12 @@
|
|||
{extends './pane.tpl'}
|
||||
|
||||
{block 'media_pane_options' append}
|
||||
{$id = 'tab-media-photoset'}
|
||||
{$id = 'tab-media-photoset'}
|
||||
{/block}
|
||||
|
||||
{block 'media_pane_footer' prepend}
|
||||
{component 'button'
|
||||
mods = 'primary'
|
||||
classes = 'js-media-photoset-submit'
|
||||
text = {lang name='media.photoset.submit'}}
|
||||
{component 'button'
|
||||
mods = 'primary'
|
||||
classes = 'js-media-photoset-submit'
|
||||
text = {lang name='media.photoset.submit'}}
|
||||
{/block}
|
|
@ -1,23 +1,23 @@
|
|||
{extends './pane.tpl'}
|
||||
|
||||
{block 'media_pane_options' append}
|
||||
{$id = 'tab-media-preview'}
|
||||
{$id = 'tab-media-preview'}
|
||||
{/block}
|
||||
|
||||
{block 'media_pane_content'}
|
||||
{if $aTargetItems}
|
||||
{foreach $aTargetItems as $oTarget}
|
||||
<p class="mb-20">
|
||||
<a href="#" class="button" onclick="ls.media.removePreviewFile({$oTarget->getMediaId()}); return false;">Удалить превью</a>
|
||||
</p>
|
||||
{if $aTargetItems}
|
||||
{foreach $aTargetItems as $oTarget}
|
||||
<p class="mb-20">
|
||||
<a href="#" class="button" onclick="ls.media.removePreviewFile({$oTarget->getMediaId()}); return false;">Удалить превью</a>
|
||||
</p>
|
||||
|
||||
{$aPreview = $oTarget->getPreviewImageItemsWebPath()}
|
||||
{$aPreview = $oTarget->getPreviewImageItemsWebPath()}
|
||||
|
||||
{foreach $aPreview as $sPreviewFile}
|
||||
<img src="{$sPreviewFile}" alt=""><br>
|
||||
{/foreach}
|
||||
{/foreach}
|
||||
{else}
|
||||
Превью можно <a href="#" onclick="jQuery('.js-tab-show-gallery').first().click(); return false;">выбрать из галереи</a>.
|
||||
{/if}
|
||||
{foreach $aPreview as $sPreviewFile}
|
||||
<img src="{$sPreviewFile}" alt=""><br>
|
||||
{/foreach}
|
||||
{/foreach}
|
||||
{else}
|
||||
Превью можно <a href="#" onclick="jQuery('.js-tab-show-gallery').first().click(); return false;">выбрать из галереи</a>.
|
||||
{/if}
|
||||
{/block}
|
|
@ -1,11 +1,11 @@
|
|||
{block 'media_pane_options'}
|
||||
{$id = $smarty.local.id}
|
||||
{$id = $smarty.local.id}
|
||||
{/block}
|
||||
|
||||
<div class="ls-media-pane-content js-media-pane-content">
|
||||
{block 'media_pane_content'}{/block}
|
||||
{block 'media_pane_content'}{/block}
|
||||
</div>
|
||||
|
||||
<div class="ls-media-pane-footer">
|
||||
{block 'media_pane_footer'}{/block}
|
||||
{block 'media_pane_footer'}{/block}
|
||||
</div>
|
|
@ -1,44 +1,44 @@
|
|||
{extends './pane.tpl'}
|
||||
|
||||
{block 'media_pane_options' append}
|
||||
{$id = 'tab-media-url'}
|
||||
{$id = 'tab-media-url'}
|
||||
{/block}
|
||||
|
||||
{block 'media_pane_content'}
|
||||
<form method="post" action="" enctype="multipart/form-data" class="mb-20 js-media-url-form">
|
||||
{* Типы файлов *}
|
||||
{* TODO: Add hook *}
|
||||
{*component 'field' template='select'
|
||||
name = 'filetype'
|
||||
label = 'Type'
|
||||
inputClasses = 'width-300 js-media-url-type'
|
||||
items = [
|
||||
[ 'value' => '1', 'text' => 'Image' ]
|
||||
]*}
|
||||
<form method="post" action="" enctype="multipart/form-data" class="mb-20 js-media-url-form">
|
||||
{* Типы файлов *}
|
||||
{* TODO: Add hook *}
|
||||
{*component 'field' template='select'
|
||||
name = 'filetype'
|
||||
label = 'Type'
|
||||
inputClasses = 'width-300 js-media-url-type'
|
||||
items = [
|
||||
[ 'value' => '1', 'text' => 'Image' ]
|
||||
]*}
|
||||
|
||||
{* Ссылка *}
|
||||
{component 'field' template='text'
|
||||
name = 'url'
|
||||
value = 'http://'
|
||||
inputClasses = 'js-media-url-form-url'
|
||||
label = {lang 'media.url.fields.url.label'}}
|
||||
</form>
|
||||
{* Ссылка *}
|
||||
{component 'field' template='text'
|
||||
name = 'url'
|
||||
value = 'http://'
|
||||
inputClasses = 'js-media-url-form-url'
|
||||
label = {lang 'media.url.fields.url.label'}}
|
||||
</form>
|
||||
|
||||
<div class="mb-15 js-media-url-image-preview" style="display: none"></div>
|
||||
<div class="mb-15 js-media-url-image-preview" style="display: none"></div>
|
||||
|
||||
<div class="js-media-url-settings-blocks">
|
||||
{component 'media' template='uploader-block.insert.image' useSizes=false}
|
||||
</div>
|
||||
<div class="js-media-url-settings-blocks">
|
||||
{component 'media' template='uploader-block.insert.image' useSizes=false}
|
||||
</div>
|
||||
{/block}
|
||||
|
||||
{block 'media_pane_footer' prepend}
|
||||
{component 'button'
|
||||
mods = 'primary'
|
||||
classes = 'js-media-url-submit-insert'
|
||||
text = {lang 'media.url.submit_insert'}}
|
||||
{component 'button'
|
||||
mods = 'primary'
|
||||
classes = 'js-media-url-submit-insert'
|
||||
text = {lang 'media.url.submit_insert'}}
|
||||
|
||||
{component 'button'
|
||||
mods = 'primary'
|
||||
classes = 'js-media-url-submit-upload'
|
||||
text = {lang 'media.url.submit_upload'}}
|
||||
{component 'button'
|
||||
mods = 'primary'
|
||||
classes = 'js-media-url-submit-upload'
|
||||
text = {lang 'media.url.submit_upload'}}
|
||||
{/block}
|
|
@ -5,26 +5,26 @@
|
|||
*}
|
||||
|
||||
{capture 'block_content'}
|
||||
<form method="post" action="" enctype="multipart/form-data">
|
||||
{* Выравнивание *}
|
||||
{component 'field' template='select'
|
||||
name = 'align'
|
||||
label = {lang name='media.image_align.title'}
|
||||
items = [
|
||||
[ 'value' => '', 'text' => {lang name='media.image_align.no'} ],
|
||||
[ 'value' => 'left', 'text' => {lang name='media.image_align.left'} ],
|
||||
[ 'value' => 'right', 'text' => {lang name='media.image_align.right'} ],
|
||||
[ 'value' => 'center', 'text' => {lang name='media.image_align.center'} ]
|
||||
]}
|
||||
<form method="post" action="" enctype="multipart/form-data">
|
||||
{* Выравнивание *}
|
||||
{component 'field' template='select'
|
||||
name = 'align'
|
||||
label = {lang name='media.image_align.title'}
|
||||
items = [
|
||||
[ 'value' => '', 'text' => {lang name='media.image_align.no'} ],
|
||||
[ 'value' => 'left', 'text' => {lang name='media.image_align.left'} ],
|
||||
[ 'value' => 'right', 'text' => {lang name='media.image_align.right'} ],
|
||||
[ 'value' => 'center', 'text' => {lang name='media.image_align.center'} ]
|
||||
]}
|
||||
|
||||
{* Размер *}
|
||||
{if $smarty.local.useSizes|default:true}
|
||||
{component 'field' template='select'
|
||||
name = 'size'
|
||||
label = {lang name='media.insert.settings.fields.size.label'}
|
||||
items = [[ 'value' => 'original', 'text' => {lang name='media.insert.settings.fields.size.original'} ]]}
|
||||
{/if}
|
||||
</form>
|
||||
{* Размер *}
|
||||
{if $smarty.local.useSizes|default:true}
|
||||
{component 'field' template='select'
|
||||
name = 'size'
|
||||
label = {lang name='media.insert.settings.fields.size.label'}
|
||||
items = [[ 'value' => 'original', 'text' => {lang name='media.insert.settings.fields.size.original'} ]]}
|
||||
{/if}
|
||||
</form>
|
||||
{/capture}
|
||||
|
||||
{component 'uploader' template='block'
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
{/block}
|
||||
|
||||
{block 'uploader_aside' append}
|
||||
{* Основные настройки *}
|
||||
{* Основные настройки *}
|
||||
{component 'media' template='uploader-block.insert.image'}
|
||||
|
||||
{* Опции фотосета *}
|
||||
|
|
|
@ -9,115 +9,115 @@
|
|||
*/
|
||||
|
||||
(function($) {
|
||||
"use strict";
|
||||
"use strict";
|
||||
|
||||
$.widget( "livestreet.lsNote", $.livestreet.lsComponent, {
|
||||
/**
|
||||
* Дефолтные опции
|
||||
*/
|
||||
options: {
|
||||
// Ссылки
|
||||
urls: {
|
||||
save: null,
|
||||
remove: null
|
||||
},
|
||||
$.widget( "livestreet.lsNote", $.livestreet.lsComponent, {
|
||||
/**
|
||||
* Дефолтные опции
|
||||
*/
|
||||
options: {
|
||||
// Ссылки
|
||||
urls: {
|
||||
save: null,
|
||||
remove: null
|
||||
},
|
||||
|
||||
// Селекторы
|
||||
selectors: {
|
||||
body: '.js-note-body',
|
||||
text: '.js-note-text',
|
||||
add: '.js-note-add',
|
||||
actions: '.js-note-actions',
|
||||
actions_edit: '.js-note-actions-edit',
|
||||
actions_remove: '.js-note-actions-remove',
|
||||
// Селекторы
|
||||
selectors: {
|
||||
body: '.js-note-body',
|
||||
text: '.js-note-text',
|
||||
add: '.js-note-add',
|
||||
actions: '.js-note-actions',
|
||||
actions_edit: '.js-note-actions-edit',
|
||||
actions_remove: '.js-note-actions-remove',
|
||||
|
||||
form: '.js-note-form',
|
||||
form_text: '.js-note-form-text',
|
||||
form_cancel: '.js-note-form-cancel'
|
||||
},
|
||||
form: '.js-note-form',
|
||||
form_text: '.js-note-form-text',
|
||||
form_cancel: '.js-note-form-cancel'
|
||||
},
|
||||
|
||||
params: {}
|
||||
},
|
||||
params: {}
|
||||
},
|
||||
|
||||
/**
|
||||
* Конструктор
|
||||
*
|
||||
* @constructor
|
||||
* @private
|
||||
*/
|
||||
_create: function () {
|
||||
this._super();
|
||||
/**
|
||||
* Конструктор
|
||||
*
|
||||
* @constructor
|
||||
* @private
|
||||
*/
|
||||
_create: function () {
|
||||
this._super();
|
||||
|
||||
// Добавление
|
||||
this._on( this.elements.add, { click: 'onShowFormClick' } );
|
||||
// Добавление
|
||||
this._on( this.elements.add, { click: 'onShowFormClick' } );
|
||||
|
||||
// Редактирование
|
||||
this._on( this.elements.actions_edit, { click: 'onShowFormClick' } );
|
||||
// Редактирование
|
||||
this._on( this.elements.actions_edit, { click: 'onShowFormClick' } );
|
||||
|
||||
// Отмена редактирования
|
||||
this._on( this.elements.form_cancel, { click: 'hideForm' } );
|
||||
// Отмена редактирования
|
||||
this._on( this.elements.form_cancel, { click: 'hideForm' } );
|
||||
|
||||
// Удаление
|
||||
this.elements.actions_remove.on('click' + this.eventNamespace, function (e) {
|
||||
this.remove();
|
||||
e.preventDefault();
|
||||
}.bind( this ));
|
||||
// Удаление
|
||||
this.elements.actions_remove.on('click' + this.eventNamespace, function (e) {
|
||||
this.remove();
|
||||
e.preventDefault();
|
||||
}.bind( this ));
|
||||
|
||||
// Сохранение
|
||||
this.elements.form.on('submit' + this.eventNamespace, function (e) {
|
||||
this.save();
|
||||
e.preventDefault();
|
||||
}.bind( this ));
|
||||
},
|
||||
// Сохранение
|
||||
this.elements.form.on('submit' + this.eventNamespace, function (e) {
|
||||
this.save();
|
||||
e.preventDefault();
|
||||
}.bind( this ));
|
||||
},
|
||||
|
||||
/**
|
||||
* Добавление/Редактирование
|
||||
*/
|
||||
onShowFormClick: function( event ) {
|
||||
event.preventDefault();
|
||||
this.showForm();
|
||||
},
|
||||
/**
|
||||
* Добавление/Редактирование
|
||||
*/
|
||||
onShowFormClick: function( event ) {
|
||||
event.preventDefault();
|
||||
this.showForm();
|
||||
},
|
||||
|
||||
/**
|
||||
* Показывает форму редактирования
|
||||
*/
|
||||
showForm: function( event ) {
|
||||
this.elements.body.hide();
|
||||
this.elements.form.show();
|
||||
this.elements.form_text.val( $.trim(this.elements.text.html()) ).select();
|
||||
},
|
||||
/**
|
||||
* Показывает форму редактирования
|
||||
*/
|
||||
showForm: function( event ) {
|
||||
this.elements.body.hide();
|
||||
this.elements.form.show();
|
||||
this.elements.form_text.val( $.trim(this.elements.text.html()) ).select();
|
||||
},
|
||||
|
||||
/**
|
||||
* Скрывает форму редактирования
|
||||
*/
|
||||
hideForm: function() {
|
||||
this.elements.body.show();
|
||||
this.elements.form.hide();
|
||||
},
|
||||
/**
|
||||
* Скрывает форму редактирования
|
||||
*/
|
||||
hideForm: function() {
|
||||
this.elements.body.show();
|
||||
this.elements.form.hide();
|
||||
},
|
||||
|
||||
/**
|
||||
* Сохраняет заметку
|
||||
*/
|
||||
save: function() {
|
||||
this._setParam( 'text', this.elements.form_text.val() );
|
||||
/**
|
||||
* Сохраняет заметку
|
||||
*/
|
||||
save: function() {
|
||||
this._setParam( 'text', this.elements.form_text.val() );
|
||||
|
||||
this._submit( 'save', this.elements.form, function ( response ) {
|
||||
this.elements.text.html(response.sText).show();
|
||||
this.elements.add.hide();
|
||||
this.elements.actions.show();
|
||||
this.hideForm();
|
||||
});
|
||||
},
|
||||
this._submit( 'save', this.elements.form, function ( response ) {
|
||||
this.elements.text.html(response.sText).show();
|
||||
this.elements.add.hide();
|
||||
this.elements.actions.show();
|
||||
this.hideForm();
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Удаление заметки
|
||||
*/
|
||||
remove: function() {
|
||||
this._load( 'remove', function () {
|
||||
this.elements.text.empty().hide();
|
||||
this.elements.add.show();
|
||||
this.elements.actions.hide();
|
||||
});
|
||||
}
|
||||
});
|
||||
/**
|
||||
* Удаление заметки
|
||||
*/
|
||||
remove: function() {
|
||||
this._load( 'remove', function () {
|
||||
this.elements.text.empty().hide();
|
||||
this.elements.add.show();
|
||||
this.elements.actions.hide();
|
||||
});
|
||||
}
|
||||
});
|
||||
})(jQuery);
|
|
@ -14,36 +14,36 @@
|
|||
{$isEditable = $smarty.local.isEditable|default:true}
|
||||
|
||||
<div class="{$component} {cmods name=$component mods=$mods} {$smarty.local.classes}" data-param-user_id="{$smarty.local.targetId}" {cattr list=$smarty.local.attributes}>
|
||||
{* Заметка *}
|
||||
<div class="{$component}-body js-note-body">
|
||||
{* Текст *}
|
||||
<p class="{$component}-text js-note-text" {if ! $note}style="display: none"{/if}>
|
||||
{if $note}
|
||||
{$note->getText()}
|
||||
{/if}
|
||||
</p>
|
||||
{* Заметка *}
|
||||
<div class="{$component}-body js-note-body">
|
||||
{* Текст *}
|
||||
<p class="{$component}-text js-note-text" {if ! $note}style="display: none"{/if}>
|
||||
{if $note}
|
||||
{$note->getText()}
|
||||
{/if}
|
||||
</p>
|
||||
|
||||
{* Действия *}
|
||||
{if $isEditable}
|
||||
<ul class="{$component}-actions js-note-actions clearfix" {if ! $note}style="display: none;"{/if}>
|
||||
<li><a href="#" class="js-note-actions-edit">{$aLang.common.edit}</a></li>
|
||||
<li><a href="#" class="js-note-actions-remove">{$aLang.common.remove}</a></li>
|
||||
</ul>
|
||||
{* Действия *}
|
||||
{if $isEditable}
|
||||
<ul class="{$component}-actions js-note-actions clearfix" {if ! $note}style="display: none;"{/if}>
|
||||
<li><a href="#" class="js-note-actions-edit">{$aLang.common.edit}</a></li>
|
||||
<li><a href="#" class="js-note-actions-remove">{$aLang.common.remove}</a></li>
|
||||
</ul>
|
||||
|
||||
{* Добавить *}
|
||||
<ul class="{$component}-actions {$component}-actions--add clearfix js-note-add" {if $note}style="display: none;"{/if}>
|
||||
<li><a href="#" class="">{$aLang.user_note.add}</a></li>
|
||||
</ul>
|
||||
{/if}
|
||||
</div>
|
||||
{* Добавить *}
|
||||
<ul class="{$component}-actions {$component}-actions--add clearfix js-note-add" {if $note}style="display: none;"{/if}>
|
||||
<li><a href="#" class="">{$aLang.user_note.add}</a></li>
|
||||
</ul>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
{* Форма редактирования *}
|
||||
{if $isEditable}
|
||||
<form class="{$component}-form js-note-form" style="display: none;">
|
||||
{component 'field' template='textarea' inputClasses="$component-form-text js-note-form-text"}
|
||||
{* Форма редактирования *}
|
||||
{if $isEditable}
|
||||
<form class="{$component}-form js-note-form" style="display: none;">
|
||||
{component 'field' template='textarea' inputClasses="$component-form-text js-note-form-text"}
|
||||
|
||||
{component 'button' mods='primary' text=$aLang.common.save}
|
||||
{component 'button' type='button' classes="js-note-form-cancel" text=$aLang.common.cancel}
|
||||
</form>
|
||||
{/if}
|
||||
{component 'button' mods='primary' text=$aLang.common.save}
|
||||
{component 'button' type='button' classes="js-note-form-cancel" text=$aLang.common.cancel}
|
||||
</form>
|
||||
{/if}
|
||||
</div>
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
.ls-poll-title { font-size: 20px; margin-bottom: 20px; }
|
||||
|
||||
.ls-poll-answer-list { margin-bottom: 20px; margin-left: 0; list-style-type: none; }
|
||||
.ls-poll-answer-list { margin-bottom: 20px; margin-left: 0; list-style-type: none; }
|
||||
|
||||
.ls-poll-answer-list-item { margin-bottom: 10px; }
|
||||
.ls-poll-answer-list-item:last-child { margin-bottom: 0; }
|
||||
|
|
|
@ -9,251 +9,251 @@
|
|||
*/
|
||||
|
||||
(function($) {
|
||||
"use strict";
|
||||
"use strict";
|
||||
|
||||
$.widget( "livestreet.lsPollManage", $.livestreet.lsComponent, {
|
||||
/**
|
||||
* Дефолтные опции
|
||||
*/
|
||||
options: {
|
||||
// Ссылки
|
||||
urls: {
|
||||
// Мод. окно добавления опроса
|
||||
modal_add: aRouter.ajax + 'poll/modal-create',
|
||||
$.widget( "livestreet.lsPollManage", $.livestreet.lsComponent, {
|
||||
/**
|
||||
* Дефолтные опции
|
||||
*/
|
||||
options: {
|
||||
// Ссылки
|
||||
urls: {
|
||||
// Мод. окно добавления опроса
|
||||
modal_add: aRouter.ajax + 'poll/modal-create',
|
||||
|
||||
// Мод. окно редактирования опроса
|
||||
modal_edit: aRouter.ajax + 'poll/modal-update',
|
||||
// Мод. окно редактирования опроса
|
||||
modal_edit: aRouter.ajax + 'poll/modal-update',
|
||||
|
||||
// Добавление
|
||||
add: aRouter.ajax + 'poll/create/',
|
||||
// Добавление
|
||||
add: aRouter.ajax + 'poll/create/',
|
||||
|
||||
// Редактирование
|
||||
update: aRouter.ajax + 'poll/update/',
|
||||
// Редактирование
|
||||
update: aRouter.ajax + 'poll/update/',
|
||||
|
||||
// Удаление
|
||||
remove: aRouter.ajax + 'poll/remove/'
|
||||
},
|
||||
// Удаление
|
||||
remove: aRouter.ajax + 'poll/remove/'
|
||||
},
|
||||
|
||||
// Селекторы
|
||||
selectors: {
|
||||
// Список добавленных опросов
|
||||
list: '.js-poll-manage-list',
|
||||
// Селекторы
|
||||
selectors: {
|
||||
// Список добавленных опросов
|
||||
list: '.js-poll-manage-list',
|
||||
|
||||
// Опрос
|
||||
item: '.js-poll-manage-item',
|
||||
// Опрос
|
||||
item: '.js-poll-manage-item',
|
||||
|
||||
// Кнопка удаления опроса
|
||||
item_remove: '.js-poll-manage-item-remove',
|
||||
// Кнопка удаления опроса
|
||||
item_remove: '.js-poll-manage-item-remove',
|
||||
|
||||
// Кнопка редактирования опроса
|
||||
item_edit: '.js-poll-manage-item-edit',
|
||||
// Кнопка редактирования опроса
|
||||
item_edit: '.js-poll-manage-item-edit',
|
||||
|
||||
// Кнопка добавления
|
||||
add: '.js-poll-manage-add',
|
||||
// Кнопка добавления
|
||||
add: '.js-poll-manage-add',
|
||||
|
||||
form: {
|
||||
form: '#js-poll-form',
|
||||
add: '.js-poll-form-answer-add',
|
||||
list: '.js-poll-form-answer-list',
|
||||
item: '.js-poll-form-answer-item',
|
||||
item_id: '.js-poll-form-answer-item-id',
|
||||
item_text: '.js-poll-form-answer-item-text',
|
||||
item_remove: '.js-poll-form-answer-item-remove',
|
||||
submit: '.js-poll-form-submit'
|
||||
}
|
||||
},
|
||||
// Максимальное кол-во вариантов которое можно добавить в опрос
|
||||
max: 20
|
||||
},
|
||||
form: {
|
||||
form: '#js-poll-form',
|
||||
add: '.js-poll-form-answer-add',
|
||||
list: '.js-poll-form-answer-list',
|
||||
item: '.js-poll-form-answer-item',
|
||||
item_id: '.js-poll-form-answer-item-id',
|
||||
item_text: '.js-poll-form-answer-item-text',
|
||||
item_remove: '.js-poll-form-answer-item-remove',
|
||||
submit: '.js-poll-form-submit'
|
||||
}
|
||||
},
|
||||
// Максимальное кол-во вариантов которое можно добавить в опрос
|
||||
max: 20
|
||||
},
|
||||
|
||||
/**
|
||||
* Конструктор
|
||||
*
|
||||
* @constructor
|
||||
* @private
|
||||
*/
|
||||
_create: function () {
|
||||
this._super();
|
||||
/**
|
||||
* Конструктор
|
||||
*
|
||||
* @constructor
|
||||
* @private
|
||||
*/
|
||||
_create: function () {
|
||||
this._super();
|
||||
|
||||
var _this = this;
|
||||
var _this = this;
|
||||
|
||||
this.elements = {
|
||||
list: this.element.find( this.options.selectors.list ),
|
||||
add: this.element.find( this.options.selectors.add ),
|
||||
remove: this.element.find( this.options.selectors.item_remove ),
|
||||
edit: this.element.find( this.options.selectors.item_edit )
|
||||
};
|
||||
this.elements = {
|
||||
list: this.element.find( this.options.selectors.list ),
|
||||
add: this.element.find( this.options.selectors.add ),
|
||||
remove: this.element.find( this.options.selectors.item_remove ),
|
||||
edit: this.element.find( this.options.selectors.item_edit )
|
||||
};
|
||||
|
||||
this.id = this.element.data('target-id');
|
||||
this.type = this.element.data('type');
|
||||
this.id = this.element.data('target-id');
|
||||
this.type = this.element.data('type');
|
||||
|
||||
//
|
||||
// События
|
||||
//
|
||||
//
|
||||
// События
|
||||
//
|
||||
|
||||
// Показывает форму добавления
|
||||
this._on( this.elements.add, { 'click': this.formShowAdd } );
|
||||
// Показывает форму добавления
|
||||
this._on( this.elements.add, { 'click': this.formShowAdd } );
|
||||
|
||||
// Показывает форму редактирования опроса
|
||||
this.element.on( 'click' + this.eventNamespace, this.options.selectors.item_edit, function () {
|
||||
_this.formShowEdit( $(this).data('poll-id'), $(this).data('poll-target-tmp') )
|
||||
});
|
||||
// Показывает форму редактирования опроса
|
||||
this.element.on( 'click' + this.eventNamespace, this.options.selectors.item_edit, function () {
|
||||
_this.formShowEdit( $(this).data('poll-id'), $(this).data('poll-target-tmp') )
|
||||
});
|
||||
|
||||
// Удаляет опрос
|
||||
this.element.on( 'click' + this.eventNamespace, this.options.selectors.item_remove, function () {
|
||||
_this.remove( $(this) )
|
||||
});
|
||||
},
|
||||
// Удаляет опрос
|
||||
this.element.on( 'click' + this.eventNamespace, this.options.selectors.item_remove, function () {
|
||||
_this.remove( $(this) )
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Показывает форму
|
||||
*
|
||||
* @param {String} url Ссылка возвращающая модальное окно
|
||||
* @param {Object} params Параметры
|
||||
*/
|
||||
formShow: function( url, params ) {
|
||||
var _this = this;
|
||||
/**
|
||||
* Показывает форму
|
||||
*
|
||||
* @param {String} url Ссылка возвращающая модальное окно
|
||||
* @param {Object} params Параметры
|
||||
*/
|
||||
formShow: function( url, params ) {
|
||||
var _this = this;
|
||||
|
||||
ls.modal.load( url, params, {
|
||||
aftershow: function ( e, modal ) {
|
||||
var form = modal.element.find( _this.option( 'selectors.form.form' ) ),
|
||||
list = form.find( _this.option( 'selectors.form.list' ) );
|
||||
ls.modal.load( url, params, {
|
||||
aftershow: function ( e, modal ) {
|
||||
var form = modal.element.find( _this.option( 'selectors.form.form' ) ),
|
||||
list = form.find( _this.option( 'selectors.form.list' ) );
|
||||
|
||||
// Отправка формы
|
||||
form.on( 'submit', function (e) {
|
||||
_this[ form.data('action') ]( form, list, modal );
|
||||
e.preventDefault();
|
||||
});
|
||||
// Отправка формы
|
||||
form.on( 'submit', function (e) {
|
||||
_this[ form.data('action') ]( form, list, modal );
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
// Добавление ответа
|
||||
form.find( _this.option( 'selectors.form.add' ) ).on( 'click', _this.answerAdd.bind( _this, list ));
|
||||
form.on( 'keydown', _this.option( 'selectors.form.item_text' ) , 'ctrl+return', _this.answerAdd.bind( _this, list ) );
|
||||
// Добавление ответа
|
||||
form.find( _this.option( 'selectors.form.add' ) ).on( 'click', _this.answerAdd.bind( _this, list ));
|
||||
form.on( 'keydown', _this.option( 'selectors.form.item_text' ) , 'ctrl+return', _this.answerAdd.bind( _this, list ) );
|
||||
|
||||
// Удаление
|
||||
form.on( 'click', _this.option( 'selectors.form.item_remove' ), function () {
|
||||
_this.answerRemove( list, $( this ) );
|
||||
});
|
||||
},
|
||||
center: false
|
||||
});
|
||||
},
|
||||
// Удаление
|
||||
form.on( 'click', _this.option( 'selectors.form.item_remove' ), function () {
|
||||
_this.answerRemove( list, $( this ) );
|
||||
});
|
||||
},
|
||||
center: false
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Показывает форму добавления
|
||||
*/
|
||||
formShowAdd: function() {
|
||||
this.formShow( this.option( 'urls.modal_add' ), { target_type: this.type, target_id: this.id } );
|
||||
},
|
||||
/**
|
||||
* Показывает форму добавления
|
||||
*/
|
||||
formShowAdd: function() {
|
||||
this.formShow( this.option( 'urls.modal_add' ), { target_type: this.type, target_id: this.id } );
|
||||
},
|
||||
|
||||
/**
|
||||
* Показывает форму редактирования
|
||||
*
|
||||
* @param {Number} id ID опроса
|
||||
* @param {String} hash Хэш опроса
|
||||
*/
|
||||
formShowEdit: function( id, hash ) {
|
||||
this.formShow( this.option( 'urls.modal_edit' ), { id: id, target_tmp: hash } );
|
||||
},
|
||||
/**
|
||||
* Показывает форму редактирования
|
||||
*
|
||||
* @param {Number} id ID опроса
|
||||
* @param {String} hash Хэш опроса
|
||||
*/
|
||||
formShowEdit: function( id, hash ) {
|
||||
this.formShow( this.option( 'urls.modal_edit' ), { id: id, target_tmp: hash } );
|
||||
},
|
||||
|
||||
/**
|
||||
* Добавляет вариант ответа
|
||||
*
|
||||
* @param {jQuery} list Список ответов
|
||||
*/
|
||||
answerAdd: function( list ) {
|
||||
var answers = list.find( this.option( 'selectors.form.item' ) );
|
||||
/**
|
||||
* Добавляет вариант ответа
|
||||
*
|
||||
* @param {jQuery} list Список ответов
|
||||
*/
|
||||
answerAdd: function( list ) {
|
||||
var answers = list.find( this.option( 'selectors.form.item' ) );
|
||||
|
||||
// Ограничиваем кол-во добавляемых ответов
|
||||
if ( answers.length == this.option( 'max' ) ) {
|
||||
ls.msg.error( null, ls.lang.get( 'poll.notices.error_answers_max', { count: this.option( 'max' ) } ) );
|
||||
return;
|
||||
} else if ( answers.length == 2 ) {
|
||||
answers.find( this.option( 'selectors.form.item_remove' ) ).show();
|
||||
}
|
||||
// Ограничиваем кол-во добавляемых ответов
|
||||
if ( answers.length == this.option( 'max' ) ) {
|
||||
ls.msg.error( null, ls.lang.get( 'poll.notices.error_answers_max', { count: this.option( 'max' ) } ) );
|
||||
return;
|
||||
} else if ( answers.length == 2 ) {
|
||||
answers.find( this.option( 'selectors.form.item_remove' ) ).show();
|
||||
}
|
||||
|
||||
var item = $( this.option( 'selectors.form.item' ) + '[data-is-template=true]' ).clone().removeAttr( 'data-is-template' ).show();
|
||||
var item = $( this.option( 'selectors.form.item' ) + '[data-is-template=true]' ).clone().removeAttr( 'data-is-template' ).show();
|
||||
|
||||
list.append( item );
|
||||
item.find( this.option( 'selectors.form.item_text' ) ).focus();
|
||||
},
|
||||
list.append( item );
|
||||
item.find( this.option( 'selectors.form.item_text' ) ).focus();
|
||||
},
|
||||
|
||||
/**
|
||||
* Удаляет вариант ответа
|
||||
*
|
||||
* @param {jQuery} list Список ответов
|
||||
* @param {jQuery} button Кнопка удаления
|
||||
*/
|
||||
answerRemove: function( list, button ) {
|
||||
var answers = list.find( this.option( 'selectors.form.item' ) );
|
||||
/**
|
||||
* Удаляет вариант ответа
|
||||
*
|
||||
* @param {jQuery} list Список ответов
|
||||
* @param {jQuery} button Кнопка удаления
|
||||
*/
|
||||
answerRemove: function( list, button ) {
|
||||
var answers = list.find( this.option( 'selectors.form.item' ) );
|
||||
|
||||
if ( answers.length == 3 ) {
|
||||
answers.find( this.option( 'selectors.form.item_remove' ) ).hide();
|
||||
}
|
||||
if ( answers.length == 3 ) {
|
||||
answers.find( this.option( 'selectors.form.item_remove' ) ).hide();
|
||||
}
|
||||
|
||||
button.closest( this.option( 'selectors.form.item' ) ).fadeOut(200, function () {
|
||||
$(this).remove();
|
||||
});
|
||||
},
|
||||
button.closest( this.option( 'selectors.form.item' ) ).fadeOut(200, function () {
|
||||
$(this).remove();
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Проставляет индексы инпутам ответа
|
||||
*
|
||||
* @param {jQuery} list Список ответов
|
||||
*/
|
||||
answerIndex: function( list ) {
|
||||
list.find( this.option( 'selectors.form.item' ) ).each(function ( index, item ) {
|
||||
var item = $(item),
|
||||
id = item.find( this.option( 'selectors.form.item_id' ) ),
|
||||
text = item.find( this.option( 'selectors.form.item_text' ) );
|
||||
/**
|
||||
* Проставляет индексы инпутам ответа
|
||||
*
|
||||
* @param {jQuery} list Список ответов
|
||||
*/
|
||||
answerIndex: function( list ) {
|
||||
list.find( this.option( 'selectors.form.item' ) ).each(function ( index, item ) {
|
||||
var item = $(item),
|
||||
id = item.find( this.option( 'selectors.form.item_id' ) ),
|
||||
text = item.find( this.option( 'selectors.form.item_text' ) );
|
||||
|
||||
id.attr( 'name', 'answers[' + index + '][id]' );
|
||||
text.attr( 'name', 'answers[' + index + '][title]' );
|
||||
}.bind(this));
|
||||
},
|
||||
id.attr( 'name', 'answers[' + index + '][id]' );
|
||||
text.attr( 'name', 'answers[' + index + '][title]' );
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
/**
|
||||
* Добавляет опрос
|
||||
*
|
||||
* @param {jQuery} form Форма
|
||||
* @param {jQuery} list Список ответов
|
||||
* @param {jQuery} modal Модальное окно с формой
|
||||
*/
|
||||
add: function( form, list, modal ) {
|
||||
this.answerIndex( list );
|
||||
/**
|
||||
* Добавляет опрос
|
||||
*
|
||||
* @param {jQuery} form Форма
|
||||
* @param {jQuery} list Список ответов
|
||||
* @param {jQuery} modal Модальное окно с формой
|
||||
*/
|
||||
add: function( form, list, modal ) {
|
||||
this.answerIndex( list );
|
||||
|
||||
this._submit( 'add', form, function( response ) {
|
||||
this.elements.list.append( response.item );
|
||||
modal.hide();
|
||||
}.bind(this), { submitButton: modal.element.find( 'button[type=submit]' ) });
|
||||
},
|
||||
this._submit( 'add', form, function( response ) {
|
||||
this.elements.list.append( response.item );
|
||||
modal.hide();
|
||||
}.bind(this), { submitButton: modal.element.find( 'button[type=submit]' ) });
|
||||
},
|
||||
|
||||
/**
|
||||
* Обновление опроса
|
||||
*
|
||||
* @param {jQuery} form Форма
|
||||
* @param {jQuery} list Список ответов
|
||||
* @param {jQuery} modal Модальное окно с формой
|
||||
*/
|
||||
update: function( form, list, modal ) {
|
||||
this.answerIndex( list );
|
||||
/**
|
||||
* Обновление опроса
|
||||
*
|
||||
* @param {jQuery} form Форма
|
||||
* @param {jQuery} list Список ответов
|
||||
* @param {jQuery} modal Модальное окно с формой
|
||||
*/
|
||||
update: function( form, list, modal ) {
|
||||
this.answerIndex( list );
|
||||
|
||||
this._submit( 'update', form, function( response ) {
|
||||
this.elements.list.find( this.option( 'selectors.item' ) + '[data-poll-id=' + response.id + ']' ).replaceWith( response.item );
|
||||
modal.hide();
|
||||
}.bind(this), { submitButton: modal.element.find( 'button[type=submit]' ) });
|
||||
},
|
||||
this._submit( 'update', form, function( response ) {
|
||||
this.elements.list.find( this.option( 'selectors.item' ) + '[data-poll-id=' + response.id + ']' ).replaceWith( response.item );
|
||||
modal.hide();
|
||||
}.bind(this), { submitButton: modal.element.find( 'button[type=submit]' ) });
|
||||
},
|
||||
|
||||
/**
|
||||
* Удаляет опрос
|
||||
*
|
||||
* @param {jQuery} button Кнопка удаления
|
||||
*/
|
||||
remove: function( button ) {
|
||||
ls.ajax.load( this.option( 'urls.remove' ), { id: button.data('poll-id'), tmp: button.data('poll-target-tmp') }, function ( response ) {
|
||||
button.closest( this.option( 'selectors.item' ) ).fadeOut('slow', function() {
|
||||
$(this).remove();
|
||||
});
|
||||
}.bind(this));
|
||||
},
|
||||
});
|
||||
/**
|
||||
* Удаляет опрос
|
||||
*
|
||||
* @param {jQuery} button Кнопка удаления
|
||||
*/
|
||||
remove: function( button ) {
|
||||
ls.ajax.load( this.option( 'urls.remove' ), { id: button.data('poll-id'), tmp: button.data('poll-target-tmp') }, function ( response ) {
|
||||
button.closest( this.option( 'selectors.item' ) ).fadeOut('slow', function() {
|
||||
$(this).remove();
|
||||
});
|
||||
}.bind(this));
|
||||
},
|
||||
});
|
||||
})(jQuery);
|
|
@ -9,106 +9,106 @@
|
|||
*/
|
||||
|
||||
(function($) {
|
||||
"use strict";
|
||||
"use strict";
|
||||
|
||||
$.widget( "livestreet.lsPoll", $.livestreet.lsComponent, {
|
||||
/**
|
||||
* Дефолтные опции
|
||||
*/
|
||||
options: {
|
||||
// Ссылки
|
||||
urls: {
|
||||
// Голосование за вариант
|
||||
vote: aRouter.ajax + 'poll/vote/'
|
||||
},
|
||||
$.widget( "livestreet.lsPoll", $.livestreet.lsComponent, {
|
||||
/**
|
||||
* Дефолтные опции
|
||||
*/
|
||||
options: {
|
||||
// Ссылки
|
||||
urls: {
|
||||
// Голосование за вариант
|
||||
vote: aRouter.ajax + 'poll/vote/'
|
||||
},
|
||||
|
||||
// Селекторы
|
||||
selectors: {
|
||||
// Форма голосования
|
||||
form: '.js-poll-vote-form',
|
||||
// Селекторы
|
||||
selectors: {
|
||||
// Форма голосования
|
||||
form: '.js-poll-vote-form',
|
||||
|
||||
// Кнопка проголосовать
|
||||
vote: '.js-poll-vote',
|
||||
// Кнопка проголосовать
|
||||
vote: '.js-poll-vote',
|
||||
|
||||
// Кнопка воздержаться от голосования
|
||||
abstain: '.js-poll-abstain',
|
||||
// Кнопка воздержаться от голосования
|
||||
abstain: '.js-poll-abstain',
|
||||
|
||||
// Результата опроса
|
||||
result: '.js-poll-result',
|
||||
// Результата опроса
|
||||
result: '.js-poll-result',
|
||||
|
||||
// Вариант
|
||||
item: '.js-poll-result-item',
|
||||
// Вариант
|
||||
item: '.js-poll-result-item',
|
||||
|
||||
// Кнопка сортировки вариантов
|
||||
sort: '.js-poll-result-sort'
|
||||
}
|
||||
},
|
||||
// Кнопка сортировки вариантов
|
||||
sort: '.js-poll-result-sort'
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Конструктор
|
||||
*
|
||||
* @constructor
|
||||
* @private
|
||||
*/
|
||||
_create: function () {
|
||||
this._super();
|
||||
/**
|
||||
* Конструктор
|
||||
*
|
||||
* @constructor
|
||||
* @private
|
||||
*/
|
||||
_create: function () {
|
||||
this._super();
|
||||
|
||||
var _this = this;
|
||||
var _this = this;
|
||||
|
||||
this.elements = {
|
||||
form: this.element.find( this.options.selectors.form ),
|
||||
vote: this.element.find( this.options.selectors.vote ),
|
||||
abstain: this.element.find( this.options.selectors.abstain )
|
||||
};
|
||||
this.elements = {
|
||||
form: this.element.find( this.options.selectors.form ),
|
||||
vote: this.element.find( this.options.selectors.vote ),
|
||||
abstain: this.element.find( this.options.selectors.abstain )
|
||||
};
|
||||
|
||||
! this.elements.form.length && this.initResult();
|
||||
! this.elements.form.length && this.initResult();
|
||||
|
||||
//
|
||||
// События
|
||||
//
|
||||
//
|
||||
// События
|
||||
//
|
||||
|
||||
this._on( this.elements.vote, { 'click': this.vote.bind( this, false ) } );
|
||||
this._on( this.elements.abstain, { 'click': this.vote.bind( this, true ) } );
|
||||
this.element.on( 'click' + this.eventNamespace, this.option( 'selectors.sort' ), this.sort.bind(this) );
|
||||
},
|
||||
this._on( this.elements.vote, { 'click': this.vote.bind( this, false ) } );
|
||||
this._on( this.elements.abstain, { 'click': this.vote.bind( this, true ) } );
|
||||
this.element.on( 'click' + this.eventNamespace, this.option( 'selectors.sort' ), this.sort.bind(this) );
|
||||
},
|
||||
|
||||
/**
|
||||
* Иниц-ия результата
|
||||
*/
|
||||
initResult: function() {
|
||||
this.elements.sort = this.element.find( this.options.selectors.sort );
|
||||
this.elements.items = this.element.find( this.options.selectors.item );
|
||||
this.elements.result = this.element.find( this.options.selectors.result );
|
||||
},
|
||||
/**
|
||||
* Иниц-ия результата
|
||||
*/
|
||||
initResult: function() {
|
||||
this.elements.sort = this.element.find( this.options.selectors.sort );
|
||||
this.elements.items = this.element.find( this.options.selectors.item );
|
||||
this.elements.result = this.element.find( this.options.selectors.result );
|
||||
},
|
||||
|
||||
/**
|
||||
* Голосование
|
||||
*/
|
||||
vote: function( abstain ) {
|
||||
this._submit( 'vote', this.elements.form, function( response ) {
|
||||
this.element.html( $.trim( response.sText ) );
|
||||
this.initResult();
|
||||
/**
|
||||
* Голосование
|
||||
*/
|
||||
vote: function( abstain ) {
|
||||
this._submit( 'vote', this.elements.form, function( response ) {
|
||||
this.element.html( $.trim( response.sText ) );
|
||||
this.initResult();
|
||||
|
||||
this._off( this.elements.vote, 'click' );
|
||||
this._off( this.elements.abstain, 'click' );
|
||||
}.bind(this), {
|
||||
submitButton: this.elements.vote,
|
||||
params: { abstain: abstain ? 1 : 0 }
|
||||
});
|
||||
},
|
||||
this._off( this.elements.vote, 'click' );
|
||||
this._off( this.elements.abstain, 'click' );
|
||||
}.bind(this), {
|
||||
submitButton: this.elements.vote,
|
||||
params: { abstain: abstain ? 1 : 0 }
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Сортировка результата
|
||||
*/
|
||||
sort: function() {
|
||||
var type = this.elements.sort.hasClass( ls.options.classes.states.active ) ? 'position' : 'count';
|
||||
/**
|
||||
* Сортировка результата
|
||||
*/
|
||||
sort: function() {
|
||||
var type = this.elements.sort.hasClass( ls.options.classes.states.active ) ? 'position' : 'count';
|
||||
|
||||
this.elements.items.sort( function (a, b) {
|
||||
return $(b).data(type) - $(a).data(type);
|
||||
});
|
||||
this.elements.items.sort( function (a, b) {
|
||||
return $(b).data(type) - $(a).data(type);
|
||||
});
|
||||
|
||||
this.elements.sort.toggleClass( ls.options.classes.states.active );
|
||||
this.elements.result.html( this.elements.items );
|
||||
}
|
||||
});
|
||||
this.elements.sort.toggleClass( ls.options.classes.states.active );
|
||||
this.elements.result.html( this.elements.items );
|
||||
}
|
||||
});
|
||||
})(jQuery);
|
|
@ -20,30 +20,30 @@
|
|||
{$index = $index|default:0}
|
||||
|
||||
<li class="{$component} js-poll-form-answer-item"
|
||||
{if $isTemplate}data-is-template="true"{/if}
|
||||
{if $isTemplate}style="display: none"{/if}>
|
||||
{if $isTemplate}data-is-template="true"{/if}
|
||||
{if $isTemplate}style="display: none"{/if}>
|
||||
|
||||
{* ID *}
|
||||
{component 'field' template='hidden'
|
||||
name = "answers[{$index}][id]"
|
||||
value = "{if $item}{$item->getId()}{/if}"
|
||||
classes = "js-poll-form-answer-item-id"}
|
||||
{* ID *}
|
||||
{component 'field' template='hidden'
|
||||
name = "answers[{$index}][id]"
|
||||
value = "{if $item}{$item->getId()}{/if}"
|
||||
classes = "js-poll-form-answer-item-id"}
|
||||
|
||||
{* Текст *}
|
||||
{component 'field' template='text'
|
||||
name = 'answers[]'
|
||||
value = ($item) ? $item->getTitle() : ''
|
||||
isDisabled = ! $allowUpdate
|
||||
inputClasses = 'width-full js-poll-form-answer-item-text'}
|
||||
{* Текст *}
|
||||
{component 'field' template='text'
|
||||
name = 'answers[]'
|
||||
value = ($item) ? $item->getTitle() : ''
|
||||
isDisabled = ! $allowUpdate
|
||||
inputClasses = 'width-full js-poll-form-answer-item-text'}
|
||||
|
||||
{* Кнопка удаления *}
|
||||
{if $allowRemove}
|
||||
{component 'icon'
|
||||
icon='remove'
|
||||
classes="{$component}-remove js-poll-form-answer-item-remove"
|
||||
attributes=[
|
||||
title => {lang 'blog.private'},
|
||||
style => "{if ! $showRemove}display: none{/if}"
|
||||
]}
|
||||
{/if}
|
||||
{* Кнопка удаления *}
|
||||
{if $allowRemove}
|
||||
{component 'icon'
|
||||
icon='remove'
|
||||
classes="{$component}-remove js-poll-form-answer-item-remove"
|
||||
attributes=[
|
||||
title => {lang 'blog.private'},
|
||||
style => "{if ! $showRemove}display: none{/if}"
|
||||
]}
|
||||
{/if}
|
||||
</li>
|
|
@ -3,99 +3,99 @@
|
|||
*}
|
||||
|
||||
<form action="" method="post" id="js-poll-form" data-action="{if $poll}update{else}add{/if}">
|
||||
{* Заголовок *}
|
||||
{component 'field' template='text'
|
||||
name = 'poll[title]'
|
||||
value = {($poll) ? $poll->getTitle() : '' }
|
||||
label = $aLang.poll.form.fields.title
|
||||
inputAttributes= [ 'autofocus' => true ]}
|
||||
{* Заголовок *}
|
||||
{component 'field' template='text'
|
||||
name = 'poll[title]'
|
||||
value = {($poll) ? $poll->getTitle() : '' }
|
||||
label = $aLang.poll.form.fields.title
|
||||
inputAttributes= [ 'autofocus' => true ]}
|
||||
|
||||
{component 'field' template='checkbox'
|
||||
name = 'poll[is_guest_allow]'
|
||||
checked = {($poll && $poll->getIsGuestAllow()) ? true : false }
|
||||
label = $aLang.poll.form.fields.is_guest_allow}
|
||||
{component 'field' template='checkbox'
|
||||
name = 'poll[is_guest_allow]'
|
||||
checked = {($poll && $poll->getIsGuestAllow()) ? true : false }
|
||||
label = $aLang.poll.form.fields.is_guest_allow}
|
||||
|
||||
{component 'field' template='checkbox'
|
||||
name = 'poll[is_guest_check_ip]'
|
||||
checked = {($poll && $poll->getIsGuestCheckIp()) ? true : false }
|
||||
label = $aLang.poll.form.fields.is_guest_check_ip}
|
||||
{component 'field' template='checkbox'
|
||||
name = 'poll[is_guest_check_ip]'
|
||||
checked = {($poll && $poll->getIsGuestCheckIp()) ? true : false }
|
||||
label = $aLang.poll.form.fields.is_guest_check_ip}
|
||||
|
||||
{* Кол-во вариантов которые может выбрать пользователь *}
|
||||
{if $poll && $poll->getCountVote()}
|
||||
{$bDisableChangeType = true}
|
||||
{/if}
|
||||
{* Кол-во вариантов которые может выбрать пользователь *}
|
||||
{if $poll && $poll->getCountVote()}
|
||||
{$bDisableChangeType = true}
|
||||
{/if}
|
||||
|
||||
<p class="mb-10">{$aLang.poll.form.fields.type.label}:</p>
|
||||
<p class="mb-10">{$aLang.poll.form.fields.type.label}:</p>
|
||||
|
||||
{component 'field' template='radio'
|
||||
name = 'poll[type]'
|
||||
value = 'one'
|
||||
label = $aLang.poll.form.fields.type.label_one
|
||||
checked = ! $poll or $poll->getCountAnswerMax() == 1
|
||||
isDisabled = $bDisableChangeType}
|
||||
{component 'field' template='radio'
|
||||
name = 'poll[type]'
|
||||
value = 'one'
|
||||
label = $aLang.poll.form.fields.type.label_one
|
||||
checked = ! $poll or $poll->getCountAnswerMax() == 1
|
||||
isDisabled = $bDisableChangeType}
|
||||
|
||||
{component 'field' template='radio'
|
||||
displayInline = true
|
||||
name = 'poll[type]'
|
||||
value = 'many'
|
||||
label = $aLang.poll.form.fields.type.label_many
|
||||
checked = $poll && $poll->getCountAnswerMax() > 1
|
||||
isDisabled = $bDisableChangeType}
|
||||
{component 'field' template='radio'
|
||||
displayInline = true
|
||||
name = 'poll[type]'
|
||||
value = 'many'
|
||||
label = $aLang.poll.form.fields.type.label_many
|
||||
checked = $poll && $poll->getCountAnswerMax() > 1
|
||||
isDisabled = $bDisableChangeType}
|
||||
|
||||
{component 'field' template='text'
|
||||
displayInline = true
|
||||
name = 'poll[count_answer_max]'
|
||||
value = ($poll) ? $poll->getCountAnswerMax() : 2
|
||||
classes = 'width-50'
|
||||
isDisabled = $bDisableChangeType}
|
||||
{component 'field' template='text'
|
||||
displayInline = true
|
||||
name = 'poll[count_answer_max]'
|
||||
value = ($poll) ? $poll->getCountAnswerMax() : 2
|
||||
classes = 'width-50'
|
||||
isDisabled = $bDisableChangeType}
|
||||
|
||||
|
||||
{* Варианты ответов *}
|
||||
<div class="fieldset m-0">
|
||||
<header class="fieldset-header">
|
||||
<h3 class="fieldset-title">{$aLang.poll.form.answers_title}</h3>
|
||||
</header>
|
||||
{* Варианты ответов *}
|
||||
<div class="fieldset m-0">
|
||||
<header class="fieldset-header">
|
||||
<h3 class="fieldset-title">{$aLang.poll.form.answers_title}</h3>
|
||||
</header>
|
||||
|
||||
<div class="fieldset-body">
|
||||
<ul class="ls-poll-form-answer-list js-poll-form-answer-list">
|
||||
{if $poll}
|
||||
{$aAnswers = $poll->getAnswers()}
|
||||
<div class="fieldset-body">
|
||||
<ul class="ls-poll-form-answer-list js-poll-form-answer-list">
|
||||
{if $poll}
|
||||
{$aAnswers = $poll->getAnswers()}
|
||||
|
||||
{foreach $aAnswers as $oAnswer}
|
||||
{component 'poll' template='form-item'
|
||||
item = $oAnswer
|
||||
index = $oAnswer@index
|
||||
allowUpdate = $poll->isAllowUpdate()
|
||||
allowRemove = $poll->isAllowUpdate() && ! $oAnswer->getCountVote()}
|
||||
{/foreach}
|
||||
{else}
|
||||
{component 'poll' template='form-item' showRemove=false}
|
||||
{component 'poll' template='form-item' showRemove=false}
|
||||
{/if}
|
||||
</ul>
|
||||
</div>
|
||||
{foreach $aAnswers as $oAnswer}
|
||||
{component 'poll' template='form-item'
|
||||
item = $oAnswer
|
||||
index = $oAnswer@index
|
||||
allowUpdate = $poll->isAllowUpdate()
|
||||
allowRemove = $poll->isAllowUpdate() && ! $oAnswer->getCountVote()}
|
||||
{/foreach}
|
||||
{else}
|
||||
{component 'poll' template='form-item' showRemove=false}
|
||||
{component 'poll' template='form-item' showRemove=false}
|
||||
{/if}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
{if ! $poll or $poll->isAllowUpdate()}
|
||||
<footer class="fieldset-footer">
|
||||
{component 'button'
|
||||
type = 'button'
|
||||
text = $aLang.common.add
|
||||
attributes = [ 'title' => '[Ctrl + Enter]' ]
|
||||
classes = 'js-poll-form-answer-add'}
|
||||
</footer>
|
||||
{/if}
|
||||
</div>
|
||||
{if ! $poll or $poll->isAllowUpdate()}
|
||||
<footer class="fieldset-footer">
|
||||
{component 'button'
|
||||
type = 'button'
|
||||
text = $aLang.common.add
|
||||
attributes = [ 'title' => '[Ctrl + Enter]' ]
|
||||
classes = 'js-poll-form-answer-add'}
|
||||
</footer>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
|
||||
{* Скрытые поля *}
|
||||
{if $poll}
|
||||
{component 'field' template='hidden' name='poll_id' value=$poll->getId()}
|
||||
{else}
|
||||
{component 'field' template='hidden' name='target[type]' value=$sTargetType}
|
||||
{component 'field' template='hidden' name='target[id]' value=$sTargetId}
|
||||
{/if}
|
||||
{* Скрытые поля *}
|
||||
{if $poll}
|
||||
{component 'field' template='hidden' name='poll_id' value=$poll->getId()}
|
||||
{else}
|
||||
{component 'field' template='hidden' name='target[type]' value=$sTargetType}
|
||||
{component 'field' template='hidden' name='target[id]' value=$sTargetId}
|
||||
{/if}
|
||||
|
||||
{component 'field' template='hidden' name='target[tmp]' value=$sTargetTmp}
|
||||
{component 'field' template='hidden' name='target[tmp]' value=$sTargetTmp}
|
||||
</form>
|
||||
|
||||
{* Шаблон ответа для добавления с помощью js *}
|
||||
|
|
|
@ -5,5 +5,5 @@
|
|||
*}
|
||||
|
||||
{foreach $polls as $poll}
|
||||
{component 'poll' poll=$poll}
|
||||
{component 'poll' poll=$poll}
|
||||
{/foreach}
|
|
@ -5,20 +5,20 @@
|
|||
*}
|
||||
|
||||
<li class="ls-poll-manage-item js-poll-manage-item" data-poll-id="{$poll->getId()}" data-poll-target-tmp="{$poll->getTargetTmp()}">
|
||||
{* Заголовок *}
|
||||
{$poll->getTitle()}
|
||||
{* Заголовок *}
|
||||
{$poll->getTitle()}
|
||||
|
||||
{* Действия *}
|
||||
<ul class="user-list-small-item-actions">
|
||||
{* Редактировать *}
|
||||
{* Показывает модальное окно с формой редактирования опроса *}
|
||||
<li class="js-poll-manage-item-edit" title="{$aLang.common.edit}" data-poll-id="{$poll->getId()}" data-poll-target-tmp="{$poll->getTargetTmp()}">
|
||||
{component 'icon' icon='edit'}
|
||||
</li>
|
||||
{* Действия *}
|
||||
<ul class="user-list-small-item-actions">
|
||||
{* Редактировать *}
|
||||
{* Показывает модальное окно с формой редактирования опроса *}
|
||||
<li class="js-poll-manage-item-edit" title="{$aLang.common.edit}" data-poll-id="{$poll->getId()}" data-poll-target-tmp="{$poll->getTargetTmp()}">
|
||||
{component 'icon' icon='edit'}
|
||||
</li>
|
||||
|
||||
{* Удалить *}
|
||||
<li class="js-poll-manage-item-remove" title="{$aLang.common.remove}" data-poll-id="{$poll->getId()}" data-poll-target-tmp="{$poll->getTargetTmp()}">
|
||||
{component 'icon' icon='remove'}
|
||||
</li>
|
||||
</ul>
|
||||
{* Удалить *}
|
||||
<li class="js-poll-manage-item-remove" title="{$aLang.common.remove}" data-poll-id="{$poll->getId()}" data-poll-target-tmp="{$poll->getTargetTmp()}">
|
||||
{component 'icon' icon='remove'}
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
|
@ -3,9 +3,9 @@
|
|||
*}
|
||||
|
||||
<ul class="ls-poll-manage-list js-poll-manage-list">
|
||||
{if $aPollItems}
|
||||
{foreach $aPollItems as $poll}
|
||||
{component 'poll' template='manage.item' poll=$poll}
|
||||
{/foreach}
|
||||
{/if}
|
||||
{if $aPollItems}
|
||||
{foreach $aPollItems as $poll}
|
||||
{component 'poll' template='manage.item' poll=$poll}
|
||||
{/foreach}
|
||||
{/if}
|
||||
</ul>
|
|
@ -6,18 +6,18 @@
|
|||
*}
|
||||
|
||||
<div class="fieldset ls-poll-manage js-poll-manage" data-type="{$smarty.local.targetType}" data-target-id="{$smarty.local.targetId}">
|
||||
<header class="fieldset-header">
|
||||
<h3 class="fieldset-title">{$aLang.poll.polls}</h3>
|
||||
</header>
|
||||
<header class="fieldset-header">
|
||||
<h3 class="fieldset-title">{$aLang.poll.polls}</h3>
|
||||
</header>
|
||||
|
||||
<div class="fieldset-body">
|
||||
{* Кнопка добавить *}
|
||||
{component 'button' text=$aLang.common.add type='button' classes='ls-poll-manage-add js-poll-manage-add'}
|
||||
<div class="fieldset-body">
|
||||
{* Кнопка добавить *}
|
||||
{component 'button' text=$aLang.common.add type='button' classes='ls-poll-manage-add js-poll-manage-add'}
|
||||
|
||||
{* Список добавленных опросов *}
|
||||
{insert name="block" block="pollFormItems" params=[
|
||||
'target_type' => $smarty.local.targetType,
|
||||
'target_id' => $smarty.local.targetId
|
||||
]}
|
||||
</div>
|
||||
{* Список добавленных опросов *}
|
||||
{insert name="block" block="pollFormItems" params=[
|
||||
'target_type' => $smarty.local.targetType,
|
||||
'target_id' => $smarty.local.targetId
|
||||
]}
|
||||
</div>
|
||||
</div>
|
|
@ -5,11 +5,11 @@
|
|||
*}
|
||||
|
||||
<div class="ls-poll poll-type-{$poll->getTargetType()} js-poll" data-poll-id="{$poll->getId()}" data-poll-answer-max="{$poll->getCountAnswerMax()}">
|
||||
<h3 class="ls-poll-title">{$poll->getTitle()}</h3>
|
||||
<h3 class="ls-poll-title">{$poll->getTitle()}</h3>
|
||||
|
||||
{if ! $poll->getVoteCurrent()}
|
||||
{component 'poll' template='vote' poll=$poll}
|
||||
{else}
|
||||
{if ! $poll->getVoteCurrent()}
|
||||
{component 'poll' template='vote' poll=$poll}
|
||||
{else}
|
||||
{component 'poll' template='result' poll=$poll}
|
||||
{/if}
|
||||
{/if}
|
||||
</div>
|
|
@ -10,29 +10,29 @@
|
|||
|
||||
{* Форма *}
|
||||
<form method="post" class="js-poll-vote-form">
|
||||
{* Список ответов *}
|
||||
<ul class="ls-poll-answer-list">
|
||||
{foreach $poll->getAnswers() as $answer}
|
||||
<li class="ls-poll-answer-list-item js-poll-answer-list-item" data-answer-id="{$answer->getId()}">
|
||||
{component 'field' template=$type
|
||||
name = 'answers[]'
|
||||
value = $answer->getId()
|
||||
label = $answer->getTitle()
|
||||
classes = 'js-poll-answer-$type'}
|
||||
</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
{* Список ответов *}
|
||||
<ul class="ls-poll-answer-list">
|
||||
{foreach $poll->getAnswers() as $answer}
|
||||
<li class="ls-poll-answer-list-item js-poll-answer-list-item" data-answer-id="{$answer->getId()}">
|
||||
{component 'field' template=$type
|
||||
name = 'answers[]'
|
||||
value = $answer->getId()
|
||||
label = $answer->getTitle()
|
||||
classes = 'js-poll-answer-$type'}
|
||||
</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
|
||||
{component 'field' template='hidden' name='id' value=$poll->getId()}
|
||||
{component 'field' template='hidden' name='id' value=$poll->getId()}
|
||||
|
||||
{if $oUserCurrent or $poll->getIsGuestAllow()}
|
||||
{* Проголосовать *}
|
||||
{component 'button' text=$aLang.poll.vote type='button' mods='primary' classes='js-poll-vote'}
|
||||
{if $oUserCurrent or $poll->getIsGuestAllow()}
|
||||
{* Проголосовать *}
|
||||
{component 'button' text=$aLang.poll.vote type='button' mods='primary' classes='js-poll-vote'}
|
||||
|
||||
{* Воздержаться *}
|
||||
{component 'button' text=$aLang.poll.abstain type='button' classes='js-poll-abstain'}
|
||||
{else}
|
||||
{* Предупрежение: голосовать могут только авторизованные пользователи *}
|
||||
{component 'alert' mods='info' text=$aLang.poll.only_auth}
|
||||
{/if}
|
||||
{* Воздержаться *}
|
||||
{component 'button' text=$aLang.poll.abstain type='button' classes='js-poll-abstain'}
|
||||
{else}
|
||||
{* Предупрежение: голосовать могут только авторизованные пользователи *}
|
||||
{component 'alert' mods='info' text=$aLang.poll.only_auth}
|
||||
{/if}
|
||||
</form>
|
|
@ -3,10 +3,10 @@
|
|||
*/
|
||||
|
||||
.ls-property-list {
|
||||
margin-bottom: 30px;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
.ls-property {
|
||||
padding: 15px 15px;
|
||||
border-bottom: 1px solid #eee;
|
||||
padding: 15px 15px;
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
|
@ -4,44 +4,44 @@
|
|||
* @template forms/form.search.base.tpl
|
||||
*/
|
||||
.ls-search-form {
|
||||
padding: 15px;
|
||||
margin-bottom: 20px;
|
||||
background: #f7f7f7;
|
||||
position: relative;
|
||||
padding: 15px;
|
||||
margin-bottom: 20px;
|
||||
background: #f7f7f7;
|
||||
position: relative;
|
||||
}
|
||||
.ls-search-form .ls-field {
|
||||
margin-bottom: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.ls-search-form-input[type="text"] {
|
||||
padding-right: 30px;
|
||||
padding-right: 30px;
|
||||
}
|
||||
|
||||
.ls-button--icon.ls-search-form-submit {
|
||||
border: none;
|
||||
background: none;
|
||||
position: absolute;
|
||||
padding: 0;
|
||||
height: auto;
|
||||
top: 21px;
|
||||
right: 22px;
|
||||
cursor: pointer;
|
||||
opacity: .7;
|
||||
filter: alpha(opacity=70);
|
||||
border: none;
|
||||
background: none;
|
||||
position: absolute;
|
||||
padding: 0;
|
||||
height: auto;
|
||||
top: 21px;
|
||||
right: 22px;
|
||||
cursor: pointer;
|
||||
opacity: .7;
|
||||
filter: alpha(opacity=70);
|
||||
}
|
||||
.ls-search-form-submit:hover {
|
||||
opacity: 1;
|
||||
filter: alpha(opacity=100);
|
||||
background-color: transparent;
|
||||
opacity: 1;
|
||||
filter: alpha(opacity=100);
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Light
|
||||
*/
|
||||
.ls-search-form--light {
|
||||
background: none;
|
||||
padding: 0;
|
||||
background: none;
|
||||
padding: 0;
|
||||
}
|
||||
.ls-search-form--light .ls-search-form-submit {
|
||||
top: 6px;
|
||||
right: 7px;
|
||||
top: 6px;
|
||||
right: 7px;
|
||||
}
|
|
@ -10,17 +10,17 @@
|
|||
{$component = 'ls-search-form'}
|
||||
|
||||
<form action="{$smarty.local.action}" method="{$smarty.local.method|default:'get'}" class="{$component} {cmods name=$component mods=$smarty.local.mods} {$smarty.local.classes}" {cattr list=$smarty.local.attributes}>
|
||||
{block 'search_form'}
|
||||
{component 'field' template='text'
|
||||
placeholder = ( $smarty.local.placeholder ) ? $smarty.local.placeholder : $aLang.search.search
|
||||
note = $smarty.local.note
|
||||
value = $smarty.local.value
|
||||
inputClasses = "{$component}-input {$smarty.local.inputClasses}"
|
||||
inputAttributes = $smarty.local.inputAttributes
|
||||
name = $smarty.local.inputName|default:'q'}
|
||||
{block 'search_form'}
|
||||
{component 'field' template='text'
|
||||
placeholder = ( $smarty.local.placeholder ) ? $smarty.local.placeholder : $aLang.search.search
|
||||
note = $smarty.local.note
|
||||
value = $smarty.local.value
|
||||
inputClasses = "{$component}-input {$smarty.local.inputClasses}"
|
||||
inputAttributes = $smarty.local.inputAttributes
|
||||
name = $smarty.local.inputName|default:'q'}
|
||||
|
||||
{if ! $smarty.local.noSubmitButton}
|
||||
{component 'button' mods='icon' classes="{$component}-submit" icon='search'}
|
||||
{/if}
|
||||
{/block}
|
||||
{if ! $smarty.local.noSubmitButton}
|
||||
{component 'button' mods='icon' classes="{$component}-submit" icon='search'}
|
||||
{/if}
|
||||
{/block}
|
||||
</form>
|
|
@ -5,26 +5,26 @@
|
|||
{extends 'layouts/layout.base.tpl'}
|
||||
|
||||
{block 'layout_page_title'}
|
||||
Component <span>search-form</span>
|
||||
Component <span>search-form</span>
|
||||
{/block}
|
||||
|
||||
{block 'layout_content'}
|
||||
{function test_heading}
|
||||
<br><h3>{$sText}</h3>
|
||||
{/function}
|
||||
{function test_heading}
|
||||
<br><h3>{$sText}</h3>
|
||||
{/function}
|
||||
|
||||
|
||||
{test_heading sText='Default'}
|
||||
{test_heading sText='Default'}
|
||||
|
||||
{component 'search-form'
|
||||
name = 'text'
|
||||
note = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Velit, libero.'}
|
||||
{component 'search-form'
|
||||
name = 'text'
|
||||
note = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Velit, libero.'}
|
||||
|
||||
|
||||
{test_heading sText='Light'}
|
||||
{test_heading sText='Light'}
|
||||
|
||||
{component 'search-form'
|
||||
name = 'text'
|
||||
mods = 'light'
|
||||
note = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Velit, libero.'}
|
||||
{component 'search-form'
|
||||
name = 'text'
|
||||
mods = 'light'
|
||||
note = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Velit, libero.'}
|
||||
{/block}
|
|
@ -3,15 +3,15 @@
|
|||
*}
|
||||
|
||||
{if $periodSelectCurrent}
|
||||
{component 'dropdown'
|
||||
classes = 'js-dropdown-default'
|
||||
name = 'sort_by_date'
|
||||
text = {lang "blog.menu.top_period_$periodSelectCurrent"}
|
||||
menu = [
|
||||
[ 'name' => '1', 'url' => "{$periodSelectRoot}?period=1", 'text' => {lang 'blog.menu.top_period_1'} ],
|
||||
[ 'name' => '7', 'url' => "{$periodSelectRoot}?period=7", 'text' => {lang 'blog.menu.top_period_7'} ],
|
||||
[ 'name' => '30', 'url' => "{$periodSelectRoot}?period=30", 'text' => {lang 'blog.menu.top_period_30'} ],
|
||||
[ 'name' => 'all', 'url' => "{$periodSelectRoot}?period=all", 'text' => {lang 'blog.menu.top_period_all'} ]
|
||||
]
|
||||
params = $smarty.local.params}
|
||||
{component 'dropdown'
|
||||
classes = 'js-dropdown-default'
|
||||
name = 'sort_by_date'
|
||||
text = {lang "blog.menu.top_period_$periodSelectCurrent"}
|
||||
menu = [
|
||||
[ 'name' => '1', 'url' => "{$periodSelectRoot}?period=1", 'text' => {lang 'blog.menu.top_period_1'} ],
|
||||
[ 'name' => '7', 'url' => "{$periodSelectRoot}?period=7", 'text' => {lang 'blog.menu.top_period_7'} ],
|
||||
[ 'name' => '30', 'url' => "{$periodSelectRoot}?period=30", 'text' => {lang 'blog.menu.top_period_30'} ],
|
||||
[ 'name' => 'all', 'url' => "{$periodSelectRoot}?period=all", 'text' => {lang 'blog.menu.top_period_all'} ]
|
||||
]
|
||||
params = $smarty.local.params}
|
||||
{/if}
|
|
@ -3,22 +3,22 @@
|
|||
*}
|
||||
|
||||
<div class="ls-sort {$sSortClasses}">
|
||||
{if $bSortShowLabel|default:true}
|
||||
<div class="ls-sort-label">{if $sSortLabel}{$sSortLabel}{else}{$aLang.sort.label}{/if}</div>
|
||||
{/if}
|
||||
{if $bSortShowLabel|default:true}
|
||||
<div class="ls-sort-label">{if $sSortLabel}{$sSortLabel}{else}{$aLang.sort.label}{/if}</div>
|
||||
{/if}
|
||||
|
||||
<div class="dropdown dropdown-toggle js-dropdown-default" data-dropdown-target="js-dropdown-sort-{$sSortName}" data-dropdown-selectable="true">...</div>
|
||||
<div class="dropdown dropdown-toggle js-dropdown-default" data-dropdown-target="js-dropdown-sort-{$sSortName}" data-dropdown-selectable="true">...</div>
|
||||
|
||||
<ul class="dropdown-menu" id="js-dropdown-sort-{$sSortName}">
|
||||
{foreach $aSortList as $aSortItem}
|
||||
{$bIsActive = $sSortOrder == $aSortItem['name']}
|
||||
<ul class="dropdown-menu" id="js-dropdown-sort-{$sSortName}">
|
||||
{foreach $aSortList as $aSortItem}
|
||||
{$bIsActive = $sSortOrder == $aSortItem['name']}
|
||||
|
||||
<li {if $bIsActive}class="active" title="{if $sSortOrderWay == 'asc'}asc{else}desc{/if}"{/if}>
|
||||
<a href="{$sSortUrl}?order={$aSortItem['name']}&order_way={if $bIsActive}{if $sSortOrderWay == 'asc'}desc{else}asc{/if}{else}asc{/if}">
|
||||
{$aSortItem['text']}
|
||||
{if $bIsActive}{if $sSortOrderWay == 'asc'}↓{else}↑{/if}{/if}
|
||||
</a>
|
||||
</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
<li {if $bIsActive}class="active" title="{if $sSortOrderWay == 'asc'}asc{else}desc{/if}"{/if}>
|
||||
<a href="{$sSortUrl}?order={$aSortItem['name']}&order_way={if $bIsActive}{if $sSortOrderWay == 'asc'}desc{else}asc{/if}{else}asc{/if}">
|
||||
{$aSortItem['text']}
|
||||
{if $bIsActive}{if $sSortOrderWay == 'asc'}↓{else}↑{/if}{/if}
|
||||
</a>
|
||||
</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</div>
|
|
@ -12,21 +12,21 @@ var ls = ls || {};
|
|||
|
||||
ls.subscribe = (function ($) {
|
||||
|
||||
/**
|
||||
* Подписка/отписка
|
||||
*/
|
||||
this.toggle = function(targetType, targetId, mail, value) {
|
||||
var url = aRouter['subscribe']+'ajax-subscribe-toggle/';
|
||||
var params = { target_type: targetType, target_id: targetId, mail: mail, value: value };
|
||||
/**
|
||||
* Подписка/отписка
|
||||
*/
|
||||
this.toggle = function(targetType, targetId, mail, value) {
|
||||
var url = aRouter['subscribe']+'ajax-subscribe-toggle/';
|
||||
var params = { target_type: targetType, target_id: targetId, mail: mail, value: value };
|
||||
|
||||
ls.hook.marker('toggleBefore');
|
||||
ls.hook.marker('toggleBefore');
|
||||
|
||||
ls.ajax.load( url, params, function( response ) {
|
||||
ls.hook.run('ls_subscribe_toggle_after',[targetType, targetId, mail, value, response ]);
|
||||
});
|
||||
ls.ajax.load( url, params, function( response ) {
|
||||
ls.hook.run('ls_subscribe_toggle_after',[targetType, targetId, mail, value, response ]);
|
||||
});
|
||||
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
return this;
|
||||
return this;
|
||||
}).call(ls.subscribe || {}, jQuery);
|
|
@ -10,10 +10,10 @@
|
|||
{$activeTag = $smarty.local.activeTag}
|
||||
|
||||
{component 'tags' template='cloud'
|
||||
tags = $smarty.local.tags
|
||||
url = '{$user->getUserWebPath()}favourites/topics/tag/{$tag->getText()|escape:\'url\'}/'
|
||||
active = $activeTag
|
||||
assign = tags}
|
||||
tags = $smarty.local.tags
|
||||
url = '{$user->getUserWebPath()}favourites/topics/tag/{$tag->getText()|escape:\'url\'}/'
|
||||
active = $activeTag
|
||||
assign = tags}
|
||||
|
||||
{component 'details'
|
||||
classes = 'js-tags-favourite-cloud'
|
||||
|
|
|
@ -5,28 +5,28 @@
|
|||
{extends 'component@tags.tags'}
|
||||
|
||||
{block 'tags_options' append}
|
||||
{$attributes = array_merge( $attributes|default:[], [
|
||||
'data-param-target_id' => $smarty.local.targetId
|
||||
])}
|
||||
{$attributes = array_merge( $attributes|default:[], [
|
||||
'data-param-target_id' => $smarty.local.targetId
|
||||
])}
|
||||
{/block}
|
||||
|
||||
{block 'tags_list' append}
|
||||
{* Персональные теги *}
|
||||
{if $oUserCurrent}
|
||||
{foreach $smarty.local.tagsPersonal as $tag}
|
||||
{component 'tags' template='item'
|
||||
text=$tag
|
||||
url="{$oUserCurrent->getUserWebPath()}favourites/topics/tag/{$tag|escape:'url'}/"
|
||||
classes="js-tags-personal-tag"
|
||||
mods="personal"}
|
||||
{/foreach}
|
||||
{* Персональные теги *}
|
||||
{if $oUserCurrent}
|
||||
{foreach $smarty.local.tagsPersonal as $tag}
|
||||
{component 'tags' template='item'
|
||||
text=$tag
|
||||
url="{$oUserCurrent->getUserWebPath()}favourites/topics/tag/{$tag|escape:'url'}/"
|
||||
classes="js-tags-personal-tag"
|
||||
mods="personal"}
|
||||
{/foreach}
|
||||
|
||||
{* Кнопка "Изменить теги" *}
|
||||
<li class="ls-tags-item ls-tags-personal-edit js-tags-personal-edit" {if $smarty.local.isEditable}style="display:none;"{/if}>
|
||||
<a href="#" class="link-dotted">
|
||||
{component 'icon' icon='edit'}
|
||||
{lang 'tags_personal.edit'}
|
||||
</a>
|
||||
</li>
|
||||
{/if}
|
||||
{* Кнопка "Изменить теги" *}
|
||||
<li class="ls-tags-item ls-tags-personal-edit js-tags-personal-edit" {if $smarty.local.isEditable}style="display:none;"{/if}>
|
||||
<a href="#" class="link-dotted">
|
||||
{component 'icon' icon='edit'}
|
||||
{lang 'tags_personal.edit'}
|
||||
</a>
|
||||
</li>
|
||||
{/if}
|
||||
{/block}
|
|
@ -5,49 +5,49 @@
|
|||
{hook run='talk_add_begin'}
|
||||
|
||||
<form action="" method="POST" enctype="multipart/form-data" class="js-form-validate">
|
||||
{hook run='form_add_talk_begin'}
|
||||
{hook run='form_add_talk_begin'}
|
||||
|
||||
{component 'field' template='hidden.security-key'}
|
||||
{component 'field' template='hidden.security-key'}
|
||||
|
||||
{* Получатели *}
|
||||
{component 'user' template='choose'
|
||||
items = ($recepient) ? [[ 'text' => $recepient->getLogin(), 'value' => $recepient->getId() ]] : null
|
||||
selectedValue = ($recepient) ? $recepient->getId() : null
|
||||
form = ($_aRequest['talk_recepient_id']) ? null : $_aRequest
|
||||
name = 'talk_users[]'
|
||||
rules = [ 'required' => true, 'rangetags' => '[1,99]' ]
|
||||
classes = 'js-talk-add-user-choose'
|
||||
label = {lang 'talk.add.fields.users.label'}
|
||||
lang_choose = {lang 'talk.add.choose_friends'}}
|
||||
{* Получатели *}
|
||||
{component 'user' template='choose'
|
||||
items = ($recepient) ? [[ 'text' => $recepient->getLogin(), 'value' => $recepient->getId() ]] : null
|
||||
selectedValue = ($recepient) ? $recepient->getId() : null
|
||||
form = ($_aRequest['talk_recepient_id']) ? null : $_aRequest
|
||||
name = 'talk_users[]'
|
||||
rules = [ 'required' => true, 'rangetags' => '[1,99]' ]
|
||||
classes = 'js-talk-add-user-choose'
|
||||
label = {lang 'talk.add.fields.users.label'}
|
||||
lang_choose = {lang 'talk.add.choose_friends'}}
|
||||
|
||||
{* Заголовок *}
|
||||
{component 'field' template='text'
|
||||
name = 'talk_title'
|
||||
rules = [ 'required' => true, 'length' => '[2,200]' ]
|
||||
label = $aLang.talk.add.fields.title.label}
|
||||
{* Заголовок *}
|
||||
{component 'field' template='text'
|
||||
name = 'talk_title'
|
||||
rules = [ 'required' => true, 'length' => '[2,200]' ]
|
||||
label = $aLang.talk.add.fields.title.label}
|
||||
|
||||
{* Текст сообщения *}
|
||||
{component 'editor'
|
||||
sSet = 'light'
|
||||
sMediaTargetType = 'talk'
|
||||
id = 'talk_text'
|
||||
name = 'talk_text'
|
||||
rules = [ 'required' => true, 'length' => '[2,3000]' ]
|
||||
label = $aLang.talk.add.fields.text.label
|
||||
inputClasses = 'js-editor-default'}
|
||||
{* Текст сообщения *}
|
||||
{component 'editor'
|
||||
sSet = 'light'
|
||||
sMediaTargetType = 'talk'
|
||||
id = 'talk_text'
|
||||
name = 'talk_text'
|
||||
rules = [ 'required' => true, 'length' => '[2,3000]' ]
|
||||
label = $aLang.talk.add.fields.text.label
|
||||
inputClasses = 'js-editor-default'}
|
||||
|
||||
{* Preview *}
|
||||
<div class="ls-text mb-20" id="text_preview" style="display: none;"></div>
|
||||
{* Preview *}
|
||||
<div class="ls-text mb-20" id="text_preview" style="display: none;"></div>
|
||||
|
||||
{hook run='form_add_talk_end'}
|
||||
{hook run='form_add_talk_end'}
|
||||
|
||||
{* Кнопки *}
|
||||
{component 'button' name='submit_talk_add' mods='primary' text=$aLang.common.send}
|
||||
{component 'button'
|
||||
name = 'submit_preview'
|
||||
type = 'button'
|
||||
text = $aLang.common.preview_text
|
||||
attributes = [ 'onclick' => "jQuery('#text_preview').show(); ls.utils.textPreview($('#talk_text'), $('#text_preview'), false); return false;" ]}
|
||||
{* Кнопки *}
|
||||
{component 'button' name='submit_talk_add' mods='primary' text=$aLang.common.send}
|
||||
{component 'button'
|
||||
name = 'submit_preview'
|
||||
type = 'button'
|
||||
text = $aLang.common.preview_text
|
||||
attributes = [ 'onclick' => "jQuery('#text_preview').show(); ls.utils.textPreview($('#talk_text'), $('#text_preview'), false); return false;" ]}
|
||||
</form>
|
||||
|
||||
{hook run='talk_add_end'}
|
|
@ -7,9 +7,9 @@
|
|||
*/
|
||||
|
||||
.talk {
|
||||
background: #fafafa;
|
||||
padding: 20px;
|
||||
margin-bottom: 0;
|
||||
background: #fafafa;
|
||||
padding: 20px;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.ls-talk-participants-details {
|
||||
|
@ -20,13 +20,13 @@
|
|||
* Список участников диалога
|
||||
*/
|
||||
.message-users .user-list-small-item.inactive {
|
||||
opacity: .5;
|
||||
cursor: help;
|
||||
opacity: .5;
|
||||
cursor: help;
|
||||
}
|
||||
.message-users .user-list-small-item.inactive .ls-talk-participants-item-inactivate,
|
||||
.message-users .user-list-small-item .ls-talk-participants-item-activate {
|
||||
display: none;
|
||||
display: none;
|
||||
}
|
||||
.message-users .user-list-small-item.inactive .ls-talk-participants-item-activate {
|
||||
display: inline-block;
|
||||
display: inline-block;
|
||||
}
|
|
@ -9,81 +9,81 @@
|
|||
*/
|
||||
|
||||
(function($) {
|
||||
"use strict";
|
||||
"use strict";
|
||||
|
||||
$.widget( "livestreet.lsTalkUsers", $.livestreet.lsUserListAdd, {
|
||||
/**
|
||||
* Дефолтные опции
|
||||
*/
|
||||
options: {
|
||||
urls: {
|
||||
add: aRouter['talk'] + 'ajaxaddtalkuser/',
|
||||
inactivate: aRouter['talk'] + 'ajaxdeletetalkuser/'
|
||||
},
|
||||
selectors: {
|
||||
// Кнопка отключения пользователя от диалога
|
||||
item_inactivate: '.js-message-users-user-inactivate',
|
||||
// Кнопка повторного приглашения пользователя в диалог
|
||||
item_activate: '.js-message-users-user-activate'
|
||||
}
|
||||
},
|
||||
$.widget( "livestreet.lsTalkUsers", $.livestreet.lsUserListAdd, {
|
||||
/**
|
||||
* Дефолтные опции
|
||||
*/
|
||||
options: {
|
||||
urls: {
|
||||
add: aRouter['talk'] + 'ajaxaddtalkuser/',
|
||||
inactivate: aRouter['talk'] + 'ajaxdeletetalkuser/'
|
||||
},
|
||||
selectors: {
|
||||
// Кнопка отключения пользователя от диалога
|
||||
item_inactivate: '.js-message-users-user-inactivate',
|
||||
// Кнопка повторного приглашения пользователя в диалог
|
||||
item_activate: '.js-message-users-user-activate'
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Конструктор
|
||||
*
|
||||
* @constructor
|
||||
* @private
|
||||
*/
|
||||
_create: function () {
|
||||
var _this = this;
|
||||
/**
|
||||
* Конструктор
|
||||
*
|
||||
* @constructor
|
||||
* @private
|
||||
*/
|
||||
_create: function () {
|
||||
var _this = this;
|
||||
|
||||
this._super();
|
||||
this._super();
|
||||
|
||||
// Отключение пользователя от диалога
|
||||
this.elements.list.on('click' + this.eventNamespace, this.options.selectors.item_inactivate, function (e) {
|
||||
_this.inactivate( $(this) );
|
||||
e.preventDefault();
|
||||
});
|
||||
// Отключение пользователя от диалога
|
||||
this.elements.list.on('click' + this.eventNamespace, this.options.selectors.item_inactivate, function (e) {
|
||||
_this.inactivate( $(this) );
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
// Повторное приглашение пользователя в диалог
|
||||
this.elements.list.on('click' + this.eventNamespace, this.options.selectors.item_activate, function (e) {
|
||||
_this.add( [ $(this).data('user-id') ] );
|
||||
e.preventDefault();
|
||||
});
|
||||
},
|
||||
// Повторное приглашение пользователя в диалог
|
||||
this.elements.list.on('click' + this.eventNamespace, this.options.selectors.item_activate, function (e) {
|
||||
_this.add( [ $(this).data('user-id') ] );
|
||||
e.preventDefault();
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Активирует пользователя при его повторном добавлении
|
||||
*/
|
||||
_onUserAdd: function ( user ) {
|
||||
this.userActivate( user.user_id );
|
||||
},
|
||||
/**
|
||||
* Активирует пользователя при его повторном добавлении
|
||||
*/
|
||||
_onUserAdd: function ( user ) {
|
||||
this.userActivate( user.user_id );
|
||||
},
|
||||
|
||||
/**
|
||||
* Повторное приглашение пользователя в диалог
|
||||
*/
|
||||
inactivate: function ( button ) {
|
||||
var userId = button.data( 'user-id' );
|
||||
/**
|
||||
* Повторное приглашение пользователя в диалог
|
||||
*/
|
||||
inactivate: function ( button ) {
|
||||
var userId = button.data( 'user-id' );
|
||||
|
||||
this._load( 'inactivate', { user_id: userId }, function( response ) {
|
||||
this.userInactivate( userId );
|
||||
this._load( 'inactivate', { user_id: userId }, function( response ) {
|
||||
this.userInactivate( userId );
|
||||
|
||||
this._trigger( "afterinactivate", null, { context: this, response: response } );
|
||||
});
|
||||
},
|
||||
this._trigger( "afterinactivate", null, { context: this, response: response } );
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Активирует пользователя при его повторном добавлении
|
||||
*/
|
||||
userActivate: function ( userId ) {
|
||||
this._getUserById( userId ).removeClass( 'inactive' );
|
||||
},
|
||||
/**
|
||||
* Активирует пользователя при его повторном добавлении
|
||||
*/
|
||||
userActivate: function ( userId ) {
|
||||
this._getUserById( userId ).removeClass( 'inactive' );
|
||||
},
|
||||
|
||||
/**
|
||||
* Отключения пользователя от диалога
|
||||
*/
|
||||
userInactivate: function ( userId ) {
|
||||
this._getUserById( userId ).addClass( 'inactive' );
|
||||
},
|
||||
});
|
||||
/**
|
||||
* Отключения пользователя от диалога
|
||||
*/
|
||||
userInactivate: function ( userId ) {
|
||||
this._getUserById( userId ).addClass( 'inactive' );
|
||||
},
|
||||
});
|
||||
})(jQuery);
|
|
@ -58,10 +58,10 @@
|
|||
</td>
|
||||
{/if}
|
||||
|
||||
{* Избранное *}
|
||||
<td class="cell-favourite">
|
||||
{component 'favourite' classes='js-favourite-talk' target=$talk}
|
||||
</td>
|
||||
{* Избранное *}
|
||||
<td class="cell-favourite">
|
||||
{component 'favourite' classes='js-favourite-talk' target=$talk}
|
||||
</td>
|
||||
|
||||
{* Основная информация о диалоге *}
|
||||
<td class="cell-info">
|
||||
|
|
|
@ -13,136 +13,136 @@
|
|||
*/
|
||||
|
||||
(function($) {
|
||||
"use strict";
|
||||
"use strict";
|
||||
|
||||
$.widget( "livestreet.lsToolbarTopics", {
|
||||
/**
|
||||
* Дефолтные опции
|
||||
*/
|
||||
options: {
|
||||
// Хоткеи
|
||||
keys: {
|
||||
// Комбинация клавиш для перехода к следующему объекту
|
||||
next: 'ctrl+shift+down',
|
||||
$.widget( "livestreet.lsToolbarTopics", {
|
||||
/**
|
||||
* Дефолтные опции
|
||||
*/
|
||||
options: {
|
||||
// Хоткеи
|
||||
keys: {
|
||||
// Комбинация клавиш для перехода к следующему объекту
|
||||
next: 'ctrl+shift+down',
|
||||
|
||||
// Комбинация клавиш для перехода к предыдущему объекту
|
||||
prev: 'ctrl+shift+up'
|
||||
},
|
||||
// Комбинация клавиш для перехода к предыдущему объекту
|
||||
prev: 'ctrl+shift+up'
|
||||
},
|
||||
|
||||
// Селекторы
|
||||
selectors: {
|
||||
// Кнопка прокрутки к следующему объекту
|
||||
next: '.js-toolbar-topics-next',
|
||||
// Селекторы
|
||||
selectors: {
|
||||
// Кнопка прокрутки к следующему объекту
|
||||
next: '.js-toolbar-topics-next',
|
||||
|
||||
// Кнопка прокрутки к предыдущему объекту
|
||||
prev: '.js-toolbar-topics-prev',
|
||||
// Кнопка прокрутки к предыдущему объекту
|
||||
prev: '.js-toolbar-topics-prev',
|
||||
|
||||
// Объект
|
||||
item: '.js-topic',
|
||||
// Объект
|
||||
item: '.js-topic',
|
||||
|
||||
// Пагинация
|
||||
pagination: '.js-pagination-topics'
|
||||
},
|
||||
// Пагинация
|
||||
pagination: '.js-pagination-topics'
|
||||
},
|
||||
|
||||
// Продолжительность прокрутки, мс
|
||||
duration: 500,
|
||||
// Продолжительность прокрутки, мс
|
||||
duration: 500,
|
||||
|
||||
// Параметр в хэше урл указывающий к какому объекту прокручивать
|
||||
// после загрузки страницы (first или last)
|
||||
param: 'gotopic'
|
||||
},
|
||||
// Параметр в хэше урл указывающий к какому объекту прокручивать
|
||||
// после загрузки страницы (first или last)
|
||||
param: 'gotopic'
|
||||
},
|
||||
|
||||
/**
|
||||
* Конструктор
|
||||
*
|
||||
* @constructor
|
||||
* @private
|
||||
*/
|
||||
_create: function () {
|
||||
// Элементы
|
||||
this.elements = {
|
||||
next: this.element.find(this.options.selectors.next),
|
||||
prev: this.element.find(this.options.selectors.prev),
|
||||
pagination: $(this.options.selectors.pagination).eq(0),
|
||||
items: $(this.options.selectors.item)
|
||||
};
|
||||
/**
|
||||
* Конструктор
|
||||
*
|
||||
* @constructor
|
||||
* @private
|
||||
*/
|
||||
_create: function () {
|
||||
// Элементы
|
||||
this.elements = {
|
||||
next: this.element.find(this.options.selectors.next),
|
||||
prev: this.element.find(this.options.selectors.prev),
|
||||
pagination: $(this.options.selectors.pagination).eq(0),
|
||||
items: $(this.options.selectors.item)
|
||||
};
|
||||
|
||||
// Текущий объект
|
||||
this.reset();
|
||||
// Текущий объект
|
||||
this.reset();
|
||||
|
||||
// Обработка параметров в хэше url'а
|
||||
this._checkUrl();
|
||||
// Обработка параметров в хэше url'а
|
||||
this._checkUrl();
|
||||
|
||||
//
|
||||
// События
|
||||
//
|
||||
//
|
||||
// События
|
||||
//
|
||||
|
||||
// Обработка нажатий по кнопкам след/пред
|
||||
this._on( this.elements.next, { 'click': this.next } );
|
||||
this._on( this.elements.prev, { 'click': this.prev } );
|
||||
// Обработка нажатий по кнопкам след/пред
|
||||
this._on( this.elements.next, { 'click': this.next } );
|
||||
this._on( this.elements.prev, { 'click': this.prev } );
|
||||
|
||||
// Обработка хоткеев
|
||||
this.document.bind( 'keydown' + this.eventNamespace, this.options.keys.next, this.next.bind(this) );
|
||||
this.document.bind( 'keydown' + this.eventNamespace, this.options.keys.prev, this.prev.bind(this) );
|
||||
},
|
||||
// Обработка хоткеев
|
||||
this.document.bind( 'keydown' + this.eventNamespace, this.options.keys.next, this.next.bind(this) );
|
||||
this.document.bind( 'keydown' + this.eventNamespace, this.options.keys.prev, this.prev.bind(this) );
|
||||
},
|
||||
|
||||
/**
|
||||
* Обработка параметров в хэше url'а
|
||||
*/
|
||||
_checkUrl: function () {
|
||||
// Проверяем наличие параметра options.param в хэше url'а
|
||||
var goto = new RegExp( this.option( 'param' ) + '=(last|first)', 'i' ).exec( location.hash );
|
||||
/**
|
||||
* Обработка параметров в хэше url'а
|
||||
*/
|
||||
_checkUrl: function () {
|
||||
// Проверяем наличие параметра options.param в хэше url'а
|
||||
var goto = new RegExp( this.option( 'param' ) + '=(last|first)', 'i' ).exec( location.hash );
|
||||
|
||||
if ( goto ) {
|
||||
// С помощью goto[1] получаем значение параметра options.param (first или last)
|
||||
var item = this.elements.items[ goto[1] ]();
|
||||
if ( goto ) {
|
||||
// С помощью goto[1] получаем значение параметра options.param (first или last)
|
||||
var item = this.elements.items[ goto[1] ]();
|
||||
|
||||
// Скроллим через небольшой промежуток времени,
|
||||
// чтобы страница успела прогрузиться
|
||||
setTimeout( this.scroll.bind(this, item), 500 );
|
||||
}
|
||||
},
|
||||
// Скроллим через небольшой промежуток времени,
|
||||
// чтобы страница успела прогрузиться
|
||||
setTimeout( this.scroll.bind(this, item), 500 );
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Переход к объекту
|
||||
*
|
||||
* @param {String} name Название функции
|
||||
*/
|
||||
_go: function ( name ) {
|
||||
// Получаем объект к которому нужно перейти
|
||||
var next = ! this.current ? this.elements.items.eq(0) : this.current[ name ]( this.options.selectors.item );
|
||||
/**
|
||||
* Переход к объекту
|
||||
*
|
||||
* @param {String} name Название функции
|
||||
*/
|
||||
_go: function ( name ) {
|
||||
// Получаем объект к которому нужно перейти
|
||||
var next = ! this.current ? this.elements.items.eq(0) : this.current[ name ]( this.options.selectors.item );
|
||||
|
||||
// Скроллим к след/пред объекту
|
||||
// Если на текущей странице больше нет объектов, переходим на другую
|
||||
next.length ? this.scroll( next ) : this.elements.pagination.lsPagination( name, true );
|
||||
},
|
||||
// Скроллим к след/пред объекту
|
||||
// Если на текущей странице больше нет объектов, переходим на другую
|
||||
next.length ? this.scroll( next ) : this.elements.pagination.lsPagination( name, true );
|
||||
},
|
||||
|
||||
/**
|
||||
* Переход к следующему объекту
|
||||
*/
|
||||
next: function () {
|
||||
this._go( 'next' );
|
||||
},
|
||||
/**
|
||||
* Переход к следующему объекту
|
||||
*/
|
||||
next: function () {
|
||||
this._go( 'next' );
|
||||
},
|
||||
|
||||
/**
|
||||
* Переход к предыдущему объекту
|
||||
*/
|
||||
prev: function () {
|
||||
this._go( 'prev' );
|
||||
},
|
||||
/**
|
||||
* Переход к предыдущему объекту
|
||||
*/
|
||||
prev: function () {
|
||||
this._go( 'prev' );
|
||||
},
|
||||
|
||||
/**
|
||||
* Скролл к текущему объекту
|
||||
*/
|
||||
scroll: function ( item ) {
|
||||
$.scrollTo( this.current = item, this.options.duration, { offset: 0 } );
|
||||
},
|
||||
/**
|
||||
* Скролл к текущему объекту
|
||||
*/
|
||||
scroll: function ( item ) {
|
||||
$.scrollTo( this.current = item, this.options.duration, { offset: 0 } );
|
||||
},
|
||||
|
||||
/**
|
||||
* Сброс текущего активного объекта
|
||||
*/
|
||||
reset: function () {
|
||||
this.current = null;
|
||||
}
|
||||
});
|
||||
/**
|
||||
* Сброс текущего активного объекта
|
||||
*/
|
||||
reset: function () {
|
||||
this.current = null;
|
||||
}
|
||||
});
|
||||
})(jQuery);
|
|
@ -9,81 +9,81 @@
|
|||
*/
|
||||
|
||||
(function($) {
|
||||
"use strict";
|
||||
"use strict";
|
||||
|
||||
$.widget( "livestreet.lsToolbarScrollUp", {
|
||||
/**
|
||||
* Дефолтные опции
|
||||
*/
|
||||
options: {
|
||||
// Продолжительность прокрутки, мс
|
||||
duration: 500
|
||||
},
|
||||
$.widget( "livestreet.lsToolbarScrollUp", {
|
||||
/**
|
||||
* Дефолтные опции
|
||||
*/
|
||||
options: {
|
||||
// Продолжительность прокрутки, мс
|
||||
duration: 500
|
||||
},
|
||||
|
||||
/**
|
||||
* Конструктор
|
||||
*
|
||||
* @constructor
|
||||
* @private
|
||||
*/
|
||||
_create: function () {
|
||||
this._on({ click: 'onClick' });
|
||||
this._on( this.window, { scroll: 'onScroll' } );
|
||||
},
|
||||
/**
|
||||
* Конструктор
|
||||
*
|
||||
* @constructor
|
||||
* @private
|
||||
*/
|
||||
_create: function () {
|
||||
this._on({ click: 'onClick' });
|
||||
this._on( this.window, { scroll: 'onScroll' } );
|
||||
},
|
||||
|
||||
/**
|
||||
* Показывает/скрывает кнопку прокрутки в зависимости от значения scrollTop
|
||||
*/
|
||||
onScroll: function() {
|
||||
if ( this.prev && this.isTop && this.window.scrollTop() > 0 ) {
|
||||
this.element.removeClass( ls.options.classes.states.active );
|
||||
this.isTop = false;
|
||||
this.prev = null;
|
||||
}
|
||||
/**
|
||||
* Показывает/скрывает кнопку прокрутки в зависимости от значения scrollTop
|
||||
*/
|
||||
onScroll: function() {
|
||||
if ( this.prev && this.isTop && this.window.scrollTop() > 0 ) {
|
||||
this.element.removeClass( ls.options.classes.states.active );
|
||||
this.isTop = false;
|
||||
this.prev = null;
|
||||
}
|
||||
|
||||
! this.prev && this.element[ this.window.scrollTop() > this.window.height() / 2 ? 'fadeIn' : 'fadeOut' ]( 500 );
|
||||
},
|
||||
! this.prev && this.element[ this.window.scrollTop() > this.window.height() / 2 ? 'fadeIn' : 'fadeOut' ]( 500 );
|
||||
},
|
||||
|
||||
/**
|
||||
* Обработка клика
|
||||
*/
|
||||
onClick: function() {
|
||||
// Не обрабатываем клики в процессе скролла
|
||||
! this.isScroll && this[ this.prev && this.isTop ? 'back' : 'up' ]();
|
||||
},
|
||||
/**
|
||||
* Обработка клика
|
||||
*/
|
||||
onClick: function() {
|
||||
// Не обрабатываем клики в процессе скролла
|
||||
! this.isScroll && this[ this.prev && this.isTop ? 'back' : 'up' ]();
|
||||
},
|
||||
|
||||
/**
|
||||
* Прокрутка вверх
|
||||
*/
|
||||
up: function() {
|
||||
this.prev = this.window.scrollTop();
|
||||
this.isScroll = true;
|
||||
/**
|
||||
* Прокрутка вверх
|
||||
*/
|
||||
up: function() {
|
||||
this.prev = this.window.scrollTop();
|
||||
this.isScroll = true;
|
||||
|
||||
$.scrollTo( 0, this.options.duration, {
|
||||
onAfter: function () {
|
||||
this.isTop = true;
|
||||
this.isScroll = false;
|
||||
this.element.addClass( ls.options.classes.states.active );
|
||||
}.bind(this)
|
||||
});
|
||||
},
|
||||
$.scrollTo( 0, this.options.duration, {
|
||||
onAfter: function () {
|
||||
this.isTop = true;
|
||||
this.isScroll = false;
|
||||
this.element.addClass( ls.options.classes.states.active );
|
||||
}.bind(this)
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Прокрутка к предыдущей позиции
|
||||
*/
|
||||
back: function() {
|
||||
if ( ! this.prev ) return;
|
||||
/**
|
||||
* Прокрутка к предыдущей позиции
|
||||
*/
|
||||
back: function() {
|
||||
if ( ! this.prev ) return;
|
||||
|
||||
this.isTop = false;
|
||||
this.isScroll = true;
|
||||
this.isTop = false;
|
||||
this.isScroll = true;
|
||||
|
||||
$.scrollTo( this.prev, this.options.duration, {
|
||||
onAfter: function () {
|
||||
this.element.removeClass( ls.options.classes.states.active );
|
||||
this.isScroll = false;
|
||||
this.prev = null;
|
||||
}.bind(this)
|
||||
});
|
||||
}
|
||||
});
|
||||
$.scrollTo( this.prev, this.options.duration, {
|
||||
onAfter: function () {
|
||||
this.element.removeClass( ls.options.classes.states.active );
|
||||
this.isScroll = false;
|
||||
this.prev = null;
|
||||
}.bind(this)
|
||||
});
|
||||
}
|
||||
});
|
||||
})(jQuery);
|
|
@ -9,13 +9,13 @@
|
|||
{$paging = $smarty.local.paging}
|
||||
|
||||
{if $topics}
|
||||
{add_block group='toolbar' name='component@toolbar-scrollnav.toolbar.scrollnav' show=count( $topics )}
|
||||
{add_block group='toolbar' name='component@toolbar-scrollnav.toolbar.scrollnav' show=count( $topics )}
|
||||
|
||||
{foreach $topics as $topic}
|
||||
{component 'topic' template='type' topic=$topic isList=true}
|
||||
{/foreach}
|
||||
{foreach $topics as $topic}
|
||||
{component 'topic' template='type' topic=$topic isList=true}
|
||||
{/foreach}
|
||||
|
||||
{component 'pagination' total=+$paging.iCountPage current=+$paging.iCurrentPage url="{$paging.sBaseUrl}/page__page__/{$paging.sGetParams}" classes='js-pagination-topics'}
|
||||
{component 'pagination' total=+$paging.iCountPage current=+$paging.iCurrentPage url="{$paging.sBaseUrl}/page__page__/{$paging.sGetParams}" classes='js-pagination-topics'}
|
||||
{else}
|
||||
{component 'blankslate' text=$aLang.common.empty}
|
||||
{component 'blankslate' text=$aLang.common.empty}
|
||||
{/if}
|
|
@ -7,13 +7,13 @@
|
|||
{$component = 'ls-topic-preview'}
|
||||
|
||||
<div class="{$component}" id="topic-text-preview">
|
||||
<header class="{$component}-header">
|
||||
<h3 class="{$component}-title">{$aLang.common.preview_text}</h3>
|
||||
</header>
|
||||
<header class="{$component}-header">
|
||||
<h3 class="{$component}-title">{$aLang.common.preview_text}</h3>
|
||||
</header>
|
||||
|
||||
<div class="{$component}-body js-topic-preview-content"></div>
|
||||
<div class="{$component}-body js-topic-preview-content"></div>
|
||||
|
||||
<footer class="{$component}-footer">
|
||||
<footer class="{$component}-footer">
|
||||
{component 'button' type='button' classes='js-topic-preview-text-hide-button' text=$aLang.common.cancel}
|
||||
</footer>
|
||||
</footer>
|
||||
</div>
|
|
@ -9,13 +9,13 @@
|
|||
{$type = $topic->getType()}
|
||||
|
||||
{if $LS->Topic_IsAllowTopicType( $type )}
|
||||
{$template = $LS->Component_GetTemplatePath('topic', "topic-type-{$type}" )}
|
||||
{$template = $LS->Component_GetTemplatePath('topic', "topic-type-{$type}" )}
|
||||
|
||||
{* Если для указанного типа существует шаблон, то подключаем его *}
|
||||
{* Иначе подключаем дефолтный шаблон топика *}
|
||||
{if ! $template}
|
||||
{$template = $LS->Component_GetTemplatePath('topic', 'topic')}
|
||||
{/if}
|
||||
{* Если для указанного типа существует шаблон, то подключаем его *}
|
||||
{* Иначе подключаем дефолтный шаблон топика *}
|
||||
{if ! $template}
|
||||
{$template = $LS->Component_GetTemplatePath('topic', 'topic')}
|
||||
{/if}
|
||||
|
||||
{include "$template" topic=$topic isList=$smarty.local.isList isPreview=$smarty.local.isPreview}
|
||||
{include "$template" topic=$topic isList=$smarty.local.isList isPreview=$smarty.local.isPreview}
|
||||
{/if}
|
|
@ -5,54 +5,54 @@
|
|||
{$component = 'user-friend'}
|
||||
|
||||
{block 'user_friend_options'}
|
||||
{$friendship = $smarty.local.friendship}
|
||||
{$tag = $smarty.local.tag|default:'li'}
|
||||
{$mods = $smarty.local.mods}
|
||||
{$attributes = $smarty.local.attributes}
|
||||
{$classes = $smarty.local.classes}
|
||||
{$userTarget = $smarty.local.userTarget}
|
||||
{$friendship = $smarty.local.friendship}
|
||||
{$tag = $smarty.local.tag|default:'li'}
|
||||
{$mods = $smarty.local.mods}
|
||||
{$attributes = $smarty.local.attributes}
|
||||
{$classes = $smarty.local.classes}
|
||||
{$userTarget = $smarty.local.userTarget}
|
||||
|
||||
{if $friendship}
|
||||
{$status = $friendship->getFriendStatus()}
|
||||
{$userCurrentId = $oUserCurrent->getId()}
|
||||
{$userToId = $friendship->getUserTo()}
|
||||
{if $friendship}
|
||||
{$status = $friendship->getFriendStatus()}
|
||||
{$userCurrentId = $oUserCurrent->getId()}
|
||||
{$userToId = $friendship->getUserTo()}
|
||||
|
||||
{* Добавлен *}
|
||||
{if $status == $USER_FRIEND_ACCEPT + $USER_FRIEND_OFFER || $status == $USER_FRIEND_ACCEPT + $USER_FRIEND_ACCEPT}
|
||||
{$status = 'added'}
|
||||
{* Добавлен *}
|
||||
{if $status == $USER_FRIEND_ACCEPT + $USER_FRIEND_OFFER || $status == $USER_FRIEND_ACCEPT + $USER_FRIEND_ACCEPT}
|
||||
{$status = 'added'}
|
||||
|
||||
{* Ожидает подтверждения *}
|
||||
{elseif ( $friendship->getStatusTo() == $USER_FRIEND_REJECT && $friendship->getStatusFrom() == $USER_FRIEND_OFFER && $userToId == $userCurrentId )
|
||||
|| ( $status == $USER_FRIEND_OFFER + $USER_FRIEND_NULL && $userCurrentId == $userToId )}
|
||||
{$status = 'pending'}
|
||||
{* Ожидает подтверждения *}
|
||||
{elseif ( $friendship->getStatusTo() == $USER_FRIEND_REJECT && $friendship->getStatusFrom() == $USER_FRIEND_OFFER && $userToId == $userCurrentId )
|
||||
|| ( $status == $USER_FRIEND_OFFER + $USER_FRIEND_NULL && $userCurrentId == $userToId )}
|
||||
{$status = 'pending'}
|
||||
|
||||
{* Приглашение отклонено *}
|
||||
{elseif $status == $USER_FRIEND_OFFER + $USER_FRIEND_REJECT && $userToId != $userCurrentId}
|
||||
{$status = 'rejected'}
|
||||
{* Приглашение отклонено *}
|
||||
{elseif $status == $USER_FRIEND_OFFER + $USER_FRIEND_REJECT && $userToId != $userCurrentId}
|
||||
{$status = 'rejected'}
|
||||
|
||||
{* Приглашение отправлено *}
|
||||
{elseif $status == $USER_FRIEND_OFFER + $USER_FRIEND_NULL && $userCurrentId == $friendship->getUserFrom()}
|
||||
{$status = 'sent'}
|
||||
{* Приглашение отправлено *}
|
||||
{elseif $status == $USER_FRIEND_OFFER + $USER_FRIEND_NULL && $userCurrentId == $friendship->getUserFrom()}
|
||||
{$status = 'sent'}
|
||||
|
||||
{* Текущий пользователь удалил из друзей target пользователя, *}
|
||||
{* но предложение target пользователя еще в силе *}
|
||||
{else}
|
||||
{$status = 'linked'}
|
||||
{/if}
|
||||
{* Текущий пользователь удалил из друзей target пользователя, *}
|
||||
{* но предложение target пользователя еще в силе *}
|
||||
{else}
|
||||
{$status = 'linked'}
|
||||
{/if}
|
||||
|
||||
{* Добавить в друзья *}
|
||||
{else}
|
||||
{$status = 'notfriends'}
|
||||
{/if}
|
||||
{* Добавить в друзья *}
|
||||
{else}
|
||||
{$status = 'notfriends'}
|
||||
{/if}
|
||||
{/block}
|
||||
|
||||
|
||||
<{$tag} class="{$component} {cmods name=$component mods=$mods} {$smarty.local.classes}" {cattr list=$smarty.local.attributes} data-status="{$status}" data-target="{$userTarget->getId()}">
|
||||
{block 'user_friend'}
|
||||
{if in_array( $status, [ 'sent', 'rejected' ] )}
|
||||
<span class="{$component}-text js-user-friend-text">{lang name="user.friends.status.{$status}"}</span>
|
||||
{else}
|
||||
<a href="#" class="{$component}-text js-user-friend-text">{lang name="user.friends.status.{$status}"}</a>
|
||||
{/if}
|
||||
{/block}
|
||||
{block 'user_friend'}
|
||||
{if in_array( $status, [ 'sent', 'rejected' ] )}
|
||||
<span class="{$component}-text js-user-friend-text">{lang name="user.friends.status.{$status}"}</span>
|
||||
{else}
|
||||
<a href="#" class="{$component}-text js-user-friend-text">{lang name="user.friends.status.{$status}"}</a>
|
||||
{/if}
|
||||
{/block}
|
||||
</{$tag}>
|
|
@ -26,17 +26,17 @@
|
|||
</a>
|
||||
|
||||
<div class="{$component}-user-body">
|
||||
<h2 class="{$component}-user-login" itemprop="nickname">
|
||||
<a href="{$user->getUserWebPath()}">
|
||||
{$user->getLogin()}
|
||||
</a>
|
||||
</h2>
|
||||
<h2 class="{$component}-user-login" itemprop="nickname">
|
||||
<a href="{$user->getUserWebPath()}">
|
||||
{$user->getLogin()}
|
||||
</a>
|
||||
</h2>
|
||||
|
||||
{if $user->getProfileName()}
|
||||
<p class="{$component}-user-name" itemprop="name">
|
||||
{$user->getProfileName()|escape}
|
||||
</p>
|
||||
{/if}
|
||||
{if $user->getProfileName()}
|
||||
<p class="{$component}-user-name" itemprop="name">
|
||||
{$user->getProfileName()|escape}
|
||||
</p>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -11,19 +11,19 @@
|
|||
{$items = $itemsHook|default:$smarty.local.items}
|
||||
|
||||
{if $smarty.local.html || $smarty.local.items}
|
||||
<div class="{$component} {cmods name=$component mods=$smarty.local.mods} {$smarty.local.classes}" {cattr list=$smarty.local.attributes}>
|
||||
<h3 class="user-info-group-title">
|
||||
{$smarty.local.title}
|
||||
</h3>
|
||||
<div class="{$component} {cmods name=$component mods=$smarty.local.mods} {$smarty.local.classes}" {cattr list=$smarty.local.attributes}>
|
||||
<h3 class="user-info-group-title">
|
||||
{$smarty.local.title}
|
||||
</h3>
|
||||
|
||||
<div class="user-info-group-content">
|
||||
{if $smarty.local.html}
|
||||
{$smarty.local.html}
|
||||
{else}
|
||||
{component 'info-list' list=$smarty.local.items classes='user-info-group-items'}
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
<div class="user-info-group-content">
|
||||
{if $smarty.local.html}
|
||||
{$smarty.local.html}
|
||||
{else}
|
||||
{component 'info-list' list=$smarty.local.items classes='user-info-group-items'}
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{hook run="{$component}-{$smarty.local.name}-after"}
|
|
@ -22,13 +22,13 @@
|
|||
* О себе
|
||||
*}
|
||||
{if $user->getProfileAbout()}
|
||||
{capture 'user_info_about'}
|
||||
<div class="ls-text">
|
||||
{$user->getProfileAbout()}
|
||||
</div>
|
||||
{/capture}
|
||||
{capture 'user_info_about'}
|
||||
<div class="ls-text">
|
||||
{$user->getProfileAbout()}
|
||||
</div>
|
||||
{/capture}
|
||||
|
||||
{component 'user' template='info-group' title={lang name='user.profile.about.title'} html=$smarty.capture.user_info_about}
|
||||
{component 'user' template='info-group' title={lang name='user.profile.about.title'} html=$smarty.capture.user_info_about}
|
||||
{/if}
|
||||
|
||||
|
||||
|
@ -40,38 +40,38 @@
|
|||
|
||||
{* Пол *}
|
||||
{if $user->getProfileSex() != 'other'}
|
||||
{$items[] = [
|
||||
'label' => {lang name='user.profile.personal.gender'},
|
||||
'content' => "{if $user->getProfileSex() == 'man'}{lang name='user.profile.personal.gender_male'}{else}{lang name='user.profile.personal.gender_female'}{/if}"
|
||||
]}
|
||||
{$items[] = [
|
||||
'label' => {lang name='user.profile.personal.gender'},
|
||||
'content' => "{if $user->getProfileSex() == 'man'}{lang name='user.profile.personal.gender_male'}{else}{lang name='user.profile.personal.gender_female'}{/if}"
|
||||
]}
|
||||
{/if}
|
||||
|
||||
{* День рождения *}
|
||||
{if $user->getProfileBirthday()}
|
||||
{$items[] = [
|
||||
'label' => {lang name='user.profile.personal.birthday'},
|
||||
'content' => {date_format date=$user->getProfileBirthday() format="j F Y" notz=true}
|
||||
]}
|
||||
{$items[] = [
|
||||
'label' => {lang name='user.profile.personal.birthday'},
|
||||
'content' => {date_format date=$user->getProfileBirthday() format="j F Y" notz=true}
|
||||
]}
|
||||
{/if}
|
||||
|
||||
{* Местоположение *}
|
||||
{if $geoTarget}
|
||||
{capture 'info_private_geo'}
|
||||
<span itemprop="address" itemscope itemtype="http://data-vocabulary.org/Address">
|
||||
{if $geoTarget->getCountryId()}
|
||||
<a href="{router page='people'}country/{$geoTarget->getCountryId()}/" itemprop="country-name">{$user->getProfileCountry()|escape}</a>{if $geoTarget->getCityId()},{/if}
|
||||
{/if}
|
||||
{capture 'info_private_geo'}
|
||||
<span itemprop="address" itemscope itemtype="http://data-vocabulary.org/Address">
|
||||
{if $geoTarget->getCountryId()}
|
||||
<a href="{router page='people'}country/{$geoTarget->getCountryId()}/" itemprop="country-name">{$user->getProfileCountry()|escape}</a>{if $geoTarget->getCityId()},{/if}
|
||||
{/if}
|
||||
|
||||
{if $geoTarget->getCityId()}
|
||||
<a href="{router page='people'}city/{$geoTarget->getCityId()}/" itemprop="locality">{$user->getProfileCity()|escape}</a>
|
||||
{/if}
|
||||
</span>
|
||||
{/capture}
|
||||
{if $geoTarget->getCityId()}
|
||||
<a href="{router page='people'}city/{$geoTarget->getCityId()}/" itemprop="locality">{$user->getProfileCity()|escape}</a>
|
||||
{/if}
|
||||
</span>
|
||||
{/capture}
|
||||
|
||||
{$items[] = [
|
||||
'label' => {lang name='user.profile.personal.place'},
|
||||
'content' => $smarty.capture.info_private_geo
|
||||
]}
|
||||
{$items[] = [
|
||||
'label' => {lang name='user.profile.personal.place'},
|
||||
'content' => $smarty.capture.info_private_geo
|
||||
]}
|
||||
{/if}
|
||||
|
||||
{component 'user' template='info-group' title={lang name='user.profile.personal.title'} items=$items}
|
||||
|
@ -84,10 +84,10 @@
|
|||
{$userfields = $user->getUserFieldValues(true, array('contact'))}
|
||||
|
||||
{foreach $userfields as $field}
|
||||
{$items[] = [
|
||||
'label' => $field->getTitle()|escape,
|
||||
'content' => $field->getValue(true, true)
|
||||
]}
|
||||
{$items[] = [
|
||||
'label' => $field->getTitle()|escape,
|
||||
'content' => $field->getValue(true, true)
|
||||
]}
|
||||
{/foreach}
|
||||
|
||||
{component 'user' template='info-group' name='contact' title={lang name='user.profile.contact'} items=$items}
|
||||
|
@ -100,10 +100,10 @@
|
|||
{$userfields = $user->getUserFieldValues(true, array('social'))}
|
||||
|
||||
{foreach $userfields as $field}
|
||||
{$items[] = [
|
||||
'label' => $field->getTitle()|escape,
|
||||
'content' => $field->getValue(true, true)
|
||||
]}
|
||||
{$items[] = [
|
||||
'label' => $field->getTitle()|escape,
|
||||
'content' => $field->getValue(true, true)
|
||||
]}
|
||||
{/foreach}
|
||||
|
||||
{component 'user' template='info-group' name='social-networks' title={lang name='user.profile.social_networks'} items=$items}
|
||||
|
@ -117,97 +117,97 @@
|
|||
|
||||
{* Кто пригласил пользователя *}
|
||||
{if $smarty.local.invitedByUser}
|
||||
{$items[] = [
|
||||
'label' => {lang name='user.profile.activity.invited_by'},
|
||||
'content' => "<a href=\"{$invitedByUser->getUserWebPath()}\">{$invitedByUser->getDisplayName()}</a>"
|
||||
]}
|
||||
{$items[] = [
|
||||
'label' => {lang name='user.profile.activity.invited_by'},
|
||||
'content' => "<a href=\"{$invitedByUser->getUserWebPath()}\">{$invitedByUser->getDisplayName()}</a>"
|
||||
]}
|
||||
{/if}
|
||||
|
||||
{* Приглашенные пользователем *}
|
||||
{if $smarty.local.usersInvited}
|
||||
{$users = ''}
|
||||
{$users = ''}
|
||||
|
||||
{foreach $smarty.local.usersInvited as $userInvited}
|
||||
{$users = $users|cat:"<a href=\"{$userInvited->getUserWebPath()}\">{$userInvited->getDisplayName()}</a> "}
|
||||
{/foreach}
|
||||
{foreach $smarty.local.usersInvited as $userInvited}
|
||||
{$users = $users|cat:"<a href=\"{$userInvited->getUserWebPath()}\">{$userInvited->getDisplayName()}</a> "}
|
||||
{/foreach}
|
||||
|
||||
{$items[] = [
|
||||
'label' => {lang name='user.profile.activity.invited'},
|
||||
'content' => $users
|
||||
]}
|
||||
{$items[] = [
|
||||
'label' => {lang name='user.profile.activity.invited'},
|
||||
'content' => $users
|
||||
]}
|
||||
{/if}
|
||||
|
||||
{* Блоги созданные пользователем *}
|
||||
{if $smarty.local.blogsCreated}
|
||||
{$blogs = ''}
|
||||
{$blogs = ''}
|
||||
|
||||
{foreach $smarty.local.blogsCreated as $blog}
|
||||
{$blogs = $blogs|cat:"<a href=\"{$blog->getUrlFull()}\">{$blog->getTitle()|escape}</a>{if ! $blog@last}, {/if}"}
|
||||
{/foreach}
|
||||
{foreach $smarty.local.blogsCreated as $blog}
|
||||
{$blogs = $blogs|cat:"<a href=\"{$blog->getUrlFull()}\">{$blog->getTitle()|escape}</a>{if ! $blog@last}, {/if}"}
|
||||
{/foreach}
|
||||
|
||||
{$items[] = [
|
||||
'label' => {lang name='user.profile.activity.blogs_created'},
|
||||
'content' => $blogs
|
||||
]}
|
||||
{$items[] = [
|
||||
'label' => {lang name='user.profile.activity.blogs_created'},
|
||||
'content' => $blogs
|
||||
]}
|
||||
{/if}
|
||||
|
||||
{* Блоги администрируемые пользователем *}
|
||||
{if $smarty.local.blogsAdminister}
|
||||
{$blogs = ''}
|
||||
{$blogs = ''}
|
||||
|
||||
{foreach $smarty.local.blogsAdminister as $blogUser}
|
||||
{$blog = $blogUser->getBlog()}
|
||||
{$blogs = $blogs|cat:"<a href=\"{$blog->getUrlFull()}\">{$blog->getTitle()|escape}</a>{if ! $blogUser@last}, {/if}"}
|
||||
{/foreach}
|
||||
{foreach $smarty.local.blogsAdminister as $blogUser}
|
||||
{$blog = $blogUser->getBlog()}
|
||||
{$blogs = $blogs|cat:"<a href=\"{$blog->getUrlFull()}\">{$blog->getTitle()|escape}</a>{if ! $blogUser@last}, {/if}"}
|
||||
{/foreach}
|
||||
|
||||
{$items[] = [
|
||||
'label' => {lang name='user.profile.activity.blogs_admin'},
|
||||
'content' => $blogs
|
||||
]}
|
||||
{$items[] = [
|
||||
'label' => {lang name='user.profile.activity.blogs_admin'},
|
||||
'content' => $blogs
|
||||
]}
|
||||
{/if}
|
||||
|
||||
{* Блоги модерируемые пользователем *}
|
||||
{if $smarty.local.blogsModerate}
|
||||
{$blogs = ''}
|
||||
{$blogs = ''}
|
||||
|
||||
{foreach $smarty.local.blogsModerate as $blogUser}
|
||||
{$blog = $blogUser->getBlog()}
|
||||
{$blogs = $blogs|cat:"<a href=\"{$blog->getUrlFull()}\">{$blog->getTitle()|escape}</a>{if ! $blogUser@last}, {/if}"}
|
||||
{/foreach}
|
||||
{foreach $smarty.local.blogsModerate as $blogUser}
|
||||
{$blog = $blogUser->getBlog()}
|
||||
{$blogs = $blogs|cat:"<a href=\"{$blog->getUrlFull()}\">{$blog->getTitle()|escape}</a>{if ! $blogUser@last}, {/if}"}
|
||||
{/foreach}
|
||||
|
||||
{$items[] = [
|
||||
'label' => {lang name='user.profile.activity.blogs_mod'},
|
||||
'content' => $blogs
|
||||
]}
|
||||
{$items[] = [
|
||||
'label' => {lang name='user.profile.activity.blogs_mod'},
|
||||
'content' => $blogs
|
||||
]}
|
||||
{/if}
|
||||
|
||||
{* Блоги в которые вступил пользователь *}
|
||||
{if $smarty.local.blogsJoined}
|
||||
{$blogs = ''}
|
||||
{$blogs = ''}
|
||||
|
||||
{foreach $smarty.local.blogsJoined as $blogUser}
|
||||
{$blog = $blogUser->getBlog()}
|
||||
{$blogs = $blogs|cat:"<a href=\"{$blog->getUrlFull()}\">{$blog->getTitle()|escape}</a>{if ! $blogUser@last}, {/if}"}
|
||||
{/foreach}
|
||||
{foreach $smarty.local.blogsJoined as $blogUser}
|
||||
{$blog = $blogUser->getBlog()}
|
||||
{$blogs = $blogs|cat:"<a href=\"{$blog->getUrlFull()}\">{$blog->getTitle()|escape}</a>{if ! $blogUser@last}, {/if}"}
|
||||
{/foreach}
|
||||
|
||||
{$items[] = [
|
||||
'label' => {lang name='user.profile.activity.blogs_joined'},
|
||||
'content' => $blogs
|
||||
]}
|
||||
{$items[] = [
|
||||
'label' => {lang name='user.profile.activity.blogs_joined'},
|
||||
'content' => $blogs
|
||||
]}
|
||||
{/if}
|
||||
|
||||
{* Дата регистрации *}
|
||||
{$items[] = [
|
||||
'label' => {lang name='user.date_registration'},
|
||||
'content' => {date_format date=$user->getDateRegister()}
|
||||
'label' => {lang name='user.date_registration'},
|
||||
'content' => {date_format date=$user->getDateRegister()}
|
||||
]}
|
||||
|
||||
{* Дата последнего визита *}
|
||||
{if $session}
|
||||
{$items[] = [
|
||||
'label' => {lang name='user.date_last_session'},
|
||||
'content' => {date_format date=$session->getDateLast()}
|
||||
]}
|
||||
{$items[] = [
|
||||
'label' => {lang name='user.date_last_session'},
|
||||
'content' => {date_format date=$session->getDateLast()}
|
||||
]}
|
||||
{/if}
|
||||
|
||||
{component 'user' template='info-group' name='activity' title={lang name='user.profile.activity.title'} items=$items}
|
||||
|
@ -216,23 +216,23 @@
|
|||
* Друзья
|
||||
*}
|
||||
{if $smarty.local.friends}
|
||||
{capture 'user_info_friends'}
|
||||
{component 'user' template='avatar-list' users=$smarty.local.friends}
|
||||
{/capture}
|
||||
{capture 'user_info_friends'}
|
||||
{component 'user' template='avatar-list' users=$smarty.local.friends}
|
||||
{/capture}
|
||||
|
||||
{component 'user' template='info-group'
|
||||
title = "<a href=\"{$user->getUserWebPath()}friends/\">{$aLang.user.friends.title}</a> ({$iCountFriendsUser})"
|
||||
html = $smarty.capture.user_info_friends}
|
||||
{component 'user' template='info-group'
|
||||
title = "<a href=\"{$user->getUserWebPath()}friends/\">{$aLang.user.friends.title}</a> ({$iCountFriendsUser})"
|
||||
html = $smarty.capture.user_info_friends}
|
||||
{/if}
|
||||
|
||||
{**
|
||||
* Стена
|
||||
*}
|
||||
{capture 'user_info_wall'}
|
||||
{insert name='block' block='wall' params=[
|
||||
'classes' => 'js-wall-default',
|
||||
'user_id' => $user->getId()
|
||||
]}
|
||||
{insert name='block' block='wall' params=[
|
||||
'classes' => 'js-wall-default',
|
||||
'user_id' => $user->getId()
|
||||
]}
|
||||
{/capture}
|
||||
|
||||
{component 'user' template='info-group' name='wall' title={lang name='wall.title'} html=$smarty.capture.user_info_wall}
|
||||
|
|
|
@ -9,72 +9,72 @@
|
|||
*/
|
||||
|
||||
(function($) {
|
||||
"use strict";
|
||||
"use strict";
|
||||
|
||||
$.widget( "livestreet.lsUserFollow", $.livestreet.lsComponent, {
|
||||
/**
|
||||
* Дефолтные опции
|
||||
*/
|
||||
options: {
|
||||
// Ссылки
|
||||
urls: {
|
||||
// Подписаться
|
||||
follow: null,
|
||||
$.widget( "livestreet.lsUserFollow", $.livestreet.lsComponent, {
|
||||
/**
|
||||
* Дефолтные опции
|
||||
*/
|
||||
options: {
|
||||
// Ссылки
|
||||
urls: {
|
||||
// Подписаться
|
||||
follow: null,
|
||||
|
||||
// Отписаться
|
||||
unfollow: null
|
||||
},
|
||||
classes: {
|
||||
active: 'active'
|
||||
},
|
||||
params: {}
|
||||
},
|
||||
// Отписаться
|
||||
unfollow: null
|
||||
},
|
||||
classes: {
|
||||
active: 'active'
|
||||
},
|
||||
params: {}
|
||||
},
|
||||
|
||||
/**
|
||||
* Конструктор
|
||||
*
|
||||
* @constructor
|
||||
* @private
|
||||
*/
|
||||
_create: function () {
|
||||
this._super();
|
||||
this._on({ click: 'onClick' });
|
||||
},
|
||||
/**
|
||||
* Конструктор
|
||||
*
|
||||
* @constructor
|
||||
* @private
|
||||
*/
|
||||
_create: function () {
|
||||
this._super();
|
||||
this._on({ click: 'onClick' });
|
||||
},
|
||||
|
||||
/**
|
||||
* Коллбэк вызываемый при клике на кнопку подписки
|
||||
*/
|
||||
onClick: function( event ) {
|
||||
this[ this.element.hasClass( ls.options.classes.states.active ) ? 'unfollow' : 'follow' ]();
|
||||
event.preventDefault();
|
||||
},
|
||||
/**
|
||||
* Коллбэк вызываемый при клике на кнопку подписки
|
||||
*/
|
||||
onClick: function( event ) {
|
||||
this[ this.element.hasClass( ls.options.classes.states.active ) ? 'unfollow' : 'follow' ]();
|
||||
event.preventDefault();
|
||||
},
|
||||
|
||||
/**
|
||||
* Подписаться
|
||||
*/
|
||||
follow: function() {
|
||||
this._load( 'follow', { users: [ this.element.data('login') ] }, 'onFollow' );
|
||||
},
|
||||
/**
|
||||
* Подписаться
|
||||
*/
|
||||
follow: function() {
|
||||
this._load( 'follow', { users: [ this.element.data('login') ] }, 'onFollow' );
|
||||
},
|
||||
|
||||
/**
|
||||
* Коллбэк вызываемый при подписке
|
||||
*/
|
||||
onFollow: function( response ) {
|
||||
this._addClass( 'active' ).text( ls.lang.get('user.actions.unfollow') );
|
||||
},
|
||||
/**
|
||||
* Коллбэк вызываемый при подписке
|
||||
*/
|
||||
onFollow: function( response ) {
|
||||
this._addClass( 'active' ).text( ls.lang.get('user.actions.unfollow') );
|
||||
},
|
||||
|
||||
/**
|
||||
* Отписаться
|
||||
*/
|
||||
unfollow: function() {
|
||||
this._load( 'unfollow', { user_id: this.element.data('id') }, 'onUnfollow' );
|
||||
},
|
||||
/**
|
||||
* Отписаться
|
||||
*/
|
||||
unfollow: function() {
|
||||
this._load( 'unfollow', { user_id: this.element.data('id') }, 'onUnfollow' );
|
||||
},
|
||||
|
||||
/**
|
||||
* Коллбэк вызываемый при отписке
|
||||
*/
|
||||
onUnfollow: function( response ) {
|
||||
this._removeClass( 'active' ).text( ls.lang.get('user.actions.follow') );
|
||||
}
|
||||
});
|
||||
/**
|
||||
* Коллбэк вызываемый при отписке
|
||||
*/
|
||||
onUnfollow: function( response ) {
|
||||
this._removeClass( 'active' ).text( ls.lang.get('user.actions.follow') );
|
||||
}
|
||||
});
|
||||
})(jQuery);
|
|
@ -9,148 +9,148 @@
|
|||
*/
|
||||
|
||||
(function($) {
|
||||
"use strict";
|
||||
"use strict";
|
||||
|
||||
$.widget( "livestreet.lsUserFriend", $.livestreet.lsComponent, {
|
||||
/**
|
||||
* Дефолтные опции
|
||||
*/
|
||||
options: {
|
||||
// Ссылки
|
||||
urls: {
|
||||
// Добавить в друзья
|
||||
add: null,
|
||||
$.widget( "livestreet.lsUserFriend", $.livestreet.lsComponent, {
|
||||
/**
|
||||
* Дефолтные опции
|
||||
*/
|
||||
options: {
|
||||
// Ссылки
|
||||
urls: {
|
||||
// Добавить в друзья
|
||||
add: null,
|
||||
|
||||
// Удалить из друзей
|
||||
remove: null,
|
||||
// Удалить из друзей
|
||||
remove: null,
|
||||
|
||||
// Подтвердить
|
||||
accept: null,
|
||||
// Подтвердить
|
||||
accept: null,
|
||||
|
||||
// Модальное окно с формой добавления
|
||||
modal: null
|
||||
},
|
||||
selectors: {
|
||||
form: '.js-user-friend-form',
|
||||
text: '.js-user-friend-text'
|
||||
},
|
||||
// Модальное окно с формой добавления
|
||||
modal: null
|
||||
},
|
||||
selectors: {
|
||||
form: '.js-user-friend-form',
|
||||
text: '.js-user-friend-text'
|
||||
},
|
||||
|
||||
params: {}
|
||||
},
|
||||
params: {}
|
||||
},
|
||||
|
||||
/**
|
||||
* Конструктор
|
||||
*
|
||||
* @constructor
|
||||
* @private
|
||||
*/
|
||||
_create: function () {
|
||||
this._super();
|
||||
/**
|
||||
* Конструктор
|
||||
*
|
||||
* @constructor
|
||||
* @private
|
||||
*/
|
||||
_create: function () {
|
||||
this._super();
|
||||
|
||||
this.target = this.element.data( 'target' );
|
||||
this.target = this.element.data( 'target' );
|
||||
|
||||
this._on({ click: 'onClick' });
|
||||
},
|
||||
this._on({ click: 'onClick' });
|
||||
},
|
||||
|
||||
/**
|
||||
* Коллбэк вызываемый при клике на кнопку добавления в друзья
|
||||
*/
|
||||
onClick: function( event ) {
|
||||
var status = this.getStatus();
|
||||
/**
|
||||
* Коллбэк вызываемый при клике на кнопку добавления в друзья
|
||||
*/
|
||||
onClick: function( event ) {
|
||||
var status = this.getStatus();
|
||||
|
||||
if ( status == 'notfriends' ) {
|
||||
this.showForm();
|
||||
} else if ( status == 'pending' ) {
|
||||
this.accept();
|
||||
} else if ( status == 'added' ) {
|
||||
this.remove();
|
||||
} else if ( status == 'linked' ) {
|
||||
this.addLinked();
|
||||
}
|
||||
if ( status == 'notfriends' ) {
|
||||
this.showForm();
|
||||
} else if ( status == 'pending' ) {
|
||||
this.accept();
|
||||
} else if ( status == 'added' ) {
|
||||
this.remove();
|
||||
} else if ( status == 'linked' ) {
|
||||
this.addLinked();
|
||||
}
|
||||
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
},
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
},
|
||||
|
||||
/**
|
||||
* Получение статуса
|
||||
*/
|
||||
getStatus: function() {
|
||||
return this.element.attr( 'data-status' );
|
||||
},
|
||||
/**
|
||||
* Получение статуса
|
||||
*/
|
||||
getStatus: function() {
|
||||
return this.element.attr( 'data-status' );
|
||||
},
|
||||
|
||||
/**
|
||||
* Установка статуса
|
||||
*/
|
||||
setStatus: function( status ) {
|
||||
var textElement = this.element.find( this.option( 'selectors.text' ) ),
|
||||
textClass = this.option( 'selectors.text' ).slice( 1 );
|
||||
/**
|
||||
* Установка статуса
|
||||
*/
|
||||
setStatus: function( status ) {
|
||||
var textElement = this.element.find( this.option( 'selectors.text' ) ),
|
||||
textClass = this.option( 'selectors.text' ).slice( 1 );
|
||||
|
||||
if ( ~ [ 'sent', 'rejected' ].indexOf( status ) ) {
|
||||
textElement.replaceWith( '<span class="' + textClass + '">' + ls.lang.get( 'user.friends.status.' + status ) + '</span>' );
|
||||
} else {
|
||||
textElement.replaceWith( '<a href="#" class="' + textClass + '">' + ls.lang.get( 'user.friends.status.' + status ) + '</a>' );
|
||||
}
|
||||
if ( ~ [ 'sent', 'rejected' ].indexOf( status ) ) {
|
||||
textElement.replaceWith( '<span class="' + textClass + '">' + ls.lang.get( 'user.friends.status.' + status ) + '</span>' );
|
||||
} else {
|
||||
textElement.replaceWith( '<a href="#" class="' + textClass + '">' + ls.lang.get( 'user.friends.status.' + status ) + '</a>' );
|
||||
}
|
||||
|
||||
this.element.attr( 'data-status', status );
|
||||
},
|
||||
this.element.attr( 'data-status', status );
|
||||
},
|
||||
|
||||
/**
|
||||
* Показывает форму
|
||||
*/
|
||||
showForm: function() {
|
||||
var _this = this;
|
||||
/**
|
||||
* Показывает форму
|
||||
*/
|
||||
showForm: function() {
|
||||
var _this = this;
|
||||
|
||||
ls.modal.load( this.option( 'urls.modal' ), { target: this.target }, {
|
||||
aftershow: function( e, modal ) {
|
||||
var form = modal.element.find( _this.option( 'selectors.form' ) ),
|
||||
textarea = form.find( _this.option( 'selectors.text' ) );
|
||||
ls.modal.load( this.option( 'urls.modal' ), { target: this.target }, {
|
||||
aftershow: function( e, modal ) {
|
||||
var form = modal.element.find( _this.option( 'selectors.form' ) ),
|
||||
textarea = form.find( _this.option( 'selectors.text' ) );
|
||||
|
||||
textarea.focus();
|
||||
textarea.focus();
|
||||
|
||||
form.on( 'submit', function ( event ) {
|
||||
var text = textarea.val();
|
||||
form.on( 'submit', function ( event ) {
|
||||
var text = textarea.val();
|
||||
|
||||
ls.utils.formLock( form );
|
||||
ls.utils.formLock( form );
|
||||
|
||||
_this._load( 'add', { idUser: _this.target, userText: text }, function( response ) {
|
||||
modal.hide();
|
||||
_this.setStatus( 'sent' );
|
||||
}, {
|
||||
onResponse: function () {
|
||||
ls.utils.formUnlock( form );
|
||||
}
|
||||
});
|
||||
_this._load( 'add', { idUser: _this.target, userText: text }, function( response ) {
|
||||
modal.hide();
|
||||
_this.setStatus( 'sent' );
|
||||
}, {
|
||||
onResponse: function () {
|
||||
ls.utils.formUnlock( form );
|
||||
}
|
||||
});
|
||||
|
||||
event.preventDefault();
|
||||
}.bind(this))
|
||||
}
|
||||
});
|
||||
},
|
||||
event.preventDefault();
|
||||
}.bind(this))
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Повторное подтверждение
|
||||
*/
|
||||
addLinked: function() {
|
||||
this.accept( 'add' );
|
||||
},
|
||||
/**
|
||||
* Повторное подтверждение
|
||||
*/
|
||||
addLinked: function() {
|
||||
this.accept( 'add' );
|
||||
},
|
||||
|
||||
/**
|
||||
* Подтверждение
|
||||
*/
|
||||
accept: function( url ) {
|
||||
this._load( url || 'accept', { idUser: this.target }, function( response ) {
|
||||
this.setStatus( 'added' );
|
||||
});
|
||||
},
|
||||
/**
|
||||
* Подтверждение
|
||||
*/
|
||||
accept: function( url ) {
|
||||
this._load( url || 'accept', { idUser: this.target }, function( response ) {
|
||||
this.setStatus( 'added' );
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Удаление из друзей
|
||||
*/
|
||||
remove: function() {
|
||||
this._load( 'remove', { idUser: this.target }, function( response ) {
|
||||
this.setStatus( 'linked' );
|
||||
});
|
||||
}
|
||||
});
|
||||
/**
|
||||
* Удаление из друзей
|
||||
*/
|
||||
remove: function() {
|
||||
this._load( 'remove', { idUser: this.target }, function( response ) {
|
||||
this.setStatus( 'linked' );
|
||||
});
|
||||
}
|
||||
});
|
||||
})(jQuery);
|
|
@ -11,11 +11,11 @@
|
|||
var ls = ls || {};
|
||||
|
||||
ls.user = (function ($) {
|
||||
"use strict";
|
||||
"use strict";
|
||||
|
||||
this.init = function () {
|
||||
return;
|
||||
};
|
||||
this.init = function () {
|
||||
return;
|
||||
};
|
||||
|
||||
return this;
|
||||
return this;
|
||||
}).call(ls.user || {}, jQuery);
|
|
@ -5,5 +5,5 @@
|
|||
*}
|
||||
|
||||
{foreach $smarty.local.users as $user}
|
||||
{component 'user' template='list-item' user=$user}
|
||||
{component 'user' template='list-item' user=$user}
|
||||
{/foreach}
|
|
@ -3,12 +3,12 @@
|
|||
*}
|
||||
|
||||
{component 'nav' name='user' activeItem=$sMenuProfileItemSelect mods='stacked' classes='user-nav' hookParams=[ 'oUserProfile' => $oUserProfile ] items=[
|
||||
[ 'name' => 'whois', 'text' => {lang name='user.profile.nav.info'}, 'url' => "{$oUserProfile->getUserWebPath()}" ],
|
||||
[ 'name' => 'wall', 'text' => {lang name='user.profile.nav.wall'}, 'url' => "{$oUserProfile->getUserWebPath()}wall/", 'count' => $iCountWallUser ],
|
||||
[ 'name' => 'created', 'text' => {lang name='user.profile.nav.publications'}, 'url' => "{$oUserProfile->getUserWebPath()}created/topics/", 'count' => $iCountCreated ],
|
||||
[ 'name' => 'favourites', 'text' => {lang name='user.profile.nav.favourite'}, 'url' => "{$oUserProfile->getUserWebPath()}favourites/topics/", 'count' => $iCountFavourite ],
|
||||
[ 'name' => 'friends', 'text' => {lang name='user.profile.nav.friends'}, 'url' => "{$oUserProfile->getUserWebPath()}friends/", 'count' => $iCountFriendsUser ],
|
||||
[ 'name' => 'activity', 'text' => {lang name='user.profile.nav.activity'}, 'url' => "{$oUserProfile->getUserWebPath()}stream/" ],
|
||||
[ 'name' => 'talk', 'text' => {lang name='user.profile.nav.messages'}, 'url' => "{router page='talk'}", 'count' => $iUserCurrentCountTalkNew, 'is_enabled' => $oUserCurrent && $oUserCurrent->getId() == $oUserProfile->getId() ],
|
||||
[ 'name' => 'settings', 'text' => {lang name='user.profile.nav.settings'}, 'url' => "{router page='settings'}", 'is_enabled' => $oUserCurrent && $oUserCurrent->getId() == $oUserProfile->getId() ]
|
||||
[ 'name' => 'whois', 'text' => {lang name='user.profile.nav.info'}, 'url' => "{$oUserProfile->getUserWebPath()}" ],
|
||||
[ 'name' => 'wall', 'text' => {lang name='user.profile.nav.wall'}, 'url' => "{$oUserProfile->getUserWebPath()}wall/", 'count' => $iCountWallUser ],
|
||||
[ 'name' => 'created', 'text' => {lang name='user.profile.nav.publications'}, 'url' => "{$oUserProfile->getUserWebPath()}created/topics/", 'count' => $iCountCreated ],
|
||||
[ 'name' => 'favourites', 'text' => {lang name='user.profile.nav.favourite'}, 'url' => "{$oUserProfile->getUserWebPath()}favourites/topics/", 'count' => $iCountFavourite ],
|
||||
[ 'name' => 'friends', 'text' => {lang name='user.profile.nav.friends'}, 'url' => "{$oUserProfile->getUserWebPath()}friends/", 'count' => $iCountFriendsUser ],
|
||||
[ 'name' => 'activity', 'text' => {lang name='user.profile.nav.activity'}, 'url' => "{$oUserProfile->getUserWebPath()}stream/" ],
|
||||
[ 'name' => 'talk', 'text' => {lang name='user.profile.nav.messages'}, 'url' => "{router page='talk'}", 'count' => $iUserCurrentCountTalkNew, 'is_enabled' => $oUserCurrent && $oUserCurrent->getId() == $oUserProfile->getId() ],
|
||||
[ 'name' => 'settings', 'text' => {lang name='user.profile.nav.settings'}, 'url' => "{router page='settings'}", 'is_enabled' => $oUserCurrent && $oUserCurrent->getId() == $oUserProfile->getId() ]
|
||||
]}
|
|
@ -10,20 +10,20 @@
|
|||
{* @hook Начало формы с настройками аккаунта *}
|
||||
{hook run='user_settings_account_begin'}
|
||||
|
||||
<fieldset>
|
||||
<legend>{lang name='user.settings.account.account'}</legend>
|
||||
<fieldset>
|
||||
<legend>{lang name='user.settings.account.account'}</legend>
|
||||
|
||||
{* E-mail *}
|
||||
{component 'field' template='email'
|
||||
value = $user->getMail()
|
||||
note = {lang name='user.settings.account.fields.email.note'}}
|
||||
</fieldset>
|
||||
</fieldset>
|
||||
|
||||
|
||||
<fieldset>
|
||||
<legend>{lang name='user.settings.account.password'}</legend>
|
||||
<fieldset>
|
||||
<legend>{lang name='user.settings.account.password'}</legend>
|
||||
|
||||
<p class="text-info">{lang name='user.settings.account.password_note'}</p>
|
||||
<p class="text-info">{lang name='user.settings.account.password_note'}</p>
|
||||
|
||||
{* Текущий пароль *}
|
||||
{component 'field' template='text'
|
||||
|
@ -47,10 +47,10 @@
|
|||
type = 'password'
|
||||
inputClasses = 'width-200'
|
||||
label = {lang name='user.settings.account.fields.password_confirm.label'}}
|
||||
</fieldset>
|
||||
</fieldset>
|
||||
|
||||
{* @hook Конец формы с настройками аккаунта *}
|
||||
{hook run='user_settings_account_end'}
|
||||
{hook run='user_settings_account_end'}
|
||||
|
||||
{* Скрытые поля *}
|
||||
{component 'field' template='hidden.security-key'}
|
||||
|
|
|
@ -3,51 +3,51 @@
|
|||
*}
|
||||
|
||||
<div class="note mb-20">
|
||||
{lang name='user.settings.invites.note'}
|
||||
{lang name='user.settings.invites.note'}
|
||||
</div>
|
||||
|
||||
{* @hook Начало формы с настройками инвайтов *}
|
||||
{hook run='user_settings_invite_begin'}
|
||||
|
||||
<p>
|
||||
{if Config::Get('general.reg.invite')}
|
||||
{lang name='user.settings.invites.available'}:
|
||||
<strong>
|
||||
{if $oUserCurrent->isAdministrator()}
|
||||
{lang name='user.settings.invites.many'}
|
||||
{else}
|
||||
{$iCountInviteAvailable}
|
||||
{/if}
|
||||
</strong>
|
||||
{else}
|
||||
{if $sReferralLink}
|
||||
{lang name='user.settings.invites.referral_link'}:<br/>
|
||||
<strong>{$sReferralLink|escape}</strong>
|
||||
{/if}
|
||||
{if Config::Get('general.reg.invite')}
|
||||
{lang name='user.settings.invites.available'}:
|
||||
<strong>
|
||||
{if $oUserCurrent->isAdministrator()}
|
||||
{lang name='user.settings.invites.many'}
|
||||
{else}
|
||||
{$iCountInviteAvailable}
|
||||
{/if}
|
||||
</strong>
|
||||
{else}
|
||||
{if $sReferralLink}
|
||||
{lang name='user.settings.invites.referral_link'}:<br/>
|
||||
<strong>{$sReferralLink|escape}</strong>
|
||||
{/if}
|
||||
|
||||
{/if}
|
||||
<br />
|
||||
{/if}
|
||||
<br />
|
||||
|
||||
{lang name='user.settings.invites.used'}: <strong>{($iCountInviteUsed) ? $iCountInviteUsed : {lang name='user.settings.invites.used_empty'}}</strong>
|
||||
{lang name='user.settings.invites.used'}: <strong>{($iCountInviteUsed) ? $iCountInviteUsed : {lang name='user.settings.invites.used_empty'}}</strong>
|
||||
</p>
|
||||
|
||||
<form action="" method="POST" enctype="multipart/form-data">
|
||||
{hook run='form_settings_invite_begin'}
|
||||
{hook run='form_settings_invite_begin'}
|
||||
|
||||
{* E-mail *}
|
||||
{component 'field' template='text'
|
||||
name = 'invite_mail'
|
||||
placeholder = 'e-mail'
|
||||
note = {lang name='user.settings.invites.fields.email.note'}
|
||||
label = {lang name='user.settings.invites.fields.email.label'}}
|
||||
{* E-mail *}
|
||||
{component 'field' template='text'
|
||||
name = 'invite_mail'
|
||||
placeholder = 'e-mail'
|
||||
note = {lang name='user.settings.invites.fields.email.note'}
|
||||
label = {lang name='user.settings.invites.fields.email.label'}}
|
||||
|
||||
{hook run='form_settings_invite_end'}
|
||||
{hook run='form_settings_invite_end'}
|
||||
|
||||
{* Скрытые поля *}
|
||||
{component 'field' template='hidden.security-key'}
|
||||
{* Скрытые поля *}
|
||||
{component 'field' template='hidden.security-key'}
|
||||
|
||||
{* Кнопки *}
|
||||
{component 'button' mods='primary' text={lang name='user.settings.invites.fields.submit.text'}}
|
||||
{* Кнопки *}
|
||||
{component 'button' mods='primary' text={lang name='user.settings.invites.fields.submit.text'}}
|
||||
</form>
|
||||
|
||||
{* @hook Конец формы с настройками инвайтов *}
|
||||
|
|
|
@ -6,50 +6,50 @@
|
|||
{hook run='user_settings_tuning_begin'}
|
||||
|
||||
<form action="{router page='settings'}tuning/" method="POST" enctype="multipart/form-data">
|
||||
{hook run='form_settings_tuning_begin'}
|
||||
{hook run='form_settings_tuning_begin'}
|
||||
|
||||
{component 'field' template='hidden.security-key'}
|
||||
{component 'field' template='hidden.security-key'}
|
||||
|
||||
<fieldset>
|
||||
<legend>{lang name='user.settings.tuning.email_notices'}</legend>
|
||||
<fieldset>
|
||||
<legend>{lang name='user.settings.tuning.email_notices'}</legend>
|
||||
|
||||
<div class="ls-field-checkbox-group">
|
||||
{component 'field' template='checkbox'
|
||||
name = 'settings_notice_new_topic'
|
||||
checked = $oUserCurrent->getSettingsNoticeNewTopic() != 0
|
||||
noMargin = true
|
||||
label = {lang name='user.settings.tuning.fields.new_topic'}}
|
||||
<div class="ls-field-checkbox-group">
|
||||
{component 'field' template='checkbox'
|
||||
name = 'settings_notice_new_topic'
|
||||
checked = $oUserCurrent->getSettingsNoticeNewTopic() != 0
|
||||
noMargin = true
|
||||
label = {lang name='user.settings.tuning.fields.new_topic'}}
|
||||
|
||||
{component 'field' template='checkbox'
|
||||
name = 'settings_notice_new_comment'
|
||||
checked = $oUserCurrent->getSettingsNoticeNewComment() != 0
|
||||
noMargin = true
|
||||
label = {lang name='user.settings.tuning.fields.new_comment'}}
|
||||
{component 'field' template='checkbox'
|
||||
name = 'settings_notice_new_comment'
|
||||
checked = $oUserCurrent->getSettingsNoticeNewComment() != 0
|
||||
noMargin = true
|
||||
label = {lang name='user.settings.tuning.fields.new_comment'}}
|
||||
|
||||
{component 'field' template='checkbox'
|
||||
name = 'settings_notice_new_talk'
|
||||
checked = $oUserCurrent->getSettingsNoticeNewTalk() != 0
|
||||
noMargin = true
|
||||
label = {lang name='user.settings.tuning.fields.new_talk'}}
|
||||
{component 'field' template='checkbox'
|
||||
name = 'settings_notice_new_talk'
|
||||
checked = $oUserCurrent->getSettingsNoticeNewTalk() != 0
|
||||
noMargin = true
|
||||
label = {lang name='user.settings.tuning.fields.new_talk'}}
|
||||
|
||||
{component 'field' template='checkbox'
|
||||
name = 'settings_notice_reply_comment'
|
||||
checked = $oUserCurrent->getSettingsNoticeReplyComment() != 0
|
||||
noMargin = true
|
||||
label = {lang name='user.settings.tuning.fields.reply_comment'}}
|
||||
{component 'field' template='checkbox'
|
||||
name = 'settings_notice_reply_comment'
|
||||
checked = $oUserCurrent->getSettingsNoticeReplyComment() != 0
|
||||
noMargin = true
|
||||
label = {lang name='user.settings.tuning.fields.reply_comment'}}
|
||||
|
||||
{component 'field' template='checkbox'
|
||||
name = 'settings_notice_new_friend'
|
||||
checked = $oUserCurrent->getSettingsNoticeNewFriend() != 0
|
||||
noMargin = true
|
||||
label = {lang name='user.settings.tuning.fields.new_friend'}}
|
||||
</div>
|
||||
</fieldset>
|
||||
{component 'field' template='checkbox'
|
||||
name = 'settings_notice_new_friend'
|
||||
checked = $oUserCurrent->getSettingsNoticeNewFriend() != 0
|
||||
noMargin = true
|
||||
label = {lang name='user.settings.tuning.fields.new_friend'}}
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<legend>{lang name='user.settings.tuning.general'}</legend>
|
||||
<fieldset>
|
||||
<legend>{lang name='user.settings.tuning.general'}</legend>
|
||||
|
||||
{foreach $aTimezoneList as $timezone}
|
||||
{foreach $aTimezoneList as $timezone}
|
||||
{$timezoneLang=$aLang.date.timezones[ $timezone ]}
|
||||
{if $timezoneLang}
|
||||
{$timezones[] = [
|
||||
|
@ -57,14 +57,14 @@
|
|||
'text' => $timezoneLang
|
||||
]}
|
||||
{/if}
|
||||
{/foreach}
|
||||
{/foreach}
|
||||
|
||||
{component 'field' template='select'
|
||||
name = 'settings_general_timezone'
|
||||
label = {lang name='user.settings.tuning.fields.timezone.label'}
|
||||
items = $timezones
|
||||
selectedValue = $_aRequest.settings_general_timezone}
|
||||
</fieldset>
|
||||
{component 'field' template='select'
|
||||
name = 'settings_general_timezone'
|
||||
label = {lang name='user.settings.tuning.fields.timezone.label'}
|
||||
items = $timezones
|
||||
selectedValue = $_aRequest.settings_general_timezone}
|
||||
</fieldset>
|
||||
|
||||
{* @hook Конец формы с настройками уведомлений *}
|
||||
{hook run='user_settings_tuning_end'}
|
||||
|
|
|
@ -16,33 +16,33 @@
|
|||
|
||||
{* Заголовок *}
|
||||
{if $smarty.local.title}
|
||||
<h3 class="user-list-small-title">{$smarty.local.title}</h3>
|
||||
<h3 class="user-list-small-title">{$smarty.local.title}</h3>
|
||||
{/if}
|
||||
|
||||
{* Уведомление о пустом списке *}
|
||||
{if ! $users || $smarty.local.hideableEmptyAlert}
|
||||
{component 'blankslate'
|
||||
text = $aLang.common.empty
|
||||
classes = 'js-user-list-small-empty'
|
||||
visible = ! $users}
|
||||
{component 'blankslate'
|
||||
text = $aLang.common.empty
|
||||
classes = 'js-user-list-small-empty'
|
||||
visible = ! $users}
|
||||
{/if}
|
||||
|
||||
{* Список пользователей *}
|
||||
{if $users || ! $smarty.local.show|default:true}
|
||||
<ul class="user-list-small js-user-list-small {$classes}" {if ! $smarty.local.show|default:true}style="display: none"{/if}>
|
||||
{foreach $users as $user}
|
||||
{$userContainer = $user}
|
||||
<ul class="user-list-small js-user-list-small {$classes}" {if ! $smarty.local.show|default:true}style="display: none"{/if}>
|
||||
{foreach $users as $user}
|
||||
{$userContainer = $user}
|
||||
|
||||
{if $user->getUser()}
|
||||
{$user = $user->getUser()}
|
||||
{/if}
|
||||
{if $user->getUser()}
|
||||
{$user = $user->getUser()}
|
||||
{/if}
|
||||
|
||||
{if ! $smarty.local.exclude || ! in_array( $user->getId(), $smarty.local.exclude )}
|
||||
{block 'user_list_small_item'}
|
||||
{*include $itemTemplate|default:'./user-list-small-item.tpl' showRemove=! $excludeRemove || ! in_array( $user->getId(), $aUserListSmallExcludeRemove )*}
|
||||
{component 'user' template='list-small-item' user=$user selectable=$smarty.local.selectable}
|
||||
{/block}
|
||||
{/if}
|
||||
{/foreach}
|
||||
</ul>
|
||||
{if ! $smarty.local.exclude || ! in_array( $user->getId(), $smarty.local.exclude )}
|
||||
{block 'user_list_small_item'}
|
||||
{*include $itemTemplate|default:'./user-list-small-item.tpl' showRemove=! $excludeRemove || ! in_array( $user->getId(), $aUserListSmallExcludeRemove )*}
|
||||
{component 'user' template='list-small-item' user=$user selectable=$smarty.local.selectable}
|
||||
{/block}
|
||||
{/if}
|
||||
{/foreach}
|
||||
</ul>
|
||||
{/if}
|
|
@ -9,10 +9,10 @@
|
|||
{$target = $smarty.local.target}
|
||||
|
||||
<ul class="{$component}">
|
||||
<li>{component 'icon' icon='plus' mods='white'} {$target->getCountVoteUp()}</li>
|
||||
<li>{component 'icon' icon='minus' mods='white'} {$target->getCountVoteDown()}</li>
|
||||
<li>{component 'icon' icon='eye' mods='white'} {$target->getCountVoteAbstain()}</li>
|
||||
<li>{component 'icon' icon='asterisk' mods='white'} {$target->getCountVote()}</li>
|
||||
<li>{component 'icon' icon='plus' mods='white'} {$target->getCountVoteUp()}</li>
|
||||
<li>{component 'icon' icon='minus' mods='white'} {$target->getCountVoteDown()}</li>
|
||||
<li>{component 'icon' icon='eye' mods='white'} {$target->getCountVoteAbstain()}</li>
|
||||
<li>{component 'icon' icon='asterisk' mods='white'} {$target->getCountVote()}</li>
|
||||
|
||||
{hook run='topic_show_vote_stats' topic=$target}
|
||||
{hook run='topic_show_vote_stats' topic=$target}
|
||||
</ul>
|
|
@ -9,103 +9,103 @@
|
|||
*/
|
||||
|
||||
(function($) {
|
||||
"use strict";
|
||||
"use strict";
|
||||
|
||||
$.widget( "livestreet.lsWallEntry", $.livestreet.lsComponent, {
|
||||
/**
|
||||
* Дефолтные опции
|
||||
*/
|
||||
options: {
|
||||
wall: null,
|
||||
$.widget( "livestreet.lsWallEntry", $.livestreet.lsComponent, {
|
||||
/**
|
||||
* Дефолтные опции
|
||||
*/
|
||||
options: {
|
||||
wall: null,
|
||||
|
||||
// Ссылки
|
||||
urls: {
|
||||
remove: null
|
||||
},
|
||||
// Ссылки
|
||||
urls: {
|
||||
remove: null
|
||||
},
|
||||
|
||||
// Селекторы
|
||||
selectors: {
|
||||
remove: '.js-comment-remove',
|
||||
reply: '.js-comment-reply'
|
||||
},
|
||||
// Селекторы
|
||||
selectors: {
|
||||
remove: '.js-comment-remove',
|
||||
reply: '.js-comment-reply'
|
||||
},
|
||||
|
||||
params: {}
|
||||
},
|
||||
params: {}
|
||||
},
|
||||
|
||||
/**
|
||||
* Конструктор
|
||||
*
|
||||
* @constructor
|
||||
* @private
|
||||
*/
|
||||
_create: function () {
|
||||
this._super();
|
||||
/**
|
||||
* Конструктор
|
||||
*
|
||||
* @constructor
|
||||
* @private
|
||||
*/
|
||||
_create: function () {
|
||||
this._super();
|
||||
|
||||
// ID поста
|
||||
this.id = this.element.data( 'id' );
|
||||
// ID поста
|
||||
this.id = this.element.data( 'id' );
|
||||
|
||||
// Тип записи (комментарий/пост)
|
||||
this.type = this.element.data( 'type' );
|
||||
// Тип записи (комментарий/пост)
|
||||
this.type = this.element.data( 'type' );
|
||||
|
||||
// Форма добавления комментария к текущему посту
|
||||
this.form = this.getType() === 'post' ? this.option( 'wall' ).lsWall( 'getFormById', this.id ) : null;
|
||||
// Форма добавления комментария к текущему посту
|
||||
this.form = this.getType() === 'post' ? this.option( 'wall' ).lsWall( 'getFormById', this.id ) : null;
|
||||
|
||||
//
|
||||
// События
|
||||
//
|
||||
//
|
||||
// События
|
||||
//
|
||||
|
||||
// Удаление
|
||||
this._on( this.elements.remove, {
|
||||
click: function( event ) {
|
||||
this.remove();
|
||||
event.preventDefault();
|
||||
}
|
||||
});
|
||||
// Удаление
|
||||
this._on( this.elements.remove, {
|
||||
click: function( event ) {
|
||||
this.remove();
|
||||
event.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
// Показать/скрыть форму ответа
|
||||
this._on( this.elements.reply, {
|
||||
click: function( event ) {
|
||||
this.formToggle();
|
||||
event.preventDefault();
|
||||
}
|
||||
});
|
||||
},
|
||||
// Показать/скрыть форму ответа
|
||||
this._on( this.elements.reply, {
|
||||
click: function( event ) {
|
||||
this.formToggle();
|
||||
event.preventDefault();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Показать/скрыть форму ответа
|
||||
*/
|
||||
formToggle: function() {
|
||||
this.form.lsWallForm( 'toggle' );
|
||||
},
|
||||
/**
|
||||
* Показать/скрыть форму ответа
|
||||
*/
|
||||
formToggle: function() {
|
||||
this.form.lsWallForm( 'toggle' );
|
||||
},
|
||||
|
||||
/**
|
||||
* Возвращает тип записи (комментарий/пост)
|
||||
*
|
||||
* @return {String} Тип записи (комментарий/пост)
|
||||
*/
|
||||
getType: function() {
|
||||
return this.type;
|
||||
},
|
||||
/**
|
||||
* Возвращает тип записи (комментарий/пост)
|
||||
*
|
||||
* @return {String} Тип записи (комментарий/пост)
|
||||
*/
|
||||
getType: function() {
|
||||
return this.type;
|
||||
},
|
||||
|
||||
/**
|
||||
* Удаление
|
||||
*/
|
||||
remove: function() {
|
||||
this._load( 'remove', { user_id: this.option( 'wall' ).lsWall( 'getUserId' ), id: this.id }, 'onRemove' );
|
||||
},
|
||||
/**
|
||||
* Удаление
|
||||
*/
|
||||
remove: function() {
|
||||
this._load( 'remove', { user_id: this.option( 'wall' ).lsWall( 'getUserId' ), id: this.id }, 'onRemove' );
|
||||
},
|
||||
|
||||
/**
|
||||
* Коллбэк вызываемый после удаления
|
||||
*/
|
||||
onRemove: function( response ) {
|
||||
this.element.fadeOut( 'slow', function() {
|
||||
this.element.remove();
|
||||
this.option( 'wall' ).lsWall( 'checkEmpty' );
|
||||
}.bind(this));
|
||||
/**
|
||||
* Коллбэк вызываемый после удаления
|
||||
*/
|
||||
onRemove: function( response ) {
|
||||
this.element.fadeOut( 'slow', function() {
|
||||
this.element.remove();
|
||||
this.option( 'wall' ).lsWall( 'checkEmpty' );
|
||||
}.bind(this));
|
||||
|
||||
this.option( 'wall' ).lsWall( 'getCommentWrapperById', this.id ).fadeOut( 'slow', function () {
|
||||
$( this ).remove();
|
||||
});
|
||||
}
|
||||
});
|
||||
this.option( 'wall' ).lsWall( 'getCommentWrapperById', this.id ).fadeOut( 'slow', function () {
|
||||
$( this ).remove();
|
||||
});
|
||||
}
|
||||
});
|
||||
})(jQuery);
|
|
@ -9,139 +9,139 @@
|
|||
*/
|
||||
|
||||
(function($) {
|
||||
"use strict";
|
||||
"use strict";
|
||||
|
||||
$.widget( "livestreet.lsWallForm", {
|
||||
/**
|
||||
* Дефолтные опции
|
||||
*/
|
||||
options: {
|
||||
wall: null,
|
||||
$.widget( "livestreet.lsWallForm", {
|
||||
/**
|
||||
* Дефолтные опции
|
||||
*/
|
||||
options: {
|
||||
wall: null,
|
||||
|
||||
// Ссылки
|
||||
urls: {
|
||||
add: null
|
||||
},
|
||||
// Ссылки
|
||||
urls: {
|
||||
add: null
|
||||
},
|
||||
|
||||
// Селекторы
|
||||
selectors: {
|
||||
text: '.js-wall-form-text',
|
||||
button_submit: '.js-wall-form-submit'
|
||||
}
|
||||
},
|
||||
// Селекторы
|
||||
selectors: {
|
||||
text: '.js-wall-form-text',
|
||||
button_submit: '.js-wall-form-submit'
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Конструктор
|
||||
*
|
||||
* @constructor
|
||||
* @private
|
||||
*/
|
||||
_create: function () {
|
||||
var _this = this;
|
||||
/**
|
||||
* Конструктор
|
||||
*
|
||||
* @constructor
|
||||
* @private
|
||||
*/
|
||||
_create: function () {
|
||||
var _this = this;
|
||||
|
||||
// Элементы
|
||||
this.elements = {
|
||||
text: this.element.find( this.option( 'selectors.text' ) ),
|
||||
submit: this.element.find( this.option( 'selectors.submit' ) )
|
||||
};
|
||||
// Элементы
|
||||
this.elements = {
|
||||
text: this.element.find( this.option( 'selectors.text' ) ),
|
||||
submit: this.element.find( this.option( 'selectors.submit' ) )
|
||||
};
|
||||
|
||||
// ID поста
|
||||
this.id = this.element.data( 'id' );
|
||||
// ID поста
|
||||
this.id = this.element.data( 'id' );
|
||||
|
||||
// Кнопка "Ответить" в посте
|
||||
this.reply = this.option( 'wall' ).lsWall( 'getEntryById', this.id ).lsWallEntry( 'getElement', 'reply' );
|
||||
// Кнопка "Ответить" в посте
|
||||
this.reply = this.option( 'wall' ).lsWall( 'getEntryById', this.id ).lsWallEntry( 'getElement', 'reply' );
|
||||
|
||||
// Отправка формы
|
||||
this._on({ submit: this.submit });
|
||||
this.elements.text.on( 'keydown' + this.eventNamespace, null, 'ctrl+return', this.submit.bind( this ) );
|
||||
// Отправка формы
|
||||
this._on({ submit: this.submit });
|
||||
this.elements.text.on( 'keydown' + this.eventNamespace, null, 'ctrl+return', this.submit.bind( this ) );
|
||||
|
||||
// Разворачивание формы
|
||||
this._on( this.elements.text, { click: this.open } );
|
||||
// Разворачивание формы
|
||||
this._on( this.elements.text, { click: this.open } );
|
||||
|
||||
// Сворачиваем открытые формы
|
||||
// при клике вне формы или кнопки Ответить
|
||||
this.document.on( 'mouseup' + this.eventNamespace, function( e ) {
|
||||
if ( e.which == 1 &&
|
||||
this.isOpened() &&
|
||||
! this.element.is( e.target ) &&
|
||||
( ! this.reply || ( this.reply && ! this.reply.is( e.target ) ) ) &&
|
||||
this.element.has( e.target ).length === 0 &&
|
||||
! this.elements.text.val() ) {
|
||||
// Сворачиваем открытые формы
|
||||
// при клике вне формы или кнопки Ответить
|
||||
this.document.on( 'mouseup' + this.eventNamespace, function( e ) {
|
||||
if ( e.which == 1 &&
|
||||
this.isOpened() &&
|
||||
! this.element.is( e.target ) &&
|
||||
( ! this.reply || ( this.reply && ! this.reply.is( e.target ) ) ) &&
|
||||
this.element.has( e.target ).length === 0 &&
|
||||
! this.elements.text.val() ) {
|
||||
|
||||
// Сворачиваем форму если у поста формы есть комментарии или если форма корневая
|
||||
if ( this.option( 'wall' ).lsWall( 'getCommentsByPostId', this.id ).length || this.id === 0 ) {
|
||||
this.close();
|
||||
}
|
||||
// Если у поста нет комментариев то скрываем форму
|
||||
else {
|
||||
this.hide();
|
||||
}
|
||||
}
|
||||
}.bind( this ));
|
||||
},
|
||||
// Сворачиваем форму если у поста формы есть комментарии или если форма корневая
|
||||
if ( this.option( 'wall' ).lsWall( 'getCommentsByPostId', this.id ).length || this.id === 0 ) {
|
||||
this.close();
|
||||
}
|
||||
// Если у поста нет комментариев то скрываем форму
|
||||
else {
|
||||
this.hide();
|
||||
}
|
||||
}
|
||||
}.bind( this ));
|
||||
},
|
||||
|
||||
/**
|
||||
* Отправка формы
|
||||
*/
|
||||
submit: function( event ) {
|
||||
var text = this.elements.text.val();
|
||||
/**
|
||||
* Отправка формы
|
||||
*/
|
||||
submit: function( event ) {
|
||||
var text = this.elements.text.val();
|
||||
|
||||
ls.utils.formLock( this.element );
|
||||
this.option( 'wall' ).lsWall( 'add', this.id, text );
|
||||
ls.utils.formLock( this.element );
|
||||
this.option( 'wall' ).lsWall( 'add', this.id, text );
|
||||
|
||||
event.preventDefault();
|
||||
},
|
||||
event.preventDefault();
|
||||
},
|
||||
|
||||
/**
|
||||
* Разворачивает форму
|
||||
*/
|
||||
open: function() {
|
||||
this.element.addClass( ls.options.classes.states.open );
|
||||
},
|
||||
/**
|
||||
* Разворачивает форму
|
||||
*/
|
||||
open: function() {
|
||||
this.element.addClass( ls.options.classes.states.open );
|
||||
},
|
||||
|
||||
/**
|
||||
* Сворачивает форму
|
||||
*/
|
||||
close: function() {
|
||||
this.element.removeClass( ls.options.classes.states.open );
|
||||
this.elements.text.val('');
|
||||
},
|
||||
/**
|
||||
* Сворачивает форму
|
||||
*/
|
||||
close: function() {
|
||||
this.element.removeClass( ls.options.classes.states.open );
|
||||
this.elements.text.val('');
|
||||
},
|
||||
|
||||
/**
|
||||
* Показать форму
|
||||
*/
|
||||
show: function() {
|
||||
this.element.show();
|
||||
this.open();
|
||||
this.elements.text.focus();
|
||||
},
|
||||
/**
|
||||
* Показать форму
|
||||
*/
|
||||
show: function() {
|
||||
this.element.show();
|
||||
this.open();
|
||||
this.elements.text.focus();
|
||||
},
|
||||
|
||||
/**
|
||||
* Скрыть форму
|
||||
*/
|
||||
hide: function() {
|
||||
this.element.hide();
|
||||
},
|
||||
/**
|
||||
* Скрыть форму
|
||||
*/
|
||||
hide: function() {
|
||||
this.element.hide();
|
||||
},
|
||||
|
||||
/**
|
||||
* Развернута форма или нет
|
||||
*/
|
||||
isOpened: function() {
|
||||
return this.element.hasClass( ls.options.classes.states.open );
|
||||
},
|
||||
/**
|
||||
* Развернута форма или нет
|
||||
*/
|
||||
isOpened: function() {
|
||||
return this.element.hasClass( ls.options.classes.states.open );
|
||||
},
|
||||
|
||||
/**
|
||||
* Сворачивает/разворачивает форму
|
||||
*/
|
||||
expandToggle: function() {
|
||||
this[ this.isOpened() ? 'close' : 'open' ]();
|
||||
},
|
||||
/**
|
||||
* Сворачивает/разворачивает форму
|
||||
*/
|
||||
expandToggle: function() {
|
||||
this[ this.isOpened() ? 'close' : 'open' ]();
|
||||
},
|
||||
|
||||
/**
|
||||
* Показывает/скрывает форму комментирования
|
||||
*/
|
||||
toggle: function() {
|
||||
this[ this.element.is( ':visible' ) ? 'hide' : 'show' ]();
|
||||
}
|
||||
});
|
||||
/**
|
||||
* Показывает/скрывает форму комментирования
|
||||
*/
|
||||
toggle: function() {
|
||||
this[ this.element.is( ':visible' ) ? 'hide' : 'show' ]();
|
||||
}
|
||||
});
|
||||
})(jQuery);
|
|
@ -9,184 +9,184 @@
|
|||
*/
|
||||
|
||||
(function($) {
|
||||
"use strict";
|
||||
"use strict";
|
||||
|
||||
$.widget( "livestreet.lsWall", $.livestreet.lsComponent, {
|
||||
/**
|
||||
* Дефолтные опции
|
||||
*/
|
||||
options: {
|
||||
// Ссылки
|
||||
urls: {
|
||||
add: null,
|
||||
remove: null,
|
||||
load: null,
|
||||
load_comments: null
|
||||
},
|
||||
$.widget( "livestreet.lsWall", $.livestreet.lsComponent, {
|
||||
/**
|
||||
* Дефолтные опции
|
||||
*/
|
||||
options: {
|
||||
// Ссылки
|
||||
urls: {
|
||||
add: null,
|
||||
remove: null,
|
||||
load: null,
|
||||
load_comments: null
|
||||
},
|
||||
|
||||
// Селекторы
|
||||
selectors: {
|
||||
entry: '.js-wall-entry',
|
||||
comment: '.js-wall-comment',
|
||||
post: '.js-wall-post',
|
||||
form: '.js-wall-form',
|
||||
more: '.js-wall-more',
|
||||
more_comments: '.js-wall-more-comments',
|
||||
comment_wrapper: '.js-wall-comment-wrapper',
|
||||
container: '.js-wall-entry-container',
|
||||
empty: '.js-wall-alert-empty'
|
||||
},
|
||||
// Селекторы
|
||||
selectors: {
|
||||
entry: '.js-wall-entry',
|
||||
comment: '.js-wall-comment',
|
||||
post: '.js-wall-post',
|
||||
form: '.js-wall-form',
|
||||
more: '.js-wall-more',
|
||||
more_comments: '.js-wall-more-comments',
|
||||
comment_wrapper: '.js-wall-comment-wrapper',
|
||||
container: '.js-wall-entry-container',
|
||||
empty: '.js-wall-alert-empty'
|
||||
},
|
||||
|
||||
params: {}
|
||||
},
|
||||
params: {}
|
||||
},
|
||||
|
||||
/**
|
||||
* Конструктор
|
||||
*
|
||||
* @constructor
|
||||
* @private
|
||||
*/
|
||||
_create: function () {
|
||||
this._super();
|
||||
/**
|
||||
* Конструктор
|
||||
*
|
||||
* @constructor
|
||||
* @private
|
||||
*/
|
||||
_create: function () {
|
||||
this._super();
|
||||
|
||||
var _this = this;
|
||||
var _this = this;
|
||||
|
||||
this.userId = this.getUserId();
|
||||
this.userId = this.getUserId();
|
||||
|
||||
// Подгрузка новых постов
|
||||
this.elements.more.lsMore({
|
||||
urls: {
|
||||
load: this.option( 'urls.load' )
|
||||
},
|
||||
proxy: [ 'last_id' ],
|
||||
params: {
|
||||
user_id: this.getUserId()
|
||||
}
|
||||
});
|
||||
// Подгрузка новых постов
|
||||
this.elements.more.lsMore({
|
||||
urls: {
|
||||
load: this.option( 'urls.load' )
|
||||
},
|
||||
proxy: [ 'last_id' ],
|
||||
params: {
|
||||
user_id: this.getUserId()
|
||||
}
|
||||
});
|
||||
|
||||
// Подгрузка комментариев
|
||||
this.elements.more_comments.livequery( function () {
|
||||
$( this ).lsMore({
|
||||
urls: {
|
||||
load: _this.option( 'urls.load_comments' )
|
||||
},
|
||||
append: false,
|
||||
proxy: [ 'last_id' ],
|
||||
params: {
|
||||
user_id: _this.getUserId()
|
||||
}
|
||||
});
|
||||
});
|
||||
// Подгрузка комментариев
|
||||
this.elements.more_comments.livequery( function () {
|
||||
$( this ).lsMore({
|
||||
urls: {
|
||||
load: _this.option( 'urls.load_comments' )
|
||||
},
|
||||
append: false,
|
||||
proxy: [ 'last_id' ],
|
||||
params: {
|
||||
user_id: _this.getUserId()
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Записи
|
||||
this.elements.entry.livequery( function () {
|
||||
$( this ).lsWallEntry({
|
||||
wall: _this.element,
|
||||
urls: {
|
||||
remove: _this.option( 'urls.remove' )
|
||||
}
|
||||
})
|
||||
});
|
||||
// Записи
|
||||
this.elements.entry.livequery( function () {
|
||||
$( this ).lsWallEntry({
|
||||
wall: _this.element,
|
||||
urls: {
|
||||
remove: _this.option( 'urls.remove' )
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
// Формы
|
||||
this.elements.form.livequery( function () {
|
||||
$( this ).lsWallForm({
|
||||
wall: _this.element
|
||||
});
|
||||
});
|
||||
},
|
||||
// Формы
|
||||
this.elements.form.livequery( function () {
|
||||
$( this ).lsWallForm({
|
||||
wall: _this.element
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Добавление
|
||||
*
|
||||
* TODO: Оптимизировать
|
||||
*/
|
||||
add: function( pid, text ) {
|
||||
var form = this.getFormById( pid );
|
||||
/**
|
||||
* Добавление
|
||||
*
|
||||
* TODO: Оптимизировать
|
||||
*/
|
||||
add: function( pid, text ) {
|
||||
var form = this.getFormById( pid );
|
||||
|
||||
this._load( 'add', { user_id: this.getUserId(), pid: pid, text: text }, function( response ) {
|
||||
if ( pid === 0 ) this.elements.empty.hide();
|
||||
this._load( 'add', { user_id: this.getUserId(), pid: pid, text: text }, function( response ) {
|
||||
if ( pid === 0 ) this.elements.empty.hide();
|
||||
|
||||
this.load( pid );
|
||||
form.lsWallForm( 'close' );
|
||||
}, {
|
||||
onResponse: function () {
|
||||
ls.utils.formUnlock( form );
|
||||
}
|
||||
});
|
||||
},
|
||||
this.load( pid );
|
||||
form.lsWallForm( 'close' );
|
||||
}, {
|
||||
onResponse: function () {
|
||||
ls.utils.formUnlock( form );
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Подгружает записи
|
||||
*
|
||||
* TODO: Оптимизировать
|
||||
*/
|
||||
load: function( pid ) {
|
||||
var container = this.element.find( this.options.selectors.container + '[data-id=' + pid + ']' ),
|
||||
firstId = container.find( '>' + this.option( 'selectors.entry' ) + ':' + ( pid === 0 ? 'first' : 'last' ) ).data( 'id' ) || -1,
|
||||
params = { user_id: this.getUserId(), first_id: firstId, target_id: pid };
|
||||
/**
|
||||
* Подгружает записи
|
||||
*
|
||||
* TODO: Оптимизировать
|
||||
*/
|
||||
load: function( pid ) {
|
||||
var container = this.element.find( this.options.selectors.container + '[data-id=' + pid + ']' ),
|
||||
firstId = container.find( '>' + this.option( 'selectors.entry' ) + ':' + ( pid === 0 ? 'first' : 'last' ) ).data( 'id' ) || -1,
|
||||
params = { user_id: this.getUserId(), first_id: firstId, target_id: pid };
|
||||
|
||||
this._load( pid === 0 ? 'load' : 'load_comments', params, function( response ) {
|
||||
if ( response.count_loaded ) {
|
||||
container[ pid === 0 ? 'prepend' : 'append' ]( response.html );
|
||||
}
|
||||
});
|
||||
},
|
||||
this._load( pid === 0 ? 'load' : 'load_comments', params, function( response ) {
|
||||
if ( response.count_loaded ) {
|
||||
container[ pid === 0 ? 'prepend' : 'append' ]( response.html );
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Получает посты
|
||||
*/
|
||||
getPosts: function() {
|
||||
return this.element.find( this.option( 'selectors.post' ) );
|
||||
},
|
||||
/**
|
||||
* Получает посты
|
||||
*/
|
||||
getPosts: function() {
|
||||
return this.element.find( this.option( 'selectors.post' ) );
|
||||
},
|
||||
|
||||
/**
|
||||
* Получает комментарии по ID поста
|
||||
*/
|
||||
getCommentsByPostId: function( pid ) {
|
||||
return this.getCommentWrapperById( pid ).find( this.option( 'selectors.comment' ) );
|
||||
},
|
||||
/**
|
||||
* Получает комментарии по ID поста
|
||||
*/
|
||||
getCommentsByPostId: function( pid ) {
|
||||
return this.getCommentWrapperById( pid ).find( this.option( 'selectors.comment' ) );
|
||||
},
|
||||
|
||||
/**
|
||||
* Получает запись по ID
|
||||
*/
|
||||
getEntryById: function( id ) {
|
||||
return this.element.find( this.option( 'selectors.entry' ) + '[data-id=' + id + ']' ).eq( 0 );
|
||||
},
|
||||
/**
|
||||
* Получает запись по ID
|
||||
*/
|
||||
getEntryById: function( id ) {
|
||||
return this.element.find( this.option( 'selectors.entry' ) + '[data-id=' + id + ']' ).eq( 0 );
|
||||
},
|
||||
|
||||
/**
|
||||
* Получает враппер комментариев по ID поста
|
||||
*/
|
||||
getCommentWrapperById: function( id ) {
|
||||
return this.element.find( this.option( 'selectors.comment_wrapper' ) + '[data-id=' + id + ']' ).eq( 0 );
|
||||
},
|
||||
/**
|
||||
* Получает враппер комментариев по ID поста
|
||||
*/
|
||||
getCommentWrapperById: function( id ) {
|
||||
return this.element.find( this.option( 'selectors.comment_wrapper' ) + '[data-id=' + id + ']' ).eq( 0 );
|
||||
},
|
||||
|
||||
/**
|
||||
* Получает форму по ID поста
|
||||
*/
|
||||
getFormById: function( id ) {
|
||||
return this.element.find( this.option( 'selectors.form' ) + '[data-id=' + id + ']' ).eq( 0 );
|
||||
},
|
||||
/**
|
||||
* Получает форму по ID поста
|
||||
*/
|
||||
getFormById: function( id ) {
|
||||
return this.element.find( this.option( 'selectors.form' ) + '[data-id=' + id + ']' ).eq( 0 );
|
||||
},
|
||||
|
||||
/**
|
||||
* Получает ID владельца стены
|
||||
*/
|
||||
getUserId: function() {
|
||||
return this.userId ? this.userId : this.userId = this.element.data( 'user-id' );
|
||||
},
|
||||
/**
|
||||
* Получает ID владельца стены
|
||||
*/
|
||||
getUserId: function() {
|
||||
return this.userId ? this.userId : this.userId = this.element.data( 'user-id' );
|
||||
},
|
||||
|
||||
/**
|
||||
* Получает развернутые формы
|
||||
*/
|
||||
getOpenedForms: function() {
|
||||
return this.element.find( this.option( 'selectors.form' ) + '.' + ls.options.classes.states.open );
|
||||
},
|
||||
/**
|
||||
* Получает развернутые формы
|
||||
*/
|
||||
getOpenedForms: function() {
|
||||
return this.element.find( this.option( 'selectors.form' ) + '.' + ls.options.classes.states.open );
|
||||
},
|
||||
|
||||
/**
|
||||
* Проверяет и если нужно показывает/скрывает сообщение о пустом списке
|
||||
*/
|
||||
checkEmpty: function() {
|
||||
this.elements.empty[ this.getPosts().length ? 'hide' : 'show' ]();
|
||||
}
|
||||
});
|
||||
/**
|
||||
* Проверяет и если нужно показывает/скрывает сообщение о пустом списке
|
||||
*/
|
||||
checkEmpty: function() {
|
||||
this.elements.empty[ this.getPosts().length ? 'hide' : 'show' ]();
|
||||
}
|
||||
});
|
||||
})(jQuery);
|
|
@ -7,31 +7,31 @@
|
|||
*/
|
||||
|
||||
@media print {
|
||||
@page { margin: 0.5cm; }
|
||||
@page { margin: 0.5cm; }
|
||||
|
||||
* { background: transparent !important; color: black !important; text-shadow: none !important; filter:none !important; -ms-filter: none !important; }
|
||||
|
||||
body, .text { font-size: 14pt; }
|
||||
|
||||
a, a:visited { text-decoration: underline; }
|
||||
* { background: transparent !important; color: black !important; text-shadow: none !important; filter:none !important; -ms-filter: none !important; }
|
||||
|
||||
body, .text { font-size: 14pt; }
|
||||
|
||||
a, a:visited { text-decoration: underline; }
|
||||
|
||||
pre, blockquote { border: 1px solid #999; page-break-inside: avoid; }
|
||||
thead { display: table-header-group; }
|
||||
tr, img { page-break-inside: avoid; }
|
||||
img { max-width: 100% !important; }
|
||||
|
||||
h1 { font-size: 30pt !important; }
|
||||
h4 { font-size: 26pt !important; }
|
||||
h5 { font-size: 23pt !important; }
|
||||
h6 { font-size: 20pt !important; }
|
||||
p, h3, h4, h5 { orphans: 3; widows: 3; }
|
||||
h3, h4, h5 { page-break-after: avoid; }
|
||||
|
||||
#header, #userbar, #nav, #sidebar, #footer, #comments, .toolbar, .nav-filter-wrapper,
|
||||
.topic-footer, .stat-performance, .actions, .reply-header { display: none !important; }
|
||||
|
||||
#wrapper { -webkit-box-shadow: none; box-shadow: none; border: 0; padding: 0; }
|
||||
#content { width: 100%; margin: 0; }
|
||||
|
||||
.topic { margin-bottom: 100px; }
|
||||
pre, blockquote { border: 1px solid #999; page-break-inside: avoid; }
|
||||
thead { display: table-header-group; }
|
||||
tr, img { page-break-inside: avoid; }
|
||||
img { max-width: 100% !important; }
|
||||
|
||||
h1 { font-size: 30pt !important; }
|
||||
h4 { font-size: 26pt !important; }
|
||||
h5 { font-size: 23pt !important; }
|
||||
h6 { font-size: 20pt !important; }
|
||||
p, h3, h4, h5 { orphans: 3; widows: 3; }
|
||||
h3, h4, h5 { page-break-after: avoid; }
|
||||
|
||||
#header, #userbar, #nav, #sidebar, #footer, #comments, .toolbar, .nav-filter-wrapper,
|
||||
.topic-footer, .stat-performance, .actions, .reply-header { display: none !important; }
|
||||
|
||||
#wrapper { -webkit-box-shadow: none; box-shadow: none; border: 0; padding: 0; }
|
||||
#content { width: 100%; margin: 0; }
|
||||
|
||||
.topic { margin-bottom: 100px; }
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -5,11 +5,11 @@
|
|||
{extends 'Component@email.email'}
|
||||
|
||||
{block 'content'}
|
||||
{lang name='emails.blog_invite_new.text' params=[
|
||||
'user_url' => $oUserFrom->getUserWebPath(),
|
||||
'user_name' => $oUserFrom->getDisplayName(),
|
||||
'blog_url' => $oBlog->getUrlFull(),
|
||||
'blog_name' => $oBlog->getTitle()|escape,
|
||||
'invite_url' => $sPath
|
||||
]}
|
||||
{lang name='emails.blog_invite_new.text' params=[
|
||||
'user_url' => $oUserFrom->getUserWebPath(),
|
||||
'user_name' => $oUserFrom->getDisplayName(),
|
||||
'blog_url' => $oBlog->getUrlFull(),
|
||||
'blog_name' => $oBlog->getTitle()|escape,
|
||||
'invite_url' => $sPath
|
||||
]}
|
||||
{/block}
|
|
@ -5,12 +5,12 @@
|
|||
{extends 'Component@email.email'}
|
||||
|
||||
{block 'content'}
|
||||
{lang name='emails.comment_new.text' params=[
|
||||
'user_url' => $oUserComment->getUserWebPath(),
|
||||
'user_name' => $oUserComment->getDisplayName(),
|
||||
'topic_name' => $oTopic->getTitle()|escape,
|
||||
'comment_url' => "{if Config::Get('module.comment.nested_per_page')}{router page='comments'}{else}{$oTopic->getUrl()}#comment{/if}{$oComment->getId()}",
|
||||
'comment_text' => "{if Config::Get('sys.mail.include_comment')}{lang name='emails.common.comment_text'}:<br><em>{$oComment->getText()}</em>{/if}",
|
||||
'unsubscribe' => "{if $sSubscribeKey}<br><br>{lang name='emails.comment_new.unsubscribe' unsubscribe_url="{router page='subscribe'}unsubscribe/{$sSubscribeKey}/"}{/if}"
|
||||
]}
|
||||
{lang name='emails.comment_new.text' params=[
|
||||
'user_url' => $oUserComment->getUserWebPath(),
|
||||
'user_name' => $oUserComment->getDisplayName(),
|
||||
'topic_name' => $oTopic->getTitle()|escape,
|
||||
'comment_url' => "{if Config::Get('module.comment.nested_per_page')}{router page='comments'}{else}{$oTopic->getUrl()}#comment{/if}{$oComment->getId()}",
|
||||
'comment_text' => "{if Config::Get('sys.mail.include_comment')}{lang name='emails.common.comment_text'}:<br><em>{$oComment->getText()}</em>{/if}",
|
||||
'unsubscribe' => "{if $sSubscribeKey}<br><br>{lang name='emails.comment_new.unsubscribe' unsubscribe_url="{router page='subscribe'}unsubscribe/{$sSubscribeKey}/"}{/if}"
|
||||
]}
|
||||
{/block}
|
|
@ -5,12 +5,12 @@
|
|||
{extends 'Component@email.email'}
|
||||
|
||||
{block 'content'}
|
||||
{lang name='emails.comment_reply.text' params=[
|
||||
'user_url' => $oUserComment->getUserWebPath(),
|
||||
'user_name' => $oUserComment->getDisplayName(),
|
||||
'topic_name' => $oTopic->getTitle()|escape,
|
||||
'comment_url' => "{if Config::Get('module.comment.nested_per_page')}{router page='comments'}{else}{$oTopic->getUrl()}#comment{/if}{$oComment->getId()}",
|
||||
'comment_text' => "{if Config::Get('sys.mail.include_comment')}{lang name='emails.common.comment_text'}:<br><em>{$oComment->getText()}</em>{/if}"
|
||||
]}
|
||||
{lang name='emails.comment_reply.text' params=[
|
||||
'user_url' => $oUserComment->getUserWebPath(),
|
||||
'user_name' => $oUserComment->getDisplayName(),
|
||||
'topic_name' => $oTopic->getTitle()|escape,
|
||||
'comment_url' => "{if Config::Get('module.comment.nested_per_page')}{router page='comments'}{else}{$oTopic->getUrl()}#comment{/if}{$oComment->getId()}",
|
||||
'comment_text' => "{if Config::Get('sys.mail.include_comment')}{lang name='emails.common.comment_text'}:<br><em>{$oComment->getText()}</em>{/if}"
|
||||
]}
|
||||
{/block}
|
||||
|
||||
|
|
|
@ -5,13 +5,13 @@
|
|||
{extends 'Component@email.email'}
|
||||
|
||||
{block 'content'}
|
||||
{lang name='emails.invite.text' params=[
|
||||
'user_url' => $oUserFrom->getUserWebPath(),
|
||||
'user_name' => $oUserFrom->getDisplayName(),
|
||||
'website_url' => Router::GetPath('/'),
|
||||
'website_name' => Config::Get('view.name'),
|
||||
'invite_code' => $sRefCode,
|
||||
'ref_link' => $sRefLink,
|
||||
'login_url' => {router page='auth/login'}
|
||||
]}
|
||||
{lang name='emails.invite.text' params=[
|
||||
'user_url' => $oUserFrom->getUserWebPath(),
|
||||
'user_name' => $oUserFrom->getDisplayName(),
|
||||
'website_url' => Router::GetPath('/'),
|
||||
'website_name' => Config::Get('view.name'),
|
||||
'invite_code' => $sRefCode,
|
||||
'ref_link' => $sRefLink,
|
||||
'login_url' => {router page='auth/login'}
|
||||
]}
|
||||
{/block}
|
|
@ -5,9 +5,9 @@
|
|||
{extends 'Component@email.email'}
|
||||
|
||||
{block 'content'}
|
||||
{lang name='emails.reactivation.text' params=[
|
||||
'website_url' => Router::GetPath('/'),
|
||||
'website_name' => Config::Get('view.name'),
|
||||
'activation_url' => "{router page='auth'}activate/{$oUser->getActivateKey()}/"
|
||||
]}
|
||||
{lang name='emails.reactivation.text' params=[
|
||||
'website_url' => Router::GetPath('/'),
|
||||
'website_name' => Config::Get('view.name'),
|
||||
'activation_url' => "{router page='auth'}activate/{$oUser->getActivateKey()}/"
|
||||
]}
|
||||
{/block}
|
|
@ -5,10 +5,10 @@
|
|||
{extends 'Component@email.email'}
|
||||
|
||||
{block 'content'}
|
||||
{lang name='emails.registration.text' params=[
|
||||
'website_url' => Router::GetPath('/'),
|
||||
'website_name' => Config::Get('view.name'),
|
||||
'user_name' => $oUser->getLogin(),
|
||||
'user_password' => $sPassword
|
||||
]}
|
||||
{lang name='emails.registration.text' params=[
|
||||
'website_url' => Router::GetPath('/'),
|
||||
'website_name' => Config::Get('view.name'),
|
||||
'user_name' => $oUser->getLogin(),
|
||||
'user_password' => $sPassword
|
||||
]}
|
||||
{/block}
|
|
@ -5,11 +5,11 @@
|
|||
{extends 'Component@email.email'}
|
||||
|
||||
{block 'content'}
|
||||
{lang name='emails.registration_activate.text' params=[
|
||||
'website_url' => Router::GetPath('/'),
|
||||
'website_name' => Config::Get('view.name'),
|
||||
'user_name' => $oUser->getLogin(),
|
||||
'user_password' => $sPassword,
|
||||
'activation_url' => "{router page='auth'}activate/{$oUser->getActivateKey()}/"
|
||||
]}
|
||||
{lang name='emails.registration_activate.text' params=[
|
||||
'website_url' => Router::GetPath('/'),
|
||||
'website_name' => Config::Get('view.name'),
|
||||
'user_name' => $oUser->getLogin(),
|
||||
'user_password' => $sPassword,
|
||||
'activation_url' => "{router page='auth'}activate/{$oUser->getActivateKey()}/"
|
||||
]}
|
||||
{/block}
|
|
@ -5,9 +5,9 @@
|
|||
{extends 'Component@email.email'}
|
||||
|
||||
{block 'content'}
|
||||
{lang name='emails.reminder_code.text' params=[
|
||||
'website_url' => Router::GetPath('/'),
|
||||
'website_name' => Config::Get('view.name'),
|
||||
'recover_url' => "{router page='auth'}password-reset/{$oReminder->getCode()}/"
|
||||
]}
|
||||
{lang name='emails.reminder_code.text' params=[
|
||||
'website_url' => Router::GetPath('/'),
|
||||
'website_name' => Config::Get('view.name'),
|
||||
'recover_url' => "{router page='auth'}password-reset/{$oReminder->getCode()}/"
|
||||
]}
|
||||
{/block}
|
|
@ -5,7 +5,7 @@
|
|||
{extends 'Component@email.email'}
|
||||
|
||||
{block 'content'}
|
||||
{lang name='emails.reminder_password.text' params=[
|
||||
'password' => $sNewPassword
|
||||
]}
|
||||
{lang name='emails.reminder_password.text' params=[
|
||||
'password' => $sNewPassword
|
||||
]}
|
||||
{/block}
|
|
@ -5,11 +5,11 @@
|
|||
{extends 'Component@email.email'}
|
||||
|
||||
{block 'content'}
|
||||
{lang name='emails.talk_comment_new.text' params=[
|
||||
'user_url' => $oUserFrom->getUserWebPath(),
|
||||
'user_name' => $oUserFrom->getDisplayName(),
|
||||
'talk_name' => $oTalk->getTitle()|escape,
|
||||
'message_url' => "{router page='talk'}read/{$oTalk->getId()}/#comment{$oTalkComment->getId()}",
|
||||
'message_text' => "{if Config::Get('sys.mail.include_comment')}{lang name='emails.common.comment_text'}:<br><em>{$oTalkComment->getText()}</em>{/if}"
|
||||
]}
|
||||
{lang name='emails.talk_comment_new.text' params=[
|
||||
'user_url' => $oUserFrom->getUserWebPath(),
|
||||
'user_name' => $oUserFrom->getDisplayName(),
|
||||
'talk_name' => $oTalk->getTitle()|escape,
|
||||
'message_url' => "{router page='talk'}read/{$oTalk->getId()}/#comment{$oTalkComment->getId()}",
|
||||
'message_text' => "{if Config::Get('sys.mail.include_comment')}{lang name='emails.common.comment_text'}:<br><em>{$oTalkComment->getText()}</em>{/if}"
|
||||
]}
|
||||
{/block}
|
|
@ -5,11 +5,11 @@
|
|||
{extends 'Component@email.email'}
|
||||
|
||||
{block 'content'}
|
||||
{lang name='emails.talk_new.text' params=[
|
||||
'user_url' => $oUserFrom->getUserWebPath(),
|
||||
'user_name' => $oUserFrom->getDisplayName(),
|
||||
'talk_name' => $oTalk->getTitle()|escape,
|
||||
'talk_url' => "{router page='talk'}read/{$oTalk->getId()}/",
|
||||
'talk_text' => "{if Config::Get('sys.mail.include_talk')}{lang name='emails.common.comment_text'}:<br><em>{$oTalk->getText()}</em>{/if}"
|
||||
]}
|
||||
{lang name='emails.talk_new.text' params=[
|
||||
'user_url' => $oUserFrom->getUserWebPath(),
|
||||
'user_name' => $oUserFrom->getDisplayName(),
|
||||
'talk_name' => $oTalk->getTitle()|escape,
|
||||
'talk_url' => "{router page='talk'}read/{$oTalk->getId()}/",
|
||||
'talk_text' => "{if Config::Get('sys.mail.include_talk')}{lang name='emails.common.comment_text'}:<br><em>{$oTalk->getText()}</em>{/if}"
|
||||
]}
|
||||
{/block}
|
|
@ -5,11 +5,11 @@
|
|||
{extends 'Component@email.email'}
|
||||
|
||||
{block 'content'}
|
||||
{lang name='emails.topic_new.text' params=[
|
||||
'user_url' => $oUserTopic->getUserWebPath(),
|
||||
'user_name' => $oUserTopic->getDisplayName(),
|
||||
'blog_name' => $oBlog->getTitle()|escape,
|
||||
'topic_url' => $oTopic->getUrl(),
|
||||
'topic_name' => $oTopic->getTitle()|escape
|
||||
]}
|
||||
{lang name='emails.topic_new.text' params=[
|
||||
'user_url' => $oUserTopic->getUserWebPath(),
|
||||
'user_name' => $oUserTopic->getDisplayName(),
|
||||
'blog_name' => $oBlog->getTitle()|escape,
|
||||
'topic_url' => $oTopic->getUrl(),
|
||||
'topic_name' => $oTopic->getTitle()|escape
|
||||
]}
|
||||
{/block}
|
|
@ -5,11 +5,11 @@
|
|||
{extends 'Component@email.email'}
|
||||
|
||||
{block 'content'}
|
||||
{lang name='emails.user_changemail.text' params=[
|
||||
'user_url' => $oUser->getUserWebPath(),
|
||||
'user_name' => $oUser->getDisplayName(),
|
||||
'mail_old' => $oChangemail->getMailFrom(),
|
||||
'mail_new' => $oChangemail->getMailTo(),
|
||||
'change_url' => "{router page='profile'}changemail/confirm-from/{$oChangemail->getCodeFrom()}/"
|
||||
]}
|
||||
{lang name='emails.user_changemail.text' params=[
|
||||
'user_url' => $oUser->getUserWebPath(),
|
||||
'user_name' => $oUser->getDisplayName(),
|
||||
'mail_old' => $oChangemail->getMailFrom(),
|
||||
'mail_new' => $oChangemail->getMailTo(),
|
||||
'change_url' => "{router page='profile'}changemail/confirm-from/{$oChangemail->getCodeFrom()}/"
|
||||
]}
|
||||
{/block}
|
|
@ -5,11 +5,11 @@
|
|||
{extends 'Component@email.email'}
|
||||
|
||||
{block 'content'}
|
||||
{lang name='emails.user_changemail.text' params=[
|
||||
'user_url' => $oUser->getUserWebPath(),
|
||||
'user_name' => $oUser->getDisplayName(),
|
||||
'mail_old' => $oChangemail->getMailFrom(),
|
||||
'mail_new' => $oChangemail->getMailTo(),
|
||||
'change_url' => "{router page='profile'}changemail/confirm-to/{$oChangemail->getCodeTo()}/"
|
||||
]}
|
||||
{lang name='emails.user_changemail.text' params=[
|
||||
'user_url' => $oUser->getUserWebPath(),
|
||||
'user_name' => $oUser->getDisplayName(),
|
||||
'mail_old' => $oChangemail->getMailFrom(),
|
||||
'mail_new' => $oChangemail->getMailTo(),
|
||||
'change_url' => "{router page='profile'}changemail/confirm-to/{$oChangemail->getCodeTo()}/"
|
||||
]}
|
||||
{/block}
|
|
@ -5,12 +5,12 @@
|
|||
{extends 'Component@email.email'}
|
||||
|
||||
{block 'content'}
|
||||
{lang name='emails.user_complaint.text' params=[
|
||||
'user_url' => $oUserFrom->getUserWebPath(),
|
||||
'user_name' => $oUserFrom->getDisplayName(),
|
||||
'user_target_url' => $oUserTarget->getUserWebPath(),
|
||||
'user_target_name' => $oUserTarget->getDisplayName(),
|
||||
'complaint_title' => $oComplaint->getTypeTitle(),
|
||||
'complaint_text' => "{if $oComplaint->getText()}{lang name='emails.user_changemail.more'}:<br>{$oComplaint->getText()}{/if}"
|
||||
]}
|
||||
{lang name='emails.user_complaint.text' params=[
|
||||
'user_url' => $oUserFrom->getUserWebPath(),
|
||||
'user_name' => $oUserFrom->getDisplayName(),
|
||||
'user_target_url' => $oUserTarget->getUserWebPath(),
|
||||
'user_target_name' => $oUserTarget->getDisplayName(),
|
||||
'complaint_title' => $oComplaint->getTypeTitle(),
|
||||
'complaint_text' => "{if $oComplaint->getText()}{lang name='emails.user_changemail.more'}:<br>{$oComplaint->getText()}{/if}"
|
||||
]}
|
||||
{/block}
|
|
@ -5,10 +5,10 @@
|
|||
{extends 'Component@email.email'}
|
||||
|
||||
{block 'content'}
|
||||
{lang name='emails.user_friend_new.text' params=[
|
||||
'user_url' => $oUserFrom->getUserWebPath(),
|
||||
'user_name' => $oUserFrom->getDisplayName(),
|
||||
'text' => $sText,
|
||||
'url' => $sPath
|
||||
]}
|
||||
{lang name='emails.user_friend_new.text' params=[
|
||||
'user_url' => $oUserFrom->getUserWebPath(),
|
||||
'user_name' => $oUserFrom->getDisplayName(),
|
||||
'text' => $sText,
|
||||
'url' => $sPath
|
||||
]}
|
||||
{/block}
|
|
@ -5,10 +5,10 @@
|
|||
{extends 'Component@email.email'}
|
||||
|
||||
{block 'content'}
|
||||
{lang name='emails.wall_new.text' params=[
|
||||
'user_url' => $oUser->getUserWebPath(),
|
||||
'user_name' => $oUser->getDisplayName(),
|
||||
'wall_url' => "{$oUserWall->getUserWebPath()}wall/",
|
||||
'message_text' => $oWall->getText()
|
||||
]}
|
||||
{lang name='emails.wall_new.text' params=[
|
||||
'user_url' => $oUser->getUserWebPath(),
|
||||
'user_name' => $oUser->getDisplayName(),
|
||||
'wall_url' => "{$oUserWall->getUserWebPath()}wall/",
|
||||
'message_text' => $oWall->getText()
|
||||
]}
|
||||
{/block}
|
|
@ -5,11 +5,11 @@
|
|||
{extends 'Component@email.email'}
|
||||
|
||||
{block 'content'}
|
||||
{lang name='emails.wall_reply.text' params=[
|
||||
'user_url' => $oUser->getUserWebPath(),
|
||||
'user_name' => $oUser->getDisplayName(),
|
||||
'wall_url' => "{$oUserWall->getUserWebPath()}wall/",
|
||||
'message_parent_text' => $oWallParent->getText(),
|
||||
'message_text' => $oWall->getText()
|
||||
]}
|
||||
{lang name='emails.wall_reply.text' params=[
|
||||
'user_url' => $oUser->getUserWebPath(),
|
||||
'user_name' => $oUser->getDisplayName(),
|
||||
'wall_url' => "{$oUserWall->getUserWebPath()}wall/",
|
||||
'message_parent_text' => $oWallParent->getText(),
|
||||
'message_text' => $oWall->getText()
|
||||
]}
|
||||
{/block}
|
|
@ -5,9 +5,9 @@
|
|||
{extends './layout.user.tpl'}
|
||||
|
||||
{block 'layout_options' append}
|
||||
{$sNav = 'messages'}
|
||||
{$sNav = 'messages'}
|
||||
{/block}
|
||||
|
||||
{block 'layout_user_page_title'}
|
||||
{$aLang.talk.title}
|
||||
{$aLang.talk.title}
|
||||
{/block}
|
|
@ -5,9 +5,9 @@
|
|||
{extends './layout.user.tpl'}
|
||||
|
||||
{block 'layout_options' append}
|
||||
{$sNav = 'settings'}
|
||||
{$sNav = 'settings'}
|
||||
{/block}
|
||||
|
||||
{block 'layout_user_page_title'}
|
||||
{$aLang.user.settings.title}
|
||||
{$aLang.user.settings.title}
|
||||
{/block}
|
|
@ -5,9 +5,9 @@
|
|||
{extends './layout.base.tpl'}
|
||||
|
||||
{block 'layout_content_header' prepend}
|
||||
{component 'user' template='header' user=$oUserProfile}
|
||||
{component 'user' template='header' user=$oUserProfile}
|
||||
|
||||
<h3 class="profile-page-header">
|
||||
{block 'layout_user_page_title'}{/block}
|
||||
</h3>
|
||||
<h3 class="profile-page-header">
|
||||
{block 'layout_user_page_title'}{/block}
|
||||
</h3>
|
||||
{/block}
|
|
@ -1,6 +1,6 @@
|
|||
{component 'nav' name='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' ]
|
||||
[ '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' ]
|
||||
]}
|
|
@ -1,4 +1,4 @@
|
|||
* {
|
||||
border-radius: 0 !important;
|
||||
box-shadow: none !important;
|
||||
border-radius: 0 !important;
|
||||
box-shadow: none !important;
|
||||
}
|
Loading…
Reference in a new issue