Fixed navbar dropdown that works for mobile device
This commit is contained in:
		
					parent
					
						
							
								8754850ac9
							
						
					
				
			
			
				commit
				
					
						94a69a4836
					
				
			
		
					 1 changed files with 53 additions and 56 deletions
				
			
		| 
						 | 
					@ -1,67 +1,64 @@
 | 
				
			||||||
{% load staticfiles i18n%}
 | 
					{% load staticfiles i18n%}
 | 
				
			||||||
{% get_current_language as LANGUAGE_CODE %}
 | 
					{% get_current_language as LANGUAGE_CODE %}
 | 
				
			||||||
{% load custom_tags %}
 | 
					{% load custom_tags %}
 | 
				
			||||||
<nav class="navbar navbar-default navbar-fixed-top topnav" role="navigation">
 | 
					<nav class="navbar navbar-default navbar-fixed-top topnav">
 | 
				
			||||||
        <div class="topnav">
 | 
					<div class="topnav">
 | 
				
			||||||
            <!-- Brand and toggle get grouped for better mobile display -->
 | 
					            <!-- Brand and toggle get grouped for better mobile display -->
 | 
				
			||||||
            <div class="navbar-header">
 | 
					  <div class="navbar-header">
 | 
				
			||||||
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
 | 
					    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
 | 
				
			||||||
                    <span class="sr-only">Toggle navigation</span>
 | 
					      <span class="sr-only">Toggle navigation</span>
 | 
				
			||||||
                    <span class="icon-bar"></span>
 | 
					      <span class="icon-bar"></span>
 | 
				
			||||||
                    <span class="icon-bar"></span>
 | 
					      <span class="icon-bar"></span>
 | 
				
			||||||
                    <span class="icon-bar"></span>
 | 
					      <span class="icon-bar"></span>
 | 
				
			||||||
                </button>
 | 
					    </button>
 | 
				
			||||||
                {% if request.resolver_match.url_name == "index" or request.resolver_match.url_name == "whydatacenterlight" %}
 | 
					    {% if request.resolver_match.url_name == "index" or request.resolver_match.url_name == "whydatacenterlight" %}
 | 
				
			||||||
                  <a href="{% url 'datacenterlight:index' %}" id="logoBlack" class="navbar-brand topnav url" data-url="#home"><img src="{% static 'datacenterlight/img/logo_black.svg' %}"></a>
 | 
					                  <a href="{% url 'datacenterlight:index' %}" id="logoBlack" class="navbar-brand topnav url" data-url="#home"><img src="{% static 'datacenterlight/img/logo_black.svg' %}"></a>
 | 
				
			||||||
                  <a href="{% url 'datacenterlight:index' %}" id="logoWhite" class="navbar-brand topnav url" data-url="#home"><img src="{% static 'datacenterlight/img/logo_white.svg' %}"></a>
 | 
					                  <a href="{% url 'datacenterlight:index' %}" id="logoWhite" class="navbar-brand topnav url" data-url="#home"><img src="{% static 'datacenterlight/img/logo_white.svg' %}"></a>
 | 
				
			||||||
                {% else %}
 | 
					                {% else %}
 | 
				
			||||||
                   <a href="{% url 'datacenterlight:index' %}" id="logoBlack" class="navbar-brand topnav url"><img src="{% static 'datacenterlight/img/logo_black.svg' %}"></a>
 | 
					                   <a href="{% url 'datacenterlight:index' %}" id="logoBlack" class="navbar-brand topnav url"><img src="{% static 'datacenterlight/img/logo_black.svg' %}"></a>
 | 
				
			||||||
                    <a href="{% url 'datacenterlight:index' %}" id="logoWhite" class="navbar-brand topnav url"><img src="{% static 'datacenterlight/img/logo_white.svg' %}"></a>
 | 
					                    <a href="{% url 'datacenterlight:index' %}" id="logoWhite" class="navbar-brand topnav url"><img src="{% static 'datacenterlight/img/logo_white.svg' %}"></a>
 | 
				
			||||||
                {% endif %}
 | 
					                {% endif %}
 | 
				
			||||||
            </div>
 | 
					    
 | 
				
			||||||
            <!-- Collect the nav links, forms, and other content for toggling -->
 | 
					  </div>
 | 
				
			||||||
            <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
 | 
					  <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"><!-- Start Navbar collapse-->
 | 
				
			||||||
                <ul class="nav navbar-nav navbar-right">
 | 
					    <ul class="nav navbar-nav navbar-right">
 | 
				
			||||||
                	{% if request.resolver_match.url_name == "index" or request.resolver_match.url_name == "whydatacenterlight" %}
 | 
							{% if request.resolver_match.url_name == "index" or request.resolver_match.url_name == "whydatacenterlight" %}
 | 
				
			||||||
                    <li class="dropdown">
 | 
					           
 | 
				
			||||||
                        <a class="url dropdown-toggle" href="{% url 'datacenterlight:index' %}#how" data-url="#how" data-toggle="dropdown">{% trans "Highlights" %}  <b class="caret"></b></a>
 | 
					           <li class="dropdown">
 | 
				
			||||||
							<ul class="dropdown-menu">
 | 
					                <a class="dropdown-toggle move multiselect" href="#"  data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">{% trans "Highlights" %}<span class="caret"></span></a>
 | 
				
			||||||
								<li><a class="url" href="{% url 'datacenterlight:index' %}#your" data-url="#your"  >{% trans "Scale out" %}</a></li>
 | 
										<ul class="dropdown-menu">
 | 
				
			||||||
								<li><a class="url" href="{% url 'datacenterlight:index' %}#our" data-url="#our">{% trans "Reliable and light" %}</a></li>
 | 
											<li><a class="url" href="{% url 'datacenterlight:index' %}#your" data-url="#your"  >{% trans "Scale out" %}</a></li>
 | 
				
			||||||
								<li> <a class="url" href="{% url 'datacenterlight:index' %}#price" data-url="#price" >{% trans "Order VM" %}</a></li>
 | 
											<li><a class="url" href="{% url 'datacenterlight:index' %}#our" data-url="#our">{% trans "Reliable and light" %}</a></li>
 | 
				
			||||||
							 </ul>
 | 
											<li> <a class="url" href="{% url 'datacenterlight:index' %}#price" data-url="#price" >{% trans "Order VM" %}</a></li>
 | 
				
			||||||
                    </li>
 | 
										</ul>  
 | 
				
			||||||
                    
 | 
					           </li>
 | 
				
			||||||
                    <li>
 | 
								<li>
 | 
				
			||||||
                        <a class="url" href="{% url 'datacenterlight:index' %}/whydatacenterlight" >{% trans "Why Data Center Light?" %}</a>
 | 
									<a class="url" href="{% url 'datacenterlight:index' %}/whydatacenterlight" >{% trans "Why Data Center Light?" %}</a>
 | 
				
			||||||
                    </li>
 | 
								</li>
 | 
				
			||||||
                    <li>
 | 
								<li>
 | 
				
			||||||
                        <a class="url" href="{% url 'datacenterlight:index' %}#contact" data-url="#contact"  >{% trans "Contact" %}</a>
 | 
									<a class="url" href="{% url 'datacenterlight:index' %}#contact" data-url="#contact"  >{% trans "Contact" %}</a>
 | 
				
			||||||
                     </li>
 | 
								</li>
 | 
				
			||||||
					       {% endif %}
 | 
								{% endif %}
 | 
				
			||||||
                    <li class="nav-language">
 | 
								<li class="nav-language">
 | 
				
			||||||
                      <div class="select-language">
 | 
									<div class="select-language">
 | 
				
			||||||
                          {% if LANGUAGE_CODE == 'en-us'%} 
 | 
									{% if LANGUAGE_CODE == 'en-us'%} 
 | 
				
			||||||
                          <span>English</span>
 | 
									<span>English</span>
 | 
				
			||||||
                          {% else %}
 | 
									{% else %}
 | 
				
			||||||
                          <span>Deutsch</span>
 | 
									<span>Deutsch</span>
 | 
				
			||||||
                          {% endif %}
 | 
									{% endif %}
 | 
				
			||||||
                          <i class="fa fa-globe" aria-hidden="true"></i>
 | 
									<i class="fa fa-globe" aria-hidden="true"></i>
 | 
				
			||||||
                      </div>
 | 
									</div>
 | 
				
			||||||
                      <div class="drop-language">
 | 
									<div class="drop-language">
 | 
				
			||||||
                          {% if LANGUAGE_CODE == 'en-us'%} 
 | 
									{% if LANGUAGE_CODE == 'en-us'%} 
 | 
				
			||||||
                              <a class="url" href="{% change_lang 'de' %}">Deutsch</a>
 | 
									<a class="url" href="{% change_lang 'de' %}">Deutsch</a>
 | 
				
			||||||
                          {% else %}
 | 
									{% else %}
 | 
				
			||||||
                              <a class="url" href="{% change_lang 'en-us' %}" >English</a>
 | 
									<a class="url" href="{% change_lang 'en-us' %}" >English</a>
 | 
				
			||||||
                          {% endif %}
 | 
									{% endif %}
 | 
				
			||||||
                      </div>
 | 
									</div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    </li>
 | 
								</li>
 | 
				
			||||||
                </ul>
 | 
					        </ul>
 | 
				
			||||||
 | 
					  </div><!-- /.navbar-collapse -->
 | 
				
			||||||
 | 
					  </div>
 | 
				
			||||||
            </div>
 | 
					  </div>
 | 
				
			||||||
            <!-- /.navbar-collapse -->
 | 
					</nav>
 | 
				
			||||||
        </div>
 | 
					 | 
				
			||||||
        <!-- /.container -->
 | 
					 | 
				
			||||||
    </nav>
 | 
					 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue