This commit is contained in:
MassiveAtoms 2020-07-14 19:12:21 -03:00
commit cfe706b1f5
34 changed files with 275 additions and 353 deletions

View File

@ -1,112 +0,0 @@
/* sidenav */
/* Fixed sidenav, full height */
.sidenav {
height: 100%;
width: 200px;
position: fixed;
z-index: 1;
top: 0;
left: 0;
background-color: #111;
overflow-x: hidden;
padding-top: 20px;
}
/* Style the sidenav links and the dropdown button */
.sidenav a,
.dropdown-btn {
padding: 6px 8px 6px 16px;
text-decoration: none;
font-size: 20px;
color: #818181;
display: block;
border: none;
background: none;
width: 100%;
text-align: left;
cursor: pointer;
outline: none;
}
/* On mouse-over */
.sidenav a:hover,
.dropdown-btn:hover {
color: #f1f1f1;
}
/* Main content */
.main {
margin-left: 200px;
/* Same as the width of the sidenav */
font-size: 20px;
/* Increased text to enable scrolling */
padding: 0px 10px;
}
/* Add an active class to the active dropdown button */
.active {
background-color: green;
color: white;
}
/* Dropdown container (hidden by default). Optional: add a lighter background color and some left padding to change the design of the dropdown content */
.dropdown-container {
display: none;
background-color: #262626;
padding-left: 8px;
}
/* Optional: Style the caret down icon */
.fa-caret-down {
float: right;
padding-right: 8px;
}
ul.topnav {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: #333;
}
.topnav li {
float: right;
}
.topnav li a {
display: block;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
.topnav li a:hover {
background-color: #111;
}
/* Table */
table {
border-spacing: 0;
width: 100%;
border: 1px solid #ddd;
}
th {
cursor: pointer;
}
th,
td {
text-align: left;
padding: 16px;
}
tr:nth-child(even) {
background-color: #f2f2f2
}

View File

@ -1,14 +0,0 @@
var dropdown = document.getElementsByClassName("dropdown-btn");
var i;
for (i = 0; i < dropdown.length; i++) {
dropdown[i].addEventListener("click", function() {
this.classList.toggle("active");
var dropdownContent = this.nextElementSibling;
if (dropdownContent.style.display === "block") {
dropdownContent.style.display = "none";
} else {
dropdownContent.style.display = "block";
}
});
}

View File

@ -3,99 +3,126 @@
<head> <head>
{% block title %}<title>Local Library</title>{% endblock %} {% block title %}<title>Local Library</title>{% endblock %}
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"
integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<!-- Add additional CSS in static file --> <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
{% load static %} <!-- Compiled and minified CSS -->
<link rel="stylesheet" href="{% static 'css/styles.css' %}"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0-beta/css/materialize.min.css">
<!-- Compiled and minified JavaScript -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0-beta/js/materialize.min.js"></script>
<style>
table {
width: 100%;
table-layout: fixed;
}
th {
text-align: center;
}
.title {
width: 40%;
}
.author {
width: 20%;
}
.rating {
width: 5%;
}
.tags {
width: 15%;
}
.added {
width: 20%;
}
</style>
</head> </head>
<body> <body>
{% block topnav%}
<ul class="topnav">
<div class="navbar-fixed">
<nav>
<div class="nav-wrapper row green darken-1">
<ul class="right">
{% if user.is_authenticated %} {% if user.is_authenticated %}
<li class="active"><a href="{{user.get_absolute_url}}"> {{ user.get_username }}</a></li> <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> <li><a href="{% url 'logout'%}?next={{request.path}}">Logout</a></li>
</ul>
<ul class="left">
<li><a href="{% url 'search' %}">Search</a></li>
<li><a href="{% url 'books' %}">Books</a></li>
<li><a class="dropdown-trigger" href="#!" data-target="dropdown-authors">Authors<i
class="material-icons right">arrow_drop_down</i></a></li>
<li><a class="dropdown-trigger" href="#!" data-target="dropdown-ratings">Ratings<i
class="material-icons right">arrow_drop_down</i></a></li>
<li><a class="dropdown-trigger" href="#!" data-target="dropdown-tags">Tags<i
class="material-icons right">arrow_drop_down</i></a></li>
</ul>
<ul id="dropdown-authors" class="dropdown-content">
{% for author in unique_authors %}
<li><a href="{{author.get_absolute_url}}">{{author}}</a></li>
{% endfor %}
</ul>
<ul id="dropdown-ratings" class="dropdown-content">
{% for rating in unique_ratings %}
<li><a href="{{rating.get_absolute_url}}">{{rating}}</a></li>
{% endfor %}
</ul>
<ul id="dropdown-tags" class="dropdown-content">
{% for tag in unique_tags %}
<li><a href="{{tag.get_absolute_url}}">{{tag}}</a></li>
{% endfor %}
</ul>
{% else %} {% else %}
<li><a href="{% url 'sign-up'%}?next={{request.path}}">Sign up</a></li> <li><a href="{% url 'sign-up'%}?next={{request.path}}">Sign up</a></li>
<li><a href="{% url 'login'%}?next={{request.path}}">Login</a></li> <li><a href="{% url 'login'%}?next={{request.path}}">Login</a></li>
{% endif %}
</ul> </ul>
{% endblock %} {% endif %}
{% if user.is_authenticated %}
<div class="container-fluid">
<div class="row">
<div class="col-sm-2">
{% block sidebar %}
<div class="sidenav">
<a href="{% url 'search' %}">Search</a>
<a href="{% url 'books' %}">Books</a>
<button class="dropdown-btn">Authors
<i class="fa fa-caret-down"></i>
</button>
<div class="dropdown-container">
{% for author in unique_authors %}
<a href="{{author.get_absolute_url}}">{{author.name}}({{author.num_books}})</a>
{% endfor %}
</div>
<button class="dropdown-btn">Publishers
<i class="fa fa-caret-down"></i>
</button>
<div class="dropdown-container">
{% for publisher in unique_publishers %}
<a href="{{publisher.get_absolute_url}}">{{publisher}} ({{publisher.num_books}})</a>
{% endfor %}
</div>
<button class="dropdown-btn">Ratings
<i class="fa fa-caret-down"></i>
</button>
<div class="dropdown-container">
{% for rating in unique_ratings %}
<a href="{{rating.get_absolute_url}}">{{rating}} ({{rating.num_books}})</a>
{% endfor %}
</div>
<button class="dropdown-btn">Tags
<i class="fa fa-caret-down"></i>
</button>
<div class="dropdown-container">
{% for tag in unique_tags %}
<a href="{{tag.get_absolute_url}}">{{tag}} ({{tag.num_books}})</a>
{% endfor %}
</div>
</div>
{% endblock %}
</div>
<div class="col-sm-10 ">{% block content %}{% endblock %}</div>
</div> </div>
</nav>
</div> </div>
<script> <script>
var dropdown = document.getElementsByClassName("dropdown-btn"); $(".dropdown-trigger").dropdown({
var i; hover: true,
constrainWidth: false,
for (i = 0; i < dropdown.length; i++) { coverTrigger: false
dropdown[i].addEventListener("click", function () {
this.classList.toggle("active");
var dropdownContent = this.nextElementSibling;
if (dropdownContent.style.display === "block") {
dropdownContent.style.display = "none";
} else {
dropdownContent.style.display = "block";
}
}); });
}
</script> </script>
{% if user.is_authenticated %}
{% block content %} {% endblock %}
{% else %}
<div class="valign-wrapper" style="width:100%;height:100%;position: absolute;">
<div class="valign" style="width:100%;">
<div class="container">
<div class="row">
<div class="col s12 m6 offset-m3">
<div class="card">
<div class="card-content center">
<p>You don't have permission to view this.</p>
</div>
<div class="card-action center">
<a class="waves-effect waves-light btn-large green accent-4" href="{% url 'login'%}?next={{request.path}}">Login</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
{% endif %}
<script> <script>
function sortTable(n) { function sortTable(n) {
var table, rows, switching, i, x, y, shouldSwitch, dir, switchcount = 0; var table, rows, switching, i, x, y, shouldSwitch, dir, switchcount = 0;
@ -153,17 +180,6 @@
} }
</script> </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> </body>
</html> </html>

View File

@ -1,6 +1,22 @@
{% if user.is_authenticated %} {% if user.is_authenticated %}
{% else %} {% else %}
<h1>You don't have permission to view this.</h1> <div class="valign-wrapper" style="width:100%;height:100%;position: absolute;">
<li><a href="{% url 'login'%}?next={{request.path}}">Login</a></li> <div class="valign" style="width:100%;">
<div class="container">
<div class="row">
<div class="col s12 m6 offset-m3">
<div class="card">
<div class="card-content center">
<p>You don't have permission to view this.</p>
</div>
<div class="card-action center">
<a class="waves-effect waves-light btn-large green accent-4" href="{% url 'login'%}?next={{request.path}}">Login</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
{% endif %} {% endif %}

View File

@ -1,17 +1,17 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block content %} {% block content %}
{% load static %}
<h1>{{author}}</h1> <h1>{{author}}</h1>
<table id="books"> <table id="books" class="highlight centered">
<tr> <tr>
<!--When a header is clicked, run the sortTable function, with a parameter, 0 for sorting by names, 1 for sorting by country:--> <!--When a header is clicked, run the sortTable function, with a parameter, 0 for sorting by names, 1 for sorting by country:-->
<th onclick="sortTable(0)">Title</th> <th class="title" onclick="sortTable(0)">Title</th>
<th onclick="sortTable(1)">Author</th> <th class="author" onclick="sortTable(1)">Author</th>
<th onclick="sortTable(2)">Rating</th> <th class="rating" onclick="sortTable(2)">Rating</th>
<th onclick="sortTable(3)">Tags</th> <th class="tags" onclick="sortTable(3)">Tags</th>
<th onclick="sortTable(4)">Added</th> <th class="added" onclick="sortTable(4)">Added</th>
</tr> </tr>
{% for book in books %} {% for book in books %}
<tr> <tr>

View File

@ -1,7 +1,7 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block content %} {% block content %}
{% load static %}
<h1>Author List</h1> <h1>Author List</h1>
{% if author_list %} {% if author_list %}
<ul> <ul>

View File

@ -2,16 +2,24 @@
{% block content %} {% block content %}
{% load static %} {% load static %}
<h1>{{book.title}} by
<div class="col s12 m7">
<div class="card z-depth-0 horizontal">
<div class="card-image">
<a style="padding-top:15%" href="{{download}}"><img src=" {% static "" %}{{imgpath}}" alt="download" srcset=""></a>
</div>
<div class="card-stacked">
<div class="card-content">
<h1> {{book.title}}</h1>
<h4> by
{% if book.authors %} {% if book.authors %}
{% for author in book.authors.all %} {% for author in book.authors.all %}
<a href="{{author.get_absolute_url}}">{{author.name}}</a> <a href="{{author.get_absolute_url}}">{{author.name}}</a>
{%endfor%} {%endfor%}
{% else %} {% else %}
{{book.author_sort}} {{book.author_sort}}
{%endif%} {%endif%}
<br>
Published by Published by
{% if book.publishers %} {% if book.publishers %}
{% for pub in book.publishers.all %} {% for pub in book.publishers.all %}
@ -19,9 +27,8 @@
{%endfor%} {%endfor%}
{% else %} {% else %}
Unknown Unknown
{%endif%} {%endif%}
<br>
Tags: Tags:
{% if book.tags %} {% if book.tags %}
{% for tag in book.tags.all %} {% for tag in book.tags.all %}
@ -29,7 +36,7 @@
{%endfor%} {%endfor%}
{% else %} {% else %}
{%endif%} {%endif%}
<br>
Rating: Rating:
{% if book.ratings %} {% if book.ratings %}
{% for rating in book.ratings.all %} {% for rating in book.ratings.all %}
@ -37,14 +44,18 @@
{%endfor%} {%endfor%}
{% else %} {% else %}
{%endif%} {%endif%}
<br>
<a href="{{book.publisher.get_absolute_url}}">{{book.publisher}}</a> <a href="{{book.publisher.get_absolute_url}}">{{book.publisher}}</a>
</h1> </h4>
</div>
<a href="{% static "" %}{{download}}"><img src="{% static "" %}{{imgpath}}" alt="download" srcset=""></a> </div>
</div>
</div>
<div class="container">
{% autoescape off %} {% autoescape off %}
{{comment}} {{comment}}
{% endautoescape %} {% endautoescape %}
</div>
{% endblock %} {% endblock %}

View File

@ -1,17 +1,21 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block content %} {% block content %}
{% load static %}
<h1>Book List</h1>
<table id="books"> <h1 class="center">Book List</h1>
<div class="row">
<div class="col s1 m0">
</div>
<div class="col s10 m12">
<table id="books" class="highlight centered">
<tr> <tr>
<!--When a header is clicked, run the sortTable function, with a parameter, 0 for sorting by names, 1 for sorting by country:--> <!--When a header is clicked, run the sortTable function, with a parameter, 0 for sorting by names, 1 for sorting by country:-->
<th onclick="sortTable(0)">Title</th> <th class="title" onclick="sortTable(0)">Title</th>
<th onclick="sortTable(1)">Author</th> <th class="author" onclick="sortTable(1)">Author</th>
<th onclick="sortTable(2)">Rating</th> <th class="rating" onclick="sortTable(2)">Rating</th>
<th onclick="sortTable(3)">Tags</th> <th class="tags" onclick="sortTable(3)">Tags</th>
<th onclick="sortTable(4)">Added</th> <th class="added" onclick="sortTable(4)">Added</th>
</tr> </tr>
{% for book in book_list %} {% for book in book_list %}
<tr> <tr>
@ -30,11 +34,8 @@
</tr> </tr>
{% endfor %} {% endfor %}
</table> </table>
<div class="col s1 m0">
</div>
</div>
{% endblock %} {% endblock %}

View File

@ -1,18 +1,18 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block content %} {% block content %}
{% load static %}
<h1>{{publisher}} </h1> <h1>{{publisher}} </h1>
{% if publisher.released %} {% if publisher.released %}
<table id="books"> <table id="books" class="highlight centered">
<tr> <tr>
<!--When a header is clicked, run the sortTable function, with a parameter, 0 for sorting by names, 1 for sorting by country:--> <!--When a header is clicked, run the sortTable function, with a parameter, 0 for sorting by names, 1 for sorting by country:-->
<th onclick="sortTable(0)">Title</th> <th class="title" onclick="sortTable(0)">Title</th>
<th onclick="sortTable(1)">Author</th> <th class="author" onclick="sortTable(1)">Author</th>
<th onclick="sortTable(2)">Rating</th> <th class="rating" onclick="sortTable(2)">Rating</th>
<th onclick="sortTable(3)">Tags</th> <th class="tags" onclick="sortTable(3)">Tags</th>
<th onclick="sortTable(4)">Added</th> <th class="added" onclick="sortTable(4)">Added</th>
</tr> </tr>
{% for book in books %} {% for book in books %}
<tr> <tr>

View File

@ -1,7 +1,7 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block content %} {% block content %}
{% load static %}
<h1>Publishers List</h1> <h1>Publishers List</h1>
{% if publisher_list %} {% if publisher_list %}
<ul> <ul>

View File

@ -1,18 +1,17 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block content %} {% block content %}
{% load static %}
<h1>{{rating}}</h1> <h1 class="left">Books with rating: {{rating}}</h1>
{% if books %} {% if books %}
<table id="books"> <table id="books" class="highlight centered">
<tr> <tr>
<!--When a header is clicked, run the sortTable function, with a parameter, 0 for sorting by names, 1 for sorting by country:--> <!--When a header is clicked, run the sortTable function, with a parameter, 0 for sorting by names, 1 for sorting by country:-->
<th onclick="sortTable(0)">Title</th> <th class="title" onclick="sortTable(0)">Title</th>
<th onclick="sortTable(1)">Author</th> <th class="author" onclick="sortTable(1)">Author</th>
<th onclick="sortTable(2)">Rating</th> <th class="rating" onclick="sortTable(2)">Rating</th>
<th onclick="sortTable(3)">Tags</th> <th class="tags" onclick="sortTable(3)">Tags</th>
<th onclick="sortTable(4)">Added</th> <th class="added" onclick="sortTable(4)">Added</th>
</tr> </tr>
{% for book in books %} {% for book in books %}
<tr> <tr>

View File

@ -1,7 +1,7 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block content %} {% block content %}
{% load static %}
<h1>Ratings List</h1> <h1>Ratings List</h1>
{% if rating_list %} {% if rating_list %}
<ul> <ul>

View File

@ -1,18 +1,17 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block content %} {% block content %}
{% load static %}
<h1>{{tag}}</h1> <h1>{{tag}}</h1>
{% if books %} {% if books %}
<table id="books"> <table id="books" class="highlight centered">
<tr> <tr>
<!--When a header is clicked, run the sortTable function, with a parameter, 0 for sorting by names, 1 for sorting by country:--> <!--When a header is clicked, run the sortTable function, with a parameter, 0 for sorting by names, 1 for sorting by country:-->
<th onclick="sortTable(0)">Title</th> <th class="title" onclick="sortTable(0)">Title</th>
<th onclick="sortTable(1)">Author</th> <th class="author" onclick="sortTable(1)">Author</th>
<th onclick="sortTable(2)">Rating</th> <th class="rating" onclick="sortTable(2)">Rating</th>
<th onclick="sortTable(3)">Tags</th> <th class="tags" onclick="sortTable(3)">Tags</th>
<th onclick="sortTable(4)">Added</th> <th class="added" onclick="sortTable(4)">Added</th>
</tr> </tr>
{% for book in books %} {% for book in books %}
<tr> <tr>

View File

@ -1,7 +1,7 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block content %} {% block content %}
{% load static %}
<h1>Tags List</h1> <h1>Tags List</h1>
{% if tag_list %} {% if tag_list %}
<ul> <ul>

View File

@ -2,19 +2,6 @@
{% block content %} {% block content %}
{% if form.errors %}
<p>Your username and password didn't match. Please try again.</p>
{% endif %}
{% if next %}
{% if user.is_authenticated %}
<p>Your account doesn't have access to this page. To proceed,
please login with an account that has access.</p>
{% else %}
<p>Please login to see this page.</p>
{% endif %}
{% endif %}
<form method="post" action="{% url 'login' %}"> <form method="post" action="{% url 'login' %}">
{% csrf_token %} {% csrf_token %}
<table> <table>
@ -27,7 +14,23 @@
<td>{{ form.password }}</td> <td>{{ form.password }}</td>
</tr> </tr>
</table> </table>
<input type="submit" value="login" />
<div style="color:#f44336">
{% if form.errors %}
<p>Your username and password didn't match. Please try again.</p>
{% endif %}
{% if next %}
{% if user.is_authenticated %}
<p>Your account doesn't have access to this page. To proceed,
please login with an account that has access.</p>
{% else %}
<p>Please login to see this page.</p>
{% endif %}
{% endif %}
</div>
<button class="waves-effect waves-light btn green accent-4" type="submit">login</button>
<input type="hidden" name="next" value="{{ next }}" /> <input type="hidden" name="next" value="{{ next }}" />
</form> </form>

View File

@ -3,7 +3,7 @@
{% block content %} {% block content %}
<form method="post"> <form method="post">
{% csrf_token %} {{form.as_p}} <input type="submit" value="Sign up"></form> {% csrf_token %} {{form.as_p}} <button class="waves-effect waves-light btn green accent-4" type="submit">sign up</button></form>

View File

@ -1,17 +1,17 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block content %} {% block content %}
{% load static %}
<h1>Results</h1> <h1>Results</h1>
<table id="books"> <table id="books">
<tr> <tr>
<!--When a header is clicked, run the sortTable function, with a parameter, 0 for sorting by names, 1 for sorting by country:--> <!--When a header is clicked, run the sortTable function, with a parameter, 0 for sorting by names, 1 for sorting by country:-->
<th onclick="sortTable(0)">Title</th> <th class="title" onclick="sortTable(0)">Title</th>
<th onclick="sortTable(1)">Author</th> <th class="author" onclick="sortTable(1)">Author</th>
<th onclick="sortTable(2)">Rating</th> <th class="rating" onclick="sortTable(2)">Rating</th>
<th onclick="sortTable(3)">Tags</th> <th class="tags" onclick="sortTable(3)">Tags</th>
<th onclick="sortTable(4)">Added</th> <th class="added" onclick="sortTable(4)">Added</th>
</tr> </tr>
{% for book in book_list %} {% for book in book_list %}
<tr> <tr>

View File

@ -1,15 +1,15 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block content %} {% block content %}
{% load static %}
<form action="{% url 'results' %}" method="get"> <div class="container">
<form action="{% url 'results' %}" method="get" style="padding-top:2em">
<label for="title">Title: </label> <label for="title">Title: </label>
<input id="title" type="text" name="title" value=""> <input id="title" type="text" name="title" value="">
<label for="author">Author: </label> <label for="author">Author: </label>
<input id="author" type="text" name="author" value=""> <input id="author" type="text" name="author" value="">
<input type="submit" value="search"> <button class="waves-effect waves-light btn green accent-4" type="submit">search</button>
</form> </form>
</div>
{% endblock %} {% endblock %}

View File

@ -5,36 +5,39 @@
{% block title %}<title>Local Library</title>{% endblock %} {% block title %}<title>Local Library</title>{% endblock %}
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"
integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<!-- Add additional CSS in static file --> <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
{% load static %} <!-- Compiled and minified CSS -->
<link rel="stylesheet" href="{% static 'css/styles.css' %}"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0-beta/css/materialize.min.css">
<!-- Compiled and minified JavaScript -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0-beta/js/materialize.min.js"></script>
</head> </head>
<body> <body>
{% block topnav%}
<ul class="topnav">
<div class="navbar-fixed">
<nav>
<div class="nav-wrapper row green darken-1">
<ul class="right">
{% if user.is_authenticated %} {% if user.is_authenticated %}
<li class="active"><a href="{{user.get_absolute_url}}"></a> {{ user.get_username }}</a></li> <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> <li><a href="{% url 'logout'%}?next={{request.path}}">Logout</a></li>
</ul>
{% else %} {% else %}
<li><a href="{% url 'sign-up'%}?next={{request.path}}">Sign up</a></li> <li><a href="{% url 'sign-up'%}?next={{request.path}}">Sign up</a></li>
<li><a href="{% url 'login'%}?next={{request.path}}">Login</a></li> <li><a href="{% url 'login'%}?next={{request.path}}">Login</a></li>
{% endif %}
</ul> </ul>
{% endblock %} {% endif %}
</div>
</nav>
</div>
<div class="container-fluid"> <div class="container">
<div class="row"> <div class="row">
<div class="col s10 ">{% block content %}{% endblock %}</div>
<div class="col-sm-10 ">{% block content %}{% endblock %}</div>
</div> </div>
</div> </div>
</body> </body>