use jinja right

This commit is contained in:
dave 2018-09-12 21:55:00 -07:00
parent 508e44f490
commit b0f003b5e1
10 changed files with 156 additions and 20 deletions

View File

@ -71,15 +71,24 @@ a {
margin-right: 0.5em;
border-radius: 3px;
}
.tag-icon-mod-3-0 {
.tag-icon-mod-6-0 {
background: #ffc94c;
}
.tag-icon-mod-3-1 {
.tag-icon-mod-6-1 {
background: #41ccb4;
}
.tag-icon-mod-3-2 {
.tag-icon-mod-6-2 {
background: #40c365;
}
.tag-icon-mod-6-3 {
background: #ffc900;
}
.tag-icon-mod-6-4 {
background: #4100b4;
}
.tag-icon-mod-6-5 {
background: #00c365;
}
.email-content {
padding: 0em 4em;

54
templates/album.html Normal file
View File

@ -0,0 +1,54 @@
{% extends "page.html" %}
{% set title = "Photos by date" %}
{% set subtitle = "By date, descending" %}
{% block buttons %}
xxx
{% endblock %}
{% block body %}
{% set locals = namespace() %}
{% set total_pages = (total_items/pgsize)|ceil %}
<div class="photo-feed">
{% set locals.im_date = "" %}
{% for item in images %}
{% set newdate = item.date.strftime("%b %d, %Y") %}
{% if newdate != locals.im_date %}
{% set locals.im_date = newdate %}
<div class="feed-divider year"><h4>{{ locals.im_date }}</h4></div>
{% endif %}
<div class="photo">
<a href="/photo/{{ item.uuid }}">
<img src="/thumb/set/feed/{{ item.uuid }}.jpg" />
</a>
</div>
{% endfor %}
<br style="clear:both" />
<div class="pager">
<h6>Page</h6>
{% if page > 0 %}
<div class="nav-prev">
<a href="{{path}}?page={{ page - 1 }}">Previous</a>
</div>
{% endif %}
<div class="pages">
<ul class="pager">
{% for pgnum in range(0, total_pages) %}
<li{% if pgnum == page %} class="current"{% endif %}>
<a href="{{path}}?page={{ pgnum }}">{{ pgnum }}</a>
</li>
{% endfor %}
</ul>
</div>
{% if page + 1 < total_pages %}
<div class="nav-next">
<a href="{{path}}?page={{ page + 1 }}">Next</a>
</div>
{% endif %}
</div>
</div>
{% endblock %}

View File

@ -0,0 +1,43 @@
{% set title = "Placeholder Title" %}
{% set subtitle = image.uuid %}
{% include "page-top.html" %}
<div class="photo-tagging pure-g">
<div class="current-tags pure-u-1-3">
<h2>Current Tags</h2>
{#<a href="/photo/{{ image.uuid }}">
<img src="/thumb/set/small/{{ image.uuid }}.jpg" />
</a>#}
<ul class="tags-picker">
{% for tagi in images[0].tags %}
<li>
<a href="/tags/{{ tagi.tag.uuid }}">{{ tagi.tag.title }}</a>
</li>
{% endfor %}
</ul>
</div>
<div class="all-tags pure-u-1-3">
<h2>All tags</h2>
<ul class="tags-picker">
{% for tag in alltags %}
<li>
<form action="/photo/{# image.uuid #}/tag_add" method="post">
<input type="hidden" name="tag" value="{{ tag.uuid }}" />
<input class="submit-link" type="submit" value="{{ tag.title }}" />
</form>
</li>
{% endfor %}
</ul>
</div>
<div class="add-tags pure-u-1-3">
<h2>Add tag</h2>
<form action="/photo/{# image.uuid #}/tag_create" method="post" class="pure-form">
<input type="text" name="tag" placeholder="new tag name" />
<input type="submit" value="Add" class="pure-button pure-button-primary" />
</form>
</div>
</div>
{% include "page-bottom.html" %}

View File

@ -1,7 +1,12 @@
{% extends "page.html" %}
{% set title = "All photos" %}
{% set subtitle = "By date, descending" %}
{% include "page-top.html" %}
{% block buttons %}
xxx
{% endblock %}
{% block body %}
{% set locals = namespace() %}
@ -21,4 +26,4 @@
{% endfor %}
</div>
{% include "page-bottom.html" %}
{% endblock %}

View File

@ -1,7 +1,12 @@
{% extends "page.html" %}
{% set title = "Photos by date" %}
{% set subtitle = "By date, descending" %}
{% include "page-top.html" %}
{% block buttons %}
xxx
{% endblock %}
{% block body %}
{% set locals = namespace() %}
@ -46,4 +51,4 @@
</div>
</div>
{% include "page-bottom.html" %}
{% endblock %}

View File

@ -1,7 +1,12 @@
{% extends "page.html" %}
{% set title = "Photo map" %}
{% set subtitle = "GPS data" %}
{% include "page-top.html" %}
{% block buttons %}
xxx
{% endblock %}
{% block body %}
<div class="photo-map">
<div id="mapdiv" style="height: 900px"></div>
@ -30,4 +35,4 @@
</script>
</div>
{% include "page-bottom.html" %}
{% endblock %}

View File

@ -1,7 +1,12 @@
{% extends "page.html" %}
{% set title = "Server statistics" %}
{% set subtitle = "Placeholder" %}
{% include "page-top.html" %}
{% block buttons %}
xxx
{% endblock %}
{% block body %}
{% set locals = namespace() %}
@ -31,4 +36,4 @@
</div>
{% include "page-bottom.html" %}
{% endblock %}

View File

@ -1,5 +0,0 @@
</div>
</div>
</div>
</body>
</html>

View File

@ -24,7 +24,7 @@
<li class="pure-menu-item"><a href="/albums" class="pure-menu-link">Bar</a></li>
<li class="pure-menu-heading">Tags</li>
{% for tag in all_tags %}
<li class="pure-menu-item"><a href="/tag/{{ tag.uuid }}" class="pure-menu-link"><span class="tag-icon tag-icon-mod-3-{{ tag.id % 3 }}"></span>{{ tag.title }}</a></li>
<li class="pure-menu-item"><a href="/tag/{{ tag.uuid }}" class="pure-menu-link"><span class="tag-icon tag-icon-mod-6-{{ tag.id % 6 }}"></span>{{ tag.title }}</a></li>
{% endfor %}
</ul>
</div>
@ -40,9 +40,18 @@
</p>
</div>
<div class="email-content-controls pure-u-1-2">
{% block buttons %}
<button class="secondary-button pure-button">420</button>
<button class="secondary-button pure-button">Blaze</button>
<button class="secondary-button pure-button">It</button>
{% endblock %}
</div>
</div>
<div class="email-content-body">
{% block body %}default body{% endblock %}
</div>
</div>
</div>
</div>
</body>
</html>

View File

@ -1,9 +1,14 @@
{% extends "page.html" %}
{% set title = "Placeholder Title" %}
{% set subtitle = image.uuid %}
{% include "page-top.html" %}
{% block buttons %}
xxx
{% block body %}
<div class="photo-tagging pure-g">
<div class="current-tags pure-u-1-3">
<h2>Current Tags</h2>
@ -13,7 +18,7 @@
<ul class="tags-picker">
{% for tagi in image.tags %}
<li>
<a href="/tags/{{ tagi.tag.uuid }}">{{ tagi.tag.title }}</a>
<a href="/tag/{{ tagi.tag.uuid }}">{{ tagi.tag.title }}</a>
</li>
{% endfor %}
</ul>
@ -40,4 +45,5 @@
</div>
</div>
{% include "page-bottom.html" %}
{% endblock %}