diff --git a/app/models/section.py b/app/models/section.py index 0c1a0ae..265a3e3 100644 --- a/app/models/section.py +++ b/app/models/section.py @@ -1,5 +1,6 @@ from app import db from app.models.utils import BaseModel +from app.controllers import create_breadcrumbs class Section(BaseModel): @@ -34,6 +35,20 @@ class Section(BaseModel): path += self.label return path + @property + def breadcrumbs_path(self): + parent = self.collection + grand_parent = parent.parent + if grand_parent.is_root: + collection_path = (parent.id,) + else: + collection_path = ( + grand_parent.id, + parent.id, + ) + breadcrumbs_path = create_breadcrumbs(self.book_id, collection_path) + return breadcrumbs_path + @property def book_id(self): _book_id = self.version.book_id diff --git a/app/static/css/styles.css b/app/static/css/styles.css index 2f1e873..5ee5282 100644 --- a/app/static/css/styles.css +++ b/app/static/css/styles.css @@ -2265,6 +2265,10 @@ input:checked + .toggle-bg { text-align: center; } +.align-middle { + vertical-align: middle; +} + .text-2xl { font-size: 1.5rem; line-height: 2rem; diff --git a/app/templates/book/local_breadcrumbs_navigation.html b/app/templates/book/local_breadcrumbs_navigation.html new file mode 100644 index 0000000..e2c45c2 --- /dev/null +++ b/app/templates/book/local_breadcrumbs_navigation.html @@ -0,0 +1,26 @@ + +
    +{% for breadcrumb in local_breadcrumbs if breadcrumb.type != "MyBookList" and breadcrumb.type != "AuthorBookList" %} +
  1. + {% if not loop.index==local_breadcrumbs|length %} + + {% else %} + + {% endif %} + + + {{ breadcrumb.label }} + {% if not loop.index==local_breadcrumbs|length %} + + {% else %} + + {% endif %} + {% if not loop.index==local_breadcrumbs|length %} + + {% endif %} +
  2. +{% endfor %} +
\ No newline at end of file diff --git a/app/templates/book/stat.html b/app/templates/book/stat.html new file mode 100644 index 0000000..687ccfc --- /dev/null +++ b/app/templates/book/stat.html @@ -0,0 +1,66 @@ + +{% extends 'base.html' %} +{% block content %} +
+ +

{{book.label}}

+ + + + +
+
+ + + + + + +
+{% endblock %} diff --git a/app/templates/home/index.html b/app/templates/home/index.html index 8900a92..8b2df55 100644 --- a/app/templates/home/index.html +++ b/app/templates/home/index.html @@ -14,7 +14,7 @@