From 1c616d27d9181b8f6ad8ae241e72feaa8314d127 Mon Sep 17 00:00:00 2001 From: PyroStefan Date: Sat, 11 Jul 2020 17:36:26 -0300 Subject: [PATCH] new css framework, changed book detail and search, reworked tables --- .../library/static/css/styles.css | 112 ------------ CalibreWebCompanion/library/static/js/nav.js | 14 -- .../library/templates/base.html | 160 ++++++++---------- .../templates/library/author_detail.html | 12 +- .../templates/library/book_detail.html | 25 +-- .../library/templates/library/book_list.html | 29 ++-- .../templates/library/publisher_detail.html | 12 +- .../templates/library/rating_detail.html | 14 +- .../library/templates/library/tag_detail.html | 12 +- .../library/templates/results.html | 10 +- .../library/templates/search.html | 8 +- 11 files changed, 134 insertions(+), 274 deletions(-) delete mode 100644 CalibreWebCompanion/library/static/css/styles.css delete mode 100644 CalibreWebCompanion/library/static/js/nav.js diff --git a/CalibreWebCompanion/library/static/css/styles.css b/CalibreWebCompanion/library/static/css/styles.css deleted file mode 100644 index 2d8332c..0000000 --- a/CalibreWebCompanion/library/static/css/styles.css +++ /dev/null @@ -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 -} \ No newline at end of file diff --git a/CalibreWebCompanion/library/static/js/nav.js b/CalibreWebCompanion/library/static/js/nav.js deleted file mode 100644 index 9503bdc..0000000 --- a/CalibreWebCompanion/library/static/js/nav.js +++ /dev/null @@ -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"; - } - }); -} \ No newline at end of file diff --git a/CalibreWebCompanion/library/templates/base.html b/CalibreWebCompanion/library/templates/base.html index 9199e18..92c2a4d 100644 --- a/CalibreWebCompanion/library/templates/base.html +++ b/CalibreWebCompanion/library/templates/base.html @@ -5,97 +5,88 @@ {% block title %}Local Library{% endblock %} - - - {% load static %} - + + + + + + + + - {% block topnav%} - - {% endblock %} + +{% block content %} {% endblock %} + - {% else %} -

You don't have permission to view this.

-
  • Login
  • - or -
  • Sign up
  • - {% endif %} - - - - - \ No newline at end of file diff --git a/CalibreWebCompanion/library/templates/library/author_detail.html b/CalibreWebCompanion/library/templates/library/author_detail.html index bfdeac7..c02f570 100644 --- a/CalibreWebCompanion/library/templates/library/author_detail.html +++ b/CalibreWebCompanion/library/templates/library/author_detail.html @@ -4,14 +4,14 @@ {% load static %}

    {{author}}

    - +
    - - - - - + + + + + {% for book in books %} diff --git a/CalibreWebCompanion/library/templates/library/book_detail.html b/CalibreWebCompanion/library/templates/library/book_detail.html index 851133f..8752fa5 100644 --- a/CalibreWebCompanion/library/templates/library/book_detail.html +++ b/CalibreWebCompanion/library/templates/library/book_detail.html @@ -2,16 +2,20 @@ {% block content %} {% load static %} -

    {{book.title}} by + +
    +
    download
    +
    +

    {{book.title}}

    +

    by {% if book.authors %} {% for author in book.authors.all %} {{author.name}} {%endfor%} {% else %} - {{book.author_sort}} {%endif%} - +
    Published by {% if book.publishers %} {% for pub in book.publishers.all %} @@ -19,9 +23,8 @@ {%endfor%} {% else %} Unknown - {%endif%} - +
    Tags: {% if book.tags %} {% for tag in book.tags.all %} @@ -29,7 +32,7 @@ {%endfor%} {% else %} {%endif%} - +
    Rating: {% if book.ratings %} {% for rating in book.ratings.all %} @@ -37,14 +40,16 @@ {%endfor%} {% else %} {%endif%} - +
    {{book.publisher}} -

    - -download +

    + + +
    {% autoescape off %} {{comment}} {% endautoescape %} +
    {% endblock %} \ No newline at end of file diff --git a/CalibreWebCompanion/library/templates/library/book_list.html b/CalibreWebCompanion/library/templates/library/book_list.html index e281bcb..c05a32d 100644 --- a/CalibreWebCompanion/library/templates/library/book_list.html +++ b/CalibreWebCompanion/library/templates/library/book_list.html @@ -1,17 +1,21 @@ {% extends "base.html" %} {% block content %} -{% load static %} -

    Book List

    -
    TitleAuthorRatingTagsAddedTitleAuthorRatingTagsAdded
    +

    Book List

    + +
    +
    +
    +
    +
    - - - - - + + + + + {% for book in book_list %} @@ -30,11 +34,8 @@ {% endfor %}
    TitleAuthorRatingTagsAddedTitleAuthorRatingTagsAdded
    - - - - - - +
    +
    + {% endblock %} \ No newline at end of file diff --git a/CalibreWebCompanion/library/templates/library/publisher_detail.html b/CalibreWebCompanion/library/templates/library/publisher_detail.html index 505db2a..0e1834e 100644 --- a/CalibreWebCompanion/library/templates/library/publisher_detail.html +++ b/CalibreWebCompanion/library/templates/library/publisher_detail.html @@ -5,14 +5,14 @@

    {{publisher}}

    {% if publisher.released %} - +
    - - - - - + + + + + {% for book in books %} diff --git a/CalibreWebCompanion/library/templates/library/rating_detail.html b/CalibreWebCompanion/library/templates/library/rating_detail.html index e2ccc5f..da77610 100644 --- a/CalibreWebCompanion/library/templates/library/rating_detail.html +++ b/CalibreWebCompanion/library/templates/library/rating_detail.html @@ -3,16 +3,16 @@ {% block content %} {% load static %} -

    {{rating}}

    +

    ⭐ {{rating}}

    {% if books %} -
    TitleAuthorRatingTagsAddedTitleAuthorRatingTagsAdded
    +
    - - - - - + + + + + {% for book in books %} diff --git a/CalibreWebCompanion/library/templates/library/tag_detail.html b/CalibreWebCompanion/library/templates/library/tag_detail.html index f997b61..dc96e98 100644 --- a/CalibreWebCompanion/library/templates/library/tag_detail.html +++ b/CalibreWebCompanion/library/templates/library/tag_detail.html @@ -5,14 +5,14 @@

    {{tag}}

    {% if books %} -
    TitleAuthorRatingTagsAddedTitleAuthorRatingTagsAdded
    +
    - - - - - + + + + + {% for book in books %} diff --git a/CalibreWebCompanion/library/templates/results.html b/CalibreWebCompanion/library/templates/results.html index 849b4c6..ddd6d78 100644 --- a/CalibreWebCompanion/library/templates/results.html +++ b/CalibreWebCompanion/library/templates/results.html @@ -7,11 +7,11 @@
    TitleAuthorRatingTagsAddedTitleAuthorRatingTagsAdded
    - - - - - + + + + + {% for book in book_list %} diff --git a/CalibreWebCompanion/library/templates/search.html b/CalibreWebCompanion/library/templates/search.html index 4650077..fdf4d11 100644 --- a/CalibreWebCompanion/library/templates/search.html +++ b/CalibreWebCompanion/library/templates/search.html @@ -1,15 +1,15 @@ {% extends "base.html" %} {% block content %} -{% load static %} - + +
    + - - +
    {% endblock %} \ No newline at end of file
    TitleAuthorRatingTagsAddedTitleAuthorRatingTagsAdded