diff --git a/resources/test_album/_static/index.css b/resources/test_album/_static/index.css new file mode 100644 index 0000000..f476fe1 --- /dev/null +++ b/resources/test_album/_static/index.css @@ -0,0 +1,112 @@ +body { + margin: 0; +} + +a { + color: #ba1200; +} + +#header { + background-color: #eee; +} + +#header * { + margin-top: 0; + text-decoration: inherit; + color: inherit; +} + +#header h1 { + padding: 0.5em; +} + +#content { + text-align: center; + max-width: 1200px; + margin: 0.5em; + margin-left: auto; + margin-right: auto; +} + +#content > * { + margin-top: 1em; +} + +ul { + padding-left: 1.5em; +} + +#album-children { + display: flex; + flex-wrap: wrap; + justify-content: center; +} + +#album-children > * { + margin: 1em; + padding: 0.75em; + background-color: lightgrey; + height: min-content; + border: thin solid black; + box-shadow: 0.25em 0.25em #ccc; +} + +#album-photos { + display: flex; + flex-wrap: wrap; + justify-content: center; +} + +.thumbnail { + margin: 1em; + display: flex; + align-items: center; +} + +.thumbnail * { + max-width: 100%; +} + +#nav { + width: 150px; + margin: auto; + display: flex; + padding: 0.5em; +} + +#nav div { + width: 50px; +} + +#photo img { + max-width: 100%; + height: auto; +} + +.caption { + max-width: 700px; + margin-left: auto; + margin-right: auto; +} + +.arrow { + border: solid black; + border-width: 0 3px 3px 0; + display: inline-block; + padding: 3px; +} + +.arrow-right { + transform: rotate(-45deg); + -webkit-transform: rotate(-45deg); +} + +.arrow-left { + transform: rotate(135deg); + -webkit-transform: rotate(135deg); +} + +.arrow-up { + transform: rotate(-135deg); + -webkit-transform: rotate(-135deg); +} diff --git a/resources/test_album/_templates/album.html b/resources/test_album/_templates/album.html new file mode 100644 index 0000000..cf4a112 --- /dev/null +++ b/resources/test_album/_templates/album.html @@ -0,0 +1,55 @@ +{% extends "base.html" %} + +{% block content %} + {% if not album_dir.is_root %} +

+ Home + {% for href, name in breadcrumbs %} + / {{name}} + {% endfor %} + / {{album_dir.path.name}} +

+
+ {% endif %} + + {% if album_dir.description %} +
+ {{ album_dir.description | safe }} +
+ {% endif %} + + {% if album_dir.children %} +

Albums

+
+ {% for child in album_dir.children %} +
+ +
+ {% if child.cover_path %} + + {% endif %} +
+
+ {{child.path.name}} +
+
+
+ {% endfor %} +
+ {% endif %} + {% if album_dir.images %} + {% if album_dir.children %} +

Photos

+ {% endif %} +
+ {% for image in album_dir.images %} +
+ + + +
+ {% endfor %} +
+ {% endif %} +{% endblock %} diff --git a/resources/test_album/_templates/base.html b/resources/test_album/_templates/base.html new file mode 100644 index 0000000..b122456 --- /dev/null +++ b/resources/test_album/_templates/base.html @@ -0,0 +1,24 @@ + + + + + + My Photos + + + + +
+ {% block content %} + {% endblock %} +
+ + + diff --git a/resources/test_album/_templates/photo.html b/resources/test_album/_templates/photo.html new file mode 100644 index 0000000..9f4198e --- /dev/null +++ b/resources/test_album/_templates/photo.html @@ -0,0 +1,54 @@ +{% extends "base.html" %} + +{% block js %} + // Do left/right navigation on keypresses + document.onkeydown = function(event) { + if (event.key == "ArrowLeft") { + {% if prev_image %} + location.href = "{{prev_image.html_filename()}}"; + {% endif %} + } else if (event.key == "ArrowRight") { + {% if next_image %} + location.href = "{{next_image.html_filename()}}"; + {% endif %} + } + } +{% endblock %} + +{% block content %} +
+ +
+ + + +
+ {% if image_path.description %} + {{ image_path.description | safe }} + {% endif %} +
+ +
+ view full size +
+{% endblock %} diff --git a/resources/test_album/moon.jpg b/resources/test_album/moon.jpg new file mode 100644 index 0000000..2a5c070 Binary files /dev/null and b/resources/test_album/moon.jpg differ diff --git a/resources/test_album/mountains.jpg b/resources/test_album/mountains.jpg new file mode 100644 index 0000000..4d1646c Binary files /dev/null and b/resources/test_album/mountains.jpg differ diff --git a/resources/test_album/nested1/description.txt b/resources/test_album/nested1/description.txt new file mode 100644 index 0000000..56925e7 --- /dev/null +++ b/resources/test_album/nested1/description.txt @@ -0,0 +1 @@ +nested album diff --git a/resources/test_album/nested1/mountains.jpg b/resources/test_album/nested1/mountains.jpg new file mode 100644 index 0000000..4d1646c Binary files /dev/null and b/resources/test_album/nested1/mountains.jpg differ diff --git a/resources/test_album/nested1/nested2/description.txt b/resources/test_album/nested1/nested2/description.txt new file mode 100644 index 0000000..18da22c --- /dev/null +++ b/resources/test_album/nested1/nested2/description.txt @@ -0,0 +1 @@ +deeply nested album diff --git a/resources/test_album/nested1/nested2/moon.jpg b/resources/test_album/nested1/nested2/moon.jpg new file mode 100644 index 0000000..2a5c070 Binary files /dev/null and b/resources/test_album/nested1/nested2/moon.jpg differ diff --git a/resources/test_album/photojawn.conf.yml b/resources/test_album/photojawn.conf.yml new file mode 100644 index 0000000..db052ae --- /dev/null +++ b/resources/test_album/photojawn.conf.yml @@ -0,0 +1,5 @@ +# Max size of thumbnails when viewing an album +thumbnail_size: [64, 64] + +# Max size of images when viewing a single one on screen +view_size: [640, 380] diff --git a/resources/test_album/with_cover/cover.jpg b/resources/test_album/with_cover/cover.jpg new file mode 120000 index 0000000..9a36752 --- /dev/null +++ b/resources/test_album/with_cover/cover.jpg @@ -0,0 +1 @@ +moon.jpg \ No newline at end of file diff --git a/resources/test_album/with_cover/moon.jpg b/resources/test_album/with_cover/moon.jpg new file mode 100644 index 0000000..2a5c070 Binary files /dev/null and b/resources/test_album/with_cover/moon.jpg differ diff --git a/resources/test_album/with_cover/mountains.jpg b/resources/test_album/with_cover/mountains.jpg new file mode 100644 index 0000000..4d1646c Binary files /dev/null and b/resources/test_album/with_cover/mountains.jpg differ diff --git a/resources/test_album/with_description/description.txt b/resources/test_album/with_description/description.txt new file mode 100644 index 0000000..e332552 --- /dev/null +++ b/resources/test_album/with_description/description.txt @@ -0,0 +1 @@ +album with a description diff --git a/resources/test_album/with_description/moon.jpg b/resources/test_album/with_description/moon.jpg new file mode 100644 index 0000000..2a5c070 Binary files /dev/null and b/resources/test_album/with_description/moon.jpg differ diff --git a/resources/test_album/with_description/moon.txt b/resources/test_album/with_description/moon.txt new file mode 100644 index 0000000..2d9c93d --- /dev/null +++ b/resources/test_album/with_description/moon.txt @@ -0,0 +1 @@ +this is a moon diff --git a/resources/test_album/with_description/mountains.jpg b/resources/test_album/with_description/mountains.jpg new file mode 100644 index 0000000..4d1646c Binary files /dev/null and b/resources/test_album/with_description/mountains.jpg differ