forked from Fediversity/Fediversity
redirect to current page after login/logout
This commit is contained in:
parent
6d0fdd0834
commit
73c9c884d7
4 changed files with 16 additions and 2 deletions
|
@ -17,9 +17,9 @@
|
|||
<body>
|
||||
<header>
|
||||
{% if user.is_authenticated %}
|
||||
<p>Welcome, {{ user.username }}! <a href="{% url 'logout' %}">Logout</a></p>
|
||||
<p>Welcome, {{ user.username }}! <a href="{% url 'logout' %}?next={{ request.path }}">Logout</a></p>
|
||||
{% else %}
|
||||
<p><a href="{% url 'login' %}">Login</a></p>
|
||||
<p><a href="{% url 'login' %}?next={{ request.path }}">Login</a></p>
|
||||
{% endif %}
|
||||
</header>
|
||||
{% block navigation %}
|
||||
|
|
10
panel/src/panel/templates/service_list.html
Normal file
10
panel/src/panel/templates/service_list.html
Normal file
|
@ -0,0 +1,10 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<h1>Fediverse services</h1>
|
||||
|
||||
<dl>
|
||||
<dt>Hello world service</dt>
|
||||
<dd>Nothing to see here</dd>
|
||||
</dl>
|
||||
{% endblock %}
|
|
@ -23,4 +23,5 @@ urlpatterns = [
|
|||
path('', views.Index.as_view(), name='index'),
|
||||
path("", include("django.contrib.auth.urls")),
|
||||
path("account/", views.AccountDetail.as_view(), name='accountdetail')
|
||||
path("services/", views.ServiceList.as_view(), name='service_list'),
|
||||
]
|
||||
|
|
|
@ -11,3 +11,6 @@ class AccountDetail(LoginRequiredMixin, DetailView):
|
|||
template_name = 'accountdetail.html'
|
||||
def get_object(self):
|
||||
return self.request.user
|
||||
|
||||
class ServiceList(TemplateView):
|
||||
template_name = 'service_list.html'
|
||||
|
|
Loading…
Add table
Reference in a new issue