Skip to content

Commit e0f25e2

Browse files
committed
Added learn to menu nav
1 parent 8feeab2 commit e0f25e2

File tree

4 files changed

+9
-2
lines changed

4 files changed

+9
-2
lines changed

core/templates/base.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
<ul class="nav navbar-nav navbar-left">
6363
<li><a href="{% url 'about' %}">About</a></li>
6464
<li><a href="{% url 'sponsors' %}">Sponsors</a></li>
65+
<li><a href="{% url 'learn:index' %}">Learn</a></li>
6566
{% contest_started as started %}
6667
{% if started %}<li><a href="{% url 'problems' %}">Problems</a></li>{% endif %}
6768
<li><a href="{% url 'updates' %}">Updates</a></li>

learn/static/css/learn.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,6 @@ figure {
3131
}
3232

3333
figure > figcaption.figure-caption {
34+
padding-top: .5em;
3435
font-style: italic;
3536
}

learn/urls.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44

55
app_name = 'learn'
66
urlpatterns = [
7-
url(r'^module/([0-9a-zA-Z_]+)/', views.module, name='module')
7+
url(r'^$', views.index, name='index'),
8+
url(r'^module/([0-9a-zA-Z_]+)/$', views.module, name='module')
89
]

learn/views.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
from django.shortcuts import render, get_object_or_404
1+
from django.shortcuts import render, get_object_or_404, redirect
22
from django.template import Template, Context
33

44
from .models import Module
55

6+
def index(request):
7+
root = Module.objects.get(prereqs=None)
8+
9+
return redirect('learn:module', root.name)
610

711
def module(request, module_name):
812
module = get_object_or_404(Module.objects, name=module_name)

0 commit comments

Comments
 (0)