Permalink
Browse files

Изменено меню создания топиков, исправлены мелкие баги

  • Loading branch information...
1 parent 168ddd2 commit 1d5af9e1347ced30c3cc9893bdb04b6e2129a65b @deniart deniart committed Apr 16, 2012
@@ -101,7 +101,7 @@
'blog_menu_top_period_7d' => 'За 7 дней',
'blog_menu_top_period_30d' => 'За 30 дней',
'blog_menu_top_period_all' => 'За все время',
- 'blog_menu_create' => 'Создать блог',
+ 'blog_menu_create' => 'Блог',
/**
* Создание/редактирование блога
*/
@@ -2,13 +2,6 @@
{include file='header.tpl' menu='topic_action'}
{else}
{include file='header.tpl'}
-{/if}
-
-
-
-{if $sEvent=='add'}
- <h2 class="page-header">{$aLang.blog_create}</h2>
-{else}
{include file='menu.blog_edit.tpl'}
{/if}
@@ -1,9 +1,7 @@
-{include file='header.tpl' menu='topic_action'}
-
-
{if $sEvent=='add'}
- <h2 class="page-header">{$aLang.topic_link_create}</h2>
+ {include file='header.tpl' menu='topic_action'}
{else}
+ {include file='header.tpl'}
<h2 class="page-header">{$aLang.topic_link_edit}</h2>
{/if}
@@ -1,4 +1,9 @@
-{include file='header.tpl' menu='topic_action' showWhiteBack=true}
+{if $sEvent=='add'}
+ {include file='header.tpl' menu='topic_action'}
+{else}
+ {include file='header.tpl'}
+ <h2 class="page-header">{$aLang.topic_photoset_edit}</h2>
+{/if}
{if $oConfig->GetValue('view.tinymce')}
@@ -32,14 +37,6 @@
</script>
-
-{if $sEvent=='add'}
- <h2 class="page-header">{$aLang.topic_photoset_create}</h2>
-{else}
- <h2 class="page-header">{$aLang.topic_photoset_edit}</h2>
-{/if}
-
-
<form id="photoset-upload-form" method="POST" enctype="multipart/form-data" onsubmit="return false;">
<p id="topic-photo-upload-input" class="topic-photo-upload-input">
<label for="">{$aLang.topic_photoset_choose_image}:</label>
@@ -1,9 +1,7 @@
-{include file='header.tpl' menu='topic_action'}
-
-
{if $sEvent=='add'}
- <h2 class="page-header">{$aLang.topic_question_create}</h2>
+ {include file='header.tpl' menu='topic_action'}
{else}
+ {include file='header.tpl'}
<h2 class="page-header">{$aLang.topic_question_edit}</h2>
{/if}
@@ -1,4 +1,10 @@
-{include file='header.tpl' menu='topic_action'}
+{if $sEvent=='add'}
+ {include file='header.tpl' menu='topic_action'}
+{else}
+ {include file='header.tpl'}
+ <h2 class="page-header">{$aLang.topic_topic_edit}</h2>
+{/if}
+
{if $oConfig->GetValue('view.tinymce')}
<script src="{cfg name='path.root.engine_lib'}/external/tinymce-jq/tiny_mce.js"></script>
@@ -20,17 +26,6 @@
{/if}
-
-
-
-
-{if $sEvent=='add'}
- <h2 class="page-header">{$aLang.topic_topic_create}</h2>
-{else}
- <h2 class="page-header">{$aLang.topic_topic_edit}</h2>
-{/if}
-
-
{hook run='add_topic_topic_begin'}
@@ -133,14 +133,28 @@
.tag-cloud li .tag-size-10 { font-size: 22px; }
+
/* Валидатор
---------------------------------------------------------------*/
.validate-error-show { color: #f00; font-weight: bold; font-size: 12px; }
+/* Выпадающее меню создания топика
+---------------------------------------------------------------*/
+.create-dropdown { position: relative; margin-right: 120px; }
+.create-dropdown a { font-weight: normal; }
+
+.create-dropdown-link { text-transform: lowercase; }
+.create-dropdown-menu { position: absolute; top: 32px; overflow: hidden; background: #fff; border: 1px solid #ddd; min-width: 150px; box-shadow: 0 0 5px #ddd; border-radius: 3px; }
+.create-dropdown-menu li { font-size: 14px; line-height: 1em; }
+.create-dropdown-menu li a { display: block; padding: 10px 15px; }
+.create-dropdown-menu li a:hover { background: #fafafa; }
+.create-dropdown-menu li.active a { color: #333; }
+.create-dropdown-menu li.active a:hover { cursor: default; }
+.drafts { float: right; margin-top: 10px; }
/* Разное
@@ -192,6 +206,7 @@
.mb-10 { margin-bottom: 10px !important; }
.mb-15 { margin-bottom: 15px !important; }
.mb-20 { margin-bottom: 20px !important; }
+.mb-30 { margin-bottom: 30px !important; }
.clearfix:before,
.clearfix:after { content: ""; display: table; }
@@ -1,30 +1,48 @@
-<ul class="nav nav-nested">
- <li {if $sMenuSubItemSelect=='add'}class="active"{/if}>
- <a href="{cfg name='path.root.web'}/{if $sMenuItemSelect=='add_blog'}topic{else}{$sMenuItemSelect}{/if}/add/">{$aLang.topic_menu_add}</a>
- {if $sMenuSubItemSelect=='add'}
- <ul class="sub-menu" >
- <li {if $sMenuItemSelect=='topic'}class="active"{/if}><a href="{router page='topic'}{$sMenuSubItemSelect}/">{$aLang.topic_menu_add_topic}</a></li>
- <li {if $sMenuItemSelect=='question'}class="active"{/if}><a href="{router page='question'}{$sMenuSubItemSelect}/">{$aLang.topic_menu_add_question}</a></li>
- <li {if $sMenuItemSelect=='link'}class="active"{/if}><a href="{router page='link'}{$sMenuSubItemSelect}/">{$aLang.topic_menu_add_link}</a></li>
- <li {if $sMenuItemSelect=='photoset'}class="active"{/if}><a href="{router page='photoset'}{$sMenuSubItemSelect}/">{$aLang.topic_menu_add_photoset}</a></li>
- {hook run='menu_topic_action_add_item'}
- <li {if $sMenuItemSelect=='add_blog'}class="active"{/if}><a href="{router page='blog'}add/">{$aLang.blog_menu_create}</a></li>
- </ul>
- {/if}
- </li>
-
- <li {if $sMenuSubItemSelect=='saved'}class="active"{/if}>
- <a href="{router page='topic'}saved/">{$aLang.topic_menu_saved}</a>
- {if $sMenuSubItemSelect=='saved'}
- <ul class="sub-menu" >
- {hook run='menu_topic_action_saved_item'}
- </ul>
- {/if}
- </li>
-
- {hook run='menu_topic_action'}
-</ul>
-
-
+<script>
+ jQuery(function($){
+ var menu = $('#create-dropdown-menu');
+
+ var pos = $('#create-dropdown-link').position();
+ menu.css({ 'left': pos.left - 5 });
+
+ $('.create-dropdown-link').click(function(){
+ menu.slideToggle();
+ return false;
+ });
+ $(document).click(function(){
+ menu.slideUp();
+ });
+
+ $('body').on("click", "#create-dropdown, #create-dropdown-link", function(e) {
+ e.stopPropagation();
+ });
+ });
+</script>
+
+
+<a href="{router page='topic'}saved/" class="drafts">{$aLang.topic_menu_saved} {if $iUserCurrentCountTopicDraft}({$iUserCurrentCountTopicDraft}){/if}</a>
+{hook run='menu_topic_action_saved_item'}
+
+
+<div class="create-dropdown" id="create-dropdown">
+ <h2 class="page-header">Создать <a href="#" class="create-dropdown-link link-dashed" id="create-dropdown-link">{$aLang.topic_menu_add_topic}</a></h2>
+
+ <ul class="create-dropdown-menu" id="create-dropdown-menu" style="display: none">
+ <li {if true}class="active"{/if}><a href="{router page='topic'}add/">{$aLang.topic_menu_add_topic}</a></li>
+ <li {if false}class="active"{/if}><a href="{router page='blog'}add/">{$aLang.blog_menu_create}</a></li>
+ {hook run='menu_topic_action'}
+ </ul>
+</div>
+
+
+{if $sMenuSubItemSelect=='add' && $sMenuItemSelect!='add_blog'}
+ <ul class="nav nav-pills mb-30">
+ <li {if $sMenuItemSelect=='topic'}class="active"{/if}><a href="{router page='topic'}{$sMenuSubItemSelect}/">{$aLang.topic_menu_add_topic}</a></li>
+ <li {if $sMenuItemSelect=='question'}class="active"{/if}><a href="{router page='question'}{$sMenuSubItemSelect}/">{$aLang.topic_menu_add_question}</a></li>
+ <li {if $sMenuItemSelect=='link'}class="active"{/if}><a href="{router page='link'}{$sMenuSubItemSelect}/">{$aLang.topic_menu_add_link}</a></li>
+ <li {if $sMenuItemSelect=='photoset'}class="active"{/if}><a href="{router page='photoset'}{$sMenuSubItemSelect}/">{$aLang.topic_menu_add_photoset}</a></li>
+ {hook run='menu_topic_action_add_item'}
+ </ul>
+{/if}
@@ -27,12 +27,10 @@
<a href="{router page='blog'}add" class="write-item-image"></a>
<a href="{router page='blog'}add" class="write-item-link">Блог</a>
</li>
- {if $iUserCurrentCountTopicDraft}
- <li class="write-item-type-draft">
- <a href="{router page='topic'}saved/" class="write-item-image"></a>
- <a href="{router page='topic'}saved/" class="write-item-link">{$aLang.topic_menu_saved} ({$iUserCurrentCountTopicDraft})</a>
- </li>
- {/if}
+ <li class="write-item-type-draft">
+ <a href="{router page='topic'}saved/" class="write-item-image"></a>
+ <a href="{router page='topic'}saved/" class="write-item-link">{$aLang.topic_menu_saved} {if $iUserCurrentCountTopicDraft}({$iUserCurrentCountTopicDraft}){/if}</a>
+ </li>
</ul>
</div>
{/strip}

0 comments on commit 1d5af9e

Please sign in to comment.