Skip to content
This repository has been archived by the owner on Feb 23, 2021. It is now read-only.

Commit

Permalink
Merge pull request #99 from gskema/refactor
Browse files Browse the repository at this point in the history
[*] FO: Refacto blockcurrencies to fit Bootstrap nav
  • Loading branch information
Gytis Šk committed Jan 24, 2016
2 parents 3e712e0 + 71d0351 commit 0f1501e
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 108 deletions.
Original file line number Diff line number Diff line change
@@ -1,30 +1,39 @@
<!-- Block currencies module -->
{if count($currencies) > 1}
<div id="currencies-block-top">
<form id="setCurrency" action="{$request_uri}" method="post">
<div class="current">
<input type="hidden" name="id_currency" id="id_currency" value=""/>
<input type="hidden" name="SubmitCurrency" value="" />
<span class="cur-label">{l s='Currency' mod='blockcurrencies'} :</span>
{foreach from=$currencies key=k item=f_currency}
{if $cookie->id_currency == $f_currency.id_currency}<strong>{$f_currency.iso_code}</strong>{/if}
{/foreach}
</div>
<ul id="first-currencies" class="currencies_ul toogle_content">
{foreach from=$currencies key=k item=f_currency}
{if strpos($f_currency.name, '('|cat:$f_currency.iso_code:')') === false}
{assign var="currency_name" value={l s='%s (%s)' sprintf=[$f_currency.name, $f_currency.iso_code]}}
{else}
{assign var="currency_name" value=$f_currency.name}
{/if}
<li {if $cookie->id_currency == $f_currency.id_currency}class="selected"{/if}>
<a href="javascript:setCurrency({$f_currency.id_currency});" rel="nofollow" title="{$currency_name}">
{$currency_name}
</a>
</li>
{/foreach}
</ul>
</form>
</div>
{if !empty($currencies)}

{foreach from=$currencies key=k item=f_currency}
{if $cookie->id_currency == $f_currency.id_currency}
{$current_iso = $f_currency.iso_code}
{break}
{/if}
{/foreach}

<li id="blockcurrencies" class="dropdown">

{* Backwards compatibility *}
<div id="setCurrency" class="hidden" style="display: none">
<input type="hidden" name="id_currency" id="id_currency" value=""/>
<input type="hidden" name="SubmitCurrency" value="" />
</div>

<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
{l s='Currency: %s' sprintf=[$current_iso] mod='blockcurrencies'} <span class="caret"></span>
</a>

<ul class="dropdown-menu">
{foreach from=$currencies key=k item=f_currency}
{if strpos($f_currency.name, '('|cat:$f_currency.iso_code:')') === false}
{assign var="currency_name" value={l s='%s (%s)' sprintf=[$f_currency.name, $f_currency.iso_code]}}
{else}
{assign var="currency_name" value=$f_currency.name}
{/if}
<li{if $cookie->id_currency == $f_currency.id_currency} class="active"{/if}>
<a href="javascript:setCurrency({$f_currency.id_currency});" rel="nofollow" title="{$currency_name}">
{$currency_name}
</a>
</li>
{/foreach}
</ul>

</li>

{/if}
<!-- /Block currencies module -->
Original file line number Diff line number Diff line change
@@ -1,79 +0,0 @@
@import "compass";
@import "./../../theme_variables";
@import "./../../vendor_variables";

#currencies-block-top {
float: right;
border-left: 1px solid #515151;
position: relative;
// max 479px
@media (max-width: $screen-xs - 1) {
width: 25%;
}
span.firstWord {
display: none;
}
div.current {
font-weight: bold;
padding: 8px 10px 10px 10px;
color: #fff;
cursor: pointer;
line-height:18px;
@media (max-width: $screen-xs - 1) {
text-align: center;
padding: 9px 5px 10px;
font-size: 11px;
}
strong {
color: #777777;
}
&:hover, &.active {
background: #2b2b2b;
}
&:after {
content: "\f0d7";
font-family: $font-icon;
font-size: 18px;
line-height: 18px;
color: #686666;
vertical-align: -2px;
padding-left: 12px;
// max 479px
@media (max-width: $screen-xs - 1) {
padding-left: 2px;
font-size: 13px;
line-height: 13px;
vertical-align: 0;
}
}
.cur-label {
// max 479px
@media (max-width: $screen-xs - 1) {
display: none;
}
}
}
ul {
display: none;
position: absolute;
top: 37px;
left: 0;
width: 157px;
background: #333;
z-index: 2;
li {
color: #fff;
line-height: 35px;
font-size: 13px;
a,
> span {
padding: 0 10px 0 12px;
display: block;
color: #fff;
}
&.selected, &:hover a {
background: #484848;
}
}
}
}

0 comments on commit 0f1501e

Please sign in to comment.