mirror of
				https://gitlab.com/brutaldon/brutaldon
				synced 2025-06-05 21:49:32 +02:00 
			
		
		
		
	Add navbar to top of main template
Also, add stub functions to views to make all the links and reverse routes work.
This commit is contained in:
		| @@ -11,6 +11,29 @@ | ||||
|     <link rel="stylesheet" href="/static/css/brutaldon.css"> | ||||
|   </head> | ||||
|   <body> | ||||
|       {% block navbar %} | ||||
|       <nav class="navbar" role="navigation" aria-label="main navigation is-active"> | ||||
|           <div class="navbar-brand"> | ||||
|               <a class="navbar-item"> | ||||
|                   <img src="https://bulma.io/images/bulma-logo.png" | ||||
|                        width="32" height="32" alt="Brutaldon"> | ||||
|               </a> | ||||
|               <!-- navbar items, navbar burger... --> | ||||
|           </div> | ||||
|           <div class="navbar-menu"> | ||||
|               <!-- navbar start, navbar end --> | ||||
|               <div class="navbar-start"> | ||||
|                   <a href="{% url "home" %}" class="navbar-item">Home</a> | ||||
|                   <a class="navbar-item" href="{% url "note" %}">Notifications</a> | ||||
|                   <a class="navbar-item" href="{% url "local" %}">Local</a> | ||||
|                   <a class="navbar-item" href="{% url "fed" %}">Federated</a> | ||||
|               </div> | ||||
|               <div class="navbar-end" > | ||||
|                   <a class="navbar-item" href="{% url "logout" %}">Log out</a> | ||||
|               </div> | ||||
|           </div> | ||||
|       </nav> | ||||
|       {% endblock %} | ||||
|   <section class="section"> | ||||
|     <div class="container"> | ||||
|       {% block content %}  | ||||
|   | ||||
| @@ -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), | ||||
| ] | ||||
|   | ||||
| @@ -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'}) | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user