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

Удален компонент modal-create

Вместо него добавлено выпадающее меню в юзербаре
This commit is contained in:
Denis Shakhov 2016-06-17 03:52:42 +07:00
parent 53a561ebbe
commit 8053761d83
9 changed files with 27 additions and 93 deletions

View file

@ -1 +0,0 @@
# Компонент modal-create

View file

@ -1,13 +0,0 @@
{
"name": "modal-create",
"version": "1.0.0",
"dependencies": {
"modal": "*"
},
"templates": {
"modal-create": "modal-create.tpl"
},
"styles": {
"modal-create": "css/modal-create.css"
}
}

View file

@ -1,37 +0,0 @@
/**
* Создать
*/
.ls-modal.ls-modal--create {
max-width: 525px;
}
.ls-modal.ls-modal--create .ls-modal-content {
padding: 20px 10px 0;
}
.write-list li {
width: 100px;
margin: 0 10px 20px;
text-align: center;
overflow: hidden;
float: left;
}
.write-list li a {
color: #39576B;
}
.write-list li .write-item-image {
display: block;
width: 100px;
height: 100px;
border-radius: 3px;
text-align: center;
background: url(../images/modal-create.png) no-repeat;
margin-bottom: 10px;
}
.write-list li.write-item-type-topic .write-item-image { background-position: 0 0; }
.write-list li.write-item-type-poll .write-item-image { background-position: -100px 0; }
.write-list li.write-item-type-link .write-item-image { background-position: -200px 0; }
.write-list li.write-item-type-photoset .write-item-image { background-position: -300px 0; }
.write-list li.write-item-type-blog .write-item-image { background-position: -400px 0; }
.write-list li.write-item-type-draft .write-item-image { background-position: -500px 0; }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

View file

@ -1,33 +0,0 @@
{**
* Модальное с меню "Создать"
*}
{capture 'modal_content'}
{function modal_create_item}
<li class="write-item-type-{$item}">
{$url = "{if ! $url}{router page=$item}add{else}{$url}{/if}"}
<a href="{$url}" class="write-item-image"></a>
<a href="{$url}" class="write-item-link">{$title}</a>
</li>
{/function}
<ul class="write-list ls-clearfix">
{foreach $LS->Topic_GetTopicTypes() as $type}
{modal_create_item item='topic' url=$type->getUrlForAdd() title=$type->getName()}
{/foreach}
{modal_create_item item='blog' title={lang 'modal_create.items.blog'}}
{modal_create_item item='talk' title={lang 'modal_create.items.talk'}}
{modal_create_item item='draft' url="{router page='content'}drafts/" title="{$aLang.topic.drafts} {if $iUserCurrentCountTopicDraft}({$iUserCurrentCountTopicDraft}){/if}"}
{hook run='write_item' isPopup=true}
</ul>
{/capture}
{component 'modal'
title = {lang 'modal_create.title'}
content = $smarty.capture.modal_content
classes = 'js-modal-default'
mods = 'create'
id = 'modal-write'}

View file

@ -37,9 +37,9 @@
*/
.ls-block--user-actions ul { overflow: hidden; background: #fff; border: 1px solid #eee; border-radius: 5px; }
.ls-block--user-actions ul li { margin-bottom: 0; }
.ls-block--user-actions ul li span,
.ls-block--user-actions ul li > span,
.ls-block--user-actions ul li a { display: block; padding: 10px 15px; color: #777; cursor: pointer; }
.ls-block--user-actions ul li span:hover,
.ls-block--user-actions ul li > span:hover,
.ls-block--user-actions ul li a:hover { background: #fafafa; color: #333; }
.ls-block--user-actions ul li a.followed { color: #f00; }

View file

@ -12,6 +12,16 @@
<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()}",
@ -29,7 +39,7 @@
[ '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.common.create, menu => [ 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}" ]
]}
@ -45,8 +55,4 @@
{component 'search' template='main' mods='light'}
</div>
</div>
{if $oUserCurrent}
{component 'modal-create'}
{/if}
</div>

View file

@ -37,6 +37,18 @@ 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'
}
});
/**
* Подтверждение удаления
*/

@ -1 +1 @@
Subproject commit 4cb6f38a860572ea84f5d075f13cce40e739eba9
Subproject commit a3a9dfe083d9ba292f7cb1a469e5283f043a0d5b