reasonably working calibreweb thing

This commit is contained in:
MassiveAtoms
2020-07-07 23:11:21 -03:00
commit 8ec8c686c6
38 changed files with 1752 additions and 0 deletions

View File

@ -0,0 +1,54 @@
<!DOCTYPE html>
<html lang="en">
<head>
{% block title %}<title>Local Library</title>{% endblock %}
<meta charset="utf-8">
<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">
<!-- Add additional CSS in static file -->
{% load static %}
<link rel="stylesheet" href="{% static 'css/styles.css' %}">
</head>
<body>
<div class="container-fluid">
<div class="row">
<div class="col-sm-2">
{% block sidebar %}
<div class="sidenav">
<a href="#about">About</a>
<a href="#services">Services</a>
<a href="#clients">Clients</a>
<a href="#contact">Contact</a>
<button class="dropdown-btn">Dropdown
<i class="fa fa-caret-down"></i>
</button>
<div class="dropdown-container">
<a href="#">Link 1</a>
<a href="#">Link 2</a>
<a href="#">Link 3</a>
</div>
<a href="#contact">{{counter}} books</a>
</div>
{% endblock %}
</div>
<div class="col-sm-10 ">{% block content %}{% endblock %}</div>
</div>
</div>
<script>
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";
}
});
}
</script>
</body>
</html>

View File

@ -0,0 +1,19 @@
{% extends "base.html" %}
{% block content %}
{% load static %}
<h1>{{authors}}</h1>
{% if books %}
<ul>
{% for book in books %}
<li><a href="{{book.get_absolute_url}}">{{book.title}}</a></li>
{%endfor%}
</ul>
{% else %}
{%endif%}
{% endblock %}

View File

@ -0,0 +1,17 @@
{% extends "base.html" %}
{% block content %}
{% load static %}
<h1>Author List</h1>
{% if authors_list %}
<ul>
{% for author in authors_list %}
<li>
<a href="{{ author.get_absolute_url }}">{{ author.name }}</a>
</li>
{% endfor %}
</ul>
{% else %}
<p>There are no authors in the library.</p>
{% endif %}
{% endblock %}

View File

@ -0,0 +1,47 @@
{% extends "base.html" %}
{% block content %}
{% load static %}
<h1>{{books.title}} by
{% if books.authors %}
{% for author in books.authors.all %}
<a href="{{author.get_absolute_url}}">{{author.name}}</a>
{%endfor%}
{% else %}
{{books.author_sort}}
{%endif%}
Published by
{% if books.publishers %}
{% for pub in books.publishers.all %}
<a href="{{pub.get_absolute_url}}">{{pub.name}}</a>
{%endfor%}
{% else %}
Unknown
{%endif%}
Tags:
{% if books.tags %}
{% for tag in books.tags.all %}
<a href="{{tag.get_absolute_url}}">{{tag.name}}</a>,
{%endfor%}
{% else %}
{%endif%}
Rating:
{% if books.ratings %}
{% for rating in books.ratings.all %}
<a href="{{rating.get_absolute_url}}">{{rating}}</a>
{%endfor%}
{% else %}
{%endif%}
<a href="{{book.publisher.get_absolute_url}}">{{book.publisher}}</a>
</h1>
{{comment}}
<a href="{% static "" %}{{download}}"><img src="{% static "" %}{{imgpath}}" alt="" srcset=""></a>
{% endblock %}

View File

@ -0,0 +1,17 @@
{% extends "base.html" %}
{% block content %}
{% load static %}
<h1>Book List</h1>
{% if books_list %}
<ul>
{% for book in books_list %}
<li>
<a href="{{ book.get_absolute_url }}">{{ book.title }}</a> ({{book.author_sort}})
</li>
{% endfor %}
</ul>
{% else %}
<p>There are no books in the library.</p>
{% endif %}
{% endblock %}

View File

@ -0,0 +1,18 @@
{% extends "base.html" %}
{% block content %}
{% load static %}
<h1>{{authors}} </h1>
{% if publishers.released %}
<ul>
{% for book in publishers.released.all %}
<li><a href="{{book.get_absolute_url}}">{{book.title}}</a></li>
{%endfor%}
</ul>
{% else %}
{%endif%}
{% endblock %}

View File

@ -0,0 +1,17 @@
{% extends "base.html" %}
{% block content %}
{% load static %}
<h1>Publishers List</h1>
{% if publishers_list %}
<ul>
{% for publisher in publishers_list %}
<li>
<a href="{{ publisher.get_absolute_url }}">{{ publisher.name }}</a>
</li>
{% endfor %}
</ul>
{% else %}
<p>There are no publishers in the library.</p>
{% endif %}
{% endblock %}

View File

@ -0,0 +1,20 @@
{% extends "base.html" %}
{% block content %}
{% load static %}
<h1>{{ratings}}</h1>
{% if books %}
<ul>
{% for book in books %}
<li><a href="{{book.get_absolute_url}}">{{book.title}}</a></li>
{%endfor%}
</ul>
{% else %}
{%endif%}
{% endblock %}

View File

@ -0,0 +1,17 @@
{% extends "base.html" %}
{% block content %}
{% load static %}
<h1>Ratings List</h1>
{% if ratings_list %}
<ul>
{% for rating in ratings_list %}
<li>
<a href="{{ rating.get_absolute_url }}">{{ rating.rating }}</a>
</li>
{% endfor %}
</ul>
{% else %}
<p>There are no ratings in the library.</p>
{% endif %}
{% endblock %}

View File

@ -0,0 +1,20 @@
{% extends "base.html" %}
{% block content %}
{% load static %}
<h1>{{tags}}</h1>
{% if books %}
<ul>
{% for book in books %}
<li><a href="{{book.get_absolute_url}}">{{book.title}}</a></li>
{%endfor%}
</ul>
{% else %}
{%endif%}
{% endblock %}

View File

@ -0,0 +1,17 @@
{% extends "base.html" %}
{% block content %}
{% load static %}
<h1>Tags List</h1>
{% if tags_list %}
<ul>
{% for tag in tags_list %}
<li>
<a href="{{ tag.get_absolute_url }}">{{ tag.name }}</a>
</li>
{% endfor %}
</ul>
{% else %}
<p>There are no tags in the library.</p>
{% endif %}
{% endblock %}