Skip to content

Commit

Permalink
Merge pull request #419 from bitcoin/newlangbar
Browse files Browse the repository at this point in the history
Display language menu in ordered columns
  • Loading branch information
saivann committed May 24, 2014
2 parents 84a3aca + 95b48d5 commit d1bccc9
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 39 deletions.
38 changes: 19 additions & 19 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
langsorder:
- id: de
- id: id
- id: en
- id: es
- id: fr
- id: it
- id: hu
- id: nl
- id: pl
- id: pt_BR
- id: ru
- id: ro
- id: sv
- id: tr
- id: bg
- id: zh_CN
- id: zh_TW
- id: ar
- id: fa
- de
- en
- es
- fr
- id
- it
- hu
- nl
- pl
- pt_BR
- ru
- ro
- sv
- tr
- bg
- zh_CN
- zh_TW
- ar
- fa

langs:
ar: ألعربية
Expand Down
12 changes: 7 additions & 5 deletions _layouts/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,18 @@
{% endif %}
<div class="head"><div>
<select id="langselect" class="langselect" onchange="window.location=this.value;">
{% for lang in site.langsorder %}{% if lang.id == page.lang %}{% assign active = ' selected="selected"'%}{% else %}{% assign active = ''%}{% endif %}
<option value="/{{ lang.id }}/{% translate {{page.id}} url {{lang.id}} %}"{{ active }}>{{ site.langs[lang.id] }}</option>
{% for lang in site.langsorder %}{% assign active = ''%}{% if lang == page.lang %}{% assign active = ' selected="selected"'%}{% endif %}
<option value="/{{ lang }}/{% translate {{page.id}} url {{lang}} %}"{{ active }}>{{ site.langs[lang] }}</option>
{% endfor %}
</select>
<ul class="lang">
<li><a href="#" onclick="return false;">{{ site.langs[page.lang] }}</a>
<ul>
{% for lang in site.langsorder %}{% if lang.id != page.lang %}
<li><a href="/{{ lang.id }}/{% translate {{page.id}} url {{lang.id}} %}">{{ site.langs[lang.id] }}</a></li>
{% endif %}{% endfor %}
{% for lang in site.langsorder %}{% assign active = ''%}{% if lang == page.lang %}{% assign active = ' class="active"'%}{% endif %}
{% cycle 'start': '<li><ul>', '', '', '', '', '', '', '', '', '' %}
<li><a href="/{{ lang }}/{% translate {{page.id}} url {{lang}} %}"{{ active }}>{{ site.langs[lang] }}</a></li>
{% cycle 'end': '', '', '', '', '', '', '', '', '', '</ul></li>' %}{% endfor %}
{% cycle 'end': '', '</ul></li>', '</ul></li>', '</ul></li>', '</ul></li>', '</ul></li>', '</ul></li>', '</ul></li>', '</ul></li>', '</ul></li>' %}
</ul>
</li>
</ul>
Expand Down
14 changes: 14 additions & 0 deletions _less/ie.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,20 @@ body{
border-right:2px solid #f7f7f7;
border-top:2px solid #f7f7f7;
}
.lang li ul{
top:28px;
}
.lang li ul li{
zoom:1;
display:inline;
}
.lang li a,
.lang li a:link,
.lang li a:visited,
.lang li a:active{
zoom:1;
display:inline;
}

.menusimple li{
zoom:1;
Expand Down
1 change: 1 addition & 0 deletions _less/rtl.less
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ p{
}
.lang li ul li{
font-family:Arial, sans-serif;
text-align:right;
}
.menusimple li a,
.menusimple li a:active,
Expand Down
39 changes: 24 additions & 15 deletions _less/screen.less
Original file line number Diff line number Diff line change
Expand Up @@ -210,14 +210,12 @@ table td,table th{
list-style:none;
padding:0;
margin:0;
text-align:right;
cursor:pointer;
}
.lang{
position:absolute;
right:5px;
top:8px;
height:30px;
border-left:2px solid transparent;
border-right:2px solid transparent;
border-top:2px solid transparent;
Expand All @@ -231,25 +229,37 @@ table td,table th{
.lang li ul{
display:none;
right:-2px;
top:28px;
position:absolute;
background-color:#fff;
margin-left:-5px;
padding-bottom:4px;
border-left:2px solid #ebebeb;
border-right:2px solid #ebebeb;
border-bottom:2px solid #ebebeb;
padding:20px;
border:2px solid #ebebeb;
white-space:nowrap;
}
.lang:hover li ul{
display:block;
}
.lang li ul li{
display:inline-block;
vertical-align:top;
text-align:left;
width:180px;
}
.lang li ul li ul{
position:relative;
margin:-4px 0;
padding:0;
border:0;
top:0;
}
.lang li ul li ul li{
display:block;
}
.lang li a,
.lang li a:link,
.lang li a:visited,
.lang li a:active{
text-decoration:none;
font-size:115%;
width:100px;
display:inline-block;
color:#b8b8b8;
padding:4px 8px;
Expand All @@ -258,18 +268,17 @@ table td,table th{
.lang li ul li a:link,
.lang li ul li a:visited,
.lang li ul li a:active{
padding:2px 8px;

padding:4px 0;
width:180px;
}
.lang:hover li a{
.lang:hover li a,
.lang li ul li ul li:hover a,
.lang li ul li ul li a.active{
color:#666666;
}
.lang:hover li ul li a{
color:#b8b8b8;
}
.lang li ul li:hover a{
color:#666666;
}

.logo{
display:block;
Expand Down

0 comments on commit d1bccc9

Please sign in to comment.