diff --git a/dlibrary/static/viewer.js b/dlibrary/static/viewer.js index f6bc30d..ebf9c62 100644 --- a/dlibrary/static/viewer.js +++ b/dlibrary/static/viewer.js @@ -98,7 +98,7 @@ document.addEventListener('DOMContentLoaded', () => { function exitToWork() { changeDuration(duration, true); localStorage.setItem(`${WORK_ID}-currentPage`, 0); - window.location.href = "../"; + window.location.href = `../${INDEX}`; } function hideTapZones() { diff --git a/dlibrary/templates/base.html b/dlibrary/templates/base.html index 40cb671..1fb0b0a 100644 --- a/dlibrary/templates/base.html +++ b/dlibrary/templates/base.html @@ -6,7 +6,7 @@ {% block title %}{% if title %}{{ title }} - {% else %}{% endif %}DLibrary{% endblock %} - + {% block head %}{% endblock %} diff --git a/dlibrary/templates/categorization.html b/dlibrary/templates/categorization.html index 3a0519c..321e7ed 100644 --- a/dlibrary/templates/categorization.html +++ b/dlibrary/templates/categorization.html @@ -1,18 +1,18 @@ {% extends "base.html" %} {% block title %}{{ categorization.capitalize() }} - DLibrary{% endblock %} {% block body %} -{% from 'utils.html' import urlcat, root with context %} -

DLibrary > {{ categorization.capitalize() }}

+{% from 'utils.html' import urlcat, index, root with context %} +

DLibrary > {{ categorization.capitalize() }}

{% include 'nav.html' %}
{% for cat in categories %}
- +
{{ cat }}
{% if samples[cat] %} - + {% endif %}
diff --git a/dlibrary/templates/list.html b/dlibrary/templates/list.html index f882c21..d0e1139 100644 --- a/dlibrary/templates/list.html +++ b/dlibrary/templates/list.html @@ -1,13 +1,13 @@ {% extends 'base.html' %} {% block body %} -{% from 'utils.html' import root with context %} -

DLibrary{% if categorization %} > {{ categorization.capitalize() }}{% endif %}{% if title %} > {{ title }}{% endif %}

+{% from 'utils.html' import index, root with context %} +

DLibrary{% if categorization %} > {{ categorization.capitalize() }}{% endif %}{% if title %} > {{ title }}{% endif %}

{% include 'nav.html' %}
{% for work in works %}
- - + +
[{% if work['circle'] %}{{ work['circle'] }}{% endif %}{% if work['circle'] and work['authors'] %} ({% endif %}{{ ', '.join(work['authors']) }}{% if work['circle'] and work['authors'] %}){% endif %}]
diff --git a/dlibrary/templates/nav.html b/dlibrary/templates/nav.html index cbd9527..62af956 100644 --- a/dlibrary/templates/nav.html +++ b/dlibrary/templates/nav.html @@ -1,2 +1,2 @@ -{% from 'utils.html' import root with context %} -
+{% from 'utils.html' import root, index with context %} + diff --git a/dlibrary/templates/utils.html b/dlibrary/templates/utils.html index 10ccd00..161dc38 100644 --- a/dlibrary/templates/utils.html +++ b/dlibrary/templates/utils.html @@ -1,2 +1,3 @@ -{% macro root() %}{% for i in range(depth) %}../{% endfor %}{% endmacro %} +{% macro root() %}{% if depth == 0 %}.{% else %}..{% endif %}{{ '/..' * (depth-1) }}{% endmacro %} +{% macro index() %}{% if not noindex %}index.html{% endif %}{% endmacro %} {% macro urlcat(s) %}{{ s | replace('/', ' ') | urlencode }}{% endmacro %} diff --git a/dlibrary/templates/viewer.html b/dlibrary/templates/viewer.html index 9ef6315..dc521e9 100644 --- a/dlibrary/templates/viewer.html +++ b/dlibrary/templates/viewer.html @@ -1,16 +1,17 @@ {% extends 'base.html' %} -{% from 'utils.html' import root with context %} +{% from 'utils.html' import index, root with context %} {% block head %} - + - + {% endblock %} {% block body %}
{% for filename in images %} - + {% endfor %}
diff --git a/dlibrary/templates/work.html b/dlibrary/templates/work.html index 68bbae6..3717b17 100644 --- a/dlibrary/templates/work.html +++ b/dlibrary/templates/work.html @@ -1,11 +1,11 @@ {% extends 'base.html' %} {% block body %} -{% from 'utils.html' import urlcat, root with context %} -

DL > {{ title }}

+{% from 'utils.html' import urlcat, root, index with context %} +

DL > {{ title }}

@@ -13,25 +13,25 @@ {% if work['circle'] %} Circle - {{ work['circle'] }} + {{ work['circle'] }} {% endif %} {% if work['authors'] %} Authors - {% for author in work['authors'] %}{{ author }} {% endfor %} + {% for author in work['authors'] %}{{ author }} {% endfor %} {% endif %} {% if work['tags'] %} Tags - {% for tag in work['tags'] %}{{ tag }} {% endfor %} + {% for tag in work['tags'] %}{{ tag }} {% endfor %} {% endif %} {% if work['series'] %} Series - {{ work['series'] }} + {{ work['series'] }} {% endif %}