From 1c616d27d9181b8f6ad8ae241e72feaa8314d127 Mon Sep 17 00:00:00 2001 From: PyroStefan Date: Sat, 11 Jul 2020 17:36:26 -0300 Subject: [PATCH 1/4] 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 From fce13c85e494dcf918f36824e96b89ee5b983df2 Mon Sep 17 00:00:00 2001 From: PyroStefan Date: Sun, 12 Jul 2020 12:29:36 -0300 Subject: [PATCH 2/4] removed static (means that img path needs to be fixed), login page is beautified --- .../library/templates/base.html | 2 +- .../templates/library/author_detail.html | 2 +- .../templates/library/author_list.html | 2 +- .../templates/library/book_detail.html | 3 +- .../templates/library/publisher_detail.html | 2 +- .../templates/library/publisher_list.html | 2 +- .../templates/library/rating_detail.html | 3 +- .../templates/library/rating_list.html | 2 +- .../library/templates/library/tag_detail.html | 1 - .../library/templates/library/tag_list.html | 2 +- .../library/templates/registration/login.html | 29 ++++++----- .../library/templates/results.html | 2 +- .../library/templates/stripped_base.html | 49 ++++++++++--------- 13 files changed, 52 insertions(+), 49 deletions(-) diff --git a/CalibreWebCompanion/library/templates/base.html b/CalibreWebCompanion/library/templates/base.html index 92c2a4d..6a69b5c 100644 --- a/CalibreWebCompanion/library/templates/base.html +++ b/CalibreWebCompanion/library/templates/base.html @@ -42,7 +42,7 @@
    TitleAuthorRatingTagsAddedTitleAuthorRatingTagsAdded
    diff --git a/CalibreWebCompanion/library/templates/library/author_list.html b/CalibreWebCompanion/library/templates/library/author_list.html index be14c9a..52f8f4d 100644 --- a/CalibreWebCompanion/library/templates/library/author_list.html +++ b/CalibreWebCompanion/library/templates/library/author_list.html @@ -1,7 +1,7 @@ {% extends "base.html" %} {% block content %} -{% load static %} +

    Author List

    {% if author_list %}
    diff --git a/CalibreWebCompanion/library/templates/library/rating_list.html b/CalibreWebCompanion/library/templates/library/rating_list.html index c3db6fb..7587be9 100644 --- a/CalibreWebCompanion/library/templates/library/rating_list.html +++ b/CalibreWebCompanion/library/templates/library/rating_list.html @@ -1,7 +1,7 @@ {% extends "base.html" %} {% block content %} -{% load static %} +

    Ratings List

    {% if rating_list %}
    @@ -27,6 +14,22 @@
    {{ form.password }}
    + +
    + {% if form.errors %} +

    Your username and password didn't match. Please try again.

    + {% endif %} + + {% if next %} + {% if user.is_authenticated %} +

    Your account doesn't have access to this page. To proceed, + please login with an account that has access.

    + {% else %} +

    Please login to see this page.

    + {% endif %} + {% endif %} +
    + diff --git a/CalibreWebCompanion/library/templates/results.html b/CalibreWebCompanion/library/templates/results.html index ddd6d78..4e30811 100644 --- a/CalibreWebCompanion/library/templates/results.html +++ b/CalibreWebCompanion/library/templates/results.html @@ -1,7 +1,7 @@ {% extends "base.html" %} {% block content %} -{% load static %} +

    Results

    diff --git a/CalibreWebCompanion/library/templates/stripped_base.html b/CalibreWebCompanion/library/templates/stripped_base.html index 80468ed..7798114 100644 --- a/CalibreWebCompanion/library/templates/stripped_base.html +++ b/CalibreWebCompanion/library/templates/stripped_base.html @@ -5,36 +5,39 @@ {% block title %}Local Library{% endblock %} - - - {% load static %} - + + + + + + + - {% block topnav%} - - {% endblock %} + +
    +
    +
    {% block content %}{% endblock %}
    - +
    From 76dd31c80c952ce316170fcd9e807026040213a4 Mon Sep 17 00:00:00 2001 From: MassiveAtoms Date: Sun, 12 Jul 2020 21:09:26 -0300 Subject: [PATCH 3/4] fixed auth issue --- CalibreWebCompanion/db.sqlite3 | Bin 131072 -> 131072 bytes .../library/templates/base.html | 81 +++++++++++------- .../templates/library/book_detail.html | 3 +- 3 files changed, 53 insertions(+), 31 deletions(-) diff --git a/CalibreWebCompanion/db.sqlite3 b/CalibreWebCompanion/db.sqlite3 index ce2c134900019b12db44b362ed60192d6b3dc2ff..5363514899439e469843baacd744b5f7584b3053 100644 GIT binary patch delta 830 zcmaiy%}*0S6u@^WrNp+3;DG=JYOE%Rw7aw0ZFi%QhL+Nr-BzJAv+-alA8mK1i~U-< z7fRF%35nQ)9!NZB!cAiKz`1%cCZ0TLJQxjk{R?zKKoU)y%wdw5_vZI|?=_p<&1Uzb zAu_dfev(YRx-0v;9Q}41L$=zkbLIy>M>(SIx2}zz*X9L};W9T=q2rF-E;Goc#%yf`)q)5$4VDM>m?$8J@ZQ)9PhiUTV&788JgFFvs7c14pG7O(u6U#VTP<=TKAIl$w^&i?(JkQbG`sJ?QY$NW`LpCnG zk||0JHi#A$y_$b4l0`8Urn2?wRDiB6l$q2r4y%%)BxWoAT9GToQdMLm;(yqn2Qoqc zTHD9-3?1OBhio`oIyn4;>Qn${4{;2|nfu${I{J=qS%IN_Y>?$xw)N@Rl|Bd9A;1p! z4)(!E@E){*Y4$d^z@XDML>`sF;kJ#CC*OA6Z}0B4cgcwf0KQtiULwF7@B%ypOJ?uN u9Jn}a3zNqs`g=a?2iL8ac<{;dpX7~UtKGvVkF7Sa0t^Ur&|t)H&Mo!(Qacxls+4)I4iR;FjnSLQ&8Gc!T2EOjT zMo}(q*?vY*8If7(#!)VzhJIO-74jt+D<)gz7o~V*`BnL4_=UKd__;V``nh8@-_C!BKbL>fX2FJ7{>i!Z`7FxJzMPvM)T;>avGP1+;7{T^ z#b?MngXbyGbC-EGKb`ZKNyxwwWSpsmm7%4ck%fhciRt89^R@U``42Mif8c-0f0O?# z|3RRM>-n1xuHSxeJ)?sIKiIxj2L4C {% block title %}Local Library{% endblock %} + @@ -13,28 +14,34 @@ @@ -45,7 +52,7 @@ -{% block content %} {% endblock %} + + {% if user.is_authenticated %} + {% block content %} {% endblock %} + {% else %} +

    You don't have permission to view this.

    +
  • Login
  • + {% endif %} +