Browse Source

Обновление скина с upstream.

explain
Alexander Yakovlev 5 years ago
parent
commit
dac9e2c046
  1. 13
      .editorconfig
  2. 2
      actions/ActionAdmin/index.tpl
  3. 10
      actions/ActionBlog/add.tpl
  4. 6
      actions/ActionBlog/admin.tpl
  5. 8
      actions/ActionBlog/blog.tpl
  6. 10
      actions/ActionBlog/index.tpl
  7. 18
      actions/ActionContent/add.tpl
  8. 8
      actions/ActionContent/drafts.tpl
  9. 10
      actions/ActionIndex/index.tpl
  10. 7
      actions/ActionProfile/created.comments.tpl
  11. 5
      actions/ActionProfile/created.notes.tpl
  12. 7
      actions/ActionProfile/created.topics.tpl
  13. 7
      actions/ActionProfile/favourite.comments.tpl
  14. 8
      actions/ActionProfile/favourite.topics.tpl
  15. 18
      actions/ActionSearch/index.tpl
  16. 10
      actions/ActionStream/all.tpl
  17. 10
      actions/ActionStream/personal.tpl
  18. 2
      actions/ActionTalk/favourites.tpl
  19. 10
      actions/ActionUserfeed/list.tpl
  20. 20
      assets/css/colors.css
  21. 25
      assets/css/layout.css
  22. 31
      assets/js/init.js
  23. 20
      layouts/layout.activity.tpl
  24. 482
      layouts/layout.base.tpl
  25. 18
      layouts/layout.blog.edit.tpl
  26. 40
      layouts/layout.content.form.tpl
  27. 18
      layouts/layout.index.tpl
  28. 52
      layouts/layout.topics.tpl
  29. 18
      layouts/layout.user.created.tpl
  30. 17
      layouts/layout.user.favourite.tpl
  31. 12
      layouts/layout.user.messages.tpl
  32. 11
      layouts/layout.user.settings.tpl
  33. 4
      navs/nav.topics.sub.tpl

13
.editorconfig

@ -0,0 +1,13 @@
# EditorConfig is awesome: http://EditorConfig.org
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
indent_style = space
indent_size = 4
trim_trailing_whitespace = true

2
actions/ActionAdmin/index.tpl

@ -12,7 +12,7 @@
{block 'layout_content'}
{component 'nav'
name = 'admin'
hook = 'admin'
mods = 'stacked pills'
items = [
[ 'name' => 'user', 'url' => "{router page='admin/plugins'}?plugin=admin&action=activate&security_ls_key={$LIVESTREET_SECURITY_KEY}", 'text' => {lang 'admin.install_plugin_admin'}, is_enabled => $availableAdminPlugin ],

10
actions/ActionBlog/add.tpl

@ -3,17 +3,9 @@
*
* @param array $blogCategories Список категорий блогов
* @param object $blogEdit Блог, передается в случае если блог редактируется
*
* TODO: Вынести 'rangelength' в конфиг
*}
{extends 'layouts/layout.base.tpl'}
{block 'layout_options' append}
{if $sEvent == 'edit'}
{$sNav = 'blog.edit'}
{/if}
{/block}
{extends 'layouts/layout.blog.edit.tpl'}
{block 'layout_page_title'}
{if $sEvent == 'add'}

6
actions/ActionBlog/admin.tpl

@ -6,11 +6,7 @@
* @param array $blogUsersInvited Список приглашенных пользователей, передается в случае если блог закрытый
*}
{extends 'layouts/layout.base.tpl'}
{block 'layout_options' append}
{$sNav = 'blog.edit'}
{/block}
{extends 'layouts/layout.blog.edit.tpl'}
{block 'layout_page_title'}
{$aLang.blog.admin.title}: <a href="{$blogEdit->getUrlFull()}">{$blogEdit->getTitle()|escape}</a>

8
actions/ActionBlog/blog.tpl

@ -15,11 +15,7 @@
* @param integer $countBlogAdministrators Кол-во администраторов
*}
{extends 'layouts/layout.base.tpl'}
{block 'layout_options' append}
{$sNav = 'topics.sub'}
{/block}
{extends 'layouts/layout.topics.tpl'}
{block 'layout_content_header'}
{component 'blog' blog=$blog blogs=$blogs}
@ -34,7 +30,5 @@
{* Список топиков *}
{if $isPrivateBlog}
{component 'alert' text=$aLang.blog.alerts.private mods='error'}
{else}
{component 'topic' template='list' topics=$topics paging=$paging}
{/if}
{/block}

10
actions/ActionBlog/index.tpl

@ -7,12 +7,4 @@
* @param string $periodSelectRoot
*}
{extends 'layouts/layout.base.tpl'}
{block 'layout_options' append}
{$sNav = 'topics'}
{/block}
{block 'layout_content'}
{component 'topic' template='list' topics=$topics paging=$paging}
{/block}
{extends 'layouts/layout.topics.tpl'}

18
actions/ActionContent/add.tpl

@ -7,22 +7,8 @@
* @parama integer $blogId
*}
{extends 'layouts/layout.base.tpl'}
{block 'layout_options' append}
{if $sEvent == 'add'}
{$sNav = 'create'}
{/if}
{/block}
{block 'layout_page_title'}
{if $sEvent == 'add'}
{$aLang.topic.add.title.add}
{else}
{$aLang.topic.add.title.edit}
{/if}
{/block}
{extends 'layouts/layout.content.form.tpl'}
{block 'layout_content'}
{component 'topic' template='add-type' topic=$topicEdit type=$topicType blogs=$blogsAllow blogId=$blogId skipBlogs=$skipBlogs}
{component 'topic.add-type' topic=$topicEdit type=$topicType blogs=$blogsAllow blogId=$blogId skipBlogs=$skipBlogs}
{/block}

8
actions/ActionContent/drafts.tpl

@ -5,16 +5,12 @@
* @parama array $paging
*}
{extends 'layouts/layout.base.tpl'}
{block 'layout_options' append}
{$sNav = 'create'}
{/block}
{extends 'layouts/layout.content.form.tpl'}
{block 'layout_page_title'}
{$aLang.topic.add.title.add}
{/block}
{block 'layout_content'}
{component 'topic' template='list' topics=$topics paging=$paging}
{component 'topic.list' topics=$topics paging=$paging}
{/block}

10
actions/ActionIndex/index.tpl

@ -5,12 +5,4 @@
* @parama array $paging
*}
{extends 'layouts/layout.base.tpl'}
{block 'layout_options' append}
{$sNav = 'topics'}
{/block}
{block 'layout_content'}
{component 'topic' template='list' topics=$topics paging=$paging}
{/block}
{extends 'layouts/layout.index.tpl'}

7
actions/ActionProfile/created.comments.tpl

@ -5,13 +5,12 @@
* @param array $paging
*}
{extends 'layouts/layout.user.tpl'}
{extends 'layouts/layout.user.created.tpl'}
{block 'layout_user_page_title'}
{lang name='user.publications.title'}
{lang 'user.publications.title'}
{/block}
{block 'layout_content' append}
{include 'navs/nav.user.created.tpl'}
{component 'comment' template='list' comments=$comments paging=$paging classes='js-topic-comments-list'}
{component 'comment.list' comments=$comments paging=$paging classes='js-topic-comments-list'}
{/block}

5
actions/ActionProfile/created.notes.tpl

@ -5,13 +5,12 @@
* @param array $paging
*}
{extends 'layouts/layout.user.tpl'}
{extends 'layouts/layout.user.created.tpl'}
{block 'layout_user_page_title'}
{lang 'user.publications.title'}
{/block}
{block 'layout_content' append}
{include 'navs/nav.user.created.tpl'}
{component 'user' template='list' users=$notesUsers pagination=$paging}
{component 'user.list' users=$notesUsers pagination=$paging}
{/block}

7
actions/ActionProfile/created.topics.tpl

@ -5,13 +5,12 @@
* @param array $paging
*}
{extends 'layouts/layout.user.tpl'}
{extends 'layouts/layout.user.created.tpl'}
{block 'layout_user_page_title'}
{lang name='user.publications.title'}
{lang 'user.publications.title'}
{/block}
{block 'layout_content' append}
{include 'navs/nav.user.created.tpl'}
{component 'topic' template='list' topics=$topics paging=$paging}
{component 'topic.list' topics=$topics paging=$paging}
{/block}

7
actions/ActionProfile/favourite.comments.tpl

@ -5,13 +5,12 @@
* @param array $paging
*}
{extends 'layouts/layout.user.tpl'}
{extends 'layouts/layout.user.favourite.tpl'}
{block 'layout_user_page_title'}
{lang name='user.favourites.title'}
{lang 'user.favourites.title'}
{/block}
{block 'layout_content' append}
{include 'navs/nav.user.favourite.tpl'}
{component 'comment' template='list' comments=$comments paging=$paging classes='js-topic-comments-list'}
{component 'comment.list' comments=$comments paging=$paging classes='js-topic-comments-list'}
{/block}

8
actions/ActionProfile/favourite.topics.tpl

@ -6,15 +6,13 @@
* @param array $activeFavouriteTag
*}
{extends 'layouts/layout.user.tpl'}
{extends 'layouts/layout.user.favourite.tpl'}
{block 'layout_user_page_title'}
{lang name='user.favourites.title'}
{lang 'user.favourites.title'}
{/block}
{block 'layout_content' append}
{include 'navs/nav.user.favourite.tpl'}
{* Блок с тегами избранного *}
{if $oUserCurrent && $oUserCurrent->getId() == $oUserProfile->getId()}
{insert name='block' block='tagsPersonalTopic' params=[
@ -23,5 +21,5 @@
]}
{/if}
{component 'topic' template='list' topics=$topics paging=$paging}
{component 'topic.list' topics=$topics paging=$paging}
{/block}

18
actions/ActionSearch/index.tpl

@ -14,10 +14,22 @@
{$aLang.search.search}
{/block}
{block 'layout_content'}
{component 'search' template='main' searchType=$searchType}
{include 'navs/nav.search.tpl'}
{block 'layout_content_header' prepend}
{component 'search.main' searchType=$searchType}
{/block}
{block 'layout_options' append}
{$layoutNav = [[
name => 'search',
activeItem => $searchType,
items => [
[ 'name' => 'topics', 'url' => "{router page='search/topics'}?q={$_aRequest.q}", 'text' => $aLang.search.result.topics, 'count' => $typeCounts.topics ],
[ 'name' => 'comments', 'url' => "{router page='search/comments'}?q={$_aRequest.q}", 'text' => $aLang.search.result.comments, 'count' => $typeCounts.comments ]
]
]]}
{/block}
{block 'layout_content'}
{if $resultItems}
{if $searchType == 'topics'}
{component 'topic' template='list' topics=$resultItems paging=$paging}

10
actions/ActionStream/all.tpl

@ -5,15 +5,7 @@
* @param integer $activityEventsAllCount
*}
{extends 'layouts/layout.base.tpl'}
{block 'layout_options' append}
{$sNav = 'activity'}
{/block}
{block 'layout_page_title'}
{$aLang.activity.title}
{/block}
{extends 'layouts/layout.activity.tpl'}
{block 'layout_content'}
{component 'activity' events=$activityEvents count=$activityEventsAllCount classes='js-activity--all'}

10
actions/ActionStream/personal.tpl

@ -5,15 +5,7 @@
* @param integer $activityEventsAllCount
*}
{extends 'layouts/layout.base.tpl'}
{block 'layout_options' append}
{$sNav = 'activity'}
{/block}
{block 'layout_page_title'}
{$aLang.activity.title}
{/block}
{extends 'layouts/layout.activity.tpl'}
{block 'layout_content'}
{component 'activity' events=$activityEvents count=$activityEventsAllCount classes='js-activity--personal'}

2
actions/ActionTalk/favourites.tpl

@ -8,5 +8,5 @@
{extends 'layouts/layout.user.messages.tpl'}
{block 'layout_content'}
{component 'talk' template='list.tpl' talks=$talks paging=$paging}
{component 'talk.list' talks=$talks paging=$paging}
{/block}

10
actions/ActionUserfeed/list.tpl

@ -5,12 +5,4 @@
* @param array $paging
*}
{extends 'layouts/layout.base.tpl'}
{block 'layout_options' append}
{$sNav = 'topics'}
{/block}
{block 'layout_content'}
{component 'topic' template='list' topics=$topics paging=$paging}
{/block}
{extends 'layouts/layout.index.tpl'}

20
assets/css/colors.css

@ -12,3 +12,23 @@
.ls-nav-item--userbar-username img.avatar {
display: none;
}
ul.classic {
list-style: inside;
list-style-type: circle;
}
ol.classic {
list-style: inside;
list-style-type: decimal;
}
.ls-nav--userbar > .ls-nav-item > a{
color: #ddd !important;
padding: 15px 20px !important;
}
.ls-nav--userbar > .ls-nav-item > a:hover{
color: #ddd !important;
background: #333 !important;
}
.ls-nav--userbar > .ls-nav-item > a > img {
display: none;
}

25
assets/css/layout.css

@ -68,23 +68,10 @@
}
}
ul.classic {
list-style: inside;
list-style-type: circle;
}
ol.classic {
list-style: inside;
list-style-type: decimal;
}
.ls-nav--userbar > .ls-nav-item > a{
color: #ddd !important;
padding: 15px 20px !important;
}
.ls-nav--userbar > .ls-nav-item > a:hover{
color: #ddd !important;
background: #333 !important;
}
.ls-nav--userbar > .ls-nav-item > a > img {
display: none;
}
/**
* Шапка сайта
*/
.ls-jumbotron {
background-image: url(../images/header.jpg);
}

31
assets/js/init.js

@ -37,6 +37,31 @@ jQuery(document).ready(function($){
$('.js-form-validate').parsley();
/**
* Userbar
*/
$('.ls-userbar .ls-nav--root > .ls-nav-item--has-children').lsDropdown({
selectors: {
toggle: '> .ls-nav-item-link',
text: '> .ls-nav-item-link > .ls-nav-item-text',
menu: '> .ls-nav--sub'
}
});
/**
* Навигация по контенту
*/
$('.ls-nav--root.ls-nav--pills > .ls-nav-item--has-children').lsDropdown({
selectors: {
toggle: '> .ls-nav-item-link',
text: '> .ls-nav-item-link > .ls-nav-item-text',
menu: '> .ls-nav--sub'
},
selectable: true
});
/**
* Подтверждение удаления
*/
@ -97,13 +122,13 @@ jQuery(document).ready(function($){
});
$('.js-field-date-default').livequery(function () {
$(this).lsFieldDate({
$(this).lsDate({
language: LANGUAGE
});
});
$('.js-field-time-default').livequery(function () {
$(this).lsFieldTime();
$(this).lsTime();
});
$('[data-type=captcha]').livequery(function () {
@ -366,7 +391,7 @@ jQuery(document).ready(function($){
cancel_photo: aRouter.settings + 'ajax-crop-cancel-photo'
},
changeavatar: function ( event, _this, avatars ) {
$( '.js-user-profile-avatar, .js-wall-entry[data-user-id=' + _this.option( 'params.user_id' ) + '] .comment-avatar img' ).attr( 'src', avatars[ '64crop' ] + '?' + Math.random() );
$( '.js-user-profile-avatar, .js-wall-entry[data-user-id=' + _this.option( 'params.target_id' ) + '] .ls-comment-avatar img' ).attr( 'src', avatars[ '64crop' ] + '?' + Math.random() );
$( '.nav-item--userbar-username img' ).attr( 'src', avatars[ '24crop' ] + '?' + Math.random() );
}
});

20
layouts/layout.activity.tpl

@ -0,0 +1,20 @@
{**
* Активность
*}
{extends './layout.base.tpl'}
{block 'layout_options' append}
{$layoutNav = [[
hook => 'activity',
activeItem => $sMenuItemSelect,
items => [
[ 'name' => 'user', 'url' => "{router page='stream'}personal/", 'text' => $aLang.activity.nav.personal, 'is_enabled' => !! $oUserCurrent ],
[ 'name' => 'all', 'url' => "{router page='stream'}all/", 'text' => $aLang.activity.nav.all ]
]
]]}
{/block}
{block 'layout_page_title'}
{$aLang.activity.title}
{/block}

482
layouts/layout.base.tpl

@ -1,281 +1,259 @@
{**
* Основной лэйаут
* Основной лэйаут, который наследуют все остальные лэйауты
*
* @param boolean $layoutShowSidebar Показывать сайдбар или нет, сайдбар не будет выводится если он не содержит блоков
* @param string $layoutNavContent Название навигации
* @param string $layoutNavContentPath Кастомный путь до навигации контента
* @param boolean $layoutShowSidebar Показывать сайдбар или нет, сайдбар не будет выводится если он не содержит блоков
* @param string $layoutNavContent Название навигации
* @param string $layoutNavContentPath Кастомный путь до навигации контента
* @param string $layoutShowSystemMessages Показывать системные уведомления или нет
*}
{extends 'Component@layout.layout'}
{extends 'component@layout.layout'}
{block 'layout_options' append}
{$layoutShowSidebar = $layoutShowSidebar|default:true}
{$layoutShowSystemMessages = $layoutShowSystemMessages|default:true}
{$layoutShowSidebar = $layoutShowSidebar|default:true}
{$layoutShowSystemMessages = $layoutShowSystemMessages|default:true}
{/block}
{*
{block 'layout_head_styles' append}
<link href='//fonts.googleapis.com/css?family=Open+Sans:300,400,700&amp;subset=latin,cyrillic' rel='stylesheet' type='text/css'>
<link rel="search" type="application/opensearchdescription+xml" href="{router page='search'}opensearch/" title="{Config::Get('view.name')}" />
{/block}
*}
{block 'layout_head' append}
{* Получаем блоки для вывода в сайдбаре *}
{if $layoutShowSidebar}
{show_blocks group='right' assign=layoutSidebarBlocks}
{$layoutSidebarBlocks = trim( $layoutSidebarBlocks )}
{$layoutShowSidebar = !!$layoutSidebarBlocks}
{/if}
{**
* Тип сетки сайта
*}
{if {Config::Get('view.grid.type')} == 'fluid'}
<style>
.layout-nav .ls-nav--main,
.layout-container,
.container {
min-width: {Config::Get('view.grid.fluid_min_width')};
max-width: {Config::Get('view.grid.fluid_max_width')};
}
</style>
{else}
<style>
.layout-nav .ls-nav--main,
.layout-container,
.container { width: {Config::Get('view.grid.fixed_width')}; }
</style>
{/if}
{* Получаем блоки для вывода в сайдбаре *}
{if $layoutShowSidebar}
{show_blocks group='right' assign=layoutSidebarBlocks}
{$layoutSidebarBlocks = trim( $layoutSidebarBlocks )}
{$layoutShowSidebar = !!$layoutSidebarBlocks}
{/if}
{**
* Тип сетки сайта
*}
{if {Config::Get('view.grid.type')} == 'fluid'}
<style>
.layout-userbar,
.layout-nav .ls-nav--main,
.layout-header .ls-jumbotron-inner,
.layout-container,
.container {
min-width: {Config::Get('view.grid.fluid_min_width')};
max-width: {Config::Get('view.grid.fluid_max_width')};
}
</style>
{else}
<style>
.layout-userbar,
.layout-nav .ls-nav--main,
.layout-header .ls-jumbotron-inner,
.layout-container,
.container { width: {Config::Get('view.grid.fixed_width')}; }
</style>
{/if}
{/block}
{block 'layout_body'}
{**
* Основная навигация
*}
<div class="layout-container">
<nav class="ls-grid-row layout-nav">
<h1 class="ls-userbar-logo">
<a href="{router page='/'}"><img src="/application/frontend/skin/ifhub/assets/images/logo.png" height="60px"></a>
</h1>
<nav class="ls-userbar-nav">
{if $oUserCurrent}
{$items = [
[
'text' => "<img src=\"{$oUserCurrent->getProfileAvatarPath(24)}\" alt=\"{$oUserCurrent->getDisplayName()}\" class=\"avatar\" /> {$oUserCurrent->getDisplayName()}",
'url' => "{$oUserCurrent->getUserWebPath()}",
'classes' => 'ls-nav-item--userbar-username',
'show' => true,
'menu' => [
[
'name' => 'whois',
'text' => {lang name='user.profile.nav.info'},
'url' => "{$oUserCurrent->getUserWebPath()}"
],
[
'name' => 'wall',
'text' => {lang name='user.profile.nav.wall'},
'url' => "{$oUserCurrent->getUserWebPath()}wall/",
'count' => $iUserCurrentCountWall
],
[
'name' => 'created',
'text' => {lang name='user.profile.nav.publications'},
'url' => "{$oUserCurrent->getUserWebPath()}created/topics/",
'count' => $iUserCurrentCountCreated
],
[
'name' => 'favourites',
'text' => {lang name='user.profile.nav.favourite'},
'url' => "{$oUserCurrent->getUserWebPath()}favourites/topics/",
'count' => $iUserCurrentCountFavourite
],
[
'name' => 'friends',
'text' => {lang name='user.profile.nav.friends'},
'url' => "{$oUserCurrent->getUserWebPath()}friends/",
'count' => $iUserCurrentCountFriends
],
[
'name' => 'activity',
'text' => {lang name='user.profile.nav.activity'},
'url' => "{$oUserCurrent->getUserWebPath()}stream/"
],
[
'name' => 'talk',
'text' => {lang name='user.profile.nav.messages'},
'url' => "{router page='talk'}",
'count' => $iUserCurrentCountTalkNew
],
[
'name' => 'settings',
'text' => {lang name='user.profile.nav.settings'},
'url' => "{router page='settings'}"
],
[
'name' => 'admin',
'text' => {lang name='admin.title'},
'url' => "{router page='admin'}",
'is_enabled' => $oUserCurrent && $oUserCurrent->isAdministrator()
]
]
],
[ 'text' => $aLang.common.create, 'url' => "{router page='content'}add/topic", 'classes' => 'js-modal-toggle-default', 'attributes' => [ 'data-lsmodaltoggle-modal' => 'modal-write' ] ],
[ 'text' => $aLang.talk.title, 'url' => "{router page='talk'}", 'title' => $aLang.talk.new_messages, 'is_enabled' => $iUserCurrentCountTalkNew, 'count' => $iUserCurrentCountTalkNew ],
[ 'text' => $aLang.auth.logout, 'url' => "{router page='auth'}logout/?security_ls_key={$LIVESTREET_SECURITY_KEY}" ]
]}
{else}
{$items = [
[
'text' => $aLang.auth.login.title,
'classes' => 'js-modal-toggle-login',
'url' => {router page='auth/login'}
],
[
'text' => $aLang.auth.registration.title,
'classes' => 'js-modal-toggle-registration',
'url' => {router page='auth/register'}
]
]}
{/if}
{component 'nav' name='userbar' activeItem=$sMenuHeadItemSelect mods='userbar' items=$items}
</nav>
{include 'navs/nav.main.tpl'}
{component 'search' template='main' mods='light'}
</nav></div>
{if $oUserCurrent}
{component 'modal-create'}
{/if}
{**
* Основной контэйнер
*}
<div id="container" class="ls-grid-row layout-container {hook run='container_class'} {if $layoutShowSidebar}layout-has-sidebar{else}layout-no-sidebar{/if}">
{* Вспомогательный контейнер-обертка *}
<div class="ls-grid-row layout-wrapper" class="{hook run='wrapper_class'}">
{**
* Контент
*}
<div class="ls-grid-col ls-grid-col-8 layout-content"
role="main"
{if $sMenuItemSelect == 'profile'}itemscope itemtype="http://data-vocabulary.org/Person"{/if}>
{hook run='content_begin'}
{* Основной заголовок страницы *}
{block 'layout_page_title' hide}
<h2 class="page-header">
{$smarty.block.child}
</h2>
{/block}
{block 'layout_content_header'}
{* Навигация *}
{if $sNav}
{if in_array($sNav, $aMenuContainers)}
{$_navContent = $aMenuFetch.$sNav}
{hook run='layout_body_begin'}
{**
* Основная навигация
*}
<div class="layout-container">
<nav class="ls-grid-row layout-nav">
<h1 class="ls-userbar-logo">
<a href="{router page='/'}"><img src="/application/frontend/skin/ifhub/assets/images/logo.png" height="60px"></a>
</h1>
<nav class="ls-userbar-nav">
{if $oUserCurrent}
{$createMenu = []}
{foreach $LS->Topic_GetTopicTypes() as $type}
{$createMenu[] = [ 'name' => $type->getCode(), 'text' => $type->getName(), 'url' => $type->getUrlForAdd() ]}
{/foreach}
{$createMenu[] = [ 'name' => 'blog', 'text' => {lang 'modal_create.items.blog'}, 'url' => {router page='blog'} ]}
{$createMenu[] = [ 'name' => 'talk', 'text' => {lang 'modal_create.items.talk'}, 'url' => {router page='talk'} ]}
{$createMenu[] = [ 'name' => 'drafts', 'text' => {lang 'topic.drafts'}, 'url' => "{router page='content'}drafts/", count => $iUserCurrentCountTopicDraft ]}
{$items = [
[
'text' => "<img src=\"{$oUserCurrent->getProfileAvatarPath(24)}\" alt=\"{$oUserCurrent->getDisplayName()}\" class=\"avatar\" /> {$oUserCurrent->getDisplayName()}",
'url' => "{$oUserCurrent->getUserWebPath()}",
'classes' => 'ls-nav-item--userbar-username',
'menu' => [
'items' => [
[ 'name' => 'whois', 'text' => {lang name='user.profile.nav.info'}, 'url' => "{$oUserCurrent->getUserWebPath()}" ],
[ 'name' => 'wall', 'text' => {lang name='user.profile.nav.wall'}, 'url' => "{$oUserCurrent->getUserWebPath()}wall/", 'count' => $iUserCurrentCountWall ],
[ 'name' => 'created', 'text' => {lang name='user.profile.nav.publications'}, 'url' => "{$oUserCurrent->getUserWebPath()}created/topics/", 'count' => $iUserCurrentCountCreated ],
[ 'name' => 'favourites', 'text' => {lang name='user.profile.nav.favourite'}, 'url' => "{$oUserCurrent->getUserWebPath()}favourites/topics/", 'count' => $iUserCurrentCountFavourite ],
[ 'name' => 'friends', 'text' => {lang name='user.profile.nav.friends'}, 'url' => "{$oUserCurrent->getUserWebPath()}friends/", 'count' => $iUserCurrentCountFriends ],
[ 'name' => 'activity', 'text' => {lang name='user.profile.nav.activity'}, 'url' => "{$oUserCurrent->getUserWebPath()}stream/" ],
[ 'name' => 'talk', 'text' => {lang name='user.profile.nav.messages'}, 'url' => "{router page='talk'}", 'count' => $iUserCurrentCountTalkNew ],
[ 'name' => 'settings', 'text' => {lang name='user.profile.nav.settings'}, 'url' => "{router page='settings'}" ],
[ 'name' => 'admin', 'text' => {lang name='admin.title'}, 'url' => "{router page='admin'}", 'is_enabled' => $oUserCurrent && $oUserCurrent->isAdministrator() ]
]
]
],
[ 'text' => $aLang.common.create, menu => [ hook => 'create', items => $createMenu ] ],
[ 'text' => $aLang.talk.title, 'url' => "{router page='talk'}", 'title' => $aLang.talk.new_messages, 'is_enabled' => $iUserCurrentCountTalkNew, 'count' => $iUserCurrentCountTalkNew ],
[ 'text' => $aLang.auth.logout, 'url' => "{router page='auth'}logout/?security_ls_key={$LIVESTREET_SECURITY_KEY}" ]
]}
{else}
{include "{$sNavPath}navs/nav.$sNav.tpl" assign=_navContent}
{$items = [
[ 'text' => $aLang.auth.login.title, 'classes' => 'js-modal-toggle-login', 'url' => {router page='auth/login'} ],
[ 'text' => $aLang.auth.registration.title, 'classes' => 'js-modal-toggle-registration', 'url' => {router page='auth/register'} ]
]}
{/if}
{* Проверяем наличие вывода на случай если меню с одним пунктом автоматом скрывается *}
{if $_navContent|strip:''}
<div class="ls-nav-group">
{$_navContent}
</div>
{/if}
{/if}
{component 'nav' hook='userbar_nav' hookParams=[ user => $oUserCurrent ] activeItem=$sMenuHeadItemSelect mods='userbar' items=$items}
</nav>
{* Системные сообщения *}
{if $layoutShowSystemMessages}
{if $aMsgError}
{component 'alert' text=$aMsgError mods='error' close=true}
{/if}
{include 'navs/nav.main.tpl'}
{component 'search' template='main' mods='light'}
</nav></div>
{if $oUserCurrent}
{component 'modal-create'}
{/if}
{**
* Основной контэйнер
*}
<div id="container" class="ls-grid-row layout-container {hook run='layout_container_class' action=$sAction} {if $layoutShowSidebar}layout-has-sidebar{else}layout-no-sidebar{/if}">
{* Вспомогательный контейнер-обертка *}
<div class="ls-grid-row layout-wrapper {hook run='layout_wrapper_class' action=$sAction}">
{**
* Контент
*}
<div class="ls-grid-col ls-grid-col-8 layout-content"
role="main"
{if $sMenuItemSelect == 'profile'}itemscope itemtype="http://data-vocabulary.org/Person"{/if}>
{hook run='layout_content_header_begin' action=$sAction}
{* Основной заголовок страницы *}
{block 'layout_page_title' hide}
<h2 class="page-header">
{$smarty.block.child}
</h2>
{/block}
{block 'layout_content_header'}
{* Навигация *}
{if $layoutNav}
{$_layoutNavContent = ""}
{if is_array($layoutNav)}
{foreach $layoutNav as $layoutNavItem}
{if is_array($layoutNavItem)}
{component 'nav' mods='pills' params=$layoutNavItem assign=_layoutNavItemContent}
{$_layoutNavContent = "$_layoutNavContent $_layoutNavItemContent"}
{else}
{$_layoutNavContent = "$_layoutNavContent $layoutNavItem"}
{/if}
{/foreach}
{else}
{$_layoutNavContent = $layoutNav}
{/if}
{* Проверяем наличие вывода на случай если меню с одним пунктом автоматом скрывается *}
{if $_layoutNavContent|strip:''}
<div class="ls-nav-group">
{$_layoutNavContent}
</div>
{/if}
{/if}
{if $aMsgNotice}
{component 'alert' text=$aMsgNotice close=true}
{* Системные сообщения *}
{if $layoutShowSystemMessages}
{if $aMsgError}
{component 'alert' text=$aMsgError mods='error' close=true}
{/if}
{if $aMsgNotice}
{component 'alert' text=$aMsgNotice close=true}
{/if}
{/if}
{/block}
{hook run='layout_content_begin' action=$sAction}
{block 'layout_content'}{/block}
{hook run='layout_content_end' action=$sAction}
</div>
{**
* Сайдбар
* Показываем сайдбар
*}
{if $layoutShowSidebar}
<aside class="ls-grid-col ls-grid-col-4 layout-sidebar" role="complementary">
{$layoutSidebarBlocks}
</aside>
{/if}
{/if}
{/block}
{block 'layout_content'}{/block}
{hook run='content_end'}
</div>
{**
* Сайдбар
* Показываем сайдбар
*}
{if $layoutShowSidebar}
<aside class="ls-grid-col ls-grid-col-4 layout-sidebar" role="complementary">
{$layoutSidebarBlocks}
</aside>
{/if}
</div> {* /wrapper *}
{* Подвал *}
<footer class="ls-grid-row layout-footer">
{block 'layout_footer'}
{hook run='footer_begin'}
{hook run='copyright'}
{hook run='footer_end'}
{/block}
</footer>
</div> {* /container *}
{* Подключение модальных окон *}
{if $oUserCurrent}
{component 'tags-personal' template='modal'}
{else}
{component 'auth' template='modal'}
{/if}
{**
* Тулбар
* Добавление кнопок в тулбар
*}
{add_block group='toolbar' name='component@admin.toolbar.admin' priority=100}
{add_block group='toolbar' name='component@toolbar-scrollup.toolbar.scrollup' priority=-100}
{* Подключение тулбара *}
{component 'toolbar' classes='js-toolbar-default' items={show_blocks group='toolbar'}}
<!-- Yandex.Metrika counter -->
<script type="text/javascript">
(function (d, w, c) {
(w[c] = w[c] || []).push(function() {
try {
w.yaCounter42008629 = new Ya.Metrika({
id:42008629,
clickmap:true,
trackLinks:true,
accurateTrackBounce:true,
webvisor:true
</div> {* /wrapper *}
{* Подвал *}
<footer class="ls-grid-row layout-footer">
{block 'layout_footer'}
{hook run='layout_footer_begin'}
{hook run='copyright'}
{hook run='layout_footer_end'}
{/block}
</footer>
</div> {* /container *}
{* Подключение модальных окон *}
{if $oUserCurrent}
{component 'tags-personal' template='modal'}
{else}
{component 'auth' template='modal'}
{/if}
{**
* Тулбар
* Добавление кнопок в тулбар
*}
{add_block group='toolbar' name='component@admin.toolbar.admin' priority=100}
{add_block group='toolbar' name='component@toolbar-scrollup.toolbar.scrollup' priority=-100}
{* Подключение тулбара *}
{component 'toolbar' classes='js-toolbar-default' items={show_blocks group='toolbar'}}
<!-- Yandex.Metrika counter -->
<script type="text/javascript">
(function (d, w, c) {
(w[c] = w[c] || []).push(function() {
try {
w.yaCounter42008629 = new Ya.Metrika({
id:42008629,
clickmap:true,
trackLinks:true,
accurateTrackBounce:true,
webvisor:true
});
} catch(e) { }
});
} catch(e) { }
});
var n = d.getElementsByTagName("script")[0],
s = d.createElement("script"),
f = function () { n.parentNode.insertBefore(s, n); };
s.type = "text/javascript";
s.async = true;
s.src = "https://mc.yandex.ru/metrika/watch.js";
if (w.opera == "[object Opera]") {
d.addEventListener("DOMContentLoaded", f, false);
} else { f(); }
})(document, window, "yandex_metrika_callbacks");
var n = d.getElementsByTagName("script")[0],
s = d.createElement("script"),
f = function () { n.parentNode.insertBefore(s, n); };
s.type = "text/javascript";
s.async = true;
s.src = "https://mc.yandex.ru/metrika/watch.js";
if (w.opera == "[object Opera]") {
d.addEventListener("DOMContentLoaded", f, false);
} else { f(); }
})(document, window, "yandex_metrika_callbacks");
</script>
<noscript><div><img src="https://mc.yandex.ru/watch/42008629" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
<!-- /Yandex.Metrika counter -->
{hook run='layout_body_end'}
{hook run='layout_body_end'}
{/block}

18
layouts/layout.blog.edit.tpl

@ -0,0 +1,18 @@
{**
* Форма ред-ия блога
*}
{extends './layout.base.tpl'}
{block 'layout_options' append}
{if $sEvent != 'add'}
{$layoutNav = [[
hook => 'blog_edit',
activeItem => $sMenuItemSelect,
items => [
[ 'name' => 'profile', 'url' => "{router page='blog'}edit/{$blogEdit->getId()}/", 'text' => $aLang.blog.admin.nav.profile ],
[ 'name' => 'admin', 'url' => "{router page='blog'}admin/{$blogEdit->getId()}/", 'text' => $aLang.blog.admin.nav.users ]
]
]]}
{/if}
{/block}

40
layouts/layout.content.form.tpl

@ -0,0 +1,40 @@
{**
* Страница добавления контента
*}
{extends './layout.base.tpl'}
{block 'layout_options' append}
{if $sEvent != 'edit'}
{$_items = []}
{* Формируем список пунктов *}
{$_topicTypes = $LS->Topic_GetTopicTypes()}
{foreach $_topicTypes as $type}
{$_items[] = [ 'name' => $type->getCode(), 'url' => $type->getUrlForAdd(), 'text' => $type->getName() ]}
{/foreach}
{* Пункт "Черновики" *}
{$_items[] = [
'name' => 'drafts',
'url' => "{router page='content'}drafts/",
'text' => $aLang.topic.drafts,
'count' => $iUserCurrentCountTopicDraft
]}
{$layoutNav = [[
name => 'content_form',
activeItem => $sMenuSubItemSelect,
items => $_items
]]}
{/if}
{/block}
{block 'layout_page_title'}
{if $sEvent == 'add'}
{$aLang.topic.add.title.add}
{else}
{$aLang.topic.add.title.edit}
{/if}
{/block}

18
layouts/layout.index.tpl

@ -0,0 +1,18 @@
{**
* Главная страница
*}
{extends './layout.topics.tpl'}
{block 'layout_options' prepend}
{* Все / Лента *}
{$layoutNav = [[
hook => 'topics',
activeItem => $sMenuItemSelect,
showSingle => false,
items => [
[ 'name' => 'index', 'url' => {router page='/'}, 'text' => {lang name='blog.menu.all'}, 'count' => $iCountTopicsNew ],
[ 'name' => 'feed', 'url' => {router page='feed'}, 'text' => $aLang.feed.title, 'is_enabled' => !! $oUserCurrent ]
]
]]}
{/block}

52
layouts/layout.topics.tpl

@ -0,0 +1,52 @@
{**
* Список топиков
*}
{extends './layout.base.tpl'}
{block 'layout_options' append}
{* Меню фильтрации топиков *}
{if $sNavTopicsSubUrl}
{if ! isset($layoutNav)}
{$layoutNav = []}
{/if}
{$layoutNav[] = [
hook => 'topics_sub',
activeItem => $sMenuSubItemSelect,
items => [
[ 'name' => 'good', 'url' => $sNavTopicsSubUrl, 'text' => {lang name='blog.menu.all_good'} ],
[ 'name' => 'new', 'url' => "{$sNavTopicsSubUrl}newall/", 'text' => {lang name='blog.menu.all_new'} ],
[ 'name' => 'discussed', 'url' => "{$sNavTopicsSubUrl}discussed/", 'text' => {lang name='blog.menu.all_discussed'} ],
[ 'name' => 'top', 'url' => "{$sNavTopicsSubUrl}top/", 'text' => {lang name='blog.menu.all_top'} ]
]
]}
{if $periodSelectCurrent}
{* Фильтр по времени *}
{$layoutNav[] = [
hook => 'topics_sub_timespan',
activeItem => $periodSelectCurrent,
items => [
[
'name' => 'good',
'text' => {lang name='blog.menu.all_good'},
'menu' => [
activeItem => $periodSelectCurrent,
items => [
[ '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'} ]
]
]
]
]
]}
{/if}
{/if}
{/block}
{block 'layout_content'}
{component 'topic.list' topics=$topics paging=$paging}
{/block}

18
layouts/layout.user.created.tpl

@ -0,0 +1,18 @@
{**
* Публикации пользователя
*}
{extends './layout.user.tpl'}
{block 'layout_options' append}
{$layoutNav = [[
hook => 'profile_created',
hookParams => [ 'oUserProfile' => $oUserProfile ],
activeItem => $sMenuSubItemSelect,
items => [
[ 'name' => 'topics', 'url' => "{$oUserProfile->getUserWebPath()}created/topics/", 'text' => {lang name='user.publications.nav.topics'}, 'count' => $iCountTopicUser ],
[ 'name' => 'comments', 'url' => "{$oUserProfile->getUserWebPath()}created/comments/", 'text' => {lang name='user.publications.nav.comments'}, 'count' => $iCountCommentUser ],
[ 'name' => 'notes', 'url' => "{$oUserProfile->getUserWebPath()}created/notes/", 'text' => {lang name='user.publications.nav.notes'}, 'count' => $iCountNoteUser, 'is_enabled' => $oUserCurrent && $oUserCurrent->getId() == $oUserProfile->getId() ]
]
]]}
{/block}

17
layouts/layout.user.favourite.tpl

@ -0,0 +1,17 @@
{**
* Избранное пользователя
*}
{extends './layout.user.tpl'}
{block 'layout_options' append}
{$layoutNav = [[
hook => 'profile_created',
hookParams => [ 'oUserProfile' => $oUserProfile ],
activeItem => $sMenuSubItemSelect,
items => [
[ 'name' => 'topics', 'text' => {lang name='user.favourites.nav.topics'}, 'url' => "{$oUserProfile->getUserWebPath()}favourites/topics/", 'count' => $iCountTopicFavourite ],
[ 'name' => 'comments', 'text' => {lang name='user.favourites.nav.comments'}, 'url' => "{$oUserProfile->getUserWebPath()}favourites/comments/", 'count' => $iCountCommentFavourite ]
]
]]}
{/block}

12
layouts/layout.user.messages.tpl

@ -5,7 +5,17 @@
{extends './layout.user.tpl'}
{block 'layout_options' append}
{$sNav = 'messages'}
{$layoutNav = [[
hook => 'talk',
activeItem => $sMenuSubItemSelect,
items => [
[ 'name' => 'inbox', 'url' => "{router page='talk'}", 'text' => $aLang.talk.nav.inbox ],
[ 'name' => 'new', 'url' => "{router page='talk'}inbox/new/", 'text' => $aLang.talk.nav.new, 'count' => $iUserCurrentCountTalkNew, 'is_enabled' => $iUserCurrentCountTalkNew ],
[ 'name' => 'add', 'url' => "{router page='talk'}add/", 'text' => $aLang.talk.nav.add ],
[ 'name' => 'favourites', 'url' => "{router page='talk'}favourites/", 'text' => $aLang.talk.nav.favourites, 'count' => $iCountTalkFavourite ],
[ 'name' => 'blacklist', 'url' => "{router page='talk'}blacklist/", 'text' => $aLang.talk.nav.blacklist ]
]
]]}
{/block}
{block 'layout_user_page_title'}

11
layouts/layout.user.settings.tpl

@ -5,7 +5,16 @@
{extends './layout.user.tpl'}
{block 'layout_options' append}
{$sNav = 'settings'}
{$layoutNav = [[
hook => 'settings',
activeItem => $sMenuSubItemSelect,
items => [
[ 'url' => "{router page='settings'}profile/", 'text' => {lang name='user.settings.nav.profile'}, 'name' => 'profile' ],
[ 'url' => "{router page='settings'}account/", 'text' => {lang name='user.settings.nav.account'}, 'name' => 'account' ],
[ 'url' => "{router page='settings'}tuning/", 'text' => {lang name='user.settings.nav.tuning'}, 'name' => 'tuning' ],
[ 'url' => "{router page='settings'}invite/", 'text' => {lang name='user.settings.nav.invites'}, 'name' => 'invite' ]
]
]]}
{/block}
{block 'layout_user_page_title'}

4
navs/nav.topics.sub.tpl

@ -15,7 +15,7 @@
[ 'name' => 'top', 'url' => "{$sNavTopicsSubUrl}top/", 'text' => {lang name='blog.menu.all_top'} ]
]}
{component 'sort' activeItem=$periodSelectCurrent}
{component 'sort' template='timespan' activeItem=$periodSelectCurrent}
{/if}
{hook run='nav_topics_sub_after' sMenuSubItemSelect=$sMenuSubItemSelect sNavTopicsSubUrl=$sNavTopicsSubUrl}
{hook run='nav_topics_sub_after' sMenuSubItemSelect=$sMenuSubItemSelect sNavTopicsSubUrl=$sNavTopicsSubUrl}
Loading…
Cancel
Save