mirror of
https://github.com/Oreolek/ifhub.club.git
synced 2024-06-28 20:45:00 +03:00
Доработка личных сообщений
This commit is contained in:
parent
4ca2ac364d
commit
4a0e2099f0
|
@ -192,6 +192,17 @@ class ModuleTalk_EntityTalk extends Entity
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Возвращает полный URL для удаления сообщения
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getUrlDelete()
|
||||||
|
{
|
||||||
|
return Router::GetPath('talk') . 'delete/' . $this->getId() . '/';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Устанавливает ID сообщения
|
* Устанавливает ID сообщения
|
||||||
*
|
*
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
"talk": "js/talk.js"
|
"talk": "js/talk.js"
|
||||||
},
|
},
|
||||||
"styles": {
|
"styles": {
|
||||||
"talk": "css/talk.css"
|
"talk": "css/talk.css",
|
||||||
|
"message-root": "css/message-root.css"
|
||||||
}
|
}
|
||||||
}
|
}
|
21
application/frontend/components/talk/css/message-root.css
Normal file
21
application/frontend/components/talk/css/message-root.css
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
/**
|
||||||
|
* Первое сообщение в диалоге
|
||||||
|
*
|
||||||
|
* @license GNU General Public License, version 2
|
||||||
|
* @copyright 2013 OOO "ЛС-СОФТ" {@link http://livestreetcms.com}
|
||||||
|
* @author Denis Shakhov <denis.shakhov@gmail.com>
|
||||||
|
*/
|
||||||
|
|
||||||
|
.ls-talk-message-root,
|
||||||
|
.ls-talk-message-root-info,
|
||||||
|
.ls-talk-message-root-actionbar,
|
||||||
|
.ls-talk-message-root-text {
|
||||||
|
margin-bottom: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ls-talk-message-root-info-item {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
.ls-talk-message-root-info-item--author {
|
||||||
|
margin-right: 15px;
|
||||||
|
}
|
|
@ -15,6 +15,10 @@
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ls-talk-participants-details {
|
||||||
|
margin-bottom: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Message user list
|
* Message user list
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -2,21 +2,47 @@
|
||||||
* Первое сообщение в диалоге
|
* Первое сообщение в диалоге
|
||||||
*}
|
*}
|
||||||
|
|
||||||
{extends 'Component@article.article'}
|
{$component = 'ls-talk-message-root'}
|
||||||
|
|
||||||
{block 'article_options'}
|
{* Генерируем копии локальных переменных, *}
|
||||||
{$article = $smarty.local.talk}
|
{* чтобы их можно было изменять в дочерних шаблонах *}
|
||||||
|
{foreach [ 'talk', 'mods', 'classes', 'attributes' ] as $param}
|
||||||
|
{assign var="$param" value=$smarty.local.$param}
|
||||||
|
{/foreach}
|
||||||
|
|
||||||
{$smarty.block.parent}
|
|
||||||
|
|
||||||
{$type = 'talk'}
|
<div class="{$component} {cmods name=$component mods=$mods} {$classes}" {cattr list=$attributes}>
|
||||||
{$classes = "{$classes} talk"}
|
{* Заголовок *}
|
||||||
{/block}
|
<h2 class="{$component}-title">
|
||||||
|
{$talk->getTitle()}
|
||||||
|
</h2>
|
||||||
|
|
||||||
{* Информация *}
|
{* Информация *}
|
||||||
{block 'article_footer_info_items' append}
|
<ul class="{$component}-info">
|
||||||
{* Избранное *}
|
{* Автор *}
|
||||||
<li class="{$component}-info-item {$component}-info-item--favourite">
|
<li class="{$component}-info-item {$component}-info-item--author">
|
||||||
{component 'favourite' classes="js-favourite-{$type}" target=$article}
|
{component 'user' template='avatar' user=$talk->getUser() size='xxsmall' mods='inline'}
|
||||||
</li>
|
</li>
|
||||||
{/block}
|
|
||||||
|
<li class="{$component}-info-item {$component}-info-item--date">
|
||||||
|
<time datetime="{date_format date=$talk->getDate() format='c'}" title="{date_format date=$talk->getDate() format='j F Y, H:i'}">
|
||||||
|
{date_format date=$talk->getDate() hours_back="12" minutes_back="60" now="60" day="day H:i" format="j F Y, H:i"}
|
||||||
|
</time>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
{* Содержимое *}
|
||||||
|
<div class="{$component}-text ls-text">
|
||||||
|
{$talk->getText()}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{* Действия *}
|
||||||
|
{component 'actionbar' classes="{$component}-actionbar" items=[
|
||||||
|
[ 'buttons' => [
|
||||||
|
[ 'text' => {component 'favourite' classes="js-favourite-talk" target=$talk}, 'mods' => 'icon', 'classes' => 'js-talk-message-root-favourite' ]
|
||||||
|
]],
|
||||||
|
[ 'buttons' => [
|
||||||
|
[ 'icon' => 'trash', 'url' => "{$talk->getUrlDelete()}?security_ls_key={$LIVESTREET_SECURITY_KEY}", 'text' => {lang 'common.remove'}, 'show' => $oUserCurrent->getId() == $talk->getUser()->getId() || $oUserCurrent->isAdministrator() ]
|
||||||
|
]]
|
||||||
|
]}
|
||||||
|
</div>
|
|
@ -13,13 +13,19 @@
|
||||||
|
|
||||||
{if ! $bNoComments}
|
{if ! $bNoComments}
|
||||||
{* Участники личного сообщения *}
|
{* Участники личного сообщения *}
|
||||||
{include './participants/participants.tpl'
|
{capture 'talk_message_root_participants'}
|
||||||
users = $talk->getTalkUsers()
|
{include './participants/participants.tpl'
|
||||||
classes = 'message-users js-message-users'
|
users = $talk->getTalkUsers()
|
||||||
attributes = [ 'data-param-target_id' => $talk->getId() ]
|
classes = 'message-users js-message-users'
|
||||||
editable = $talk->getUserId() == $oUserCurrent->getId() || $oUserCurrent->isAdministrator()
|
attributes = [ 'data-param-target_id' => $talk->getId() ]
|
||||||
title = $aLang.talk.users.title
|
editable = $talk->getUserId() == $oUserCurrent->getId() || $oUserCurrent->isAdministrator()
|
||||||
excludeRemove = [ $oUserCurrent->getId() ]}
|
excludeRemove = [ $oUserCurrent->getId() ]}
|
||||||
|
{/capture}
|
||||||
|
|
||||||
|
{component 'details'
|
||||||
|
classes = 'js-details-default ls-talk-participants-details'
|
||||||
|
title = "{lang 'talk.users.title'} ({count($talk->getTalkUsers())})"
|
||||||
|
content = $smarty.capture.talk_message_root_participants}
|
||||||
|
|
||||||
{* Вывод комментариев к сообщению *}
|
{* Вывод комментариев к сообщению *}
|
||||||
{component 'comment' template='comments'
|
{component 'comment' template='comments'
|
||||||
|
|
Loading…
Reference in a new issue