1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-06-16 23:00:51 +03:00

Доработка компонентов

This commit is contained in:
Denis Shakhov 2014-10-22 21:56:53 +07:00
parent 063ff02a20
commit 63ae63c8ee
37 changed files with 124 additions and 481 deletions

View file

@ -401,7 +401,7 @@ class ActionAjax extends Action
$oViewer->Assign('sTargetType', $sTargetType);
$oViewer->Assign('sTargetId', $sTargetId);
$oViewer->Assign('sTargetTmp', $sTargetTmp);
$this->Viewer_AssignAjax('sText', $oViewer->Fetch("modals/modal.poll_create.tpl"));
$this->Viewer_AssignAjax('sText', $oViewer->Fetch("components/poll/modal.poll-create.tpl"));
}
protected function EventPollModalUpdate()

View file

@ -1162,7 +1162,7 @@ class ActionProfile extends Action
$oViewer = $this->Viewer_GetLocalViewer();
$oViewer->Assign('target', $iTarget, true);
$this->Viewer_AssignAjax('sText', $oViewer->Fetch("modals/modal.add_friend.tpl"));
$this->Viewer_AssignAjax('sText', $oViewer->Fetch("components/user/modal.add-friend.tpl"));
}
/**

View file

@ -64,6 +64,8 @@ class BlockTagsFavouriteTopic extends Block
*/
$this->Viewer_Assign("aFavouriteTopicUserTags", $aTags);
$this->Viewer_Assign("oFavouriteUser", $oUser);
$this->SetTemplate('components/tags-favourite/tags-cloud.tpl');
}
}
}

View file

@ -48,17 +48,17 @@ class HookStatisticsPerformance extends Hook
*/
$iTimeInit = $oEngine->GetTimeInit();
$iTimeFull = round(microtime(true) - $iTimeInit, 3);
$this->Viewer_Assign('iTimeFullPerformance', $iTimeFull);
$this->Viewer_Assign('timeFullPerformance', $iTimeFull, true);
/**
* Получаем статистику по кешу и БД
*/
$aStats = $oEngine->getStats();
$aStats['cache']['time'] = round($aStats['cache']['time'], 5);
$this->Viewer_Assign('aStatsPerformance', $aStats);
$this->Viewer_Assign('stats', $aStats, true);
$this->Viewer_Assign('bIsShowStatsPerformance', Router::GetIsShowStats());
/**
* В ответ рендерим шаблон статистики
*/
return $this->Viewer_Fetch('actions/ActionAdmin/statistics_performance.tpl');
return $this->Viewer_Fetch('components/perfomance/performance.tpl');
}
}

View file

@ -548,6 +548,7 @@ $config['head']['default']['js'] = array(
"___path.skin.web___/components/favourite/js/favourite.js",
"___path.skin.web___/components/editor/js/editor.js",
"___path.skin.web___/components/comment/js/comment.js",
"___path.skin.web___/components/comment/js/toolbar.comments.js",
"___path.skin.web___/components/topic/js/topic.js",
"___path.skin.web___/components/topic/js/topic-add.js",
"___path.skin.web___/components/topic/js/topic-favourite.js",
@ -579,14 +580,12 @@ $config['head']['default']['js'] = array(
"___path.skin.web___/components/uploader/js/uploader-file.js",
"___path.skin.web___/components/uploader/js/uploader-info.js",
"___path.skin.web___/components/media/js/media.js",
"___path.skin.web___/components/tags/js/tags.js",
"___path.skin.web___/components/tags-favourite/js/tags-favourite.js",
"___path.skin.web___/components/block/js/block.js",
"___path.skin.web___/components/actionbar/js/actionbar-item-select.js",
"___path.skin.web___/components/toolbar-scrollup/js/toolbar.scrollup.js",
"___path.skin.web___/components/toolbar-scrollnav/js/toolbar.scrollnav.js",
"___path.application.web___/frontend/common/js/subscribe.js",
"___path.application.web___/frontend/common/js/toolbar.comments.js",
"___path.application.web___/frontend/common/js/toolbar.topics.js",
"___path.application.web___/frontend/common/js/toolbar.scrollup.js",
"___path.application.web___/frontend/common/js/admin.js",
"___path.application.web___/frontend/common/js/content.js",
"___path.application.web___/frontend/common/js/search.js",
"___path.application.web___/frontend/common/js/init.js",
@ -607,6 +606,7 @@ $config['head']['default']['css'] = array(
"___path.skin.web___/components/toolbar/css/toolbar.css",
"___path.skin.web___/components/nav/css/nav.css",
"___path.skin.web___/components/property/css/property.css",
"___path.skin.web___/components/tags-favourite/css/tags-favourite.css",
"___path.framework.frontend.web___/css/forms.css",
"___path.framework.frontend.web___/css/tooltip.css",
"___path.framework.frontend.web___/css/typography.css",

View file

@ -1,34 +0,0 @@
/**
* Админка
*
* @module ls/admin
*
* @license GNU General Public License, version 2
* @copyright 2013 OOO "ЛС-СОФТ" {@link http://livestreetcms.com}
* @author Denis Shakhov <denis.shakhov@gmail.com>
*/
var ls = ls || {};
ls.admin = ls.admin || {};
ls.admin.blogCategories = (function ($) {
this.showForm = function( url, form ) {
ls.ajax.submit( url, form, function( result ) {
if (result.bStateError) {
ls.msg.error(result.sMsgTitle, result.sMsg);
} else {
window.location.href = window.location.href;
}
});
};
this.showFormAdd = function( form ) {
this.showForm( aRouter.admin + 'blogcategory/add/', form );
};
this.showFormEdit = function( form ) {
this.showForm( aRouter.admin + 'blogcategory/edit/', form );
};
return this;
}).call( ls.admin.blogCategories || {}, jQuery );

View file

@ -1,16 +1,13 @@
{extends 'layouts/layout.base.tpl'}
{block 'layout_options'}
{$bNoSidebar = true}
{$bNoSidebar = true}
{/block}
{block 'layout_page_title'}{lang name='admin.title'} {if $bAvailableAdminPlugin} - <a href="{router page='admin/plugins'}?plugin=admin&action=activate&security_ls_key={$LIVESTREET_SECURITY_KEY}">{lang name='admin.install_plugin_admin'}</a>{/if}{/block}
{block 'layout_page_title'}
{lang name='admin.title'}
{/block}
{block 'layout_content'}
<ul>
<li><a href="{router page="admin"}plugins/">{lang name='admin.items.plugins'}</a></li>
{hook run='admin_action_item'}
</ul>
{hook run='admin_action'}
{include 'components/admin/manage.tpl'}
{/block}

View file

@ -11,53 +11,5 @@
{/block}
{block 'layout_content'}
<table class="table table-plugins">
<thead>
<tr>
<th>{$aLang.admin.plugins.plugin_name}</th>
<th>{$aLang.admin.plugins.plugin_version}</th>
<th>{$aLang.admin.plugins.plugin_author}</th>
<th>{$aLang.admin.plugins.plugin_settings}</th>
<th></th>
</tr>
</thead>
<tbody>
{foreach $aPlugins as $aPlugin}
<tr {if $aPlugin.is_active}class="active"{/if}>
<td>
<h3>{$aPlugin.property->name->data}</h3>
{$aPlugin.property->description->data}
</td>
<td>{$aPlugin.property->version|escape:'html'}</td>
<td>
{$aPlugin.property->author->data}<br />
{$aPlugin.property->homepage}
</td>
<td>
{if $aPlugin.property->settings != ""}
{if $aPlugin.is_active}
<a href="{$aPlugin.property->settings}">{$aLang.admin.plugins.plugin_settings}</a>
{else}
{/if}
{/if}
</td>
<td align="center">
{if $aPlugin.is_active}
<a href="{router page='admin'}plugins/?plugin={$aPlugin.code}&action=deactivate&security_ls_key={$LIVESTREET_SECURITY_KEY}" class="button">{$aLang.admin.plugins.plugin_deactivate}</a>
{else}
<a href="{router page='admin'}plugins/?plugin={$aPlugin.code}&action=activate&security_ls_key={$LIVESTREET_SECURITY_KEY}" class="button button-primary">{$aLang.admin.plugins.plugin_activate}</a>
{/if}
{if $aPlugin.apply_update and $aPlugin.is_active}
<a href="{router page='admin'}plugins/?plugin={$aPlugin.code}&action=apply_update&security_ls_key={$LIVESTREET_SECURITY_KEY}" class="button">{lang name='admin.plugins.plugin_apply_update'}</a>
{/if}
<a href="{router page='admin'}plugins/?plugin={$aPlugin.code}&action=remove&security_ls_key={$LIVESTREET_SECURITY_KEY}" class="button" onclick="return confirm('{$aLang.common.remove_confirm}');">{lang name='admin.plugins.plugin_delete'}</a>
</td>
</tr>
{/foreach}
</tbody>
</table>
{include 'components/admin/plugins.tpl' plugins=$aPlugins}
{/block}

View file

@ -1,42 +0,0 @@
{**
* Информация о производительности движка
*
* @styles css/admin.css
*}
{if $bIsShowStatsPerformance and $oUserCurrent and $oUserCurrent->isAdministrator()}
<div class="alert alert--info stat-performance">
{hook run='statistics_performance_begin'}
<table>
<tr>
<td>
<h4>MySql</h4>
query: <strong>{$aStatsPerformance.sql.count}</strong><br />
time: <strong>{$aStatsPerformance.sql.time}</strong>
</td>
<td>
<h4>Cache</h4>
query: <strong>{$aStatsPerformance.cache.count}</strong><br />
&mdash; set: <strong>{$aStatsPerformance.cache.count_set}</strong><br />
&mdash; get: <strong>{$aStatsPerformance.cache.count_get}</strong><br />
time: <strong>{$aStatsPerformance.cache.time}</strong>
</td>
<td>
<h4>PHP</h4>
time load modules: <strong>{$aStatsPerformance.engine.time_load_module}</strong><br />
full time: <strong>{$iTimeFullPerformance}</strong>
</td>
<td>
<h4>Memory</h4>
memory usage: <strong>{memory_get_usage(true) / 1024 / 1024} Mb</strong><br />
memory peak usage: <strong>{memory_get_peak_usage(true) / 1024 / 1024} Mb</strong>
</td>
{hook run='statistics_performance_item'}
</tr>
</table>
{hook run='statistics_performance_end'}
</div>
{/if}

View file

@ -1,19 +0,0 @@
{**
* Избранные теги пользователя.
* Блок находится в профиле пользователя в разделе "Избранные топики".
*
* @styles css/common.css
*}
<div class="accordion">
<h3 class="accordion-header" onclick="jQuery('#block_favourite_topic_content').toggle(); return false;">
<span class="link-dotted">{lang 'favourite_tags.title'} {if $sFavouriteTag}({$sFavouriteTag}){/if}</span>
</h3>
<div class="accordion-content" id="block_favourite_topic_content">
{include 'components/tags/tag_cloud.tpl'
aTags = $aFavouriteTopicUserTags
sTagsUrl = '{$oFavouriteUser->getUserWebPath()}favourites/topics/tag/{$oTag->getText()|escape:\'url\'}/'
sTagsActive = $sFavouriteTag}
</div>
</div>

View file

@ -17,7 +17,7 @@
{* Подключаем модальное окно удаления блога если пользователь админ *}
{if $oUserCurrent and $oUserCurrent->isAdministrator()}
{include 'modals/modal.blog_delete.tpl'}
{include './modal.blog-delete.tpl'}
{/if}
{* Является ли пользователь администратором или управляющим блога *}

View file

@ -25,7 +25,7 @@
{/if}
{/block}
{add_block group='toolbar' name='toolbar/toolbar.comment.tpl' target='.js-comment'}
{add_block group='toolbar' name='components/comment/toolbar.comment.tpl' target='.js-comment'}
<div class="{$sComponent} js-comments {mod name=$sComponent mods=$mods} {$smarty.local.classes}"
id="comments"

View file

@ -2,43 +2,43 @@
* Базовый шаблона e-mail'а
*}
{$sBackgroundColor = 'F4F4F4'} {* Цвет фона *}
{$backgroundColor = 'F4F4F4'} {* Цвет фона *}
{$sContainerBorderColor = 'D0D6E8'} {* Цвет границ основного контейнера *}
{$containerBorderColor = 'D0D6E8'} {* Цвет границ основного контейнера *}
{$sHeaderBackgroundColor = '5C7DC4'} {* Цвет фона шапки *}
{$sHeaderTitleColor = 'FFFFFF'} {* Цвет заголовка в шапке *}
{$sHeaderDescriptionColor = 'B8C5E1'} {* Цвет описания в шапке *}
{$headerBackgroundColor = '5C7DC4'} {* Цвет фона шапки *}
{$headerTitleColor = 'FFFFFF'} {* Цвет заголовка в шапке *}
{$headerDescriptionColor = 'B8C5E1'} {* Цвет описания в шапке *}
{$sContentBackgroundColor = 'FFFFFF'} {* Цвет фона содержимого письма *}
{$sContentTitleColor = '000000'} {* Цвет заголовка *}
{$sContentTextColor = '4f4f4f'} {* Цвет текста *}
{$contentBackgroundColor = 'FFFFFF'} {* Цвет фона содержимого письма *}
{$contentTitleColor = '000000'} {* Цвет заголовка *}
{$contentTextColor = '4f4f4f'} {* Цвет текста *}
{$sFooterBackgroundColor = 'fafafa'} {* Цвет фона футера *}
{$sFooterTextColor = '949fa3'} {* Цвет текста в футере *}
{$sFooterLinkColor = '949fa3'} {* Цвет ссылки в футере *}
{$footerBackgroundColor = 'fafafa'} {* Цвет фона футера *}
{$footerTextColor = '949fa3'} {* Цвет текста в футере *}
{$footerLinkColor = '949fa3'} {* Цвет ссылки в футере *}
{* Путь до папки с изображенями *}
{$sImagesDir = "{Config::Get('path.skin.assets.web')}/images/emails"}
{$imagesDir = "{Config::Get('path.skin.web')}/components/email/images"}
{* Фон *}
<table width="100%" align="center" bgcolor="#{$sBackgroundColor}" cellpadding="0" cellspacing="0" style="border-collapse: collapse;">
<table width="100%" align="center" bgcolor="#{$backgroundColor}" cellpadding="0" cellspacing="0" style="border-collapse: collapse;">
<tr><td>
<br />
<br />
{* Основной контейнер *}
<table width="573" align="center" cellpadding="0" cellspacing="0" style="border-collapse: collapse; font: normal 13px/1.4em Verdana, Arial; color: #4f4f4f; border: 1px solid #{$sContainerBorderColor};">
<table width="573" align="center" cellpadding="0" cellspacing="0" style="border-collapse: collapse; font: normal 13px/1.4em Verdana, Arial; color: #4f4f4f; border: 1px solid #{$containerBorderColor};">
{* Шапка *}
<tr>
<td>
<table width="100%" bgcolor="#{$sHeaderBackgroundColor}" cellpadding="50" cellspacing="0" style="border-collapse: collapse;">
<table width="100%" bgcolor="#{$headerBackgroundColor}" cellpadding="50" cellspacing="0" style="border-collapse: collapse;">
<tr>
<td style="font-size: 11px; line-height: 1em;">
<span style="font: normal 29px Arial, sans-serif; line-height: 1em; color: #{$sHeaderTitleColor}"><strong>{Config::Get('view.name')}</strong></span>
<div style="line-height: 0; height: 10px;"><img src="{$sImagesDir}/blank.gif" width="10" height="10"/></div>
<span style="color: #{$sHeaderDescriptionColor}">{Config::Get('view.description')}</span>
<span style="font: normal 29px Arial, sans-serif; line-height: 1em; color: #{$headerTitleColor}"><strong>{Config::Get('view.name')}</strong></span>
<div style="line-height: 0; height: 10px;"><img src="{$imagesDir}/blank.gif" width="10" height="10"/></div>
<span style="color: #{$headerDescriptionColor}">{Config::Get('view.description')}</span>
</td>
</tr>
</table>
@ -48,18 +48,18 @@
{* Контент *}
<tr>
<td>
<table width="100%" cellpadding="50" cellspacing="0" bgcolor="#{$sContentBackgroundColor}" style="border-collapse: collapse;">
<table width="100%" cellpadding="50" cellspacing="0" bgcolor="#{$contentBackgroundColor}" style="border-collapse: collapse;">
<tr>
<td valign="top">
<table width="100%" cellpadding="0" cellspacing="0" style="border-collapse: collapse; font: normal 13px/1.4em Verdana, Arial; color: #{$sContentTextColor};">
<table width="100%" cellpadding="0" cellspacing="0" style="border-collapse: collapse; font: normal 13px/1.4em Verdana, Arial; color: #{$contentTextColor};">
{* Заголовок *}
{if $sTitle}
<tr>
<td valign="top">
<span style="font: normal 19px Arial; line-height: 1.3em; color: #{$sContentTitleColor}">{$sTitle}</span>
<span style="font: normal 19px Arial; line-height: 1.3em; color: #{$contentTitleColor}">{$title}</span>
</td>
</tr>
<tr><td height="10"><div style="line-height: 0;"><img src="{$sImagesDir}/blank.gif" width="15" height="15"/></div></td></tr>
<tr><td height="10"><div style="line-height: 0;"><img src="{$imagesDir}/blank.gif" width="15" height="15"/></div></td></tr>
{/if}
{* Текст *}
@ -77,11 +77,11 @@
</table>
{* Подвал *}
<table width="100%" bgcolor="#{$sFooterBackgroundColor}" cellpadding="20" cellspacing="0" style="border-collapse: collapse; font: normal 11px Verdana, Arial; line-height: 1.3em; color: #{$sFooterTextColor};">
<table width="100%" bgcolor="#{$footerBackgroundColor}" cellpadding="20" cellspacing="0" style="border-collapse: collapse; font: normal 11px Verdana, Arial; line-height: 1.3em; color: #{$footerTextColor};">
<tr>
<td valign="center">
<img src="{$sImagesDir}/blank.gif" width="27" height="10" style="vertical-align: middle">
<a href="{Router::GetPath('/')}" style="color: #{$sFooterLinkColor} !important;">{Config::Get('view.name')}</a>
<img src="{$imagesDir}/blank.gif" width="27" height="10" style="vertical-align: middle">
<a href="{Router::GetPath('/')}" style="color: #{$footerLinkColor} !important;">{Config::Get('view.name')}</a>
</td>
</tr>
</table>

View file

@ -0,0 +1,42 @@
{**
* Информация о производительности движка
*}
{if $bIsShowStatsPerformance and $oUserCurrent and $oUserCurrent->isAdministrator()}
{$stats = $smarty.local.stats}
<div class="alert alert--info stat-performance">
{hook run='statistics_performance_begin'}
<table>
<tr>
<td>
<h4>MySql</h4>
query: <strong>{$stats.sql.count}</strong><br />
time: <strong>{$stats.sql.time}</strong>
</td>
<td>
<h4>Cache</h4>
query: <strong>{$stats.cache.count}</strong><br />
&mdash; set: <strong>{$stats.cache.count_set}</strong><br />
&mdash; get: <strong>{$stats.cache.count_get}</strong><br />
time: <strong>{$stats.cache.time}</strong>
</td>
<td>
<h4>PHP</h4>
time load modules: <strong>{$stats.engine.time_load_module}</strong><br />
full time: <strong>{$smarty.local.timeFullPerformance}</strong>
</td>
<td>
<h4>Memory</h4>
memory usage: <strong>{memory_get_usage(true) / 1024 / 1024} Mb</strong><br />
memory peak usage: <strong>{memory_get_peak_usage(true) / 1024 / 1024} Mb</strong>
</td>
{hook run='statistics_performance_item'}
</tr>
</table>
{hook run='statistics_performance_end'}
</div>
{/if}

View file

@ -1,14 +1,14 @@
{**
* Управления опросами (добавление/удаление/редактирование)
*
* @param string $sTargetId
* @param string $sTargetType
* @param string $targetId
* @param string $targetType
*
* @styles poll.css
* @scripts <common>/js/poll.js
*}
<div class="fieldset poll-manage js-poll-manage" data-type="{$sTargetType}" data-target-id="{$sTargetId}">
<div class="fieldset 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>
@ -19,8 +19,8 @@
{* Список добавленных опросов *}
{insert name="block" block="pollFormItems" params=[
'target_type' => $sTargetType,
'target_id' => $sTargetId
'target_type' => $smarty.local.targetType,
'target_id' => $smarty.local.targetId
]}
</div>
</div>

View file

@ -6,9 +6,6 @@
.tag-list-item a { white-space: nowrap; }
.tag-list-item-edit { margin-left: 20px; }
.tag-list-item-tag.tag-list-item-tag-personal a { color: #3CA023; }
.tag-list-item-tag.tag-list-item-tag-personal a:hover { color: #f00; }
/**
* Облако тегов

View file

@ -1,182 +0,0 @@
/**
* Теги
*
* @module ls/tags
*
* @license GNU General Public License, version 2
* @copyright 2013 OOO "ЛС-СОФТ" {@link http://livestreetcms.com}
* @author Denis Shakhov <denis.shakhov@gmail.com>
*/
var ls = ls || {};
ls.tags = (function ($) {
"use strict";
/**
* ID текущего объекта
*
* @private
*/
var _targetId = 0;
/**
* Тип текущего объекта
*
* @private
*/
var _targetType = null;
/**
* Дефолтные опции
*
* @private
*/
var _defaults = {
// Селекторы
selectors: {
form: '#favourite-form-tags',
submitForm: '#js-favourite-form',
submitButton: '.js-tags-form-submit',
submitInputList: '.js-tags-form-input-list',
tag: '.js-tag-list-item-tag',
tagPersonal: '.js-tag-list-item-tag-personal',
editPersonalTags: '.js-favourite-tag-edit'
},
// Роуты
routers: {
save: aRouter['ajax'] + 'favourite/save-tags/'
}
};
/**
* Инициализация
*
* @param {Object} options Опции
*/
this.init = function(options) {
var _this = this;
this.options = $.extend({}, _defaults, options);
this.oForm = $(this.options.selectors.form);
this.oSubmitButton = $(this.options.selectors.submitButton);
this.oSubmitForm = $(this.options.selectors.submitForm);
this.oSubmitInputList = $(this.options.selectors.submitInputList);
this.oEditPersonalTags = $(this.options.selectors.editPersonalTags);
// Показываем форму редактирования персональных тегов
this.oEditPersonalTags.on('click', function (e) {
var oElement = $(this);
_this.setTarget(oElement.data('id'), oElement.data('type'));
_this.showForm();
e.preventDefault();
});
// Сабмит формы редактирования персональных тегов
this.oSubmitForm.on('submit', function (e) {
this.save();
e.preventDefault();
}.bind(this));
};
/**
* Устанавливает id и тип текущего объекта
*
* @param {Number} iId ID объекта
* @param {String} sType Тип объекта
*/
this.setTarget = function(iId, sType) {
_targetId = iId;
_targetType = sType;
};
/**
* Сохраняет персональные теги
*/
this.save = function() {
var _this = this;
ls.hook.marker('saveTagsBefore');
ls.ajax.submit(this.options.routers.save, this.oSubmitForm, function(result) {
if (result.bStateError) {
ls.msg.error(null, result.sMsg);
} else {
var tagsContainer = $('.js-tags-' + _targetType + '-' + _targetId),
aTags = [];
$.each(result.aTags, function(k, v) {
aTags.push('<li class="tag-list-item tag-list-item-tag tag-list-item-tag-personal js-tag-list-item-tag-personal">, ' +
'<a rel="tag" href="' + v.url + '" class="">' + v.tag + '</a></li>');
});
this.hideForm();
tagsContainer.find(this.options.selectors.tagPersonal).remove();
tagsContainer.find(this.options.selectors.editPersonalTags).before( aTags.join('') );
ls.hook.run('ls_favourite_save_tags_after', [this.oSubmitForm, result], this);
}
}.bind(this), {
submitButton: _this.oSubmitButton,
params: {
target_id: _targetId,
target_type: _targetType
}
});
return false;
};
/**
* Показывает форму редактирования тегов
*/
this.showForm = function() {
var aTags = [];
$('.js-tags-' + _targetType + '-' + _targetId).find(this.options.selectors.tagPersonal + ' a').each(function(k, tag) {
aTags.push( $(tag).text() );
});
this.oSubmitInputList.val( aTags.join(', ') );
this.oForm.modal('show');
return false;
};
/**
* Скрывает форму редактирования тегов
*/
this.hideForm = function() {
this.oForm.modal('hide');
};
/**
* Показывает персональные теги
*
* @param {Number} iTargetId ID объекта
* @param {String} sTargetType Тип объекта
*/
this.showPersonalTags = function(sTargetType, iTargetId) {
$('.js-tags-' + sTargetType + '-' + iTargetId).find(this.options.selectors.editPersonalTags).show();
};
/**
* Скрывает персональные теги
*
* @param {Number} iTargetId ID объекта
* @param {String} sTargetType Тип объекта
*/
this.hidePersonalTags = function(sTargetType, iTargetId) {
var tagsContainer = $('.js-tags-' + sTargetType + '-' + iTargetId);
tagsContainer.find(this.options.selectors.tagPersonal).remove();
tagsContainer.find(this.options.selectors.editPersonalTags).hide();
this.hideForm();
};
return this;
}).call(ls.tags || {}, jQuery);

View file

@ -1,34 +0,0 @@
{**
* Список тегов
*
* @styles css/common.css
*}
{if $aTags}
<ul class="tag-list tag-list-topic js-tags-topic-{$oTopic->getId()}" data-type="{$sTagsFavouriteType}" data-id="{$iTagsFavouriteId}">
<li class="tag-list-item tag-list-item-label">{$aLang.tags.tags}:</li>
{strip}
{foreach $aTags as $sTag}
<li class="tag-list-item tag-list-item-tag">
{if ! $sTag@first}, {/if}<a rel="tag" href="{router page='tag'}{$sTag|escape:'url'}/">{$sTag|escape}</a>
</li>
{/foreach}
{* Персональные теги *}
{if $oUserCurrent && $bTagsUseFavourite}
{foreach $aTagsFavourite as $sTag}
<li class="tag-list-item tag-list-item-tag tag-list-item-tag-personal js-tag-list-item-tag-personal">
, <a href="{$oUserCurrent->getUserWebPath()}favourites/topics/tag/{$sTag|escape:'url'}/"
rel="tag"
class="">{$sTag|escape}</a>
</li>
{/foreach}
<li class="tag-list-item tag-list-item-edit js-favourite-tag-edit" data-type="{$sTagsFavouriteType}" data-id="{$iTagsFavouriteId}" {if $smarty.local.showEditButton}style="display:none;"{/if}>
<a href="#" class="link-dotted">{lang 'favourite_tags.edit'}</a>
</li>
{/if}
{/strip}
</ul>
{/if}

View file

@ -0,0 +1,21 @@
{**
* Список тегов
*}
{$component = 'tags'}
{if $smarty.local.tags}
<ul class="tag-list js-tags-topic-{$smarty.local.targetId}" data-type="{$smarty.local.targetType}" data-id="{$smarty.local.targetId}">
<li class="tag-list-item tag-list-item-label">{$aLang.tags.tags}:</li>
{strip}
{block 'tags_list'}
{foreach $smarty.local.tags as $tag}
<li class="tag-list-item tag-list-item-tag">
{if ! $tag@first}, {/if}<a rel="tag" href="{router page='tag'}{$tag|escape:'url'}/">{$tag|escape}</a>
</li>
{/foreach}
{/block}
{/strip}
</ul>
{/if}

View file

@ -1,9 +1,6 @@
{**
* Тулбар
* Кнопка прокручивания к следующему/предыдущему топику
*
* @styles css/toolbar.css
* @scripts js/livestreet/toolbar.js
*}
{extends 'components/toolbar/toolbar.item.tpl'}

View file

@ -8,7 +8,7 @@
{$topics = $smarty.local.topics}
{if $topics}
{add_block group='toolbar' name='toolbar/toolbar.topic.tpl' show=count( $topics )}
{add_block group='toolbar' name='components/toolbar-scrollnav/toolbar.scrollnav.tpl' show=count( $topics )}
{foreach $topics as $topic}
{include './topic-type.tpl' topic=$topic isList=true}

View file

@ -66,13 +66,12 @@
{$favourite = $topic->getFavourite()}
{if ! $isPreview}
{include 'components/tags/tag_list.tpl'
aTags = $topic->getTagsArray()
bTagsUseFavourite = true
showEditButton = ! $favourite
aTagsFavourite = ($favourite) ? $favourite->getTagsArray() : []
sTagsFavouriteType = 'topic'
iTagsFavouriteId = $topic->getId()}
{include 'components/tags-favourite/tags.tpl'
tags = $topic->getTagsArray()
tagsFavourite = ( $favourite ) ? $favourite->getTagsArray() : []
isEditable = ! $favourite
targetType = 'topic'
targetId = $topic->getId()}
{/if}
{/if}

View file

@ -224,7 +224,6 @@ ls.user = (function ($) {
return false;
};
this.showCropImage = function(src, params) {
params = params || {};
var _this = this;

View file

@ -147,9 +147,9 @@
{* Подключение модальных окон *}
{if $oUserCurrent}
{include 'modals/modal.create.tpl'}
{include 'modals/modal.favourite_tags.tpl'}
{include 'components/tags-favourite/modal.favourite_tags.tpl'}
{else}
{include 'modals/modal.auth.tpl'}
{include 'components/auth/modal.auth.tpl'}
{/if}
@ -157,8 +157,8 @@
* Тулбар
* Добавление кнопок в тулбар
*}
{add_block group='toolbar' name='toolbar/toolbar.admin.tpl' priority=100}
{add_block group='toolbar' name='toolbar/toolbar.scrollup.tpl' priority=-100}
{add_block group='toolbar' name='components/admin/toolbar.admin.tpl' priority=100}
{add_block group='toolbar' name='components/toolbar-scrollup/toolbar.scrollup.tpl' priority=-100}
{* Подключение тулбара *}
{include 'components/toolbar/toolbar.tpl'}

View file

@ -1,30 +0,0 @@
{**
* Добавление пользовательских тегов к топику
*
* @styles css/modals.css
* @scripts <common>/js/tags.js
*}
{extends 'components/modal/modal.tpl'}
{block 'modal_id'}favourite-form-tags{/block}
{block 'modal_class'}modal-favourite-tags js-modal-default{/block}
{block 'modal_title'}{lang 'favourite_tags.title'}{/block}
{block 'modal_content'}
<form id="js-favourite-form">
{include 'components/field/field.text.tpl'
name = 'tags'
noMargin = true
autofocus = true
classes = 'width-full autocomplete-tags-sep js-tags-form-input-list'}
</form>
{/block}
{block 'modal_footer_begin'}
{include 'components/button/button.tpl'
form = 'js-favourite-form'
text = $aLang.common.save
classes = 'js-tags-form-submit'
mods = 'primary'}
{/block}

View file

@ -1,9 +1,5 @@
{**
* Ресайз загруженного изображения
*
* @styles css/modals.css
*
* TODO: Унифицировать
*}
{extends 'components/modal/modal.tpl'}

View file

@ -1,18 +0,0 @@
{**
* Тулбар
* Кнопка перехода в админку
*
* @styles css/toolbar.css
* @scripts js/livestreet/toolbar.js
*}
{extends 'components/toolbar/toolbar.item.tpl'}
{block 'toolbar_item_options' append}
{$_mods = 'admin'}
{$_bShow = $oUserCurrent and $oUserCurrent->isAdministrator()}
{/block}
{block 'toolbar_item'}
{toolbar_item_icon sUrl="{router page='admin'}" sTitle="{lang name='admin.title'}" sIcon="icon-cog"}
{/block}