init command
This commit is contained in:
parent
5debb179ca
commit
d097116c37
11 changed files with 335 additions and 3 deletions
55
resources/skel/_templates/album.html
Normal file
55
resources/skel/_templates/album.html
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
{% if not album_dir.is_root %}
|
||||
<h1>
|
||||
<a href="{{root_path}}">Home</a>
|
||||
{% for href, name in breadcrumbs %}
|
||||
/ <a href="{{href}}">{{name}}</a>
|
||||
{% endfor %}
|
||||
/ {{album_dir.path.name}}
|
||||
</h1>
|
||||
<hr>
|
||||
{% endif %}
|
||||
|
||||
{% if album_dir.description %}
|
||||
<div class="caption">
|
||||
{{ album_dir.description | safe }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if album_dir.children %}
|
||||
<h2>Albums</h2>
|
||||
<div id="album-children">
|
||||
{% for child in album_dir.children %}
|
||||
<div class="album">
|
||||
<a href="{{child.path.name}}/">
|
||||
<div>
|
||||
{% if child.cover_path %}
|
||||
<img
|
||||
src="{{child.cover_path.path.parent.relative_to(album_dir.path)}}/slides/{{child.cover_path.thumbnail_filename()}}" />
|
||||
{% endif %}
|
||||
</div>
|
||||
<div>
|
||||
{{child.path.name}}
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if album_dir.images %}
|
||||
{% if album_dir.children %}
|
||||
<h2>Photos</h2>
|
||||
{% endif %}
|
||||
<div id="album-photos">
|
||||
{% for image in album_dir.images %}
|
||||
<div class="thumbnail">
|
||||
<a href="slides/{{image.html_filename()}}">
|
||||
<img src="slides/{{image.thumbnail_filename()}}" />
|
||||
</a>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
24
resources/skel/_templates/base.html
Normal file
24
resources/skel/_templates/base.html
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>My Photos</title>
|
||||
<link rel="stylesheet" href="{{ root_path }}/static/index.css" type="text/css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<a href="{{ root_path }}">
|
||||
<h1>My Photos</h1>
|
||||
</a>
|
||||
</div>
|
||||
<div id="content">
|
||||
{% block content %}
|
||||
{% endblock %}
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
{% block js %}
|
||||
{% endblock %}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
54
resources/skel/_templates/photo.html
Normal file
54
resources/skel/_templates/photo.html
Normal file
|
|
@ -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 %}
|
||||
<div id="photo">
|
||||
<img src="{{image_path.display_filename()}}" />
|
||||
</div>
|
||||
|
||||
<div id="nav">
|
||||
<div>
|
||||
{% if prev_image %}
|
||||
<a href="{{prev_image.html_filename()}}">
|
||||
<i class="arrow arrow-left"></i>
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div>
|
||||
<a href="..">
|
||||
<i class="arrow arrow-up"></i>
|
||||
</a>
|
||||
</div>
|
||||
<div>
|
||||
{% if next_image %}
|
||||
<a href="{{next_image.html_filename()}}">
|
||||
<i class="arrow arrow-right"></i>
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="photo-description" class="caption">
|
||||
{% if image_path.description %}
|
||||
{{ image_path.description | safe }}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div id="download">
|
||||
<a href="../{{image_path.path.name}}">view full size</a>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Loading…
Add table
Add a link
Reference in a new issue