mirror of
https://github.com/Oreolek/ifhub.club.git
synced 2024-06-28 20:45:00 +03:00
Оптимизация заметки о пользователе
This commit is contained in:
parent
f510d16d3c
commit
f26357f870
|
@ -163,7 +163,7 @@ class ActionProfile extends Action {
|
|||
}
|
||||
return true;
|
||||
} else {
|
||||
$this->Message_AddError($this->Lang_Get('user_note_save_error'),$this->Lang_Get('error'));
|
||||
$this->Message_AddError($this->Lang_Get('common.error.save'),$this->Lang_Get('error'));
|
||||
}
|
||||
} else {
|
||||
$this->Message_AddError($oComplaint->_getValidateError(),$this->Lang_Get('error'));
|
||||
|
@ -686,7 +686,7 @@ class ActionProfile extends Action {
|
|||
if ($this->User_SaveNote($oNote)) {
|
||||
$this->Viewer_AssignAjax('sText',$oNote->getText());
|
||||
} else {
|
||||
$this->Message_AddError($this->Lang_Get('user_note_save_error'),$this->Lang_Get('error'));
|
||||
$this->Message_AddError($this->Lang_Get('common.error.save'),$this->Lang_Get('error'));
|
||||
}
|
||||
} else {
|
||||
$this->Message_AddError($oNote->_getValidateError(),$this->Lang_Get('error'));
|
||||
|
|
|
@ -49,7 +49,7 @@ class ModuleUser_EntityNote extends Entity {
|
|||
if ($oUserTarget=$this->User_GetUserById($sValue) and $this->getUserId()!=$oUserTarget->getId()) {
|
||||
return true;
|
||||
}
|
||||
return $this->Lang_Get('user_note_target_error');
|
||||
return $this->Lang_Get('user_note.notices.target_error');
|
||||
}
|
||||
}
|
||||
?>
|
|
@ -27,6 +27,14 @@ return array(
|
|||
'edit' => 'Редактировать',
|
||||
'save' => 'Сохранить',
|
||||
'create' => 'Создать',
|
||||
'cancel' => 'Отменить',
|
||||
'empty' => 'Тут ничего нет',
|
||||
'error' => array(
|
||||
'save' => 'Ошибка сохранения',
|
||||
),
|
||||
'success' => array(
|
||||
'save' => 'Успешно сохранено',
|
||||
)
|
||||
),
|
||||
|
||||
/**
|
||||
|
@ -80,6 +88,28 @@ return array(
|
|||
'by_rating' => 'по рейтингу',
|
||||
),
|
||||
|
||||
/**
|
||||
* Заметка пользователя
|
||||
*/
|
||||
'user_note' => array(
|
||||
'add' => 'Написать заметку',
|
||||
|
||||
// Всплывающие сообщения
|
||||
'notices' => array(
|
||||
'target_error' => 'Неверный пользователь для заметки', // TODO: Remove?
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Жалобы
|
||||
*/
|
||||
'report' => array(
|
||||
// Всплывающие сообщения
|
||||
'notices' => array(
|
||||
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Блог
|
||||
*/
|
||||
|
@ -439,22 +469,6 @@ return array(
|
|||
'topic_preview' => 'Предпросмотр',
|
||||
'topic_delete' => 'Удалить',
|
||||
'topic_delete_confirm' => 'Вы действительно хотите удалить топик?',
|
||||
/**
|
||||
* Топик-ссылка
|
||||
*/
|
||||
'topic_link' => 'топик-ссылка',
|
||||
'topic_link_title' => 'Ссылки',
|
||||
'topic_link_title_edit' => 'Редактирование ссылки',
|
||||
'topic_link_title_create' => 'Добавление ссылки',
|
||||
'topic_link_create' => 'Создание топика-ссылки',
|
||||
'topic_link_edit' => 'Редактирование топика-ссылки',
|
||||
'topic_link_count_jump' => 'переходов по ссылке',
|
||||
'topic_link_create_url' => 'Ссылка',
|
||||
'topic_link_create_url_notice' => 'Например, http://livestreet.ru/blog/dev_livestreet/113.html',
|
||||
'topic_link_create_url_error' => 'Ссылка должна быть от 2 до 200 символов',
|
||||
'topic_link_create_text' => 'Краткое описание (максимум 500 символов)',
|
||||
'topic_link_create_text_notice' => 'HTML-теги запрещены',
|
||||
'topic_link_create_text_error' => 'Описание ссылки должно быть от 10 до 500 символов',
|
||||
/**
|
||||
* Топик-опрос
|
||||
*/
|
||||
|
@ -733,17 +747,6 @@ return array(
|
|||
'user_field_error_add_no_name' => 'Необходимо указать название поля',
|
||||
'user_field_error_add_no_title' => 'Необходимо указать заголовок поля',
|
||||
'user_field_error_name_exists' => 'Поле с таким именем уже существует',
|
||||
/**
|
||||
* Заметка пользователя
|
||||
*/
|
||||
'user_note_form_edit' => 'Редактировать',
|
||||
'user_note_form_delete' => 'Удалить',
|
||||
'user_note_form_save' => 'Сохранить',
|
||||
'user_note_form_cancel' => 'Отмена',
|
||||
'user_note_add' => 'Написать заметку',
|
||||
'user_note_save_error' => 'Ошибка сохранения заметки',
|
||||
'user_note_target_error' => 'Неверный пользователь для заметки',
|
||||
'user_note_list_empty' => 'Тут ничего нет',
|
||||
/**
|
||||
* Жалобы на пользователя
|
||||
*/
|
||||
|
|
|
@ -26,12 +26,12 @@
|
|||
</h2>
|
||||
|
||||
{* Заметка *}
|
||||
<p class="object-list-item-description user-note">{$oNote->getText()|escape}</p>
|
||||
{include 'user_note.tpl' oUserNote=$oNote iUserNoteId=$oUser->getId()}
|
||||
</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
{else}
|
||||
{include file='alert.tpl' mAlerts=$aLang.user_note_list_empty sAlertStyle='empty'}
|
||||
{include file='alert.tpl' mAlerts=$aLang.common.empty sAlertStyle='empty'}
|
||||
{/if}
|
||||
|
||||
{include file='pagination.tpl' aPaging=$aPaging}
|
||||
|
|
|
@ -249,9 +249,9 @@
|
|||
/**
|
||||
* Заметка
|
||||
*/
|
||||
.user-note { background: #F1F7AF; padding: 20px; }
|
||||
.user-note .user-note-text { margin-bottom: 10px; }
|
||||
.user-note .actions { margin-bottom: 0; }
|
||||
.user-note { background: #F1F7AF; padding: 20px; margin-bottom: 15px; }
|
||||
.user-note:last-child { margin-bottom: 0; }
|
||||
.actions.user-note-actions { margin: 10px 0 0 0; padding: 0; background: none; border: none; }
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -4,38 +4,17 @@
|
|||
* @styles css/blocks.css
|
||||
*}
|
||||
|
||||
{extends file='blocks/block.aside.base.tpl'}
|
||||
{extends 'blocks/block.aside.base.tpl'}
|
||||
|
||||
{block name='block_options'}
|
||||
{block 'block_options'}
|
||||
{if ! $oUserCurrent or ( $oUserCurrent and $oUserCurrent->getId() == $oUserProfile->getId() )}
|
||||
{$bBlockNotShow = true}
|
||||
{/if}
|
||||
{/block}
|
||||
|
||||
{block name='block_type'}profile-note{/block}
|
||||
{block 'block_type'}profile-note{/block}
|
||||
{block 'block_class'}block-nopadding{/block}
|
||||
|
||||
{block name='block_content_after'}
|
||||
<div class="user-note js-user-note" data-user-id="{$oUserProfile->getId()}">
|
||||
<div class="user-note-content js-user-note-content">
|
||||
<p class="user-note-text js-user-note-text" {if ! $oUserNote}style="display: none"{/if}>
|
||||
{if $oUserNote}
|
||||
{$oUserNote->getText()}
|
||||
{/if}
|
||||
</p>
|
||||
|
||||
<ul class="actions user-note-actions js-user-note-actions" {if ! $oUserNote}style="display: none;"{/if}>
|
||||
<li><a href="#" class="link-dotted js-user-note-edit-button">{$aLang.user_note_form_edit}</a></li>
|
||||
<li><a href="#" class="link-dotted js-user-note-remove-button">{$aLang.user_note_form_delete}</a></li>
|
||||
</ul>
|
||||
|
||||
<a href="#" class="link-dotted js-user-note-add-button" {if $oUserNote}style="display:none;"{/if}>{$aLang.user_note_add}</a>
|
||||
</div>
|
||||
|
||||
<div class="js-user-note-edit" style="display: none;">
|
||||
<textarea rows="4" cols="20" class="width-full mb-15 js-user-note-edit-text"></textarea>
|
||||
|
||||
<button type="submit" class="button button-primary js-user-note-edit-save">{$aLang.user_note_form_save}</button>
|
||||
<button type="submit" class="button js-user-note-edit-cancel">{$aLang.user_note_form_cancel}</button>
|
||||
</div>
|
||||
</div>
|
||||
{block 'block_content_after'}
|
||||
{include 'user_note.tpl' oUserNote=$oUserProfile->getUserNote() iUserNoteId=$oUserProfile->getId()}
|
||||
{/block}
|
|
@ -35,7 +35,7 @@
|
|||
|
||||
{* Заметка *}
|
||||
{if $oUserNote}
|
||||
<p class="object-list-item-description user-note">{$oUserNote->getText()|escape}</p>
|
||||
{include 'user_note.tpl' oUserNote=$oUserNote iUserNoteId=$oUser->getId()}
|
||||
{/if}
|
||||
|
||||
{* Информация *}
|
||||
|
|
41
application/frontend/skin/developer/user_note.tpl
Normal file
41
application/frontend/skin/developer/user_note.tpl
Normal file
|
@ -0,0 +1,41 @@
|
|||
{**
|
||||
* Заметка
|
||||
*
|
||||
* @param object $oUserNote Заметка
|
||||
* @param integer $iUserNoteId ID сущности
|
||||
* @param boolean $bUserNoteEditable Можно редактировать заметку или нет
|
||||
* @param string $sUserNoteClasses Дополнительные классы
|
||||
*
|
||||
* @styles <common>/css/common.css
|
||||
* @scripts <common>/js/usernote.js
|
||||
*}
|
||||
|
||||
{$bUserNoteEditable = $bUserNoteEditable|default:true}
|
||||
|
||||
<div class="user-note js-user-note {$sUserNoteClasses}" data-user-id="{$iUserNoteId}">
|
||||
<div class="user-note-content js-user-note-content">
|
||||
<p class="user-note-text js-user-note-text" {if ! $oUserNote}style="display: none"{/if}>
|
||||
{if $oUserNote}
|
||||
{$oUserNote->getText()}
|
||||
{/if}
|
||||
</p>
|
||||
|
||||
{if $bUserNoteEditable}
|
||||
<ul class="actions user-note-actions js-user-note-actions" {if ! $oUserNote}style="display: none;"{/if}>
|
||||
<li><a href="#" class="link-dotted js-user-note-edit-button">{$aLang.common.edit}</a></li>
|
||||
<li><a href="#" class="link-dotted js-user-note-remove-button">{$aLang.common.remove}</a></li>
|
||||
</ul>
|
||||
|
||||
<a href="#" class="link-dotted js-user-note-add-button" {if $oUserNote}style="display:none;"{/if}>{$aLang.user_note.add}</a>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
{if $bUserNoteEditable}
|
||||
<div class="js-user-note-edit" style="display: none;">
|
||||
<textarea rows="4" cols="20" class="width-full mb-15 js-user-note-edit-text"></textarea>
|
||||
|
||||
<button type="submit" class="button button-primary js-user-note-edit-save">{$aLang.common.save}</button>
|
||||
<button type="submit" class="button js-user-note-edit-cancel">{$aLang.common.cancel}</button>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
Loading…
Reference in a new issue