Skip to content

Commit

Permalink
updated navbar to highlight current page
Browse files Browse the repository at this point in the history
  • Loading branch information
rladdusaw committed Jun 28, 2016
1 parent 5ad6c7b commit a0df962
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
2 changes: 2 additions & 0 deletions templates/accounts/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<br>
<input class="btn btn-lg btn-default btn-block" type="submit" value="Submit" />
</form>
<a href="{% url 'register_view' %}" class="btn btn-lg btn-default btn-block">Register</a>
</div>

{% endblock %}
Expand All @@ -27,6 +28,7 @@
$("#id_username").attr('class', 'form-control');
$("#id_password").attr('placeholder', '{{ form.password.label }}');
$("#id_password").attr('class', 'form-control');
$("#id_login_navbar").attr('class', 'active');
});
</script>

Expand Down
7 changes: 4 additions & 3 deletions templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li class="active">
<li id="id_home_navbar">
<a href="{% url 'home' %}">Home</a>
</li>
<li>
<li id="id_login_navbar">
<a href="{% url 'login_view' %}">Login</a>
</li>
<li>
<li id="id_profile_navbar">
<a href="{% url 'register_view' %}">Register</a>
</li>
</ul>
Expand All @@ -43,6 +43,7 @@

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="/static/bootstrap/js/bootstrap.min.js"></script>

{% block scripts %}
{% endblock %}

Expand Down
8 changes: 8 additions & 0 deletions templates/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,12 @@ <h3>Welcome, Anonymous User</h3>
{% endif %}
</div>
-->
{% endblock %}

{% block scripts %}
<script>
$(document).ready(function () {
$("#id_home_navbar").attr('class', 'active');
});
</script>
{% endblock %}
2 changes: 1 addition & 1 deletion wishlist/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
from .views import WishlistView

urlpatterns = [
url(r'create/$', WishlistView.as_view(), name='create_wishlist'),
url(r'create/$', WishlistView.as_view(), name='create_wishlist'),
]

0 comments on commit a0df962

Please sign in to comment.