Fix select languages in dcl

This commit is contained in:
Henry Bravo 2017-05-27 12:49:42 -05:00
parent ac28ab0d6b
commit 8d8b387cc7
4 changed files with 106 additions and 16 deletions

View file

@ -136,7 +136,7 @@ h6 {
cursor: pointer; cursor: pointer;
} }
.navbar-right { .navbar-right {
margin-right: 0px; margin-right: 10px;
} }
.navbar-default .btn-link { .navbar-default .btn-link {
color: #fff; color: #fff;
@ -144,6 +144,52 @@ h6 {
.navbar-default .btn-link:hover { .navbar-default .btn-link:hover {
color: #fff !important; color: #fff !important;
} }
.nav-language{
position: relative;
}
.nav-language .select-language{
padding: 15px 10px;
color: #777;
}
.navbar-transparent .nav-language .select-language{
color: #fff;
}
.nav-language .select-language span{
margin-left: 5px;
margin-right: 5px;
}
.nav-language .drop-language{
position: absolute;
top: 45px;
left: -8px;
background: #fff;
width: 100px;
height: 40px;
padding: 9px 10px;
-webkit-box-shadow: -8px 13px 31px -8px rgba(77,77,77,1);
-moz-box-shadow: -8px 13px 31px -8px rgba(77,77,77,1);
box-shadow: -8px 13px 31px -8px rgba(77,77,77,1);
display: none;
z-index: 100;
/* margin-left: 10px; */
text-align: center;
border-radius: 4px;
}
.nav-language .drop-language a{
cursor: pointer;
}
.navbar-transparent .nav-language .drop-language{
background: transparent;
border: 1px solid #fff;
}
.navbar-transparent .nav-language .drop-language a{
color: #fff;
}
.nav-language:hover .drop-language{
display: block;
}
.intro-header { .intro-header {
height: 100vh; height: 100vh;
text-align: center; text-align: center;
@ -250,7 +296,7 @@ h6 {
bottom: 0; bottom: 0;
left: 0; left: 0;
right: 0; right: 0;
background: rgba(90, 116, 175, 0.7); background: rgba(90, 116, 175, 0.8);
} }
.intro-pricing .intro-message .section-heading{ .intro-pricing .intro-message .section-heading{
font-size: 45px; font-size: 45px;
@ -693,6 +739,23 @@ h6 {
font-size: 15px; font-size: 15px;
color: #777; color: #777;
} }
.nav-language:hover{
height: 80px;
}
.navbar-transparent .nav-language .select-language {
color: #777;
}
.navbar-transparent .nav-language .drop-language a {
color: #777;
}
.navbar-transparent .nav-language .drop-language {
background: #fff;
/* border: 1px solid #fff; */
z-index: 100000;
left: 9px;
border: 1px solid rgba(119, 119, 119, 0.4);
box-shadow: none;
}
.split-section { .split-section {
padding: 10px 0; padding: 10px 0;
} }

View file

@ -74,7 +74,7 @@
<a class="url" href="javascript:void(0)" data-url="#contact" >{% trans "Contact" %}</a> <a class="url" href="javascript:void(0)" data-url="#contact" >{% trans "Contact" %}</a>
</li> </li>
<select class="selectpicker" data-width="fit" onchange="location = this.value;" style="margin-top:10px;"> <!-- <select class="selectpicker" data-width="fit" onchange="location = this.value;" style="margin-top:10px;">
{% if LANGUAGE_CODE == 'en-us'%} {% if LANGUAGE_CODE == 'en-us'%}
<option selected="selected" value="{{base_url}}/en-us/datacenterlight/">English</option> <option selected="selected" value="{{base_url}}/en-us/datacenterlight/">English</option>
{% else %} {% else %}
@ -86,7 +86,25 @@
<option value="{{base_url}}/de/datacenterlight/">Deutsch</option> <option value="{{base_url}}/de/datacenterlight/">Deutsch</option>
{% endif %} {% endif %}
</select> </select> -->
<li class="nav-language">
<div class="select-language">
{% if LANGUAGE_CODE == 'en-us'%}
<span>English</span>
{% else %}
<span>Deutsch</span>
{% endif %}
<i class="fa fa-globe" aria-hidden="true"></i>
</div>
<div class="drop-language">
{% if LANGUAGE_CODE == 'en-us'%}
<a class="url" href="{{base_url}}/de/datacenterlight" >Deutsch</a>
{% else %}
<a class="url" href="{{base_url}}/en-us/datacenterlight" >English</a>
{% endif %}
</div>
</li>
</ul> </ul>

View file

@ -74,19 +74,24 @@
<a class="url" href="javascript:void(0)" data-url="#contact" >{% trans "Contact" %}</a> <a class="url" href="javascript:void(0)" data-url="#contact" >{% trans "Contact" %}</a>
</li> --> </li> -->
<select class="selectpicker" data-width="fit" onchange="location = this.value;" style="margin-top:10px;"> <li class="nav-language">
<div class="select-language">
{% if LANGUAGE_CODE == 'en-us'%} {% if LANGUAGE_CODE == 'en-us'%}
<option selected="selected" value="{{base_url}}/en-us/datacenterlight/">English</option> <span>English</span>
{% else %} {% else %}
<option value="{{base_url}}/en-us/datacenterlight/">English</option> <span>Deutsch</span>
{% endif %} {% endif %}
{% if LANGUAGE_CODE == 'de'%} <i class="fa fa-globe" aria-hidden="true"></i>
<option selected="selected" value="{{base_url}}/de/datacenterlight/">Deutsch</option> </div>
<div class="drop-language">
{% if LANGUAGE_CODE == 'en-us'%}
<a class="url" href="{{base_url}}/de/datacenterlight/pricing" >Deutsch</a>
{% else %} {% else %}
<option value="{{base_url}}/de/datacenterlight/">Deutsch</option> <a class="url" href="{{base_url}}/en-us/datacenterlight/pricing" >English</a>
{% endif %} {% endif %}
</select> </div>
</li>
</ul> </ul>

View file

@ -7,6 +7,7 @@ from django.core.urlresolvers import reverse_lazy, reverse
from utils.mailer import BaseEmail from utils.mailer import BaseEmail
from django.shortcuts import render from django.shortcuts import render
from django.shortcuts import redirect from django.shortcuts import redirect
from django.utils.translation import get_language, get_language_info
from opennebula_api.models import OpenNebulaManager from opennebula_api.models import OpenNebulaManager
from opennebula_api.serializers import VirtualMachineTemplateSerializer from opennebula_api.serializers import VirtualMachineTemplateSerializer
@ -24,6 +25,7 @@ class PricingView(TemplateView):
context = { context = {
'templates': VirtualMachineTemplateSerializer(templates, many=True).data, 'templates': VirtualMachineTemplateSerializer(templates, many=True).data,
'languages': getlanguages()
} }
except: except:
messages.error( request, messages.error( request,
@ -241,3 +243,5 @@ class IndexView(CreateView):
messages.add_message(self.request, messages.SUCCESS, self.success_message) messages.add_message(self.request, messages.SUCCESS, self.success_message)
return super(IndexView, self).form_valid(form) return super(IndexView, self).form_valid(form)