implement login and logout
- add LogoutView to dashboard app - define logout URL pattern - only use login view from django.contrib.auth.views instead of including all auth URLs - change base template to support login/logout - add template dashboard/user_dashboard.html
This commit is contained in:
parent
1deed46d34
commit
2bc278ae92
5 changed files with 55 additions and 9 deletions
|
@ -1,4 +1,4 @@
|
|||
{% load staticfiles %}
|
||||
{% load staticfiles i18n %}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
@ -32,21 +32,29 @@
|
|||
<body>
|
||||
|
||||
<div class="navbar navbar-inverse navbar-fixed-top">
|
||||
<div class="container">
|
||||
<div class="container-fluid">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="#">gnuviechadmin</a>
|
||||
<a class="navbar-brand" href="{% url "dashboard" %}">gnuviechadmin</a>
|
||||
</div>
|
||||
<div class="collapse navbar-collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
<li class="active"><a href="#">Home</a></li>
|
||||
<li class="active"><a href="{% if user.is_authenticated %}{% url 'customer_dashboard' slug=user.username %}{% else %}{% url 'dashboard' %}{% endif %}">Home</a></li>
|
||||
<li><a href="#about">About</a></li>
|
||||
<li><a href="#contact">Contact</a></li>
|
||||
</ul>
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
{% if user.is_authenticated %}
|
||||
<li><a href="#">{% trans "My Profile" %}</a></li>
|
||||
<li><a href="{% url 'logout' %}">{% trans "Logout" %}</a></li>
|
||||
{% else %}
|
||||
<li><a href="{% url 'login' %}?next={{ request.path }}">{% trans "Sign In" %}</a></li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div><!--/.nav-collapse -->
|
||||
</div>
|
||||
</div>
|
||||
|
|
12
gnuviechadmin/templates/dashboard/user_dashboard.html
Normal file
12
gnuviechadmin/templates/dashboard/user_dashboard.html
Normal file
|
@ -0,0 +1,12 @@
|
|||
{% extends "base.html" %}
|
||||
{% load i18n %}
|
||||
{% block title %}{{ block.super }} - {% blocktrans with full_name=dashboard_user.get_full_name %}Dashboard for {{ full_name }}{% endblocktrans %}{% endblock title %}
|
||||
{% block page_title %}{% blocktrans with full_name=dashboard_user.get_full_name %}Dashboard for {{ full_name }}{% endblocktrans %}{% endblock page_title %}
|
||||
{% block content %}
|
||||
<p>Contract details</p>
|
||||
<ul>
|
||||
<li>Domains</li>
|
||||
<li>Email mailboxes</li>
|
||||
<li>Email addresses</li>
|
||||
</ul>
|
||||
{% endblock content %}
|
Loading…
Add table
Add a link
Reference in a new issue