From 43e4726c2f2cf583d368b0168a9e750c6f61b738 Mon Sep 17 00:00:00 2001 From: Jason McBrayer Date: Tue, 24 Apr 2018 19:20:22 -0400 Subject: [PATCH] Add navbar to top of main template Also, add stub functions to views to make all the links and reverse routes work. --- brutaldon/templates/base.html | 23 +++++++++++++++++++++++ brutaldon/urls.py | 8 ++++++-- brutaldon/views.py | 15 ++++++++++++++- 3 files changed, 43 insertions(+), 3 deletions(-) diff --git a/brutaldon/templates/base.html b/brutaldon/templates/base.html index 33c1004..d991a6c 100644 --- a/brutaldon/templates/base.html +++ b/brutaldon/templates/base.html @@ -11,6 +11,29 @@ + {% block navbar %} + + {% endblock %}
{% block content %} diff --git a/brutaldon/urls.py b/brutaldon/urls.py index dcdd61c..21c95b4 100644 --- a/brutaldon/urls.py +++ b/brutaldon/urls.py @@ -19,8 +19,12 @@ from brutaldon import views urlpatterns = [ path('admin/', admin.site.urls), - path('home/', views.home), + path('home', views.home, name='home'), path('login', views.login, name="login"), - path('error', views.error), + path('logout', views.logout, name='logout'), + path('error', views.error, name='error'), + path('note', views.note, name='note'), + path('local', views.local, name='local'), + path('fed', views.fed, name='fed'), path('', views.home), ] diff --git a/brutaldon/views.py b/brutaldon/views.py index 62be5b9..fd93ce3 100644 --- a/brutaldon/views.py +++ b/brutaldon/views.py @@ -83,5 +83,18 @@ def login(request): else: return render(request, 'setup/login.html', {'form': form}) +def logout(request): + return redirect(error) + def error(request): - return render('error.html', { 'error': "Not logged in yet."}) + return render(request, 'error.html', { 'error': "Not logged in yet."}) + +def note(request): + return render(request, 'main/timeline.html', {'timeline': 'Notifications'}) + +def local(request): + return render(request, 'main/timeline.html', {'timeline': 'Local'}) + +def fed(request): + return render(request, 'main/timeline.html', {'timeline': 'Federated'}) +