1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-06-26 03:30:48 +03:00

Добавлен блок "Создать блог"

This commit is contained in:
Denis Shakhov 2013-06-18 16:26:58 +07:00
parent 7363d40957
commit e8ab01a848
6 changed files with 98 additions and 6 deletions

View file

@ -447,7 +447,12 @@ $config['block']['rule_tag'] = array(
);
$config['block']['rule_blogs'] = array(
'action' => array( 'blogs' ),
'blocks' => array( 'right' => array('blogCategories') ),
'blocks' => array(
'right' => array(
'blocks/block.blogAdd.tpl' => array('priority' => 100),
'blogCategories' => array('priority' => 50)
)
),
);
$config['block']['userfeedBlogs'] = array(

View file

@ -45,6 +45,9 @@ return array(
'blog_expand_info' => 'Подробнее ↓',
'blog_fold_info' => 'Свернуть ↑',
'blog_by_category_empty' => 'В данной категории нет блогов',
'blog_add' => 'Создать блог',
'blog_can_add' => 'Вы можете создать свой блог!',
'blog_cant_add' => 'Для возможности создавать блоги, ваш рейтинг должен быть больше %%rating%%.',
/**
* Declensions
*/

View file

@ -0,0 +1,27 @@
{**
* Блок с кнопкой добавления блога
*
* @styles css/blocks.css
*}
{extends file='blocks/block.aside.base.tpl'}
{block name='block_type'}blog-add{/block}
{block name='block_options'}
{if ! $oUserCurrent}
{$bBlockNotShow = true}
{/if}
{/block}
{block name='block_content'}
{if $oUserCurrent and ($oUserCurrent->getRating() > {cfg name='acl.create.blog.rating'} or $oUserCurrent->isAdministrator())}
<p>{$aLang.blog_can_add}</p>
<a href="{router page='blog'}add/" class="button button-primary button-large">{$aLang.blog_add}</a>
{else}
<p>{$aLang.blog_cant_add|ls_lang:"rating%%`$oConfig->get('acl.create.blog.rating')`"}</p>
<button class="button button-primary button-large" disabled>{$aLang.blog_add}</button>
{/if}
{/block}

View file

@ -55,6 +55,21 @@
.block-type-blog-categories li a { display: block; margin-bottom: 1px; padding: 5px 9px; }
.block-type-blog-categories li.active a { color: #fff; text-decoration: none; background: #5560D5; }
/**
* @type blog add
* @file blocks/block.blogAdd.tpl
*/
.block.block-type-blog-add {
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
border: 1px solid #eee;
background: #fafafa;
padding: 10px;
text-align: center;
}
.block.block-type-blog-add p { margin-bottom: 25px; }
/**
* @type blog navigation
* @file blocks/block.blogNav.tpl
@ -66,13 +81,13 @@
* @type profile
* @file blocks/block.profilePhoto.tpl
*/
.block-type-profile-photo { background: none; border: none; padding: 0; }
.block-type-profile-photo .profile-photo-wrapper { position: relative; min-height: 50px; width: 250px; margin: 0 auto; }
.block-type-profile-photo { background: none; border: none; padding: 0; text-align: center; }
.block-type-profile-photo .profile-photo-wrapper { position: relative; min-height: 50px; display: inline-block; }
.block-type-profile-photo .profile-photo { vertical-align: top; }
.block-type-profile-photo .status { position: absolute; top: 5px; left: 5px; padding: 1px 7px; font-size: 11px; }
.block-type-profile-photo .status.status-online { background: #B7BC1C; color: #fff; }
.block-type-profile-photo .status.status-offline { background: #333; color: #fff; opacity: .5; filter: alpha(opacity=50); }
.block-type-profile-photo .status { position: absolute; top: 10px; left: 0; padding: 4px 9px; }
.block-type-profile-photo .status.status-online { background: #b7bc1c; background: rgba(183, 188, 28, .8); color: #fff; }
.block-type-profile-photo .status.status-offline { background: #333; background: rgba(0, 0, 0, .6); color: #fff; }
.block-type-profile-photo .upload-photo { padding: 7px 10px 10px; background: #f7f7f7; }

View file

@ -0,0 +1,27 @@
{**
* Блок с кнопкой добавления блога
*
* @styles css/blocks.css
*}
{extends file='blocks/block.aside.base.tpl'}
{block name='block_type'}blog-add{/block}
{block name='block_options'}
{if ! $oUserCurrent}
{$bBlockNotShow = true}
{/if}
{/block}
{block name='block_content'}
{if $oUserCurrent and ($oUserCurrent->getRating() > {cfg name='acl.create.blog.rating'} or $oUserCurrent->isAdministrator())}
<p>{$aLang.blog_can_add}</p>
<a href="{router page='blog'}add/" class="button button-primary button-large">{$aLang.blog_add}</a>
{else}
<p>{$aLang.blog_cant_add|ls_lang:"rating%%`$oConfig->get('acl.create.blog.rating')`"}</p>
<button class="button button-primary button-large" disabled>{$aLang.blog_add}</button>
{/if}
{/block}

View file

@ -174,6 +174,21 @@
.block-type-blog-categories li a { display: block; margin-bottom: 1px; padding: 5px 10px; border-radius: 3px; }
.block-type-blog-categories li.active a { color: #fff; text-decoration: none; background: #3ABCFF; }
/**
* @type blog add
* @file blocks/block.blogAdd.tpl
*/
.block.block-type-blog-add {
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
border: 1px solid #D9E3EC;
background: #F1F7FD;
padding: 20px 15px;
text-align: center;
}
.block.block-type-blog-add p { margin-bottom: 25px; }
/**
* @type blog navigation
* @file blocks/block.blogNav.tpl