diff --git a/application/frontend/common/js/favourite.js b/application/frontend/common/js/favourite.js
index 8ec41871..247cfcae 100644
--- a/application/frontend/common/js/favourite.js
+++ b/application/frontend/common/js/favourite.js
@@ -79,10 +79,10 @@ ls.favourite = (function ($) {
if ( ! this.options.type[data.type] ) return false;
var params = {
- type: ! data.toggle.hasClass(ls.options.classes.states.active),
+ type: ! data.element.hasClass(ls.options.classes.states.active),
id: data.targetId
};
-
+
ls.hook.marker('toggleBefore');
ls.ajax.load(this.options.type[data.type].url, params, function(result) {
@@ -91,13 +91,13 @@ ls.favourite = (function ($) {
} else {
ls.msg.notice(null, result.sMsg);
- data.toggle.removeClass(ls.options.classes.states.active);
+ data.element.removeClass(ls.options.classes.states.active);
if (result.bState) {
- data.toggle.addClass(ls.options.classes.states.active).attr('title', ls.lang.get('favourite.remove'));
+ data.element.addClass(ls.options.classes.states.active).attr('title', ls.lang.get('favourite.remove'));
ls.tags && ls.tags.showPersonalTags(data.type, data.targetId);
} else {
- data.toggle.attr('title', ls.lang.get('favourite.add'));
+ data.element.attr('title', ls.lang.get('favourite.add'));
ls.tags && ls.tags.hidePersonalTags(data.type, data.targetId);
}
diff --git a/application/frontend/common/js/media.js b/application/frontend/common/js/media.js
index 2253601b..8c9c48b7 100644
--- a/application/frontend/common/js/media.js
+++ b/application/frontend/common/js/media.js
@@ -220,7 +220,7 @@ ls.media = (function ($) {
}.bind(this));
// Инициализация фоторамы при предпросмотре
- ls.hook.inject([ls.utilities,'textPreview'], function() {
+ ls.hook.inject([ls.utils,'textPreview'], function() {
$('.fotorama').fotorama();
},'textPreviewDisplayAfter');
diff --git a/application/frontend/common/js/user.js b/application/frontend/common/js/user.js
index 407348d6..e6088c51 100644
--- a/application/frontend/common/js/user.js
+++ b/application/frontend/common/js/user.js
@@ -11,14 +11,29 @@
var ls = ls || {};
ls.user = (function ($) {
+ "use strict";
+
+ /**
+ * Дефолтные опции
+ *
+ * @private
+ */
+ var _defaults = {
+ urls: {
+ follow: aRouter['stream'] + 'ajaxadduser/',
+ unfollow: aRouter['stream'] + 'ajaxremoveuser/'
+ }
+ };
this.jcropImage = null;
/**
* Инициализация
*/
- this.init = function() {
- var self = this;
+ this.init = function(options) {
+ var _this = this;
+
+ this.options = $.extend({}, _defaults, options);
/* Авторизация */
ls.ajax.form(aRouter.login + 'ajax-login', '.js-form-login', function (result, status, xhr, form) {
@@ -68,17 +83,9 @@ ls.user = (function ($) {
var oElement = $(this);
if (oElement.hasClass(ls.options.classes.states.active)) {
- // Удаляем
- ls.user_list_add.remove('activity', null, oElement.data('user-id'), function (oResponse, iUserId) {
- oElement.removeClass(ls.options.classes.states.active).text(ls.lang.get('profile_user_follow'));
- });
+ _this.unfollow(oElement, oElement.data('user-id'));
} else {
- // Добавляем
- ls.user_list_add.add('activity', null, oElement.data('user-id'), {
- add_success: function (oResponse) {
- oElement.addClass(ls.options.classes.states.active).text(ls.lang.get('profile_user_unfollow'));
- }
- });
+ _this.follow(oElement, oElement.data('user-login'));
}
e.preventDefault();
@@ -108,16 +115,16 @@ ls.user = (function ($) {
// Загрузка фотографии в профиль
$('.js-ajax-user-photo-upload').on('change', function () {
- self.uploadProfilePhoto($(this));
+ _this.uploadProfilePhoto($(this));
});
// Удаление фотографии профиля
$('.js-ajax-user-photo-upload-remove').on('click', function () {
- self.removeProfilePhoto($(this).data('userId'));
+ _this.removeProfilePhoto($(this).data('userId'));
return false;
});
// Изменения аватара
$('.js-ajax-user-avatar-change').on('click', function () {
- self.changeProfileAvatar($(this).data('userId'));
+ _this.changeProfileAvatar($(this).data('userId'));
return false;
});
};
@@ -182,81 +189,32 @@ ls.user = (function ($) {
};
/**
- * Поиск пользователей по началу логина
+ * Подписка на пользователя
*/
- this.searchUsersByPrefix = function(sPrefix,obj) {
- obj=$(obj);
- var url = aRouter['people']+'ajax-search/';
- var params = {user_login: sPrefix, isPrefix: 1};
- $('#search-user-login').addClass('loader');
-
- ls.hook.marker('searchUsersByPrefixBefore');
- ls.ajax.load(url, params, function(result){
- $('#search-user-login').removeClass('loader');
- $('#user-prefix-filter').find('.active').removeClass('active');
- obj.parent().addClass('active');
- if (result.bStateError) {
- $('#users-list-search').hide();
- $('#users-list-original').show();
- } else {
- $('#users-list-original').hide();
- $('#users-list-search').html(result.sText).show();
- ls.hook.run('ls_user_search_users_by_prefix_after',[sPrefix, obj, result]);
- }
- });
- return false;
+ this.follow = function(oElement, sUserLogin) {
+ ls.ajax.load(this.options.urls.follow, { aUserList: [ sUserLogin ] }, function(oResponse) {
+ oElement.addClass(ls.options.classes.states.active).text( ls.lang.get('profile_user_unfollow') );
+ }.bind(this));
};
/**
- * Подписка
+ * Отписаться от пользователя
*/
- this.followToggle = function(obj, iUserId) {
- if ($(obj).hasClass('followed')) {
- ls.stream.unsubscribe(iUserId);
- $(obj).toggleClass('followed').text(ls.lang.get('profile_user_follow'));
- } else {
- ls.stream.subscribe(iUserId);
- $(obj).toggleClass('followed').text(ls.lang.get('profile_user_unfollow'));
- }
- return false;
+ this.unfollow = function(oElement, iUserId) {
+ ls.ajax.load(this.options.urls.unfollow, { iUserId: iUserId }, function(oResponse) {
+ oElement.removeClass(ls.options.classes.states.active).text( ls.lang.get('profile_user_follow') );
+ }.bind(this));
};
/**
- * Поиск пользователей
+ * Добавляет жалобу
*/
- this.searchUsers = function(sFormSelector) {
- var url = aRouter['people']+'ajax-search/',
- oInputSearch = $(sFormSelector).find('input'),
- oOriginalContainer = $('#users-list-original'),
- oSearchContainer = $('#users-list-search');
-
- oInputSearch.addClass(ls.options.classes.states.loading);
-
- ls.hook.marker('searchUsersBefore');
-
- ls.ajax.submit(url, sFormSelector, function(result) {
- oInputSearch.removeClass(ls.options.classes.states.loading);
-
- if (result.bShowOriginal) {
- oSearchContainer.hide();
- oOriginalContainer.show();
- } else {
- oOriginalContainer.hide();
- oSearchContainer.html(result.sText).show();
-
- ls.hook.run('ls_user_search_users_after', [sFormSelector, result]);
- }
- });
- };
-
-
- this.addComplaint = function(form) {
- ls.ajax.submit(aRouter.profile+'ajax-complaint-add/', form, function(result){
+ this.addComplaint = function(oForm) {
+ ls.ajax.submit(aRouter.profile + 'ajax-complaint-add/', oForm, function(result) {
$('#modal-complaint-user').modal('hide');
});
};
-
this.uploadProfilePhoto = function(input) {
var form = $('
').hide().appendTo('body');
input.clone(true).insertAfter(input);
@@ -293,7 +251,7 @@ ls.user = (function ($) {
};
this.changeProfileAvatar = function(idUser) {
- var self = this;
+ var _this = this;
ls.modal.load(aRouter.ajax+'modal/image-crop/', {image_src: $('.js-ajax-user-photo-image').attr('src') }, {
aftershow: function() {
this.jcropImage && this.jcropImage.destroy();
@@ -304,7 +262,7 @@ ls.user = (function ($) {
});
$('.js-image-crop').Jcrop({ minSize: [32, 32], aspectRatio: 1 }, function () {
- self.jcropImage = this;
+ _this.jcropImage = this;
var w=$('.js-image-crop').innerWidth();
var h=$('.js-image-crop').innerHeight();
@@ -318,7 +276,7 @@ ls.user = (function ($) {
$('.js-ajax-image-crop-submit').on('click',function() {
var params={
user_id: idUser,
- size: self.jcropImage.tellSelect(),
+ size: _this.jcropImage.tellSelect(),
canvas_width: $('.js-image-crop').innerWidth()
}
ls.ajax.load(aRouter.settings+'ajax-change-avatar/', params, function(result) {
@@ -336,4 +294,4 @@ ls.user = (function ($) {
};
return this;
-}).call(ls.user || {},jQuery);
+}).call(ls.user || {}, jQuery);
diff --git a/application/frontend/common/js/usernote.js b/application/frontend/common/js/usernote.js
index 6f6a4a7a..e82c3179 100644
--- a/application/frontend/common/js/usernote.js
+++ b/application/frontend/common/js/usernote.js
@@ -1,174 +1,157 @@
/**
* Заметки
- *
+ *
* @module ls/usernote
- *
+ *
* @license GNU General Public License, version 2
* @copyright 2013 OOO "ЛС-СОФТ" {@link http://livestreetcms.com}
* @author Denis Shakhov
*/
-var ls = ls || {};
-
-ls.usernote = (function($) {
+(function($) {
"use strict";
- /**
- * Дефолтные опции
- */
- var defaults = {
- // Роутеры
- routers: {
- save: aRouter['profile'] + 'ajax-note-save/',
- remove: aRouter['profile'] + 'ajax-note-remove/'
+ $.widget( "livestreet.usernote", {
+ /**
+ * Дефолтные опции
+ */
+ options: {
+ // Ссылки
+ urls: {
+ save: aRouter['profile'] + 'ajax-note-save/',
+ remove: aRouter['profile'] + 'ajax-note-remove/'
+ },
+
+ // Селекторы
+ selectors: {
+ body: '.js-user-note-body',
+ text: '.js-user-note-text',
+ add: '.js-user-note-add',
+ actions: '.js-user-note-actions',
+ actions_edit: '.js-user-note-actions-edit',
+ actions_remove: '.js-user-note-actions-remove',
+
+ form: '.js-user-note-form',
+ form_text: '.js-user-note-form-text',
+ form_save: '.js-user-note-form-save',
+ form_cancel: '.js-user-note-form-cancel'
+ }
},
- // Селекторы
- selectors: {
- note: '.js-user-note',
- noteContent: '.js-user-note-content',
- noteText: '.js-user-note-text',
- noteAddButton: '.js-user-note-add-button',
- noteActions: '.js-user-note-actions',
- noteEditButton: '.js-user-note-edit-button',
- noteRemoveButton: '.js-user-note-remove-button',
+ /**
+ * Конструктор
+ *
+ * @constructor
+ * @private
+ */
+ _create: function () {
+ var _this = this;
- noteEdit: '.js-user-note-edit',
- noteEditText: '.js-user-note-edit-text',
- noteEditSaveButton: '.js-user-note-edit-save',
- noteEditCancelButton: '.js-user-note-edit-cancel'
- }
- };
+ this.options = $.extend({}, this.options, ls.utils.getDataOptions(this.element, this.widgetName));
- /**
- * Инициализация
- *
- * @param {Object} options Опции
- */
- this.init = function(options) {
- var self = this;
+ // Получаем аякс параметры
+ this.params = ls.utils.getDataOptions(this.element, 'param');
- this.options = $.extend({}, defaults, options);
+ // Получаем элементы
+ this.elements = {};
+ this.elements.container = this.element;
- // Добавление
- $(this.options.selectors.note).each(function () {
- var oNote = $(this);
+ this.elements.body = this.elements.container.find(this.options.selectors.body);
+ this.elements.text = this.elements.body.find(this.options.selectors.text);
+ this.elements.add = this.elements.body.find(this.options.selectors.add);
+ this.elements.actions = this.elements.body.find(this.options.selectors.actions);
+ this.elements.actions_edit = this.elements.actions.find(this.options.selectors.actions_edit);
+ this.elements.actions_remove = this.elements.actions.find(this.options.selectors.actions_remove);
- var oVars = {
- oNote: oNote,
- oNoteText: oNote.find(self.options.selectors.noteText),
- oNoteEditText: oNote.find(self.options.selectors.noteEditText),
- oNoteContent: oNote.find(self.options.selectors.noteContent),
- oNoteEdit: oNote.find(self.options.selectors.noteEdit),
- oNoteAdd: oNote.find(self.options.selectors.noteAddButton),
- oNoteActions: oNote.find(self.options.selectors.noteActions),
- iUserId: oNote.data('user-id')
+ this.elements.form = this.elements.container.find(this.options.selectors.form);
+ this.elements.form_text = this.elements.form.find(this.options.selectors.form_text);
+ this.elements.form_save = this.elements.form.find(this.options.selectors.form_save);
+ this.elements.form_cancel = this.elements.form.find(this.options.selectors.form_cancel);
+
+ // Добавление
+ this.elements.add.on('click', function (e) {
+ _this.showForm();
+ e.preventDefault();
+ });
+
+ // Редактирование
+ this.elements.actions_edit.on('click', function (e) {
+ _this.showForm();
+ e.preventDefault();
+ });
+
+ // Отмена редактирования
+ this.elements.form_cancel.on('click', this.hideForm.bind(this));
+
+ // Удаление
+ this.elements.actions_remove.on('click', function (e) {
+ _this.remove();
+ e.preventDefault();
+ });
+
+ // Сохранение
+ this.elements.form.on('submit', function (e) {
+ _this.save();
+ e.preventDefault();
+ });
+ },
+
+ /**
+ * Показывает форму редактирования
+ */
+ showForm: function() {
+ 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();
+ },
+
+ /**
+ * Сохраняет заметку
+ */
+ save: function() {
+ var oParams = {
+ text: this.elements.form_text.val()
};
- // Показывает форму добавления
- oVars.oNote.find(self.options.selectors.noteAddButton).on('click', function (e) {
- self.showForm(oVars);
- e.preventDefault();
- }.bind(self));
+ oParams = $.extend({}, oParams, this.params);
- // Отмена
- oVars.oNote.find(self.options.selectors.noteEditCancelButton).on('click', function (e) {
- self.hideForm(oVars);
- });
+ ls.utils.formLock(this.elements.form);
- // Сохранение заметки
- oVars.oNote.find(self.options.selectors.noteEditSaveButton).on('click', function (e) {
- self.save(oVars);
- });
+ ls.ajax.load(this.options.urls.save, oParams, function (oResponse) {
+ ls.utils.formUnlock(this.elements.form);
- // Удаление заметки
- oVars.oNote.find(self.options.selectors.noteRemoveButton).on('click', function (e) {
- self.remove(oVars);
- e.preventDefault();
- });
+ if (oResponse.bStateError) {
+ ls.msg.error(null, oResponse.sMsg);
+ } else {
+ this.elements.text.html(oResponse.sText).show();
+ this.elements.add.hide();
+ this.elements.actions.show();
+ this.hideForm();
+ }
+ }.bind(this));
+ },
- // Редактирование заметки
- oVars.oNote.find(self.options.selectors.noteEditButton).on('click', function (e) {
- self.showForm(oVars);
- oVars.oNoteEditText.val( $.trim(oVars.oNoteText.html()) );
- e.preventDefault();
- });
- });
- };
-
- /**
- * Показывает форму редактирования
- *
- * @param {Object} oVars Общие переменные
- */
- this.showForm = function(oVars) {
- oVars.oNoteContent.hide();
- oVars.oNoteEdit.show();
- oVars.oNoteEditText.val( $.trim(oVars.oNoteText.html()) ).focus();
- };
-
- /**
- * Скрывает форму редактирования
- *
- * @param {Object} oVars Общие переменные
- */
- this.hideForm = function(oVars) {
- oVars.oNoteContent.show();
- oVars.oNoteEdit.hide();
- };
-
- /**
- * Сохраняет заметку
- *
- * @param {Object} oVars Общие переменные
- */
- this.save = function(oVars) {
- var params = {
- iUserId: oVars.iUserId,
- text: oVars.oNoteEditText.val()
- };
-
- ls.hook.marker('saveBefore');
-
- ls.ajax.load(this.options.routers.save, params, function (result) {
- if (result.bStateError) {
- ls.msg.error(null, result.sMsg);
- } else {
- oVars.oNoteText.html(result.sText).show();
- oVars.oNoteAdd.hide();
- oVars.oNoteActions.show();
- this.hideForm(oVars);
-
- ls.hook.run('ls_usernote_save_after',[params, result]);
- }
- }.bind(this));
- };
-
- /**
- * Удаление заметки
- *
- * @param {Object} oVars Общие переменные
- */
- this.remove = function(oVars) {
- var params = {
- iUserId: oVars.iUserId
- };
-
- ls.hook.marker('removeBefore');
-
- ls.ajax.load(this.options.routers.remove, params, function (result) {
- if (result.bStateError) {
- ls.msg.error(null, result.sMsg);
- } else {
- oVars.oNoteText.empty().hide();
- oVars.oNoteAdd.show();
- oVars.oNoteActions.hide();
- this.hideForm(oVars);
-
- ls.hook.run('ls_usernote_remove_after',[params, result]);
- }
- }.bind(this));
- };
-
- return this;
-}).call(ls.usernote || {},jQuery);
\ No newline at end of file
+ /**
+ * Удаление заметки
+ */
+ remove: function() {
+ ls.ajax.load(this.options.urls.remove, this.params, function (oResponse) {
+ if (oResponse.bStateError) {
+ ls.msg.error(null, oResponse.sMsg);
+ } else {
+ this.elements.text.empty().hide();
+ this.elements.add.show();
+ this.elements.actions.hide();
+ }
+ }.bind(this));
+ }
+ });
+})(jQuery);
\ No newline at end of file
diff --git a/application/frontend/skin/developer/alert.tpl b/application/frontend/skin/developer/alert.tpl
index 50a76d02..6e33c307 100644
--- a/application/frontend/skin/developer/alert.tpl
+++ b/application/frontend/skin/developer/alert.tpl
@@ -1,35 +1,64 @@
{**
* Уведомления
*
- * @param string $sAlertTitle Заголовок
- * @param string $sAlertStyle Стиль уведомления (error, info и т.д.), по умолчанию - success
- * @param string $sAlertAttributes Дополнительные атрибуты основного блока
- * @param string $sAlertClasses Дополнительные классы
- * @param boolean $bAlertVisible Показывать или нет уведомление, по умолчанию - true
- * @param boolean $bAlertClose Показывать или нет кнопку закрытия, по умолчанию - false
- * @param mixed $mAlerts Массив либо строка с текстом уведомления
+ * @param string $sAlertTitle Заголовок
+ * @param mixed $mAlerts Массив либо строка с текстом уведомления
+ * @param string $sAlertMods (success) Модификаторы (error, info и т.д.)
+ * @param string $sAlertAttributes Дополнительные атрибуты основного блока
+ * @param string $sAlertClasses Дополнительные классы
+ * @param bool $bAlertVisible (true) Показывать или нет уведомление
+ * @param bool $bAlertClose (true) Показывать или нет кнопку закрытия
*
* @styles /css/alerts.css
*}
-
+{* Название компонента *}
+{$_sComponentName = 'alert'}
+{* Дефолтный модификатор *}
+{$_sComponentDefaultMod = 'success'}
+
+{* Строка которой разделяются имя компонента и модификатор *}
+{$_sModifierDelimiter = '--'}
+
+{* Временный костыль *}
+{$sAlertMods = $sAlertStyle}
+
+{* Формируем модификаторы *}
+{$aMods = " "|explode:($sAlertMods|default:$_sComponentDefaultMod|strip)}
+
+{foreach $aMods as $sMod}
+ {if $sMod}
+ {$sResultMods = "$sResultMods $_sComponentName$_sModifierDelimiter$sMod"}
+ {/if}
+{/foreach}
+
+
+{* Уведомление *}
+
+ {* Заголовок *}
{if $sAlertTitle}
-
{$sAlertTitle}
+
{$sAlertTitle}
{/if}
+ {* Кнопка закрытия *}
{if $bAlertClose}
-
×
+
×
{/if}
-
+ {* Контент *}
+
{block name='alert_body'}
{if is_array($mAlerts)}
-
+
{foreach $mAlerts as $aAlert}
- - {if $aAlert.title}{$aAlert.title}:{/if} {$aAlert.msg}
+ -
+ {if $aAlert.title}
+ {$aAlert.title}:
+ {/if}
+
+ {$aAlert.msg}
+
{/foreach}
{else}
diff --git a/application/frontend/skin/developer/assets/css/common.css b/application/frontend/skin/developer/assets/css/common.css
index 82e71cdc..6c8d52e6 100644
--- a/application/frontend/skin/developer/assets/css/common.css
+++ b/application/frontend/skin/developer/assets/css/common.css
@@ -1,6 +1,6 @@
/**
* Общие стили
- *
+ *
* @license GNU General Public License, version 2
* @copyright 2013 OOO "ЛС-СОФТ" {@link http://livestreetcms.com}
* @author Denis Shakhov
@@ -13,22 +13,24 @@
* @template favourite.tpl
*/
.favourite { cursor: pointer; display: inline-block; }
-.favourite-toggle {
- display: inline-block;
- width: 14px;
- height: 14px;
- vertical-align: text-top;
- background: url(../images/icons.png) -96px 0 no-repeat;
- opacity: .3;
+.favourite:hover { opacity: .8; filter: alpha(opacity=80); }
+
+.favourite-toggle {
+ display: inline-block;
+ width: 14px;
+ height: 14px;
+ vertical-align: text-top;
+ background: url(../images/icons.png) -96px 0 no-repeat;
+ opacity: .3;
filter: alpha(opacity=30);
}
-.favourite-toggle.active { opacity: 1; filter: alpha(opacity=100); }
-.favourite:hover { opacity: .8; filter: alpha(opacity=80); }
+.favourite.active .favourite-toggle { opacity: 1; filter: alpha(opacity=100); }
+
.favourite-count { margin-left: 0; font-weight: bold; }
/**
- * Пагинация
+ * Пагинация
*
* @template pagination.tpl
* @template comments/comment_pagination.tpl
@@ -47,14 +49,11 @@
/**
- * Экшнбар
+ * Экшнбар
*/
-.actionbar { background: #fafafa; border: 1px solid #eee; margin-bottom: 2px; }
-.actionbar-item { float: left; white-space: nowrap; }
-.actionbar-item-link { float: left; padding: 10px 15px; color: #333; }
-.actionbar-item-link:hover { text-decoration: none; background: #eee; color: #000; }
-.actionbar-item-link.link-dotted { border-color: #f00; }
-.actionbar-item-link.link-dotted:hover { border-color: #06e; color: #06e; text-decoration: none; }
+.actionbar { background: #fafafa; padding: 10px 10px 0; margin-bottom: 10px; }
+.actionbar-item { float: left; white-space: nowrap; margin-right: 10px; }
+.actionbar-item-link { margin-bottom: 10px; }
/**
@@ -69,7 +68,7 @@
/**
- * Item List
+ * Item List
*/
.item-list { }
.item-list li { min-height: 51px; padding: 17px 15px 20px 80px; border-top: 1px solid #eee; position: relative; zoom: 1; background: #fff; }
@@ -109,8 +108,8 @@
/**
- * Список пользователей
- *
+ * Список пользователей
+ *
* @template user_list_avatar.tpl
*/
.user-list-avatar { overflow: hidden; zoom: 1; }
@@ -128,6 +127,7 @@
.user-list-small-item { background: #fafafa; padding: 10px 55px 10px 10px; margin-bottom: 1px; position: relative; }
.user-list-small-item:last-child { margin-bottom: 0; }
.user-list-small-item input { vertical-align: middle; }
+.user-list-small-item.selected { background: #ffc; }
.user-list-small-item-actions { position: absolute; top: 50%; right: 13px; margin-top: -8px; }
.user-list-small-item-actions li { cursor: pointer; opacity: .7; }
@@ -203,7 +203,7 @@
/**
- * Облако тегов
+ * Облако тегов
*/
.tag-cloud { width: 100%; }
@@ -226,10 +226,12 @@
/**
* Заметка
*/
-.user-note { background: #F1F7AF; padding: 20px; margin-bottom: 15px; }
-.user-note:last-child { margin-bottom: 0; }
-.user-note-actions { margin: 10px 0 0 0; overflow: hidden; }
-.user-note-actions li { float: left; margin-right: 15px; }
+.user-note { background: #F1F7AF; padding: 20px; margin-bottom: 15px; }
+.user-note:last-child { margin-bottom: 0; }
+.user-note-actions { margin: 10px 0 0 0; overflow: hidden; }
+.user-note-actions li { float: left; margin-right: 15px; }
+.user-note-form .form-field { margin-bottom: 15px; }
+.user-note-form-text { height: 5em; }
/**
diff --git a/application/frontend/skin/developer/favourite.tpl b/application/frontend/skin/developer/favourite.tpl
index 8e6a6e21..9c1e7c1c 100644
--- a/application/frontend/skin/developer/favourite.tpl
+++ b/application/frontend/skin/developer/favourite.tpl
@@ -3,20 +3,34 @@
*
* @param object $oFavouriteObject Объект сущности
* @param string $sFavouriteType Название сущности (blog, topic и т.д.)
- * @param string $oUserCurrent Текущий залогиненый пользователь
+ * @param string $sFavouriteClasses
+ * @param string $sFavouriteAttributes
+ * @param string $oUserCurrent Текущий залогиненый пользователь
*
* @styles assets/css/common.css
* @scripts /js/favourite.js
*}
-{$bFavouriteIsActive = $oFavouriteObject->getIsFavourite()}
-{$iFavouriteCount = $oFavouriteObject->getCountFavourite()}
+{* Название компонента *}
+{$_sComponentName = 'favourite'}
-
-
+{* True если объект находится в избранном *}
+{$bIsActive = $oUserCurrent && $oFavouriteObject->getIsFavourite()}
- {if isset($iFavouriteCount)}
-
{$iFavouriteCount}
+{* Кол-во объектов в избранном *}
+{$iCount = $oFavouriteObject->getCountFavourite()}
+
+
+
+ {* Кнопка добавления/удаления из избранного *}
+
+
+ {* Кол-во объектов в избранном *}
+ {if isset($iCount)}
+
{$iCount}
{/if}
\ No newline at end of file
diff --git a/application/frontend/skin/developer/user_note.tpl b/application/frontend/skin/developer/user_note.tpl
index 7a44312d..2b81b3ca 100644
--- a/application/frontend/skin/developer/user_note.tpl
+++ b/application/frontend/skin/developer/user_note.tpl
@@ -3,39 +3,48 @@
*
* @param object $oUserNote Заметка
* @param integer $iUserNoteId ID сущности
- * @param boolean $bUserNoteEditable Можно редактировать заметку или нет
- * @param string $sUserNoteClasses Дополнительные классы
+ * @param boolean $bUserNoteEditable Можно редактировать заметку или нет
+ * @param string $sUserNoteClasses Дополнительные классы
*
- * @styles
/css/common.css
+ * @styles assets/css/common.css
* @scripts /js/usernote.js
*}
+{* Название компонента *}
+{$_sComponentName = 'user-note'}
+
+{* Установка дефолтных значений *}
{$bUserNoteEditable = $bUserNoteEditable|default:true}
-
-
-
+
+ {* Заметка *}
+
+ {* Текст *}
+
{if $oUserNote}
{$oUserNote->getText()}
{/if}
-
+
+ {* Действия *}
{if $bUserNoteEditable}
-
+ {* Форма редактирования *}
{if $bUserNoteEditable}
-
-
+
+ {include 'forms/fields/form.field.button.tpl' sFieldStyle='primary' sFieldClasses="js-$_sComponentName-form-save" sFieldText=$aLang.common.save}
+ {include 'forms/fields/form.field.button.tpl' sFieldType='button' sFieldClasses="js-$_sComponentName-form-cancel" sFieldText=$aLang.common.cancel}
+
{/if}
\ No newline at end of file