fixed auth issue

This commit is contained in:
MassiveAtoms 2020-07-12 21:09:26 -03:00
parent fce13c85e4
commit 76dd31c80c
3 changed files with 53 additions and 31 deletions

Binary file not shown.

View File

@ -3,6 +3,7 @@
<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">
@ -14,24 +15,30 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0-beta/js/materialize.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0-beta/js/materialize.min.js"></script>
<style> <style>
table { table {
width:100%; width: 100%;
table-layout:fixed; table-layout: fixed;
} }
th { th {
text-align: center; text-align: center;
} }
.title { .title {
width: 40%; width: 40%;
} }
.author { .author {
width: 20%; width: 20%;
} }
.rating { .rating {
width: 5%; width: 5%;
} }
.tags { .tags {
width: 15%; width: 15%;
} }
.added { .added {
width: 20%; width: 20%;
} }
@ -53,9 +60,12 @@
<ul class="left"> <ul class="left">
<li><a href="{% url 'search' %}">Search</a></li> <li><a href="{% url 'search' %}">Search</a></li>
<li><a href="{% url 'books' %}">Books</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-authors">Authors<i
<li><a class="dropdown-trigger" href="#!" data-target="dropdown-ratings">Ratings<i class="material-icons right">arrow_drop_down</i></a></li> 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> <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>
<ul id="dropdown-authors" class="dropdown-content"> <ul id="dropdown-authors" class="dropdown-content">
{% for author in unique_authors %} {% for author in unique_authors %}
@ -82,10 +92,21 @@
</nav> </nav>
</div> </div>
<script> <script>
$(".dropdown-trigger").dropdown({hover: true, constrainWidth: false, coverTrigger: false}); $(".dropdown-trigger").dropdown({
hover: true,
constrainWidth: false,
coverTrigger: false
});
</script> </script>
{% block content %} {% endblock %}
{% if user.is_authenticated %}
{% block content %} {% endblock %}
{% else %}
<h1>You don't have permission to view this.</h1> <!--Here, stefan -->
<li><a href="{% url 'login'%}?next={{request.path}}">Login</a></li>
{% endif %}
<script> <script>
function sortTable(n) { function sortTable(n) {

View File

@ -1,9 +1,10 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block content %} {% block content %}
{% load static %}
<div class="row"> <div class="row">
<div class="col s4"><a href="{{download}}"><img src="{{imgpath}}" alt="download" srcset=""></a></div> <div class="col s4"><a href="{{download}}"><img src=" {% static "" %}{{imgpath}}" alt="download" srcset=""></a></div>
<div class="col s8"> <div class="col s8">
<h1> {{book.title}}</h1> <h1> {{book.title}}</h1>
<h4> by <h4> by