first commit
This commit is contained in:
150
apps/frontend/templates/theme/airsports/_header.html
Normal file
150
apps/frontend/templates/theme/airsports/_header.html
Normal file
@@ -0,0 +1,150 @@
|
||||
<div id="header-navbar-position">
|
||||
<div id="header-navbar-outer">
|
||||
<div class="container">
|
||||
<nav id="header-navbar" class="navbar" role="navigation">
|
||||
<div id="logo_small" class="visible-xs">
|
||||
<div>
|
||||
<a href="{$homepage_url}">
|
||||
<img src="{image_path image='logo_small.png'}" alt="Logo" />
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div id="navbar-buttons" class="btn-group pull-right">
|
||||
<button id="nav-button-search" type="button" class="btn btn-navbar hidden-xs collapsed" data-toggle="collapse" data-target="#nav-search" data-parent="#header-navbar">
|
||||
<span class="glyphicon glyphicon-search"></span>
|
||||
</button>
|
||||
<button id="nav-button-shopping-cart" class="btn btn-navbar collapsed empty" data-toggle="collapse" data-target="#nav-shopping-cart" data-parent="#header-navbar">
|
||||
<span class="glyphicon glyphicon-shopping-cart"></span>
|
||||
<small class="quantity"></small>
|
||||
</button>
|
||||
|
||||
{if !$sf_user->isAuthenticated()}
|
||||
<a href="{url_for internal='stUser/loginUser' secure=true}" id="nav-button-user" class="hidden-xs btn btn-navbar collapsed">
|
||||
<span id="login-status-info" class="glyphicon glyphicon-user"></span>
|
||||
<small class="login-status"> </small>
|
||||
</a>
|
||||
<button id="nav-button-user" class="visible-xs btn btn-navbar collapsed" data-toggle="collapse" data-target="#nav-user" data-parent="#header-navbar">
|
||||
<span id="login-status-info" class="glyphicon glyphicon-user"></span>
|
||||
<small class="login-status"> </small>
|
||||
</button>
|
||||
{else}
|
||||
<button id="nav-button-user" class="btn btn-navbar collapsed" data-toggle="collapse" data-target="#nav-user" data-parent="#header-navbar">
|
||||
<span id="login-status-info" class="glyphicon glyphicon-user"></span>
|
||||
<small class="login-status"> </small>
|
||||
</button>
|
||||
{/if}
|
||||
<button id="nav-button-settings" class="btn btn-navbar hidden-xs collapsed" data-toggle="collapse" data-target="#nav-settings" data-parent="#header-navbar">
|
||||
<span class="glyphicon glyphicon-globe"></span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="navbar-header">
|
||||
<button id="nav-button-menu" type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#nav-menu" data-parent="#header-navbar">
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
</div>
|
||||
<!-- Menu -->
|
||||
<div id="nav-menu" class="navbar-collapse collapse">
|
||||
{st_get_component module="stCategoryTree" component="horizontal"}
|
||||
</div>
|
||||
<div class="navbar-dropdown">
|
||||
<!-- Koszyk -->
|
||||
<div id="nav-shopping-cart" class="navbar-collapse collapse">
|
||||
{st_get_component module="stBasket" component="show"}
|
||||
</div>
|
||||
<div id="nav-user" class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
<!-- Moje konto, Język, Waluta -->
|
||||
{st_get_component module="stUser" component="loginStatus"}
|
||||
</ul>
|
||||
</div>
|
||||
{strip}
|
||||
<div id="nav-settings" class="hidden-xs navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
<li class="dropdown">
|
||||
{st_get_component module="stLanguageFrontend" component="choose"}
|
||||
</li>
|
||||
<li class="dropdown">
|
||||
{st_get_component module="stCurrencyFrontend" component="pickCurrency"}
|
||||
</li>
|
||||
</ul>
|
||||
{slot name="nav-setting" hidden="true"}{/slot}
|
||||
</div>
|
||||
{/strip}
|
||||
<div id="nav-search" class="navbar-collapse collapse hidden-xs">
|
||||
{include_file id="_search"}
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{literal}
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
jQuery(function($) {
|
||||
if ($('#nav-settings > ul > li:empty').length == 2)
|
||||
{
|
||||
$('#nav-button-settings').hide();
|
||||
}
|
||||
|
||||
var menuHeight = $('#header-navbar-outer').height();
|
||||
var dropdown = $('#header-navbar .dropdown-menu');
|
||||
|
||||
function menuFix() {
|
||||
|
||||
if ($(window).width() > 768) {
|
||||
|
||||
var scrolled = $(window).scrollTop();
|
||||
var menuTop = $('#header-navbar-position').offset().top;
|
||||
var windowHeight = $(window).height();
|
||||
var headerHeight = $('#top').height();
|
||||
|
||||
if (scrolled > menuTop) {
|
||||
$('#header-navbar-outer').addClass('navbar-fixed-top');
|
||||
$('#header-navbar-position').css('min-height', menuHeight - 1);
|
||||
dropdown.css('max-height', windowHeight - menuHeight - 15);
|
||||
} else if (scrolled < menuTop) {
|
||||
$('#header-navbar-outer').removeClass('navbar-fixed-top');
|
||||
$('#header-navbar-position').css('min-height', '');
|
||||
dropdown.css('max-height', windowHeight - headerHeight - menuHeight - 15);
|
||||
};
|
||||
} else {
|
||||
dropdown.removeAttr("style");
|
||||
};
|
||||
}
|
||||
|
||||
function parallaxBaner(){
|
||||
|
||||
if ($(window).width() > 767) {
|
||||
|
||||
var scrolled = $(window).scrollTop();
|
||||
var scrollBaner2 = scrolled;
|
||||
|
||||
$('body').css('background-position', 'center '+ (scrollBaner2*0.5)+'px');
|
||||
}
|
||||
}
|
||||
|
||||
$(document).ready(function(){
|
||||
menuFix();
|
||||
if ($(window).width() < 768) {
|
||||
var windowHeightMobile = $(window).height();
|
||||
var menuHeightMobile = $('#header-navbar').height();
|
||||
$('#header-navbar .navbar-collapse').css('max-height', windowHeightMobile - menuHeightMobile);
|
||||
};
|
||||
});
|
||||
$(window).scroll(function(){
|
||||
menuFix();
|
||||
//parallaxBaner();
|
||||
});
|
||||
$(window).resize(function(){
|
||||
menuFix();
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
//]]>
|
||||
</script>
|
||||
{/literal}
|
||||
Reference in New Issue
Block a user