Commit 3b5425fe authored by Okhin's avatar Okhin

Adding the langauge switch, and some aesthetics on the main bar

parent 58b3de62
......@@ -38,20 +38,6 @@
<body>
<div id="header">
<h1><a href="{% url 'homepage' %}">Respect My Net <span>{% trans "Report cases of Net Neutrality violations" %}</span></a></h1>
<div id="user">
<p>
{% if user.is_authenticated %}
{{ user.username }},
<a href="{%root_url%}/accounts/logout">{% trans "Logout" %}</a>
<span>or</span>
<a href="{%root_url%}/admin/">{% trans "Admin" %}</a>
{% block adminext %}
{% endblock %}
{% else %}
<a href="{%root_url%}/admin/" id="login">{% trans "Login" %}</a>
{% endif %}
</p>
</div>
</div>
<nav class="navbar navbar-default">
......@@ -71,18 +57,50 @@
<li role="presentation" {% block active_tab_cases %}{% endblock %}><a href="{% url 'list_violations' %}">{% trans "Cases" %}</a></li>
<li role="presentation" {% block active_tab_about %}{% endblock %}><a href="{%root_url%}/about">{% trans "What is Net Neutrality?" %}</a></li>
<li role="presentation" {% block active_tab_start %}{% endblock %}><a href="{%root_url%}/start">{% trans "Start Monitoring" %}</a></li>
{% if user.is_authenticated %}
<p class="navbar-text">{{ user.username }}</p>
<li role="presentation" class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" href="#">{% trans "Admin Action" %} <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="{%root_url%}/accounts/logout">{% trans "Logout" %}</a></li>
<li><a href="{%root_url%}/admin/">{% trans "Admin" %}</a></li>
<li role="separator" class="divder"></li>
{% block adminext %}
{% endblock %}
</ul>
{% else %}
<li role="presentation"><a href="{%root_url%}/admin/" id="login">{% trans "Login" %}</a></li>
{% endif %}
</ul>
<form action="{% url 'set_language' %}" method="post" class="navbar-form">{% csrf_token %}
<div class="input-group">
<select class="form-control" name="language">
{% get_current_language as LANGUAGE_CODE %}
{% get_available_languages as LANGUAGES %}
{% get_language_info_list for LANGUAGES as languages %}
{% for language in languages %}
<option value="{{ language.code }}"{% if language.code == LANGUAGE_CODE %} selected="selected"{% endif %}>
{{ language.name_local }} ({{ language.code }})
</option>
{% endfor %}
</select>
<span class="input-group-btn">
<button type="submit" class="btn btn-default">Go</button>
</span>
</div>
</form>
<form action="/search/" method="get" class="navbar-form navbar-right">
<div class="form-group">
<div class="input-group">
<input type="text" class="form-control" placeholder="Quick Search...">
<span class="input-group-btn">
<button type="submit" class="btn btn-default">Search</button>
</span>
</div>
{% buttons %}
<button type="submit" class="btn btn-default">Search</button>
{% endbuttons %}
</form>
</nav>
</div>
</div>
</nav>
{% if messages %}
{% for message in messages %}
......
......@@ -6,7 +6,7 @@
{% block styles %}
{% endblock %}
{% block adminext %}
, <a href="{%root_url%}/admin/bt/violation/{{v.id}}/ ">{% trans "Edit" %}</a>
<li><a href="{%root_url%}/admin/bt/violation/{{v.id}}/ ">{% trans "Edit" %}</a></li>
{% endblock %}
{% block scripts %}
<script type="text/javascript" src="/static/js/jquery.min.js"></script>
......
......@@ -82,6 +82,8 @@ urlpatterns = patterns('',
include(operator_api_resource.urls)),
url(r'^search/',
bt.ViolationSearchView.as_view(template_name='search/search.html')),
# Language switch
url(r'^i18n/', include('django.conf.urls.i18n')),
)
if settings.DEV_SERVER == True:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment