added authentication
This commit is contained in:
@@ -13,6 +13,20 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
{% block topnav%}
|
||||
<ul class="topnav">
|
||||
|
||||
{% if user.is_authenticated %}
|
||||
<li class="active"><a href="{{user.get_absolute_url}}"> {{ user.get_username }}</a></li>
|
||||
<li><a href="{% url 'logout'%}?next={{request.path}}">Logout</a></li>
|
||||
{% else %}
|
||||
<li><a href="{% url 'sign-up'%}?next={{request.path}}">Sign up</a></li>
|
||||
<li><a href="{% url 'login'%}?next={{request.path}}">Login</a></li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
{% endblock %}
|
||||
|
||||
{% if user.is_authenticated %}
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-sm-2">
|
||||
@@ -138,6 +152,18 @@
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
{% else %}
|
||||
<h1>You don't have permission to view this.</h1>
|
||||
<li><a href="{% url 'login'%}?next={{request.path}}">Login</a></li>
|
||||
or
|
||||
<li><a href="{% url 'sign-up'%}?next={{request.path}}">Sign up</a></li>
|
||||
{% endif %}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user