163 lines
5.7 KiB
HTML
163 lines
5.7 KiB
HTML
{% set title = "Search - {} results".format(total_sets|number_format) %}
|
|
{% extends "page.html" %}
|
|
{% block title %}Search & Bulk Operations{% endblock %}
|
|
{% block subtitle %}Matched Images: {{ total_sets|number_format }} <a href="/search">reset</a>{% endblock %}
|
|
{% block buttons %}{% endblock %}
|
|
|
|
{% block body %}
|
|
<form method="post" action="/search" class="pure-form">
|
|
<div class="pure-g">
|
|
<div class="pure-u-1-5 ">
|
|
<p>Include tags</p>
|
|
<select multiple name="include_tags" style="height: 200px;width:100%;">
|
|
{% for tag in all_tags %}
|
|
<option value="{{ tag.uuid }}"{% if tag.uuid in include_tags %} selected{% endif %}>{{ tag.title }}</option>
|
|
{% endfor %}
|
|
</select>
|
|
</div>
|
|
<div class="pure-u-1-5">
|
|
<p>Exclude tags</p>
|
|
<select multiple name="exclude_tags" style="height:200px;width:100%;">
|
|
{% for tag in all_tags %}
|
|
<option value="{{ tag.uuid }}"{% if tag.uuid in exclude_tags %} selected{% endif %}>{{ tag.title }}</option>
|
|
{% endfor %}
|
|
</select>
|
|
</div>
|
|
<div class="pure-u-1-5">
|
|
<p>Date range</p>
|
|
<div>
|
|
<label>
|
|
Before:<br />
|
|
<input type="text" name="before" value="{{ before }}" />
|
|
</label>
|
|
</div>
|
|
<div>
|
|
<label>
|
|
After:<br />
|
|
<input type="text" name="after" value="{{ after }}" />
|
|
</label>
|
|
</div>
|
|
<div>
|
|
Now: <pre style="margin:0">{{ now }}</pre>
|
|
</div>
|
|
</div>
|
|
<div class="pure-u-1-5">
|
|
<p>Keywords</p>
|
|
<div>
|
|
<label>
|
|
Title:<br />
|
|
<input type="text" name="keywords_title" value="{{ keywords_title }}" />
|
|
</label>
|
|
</div>
|
|
<div>
|
|
<label>
|
|
Description:<br />
|
|
<input type="text" name="keywords_description" value="{{ keywords_description }}" />
|
|
</label>
|
|
</div>
|
|
<div>
|
|
<label>
|
|
File name:<br />
|
|
<input type="text" name="keywords_filename" value="{{ keywords_filename }}" />
|
|
</label>
|
|
</div>
|
|
</div>
|
|
<div class="pure-u-1-5">
|
|
<p>Options</p>
|
|
<label><input type="checkbox" name="untagged" value="1"{% if selecting_untagged %} checked="checked"{% endif %} /> Untagged</label>
|
|
</div>
|
|
</div>
|
|
|
|
<input type="submit" value="Search" class="pure-button">
|
|
|
|
<hr>
|
|
<h2>Preview</h2>
|
|
<div>
|
|
{% for image in images %}
|
|
<div class="search-result">
|
|
<a href="/photo/{{ image.uuid }}">
|
|
<img src="/thumb/set/small/{{ image.uuid }}.jpg" style="max-width: 100px"/>
|
|
</a>
|
|
<div class="inner">
|
|
<button name="set_after" value="{{ image.date.strftime("%Y/%m/%d %H.%M.%S") }}" type="submit">After</button>
|
|
<button name="set_before" value="{{ image.date.strftime("%Y/%m/%d %H.%M.%S") }}" type="submit">Before</button>
|
|
<span>{{ image.date }}</span>
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
<br clear="all" />
|
|
</div>
|
|
|
|
|
|
{% set total_pages = (total_sets/pgsize)|ceil %}
|
|
<div>
|
|
<h6>Page</h6>
|
|
{% if page > 0 %}
|
|
<div class="nav-prev">
|
|
<button name="page" value="{{ page - 1 }}" type="submit">Previous</button>
|
|
</div>
|
|
{% endif %}
|
|
<div class="pages">
|
|
<ul class="pager form-pager">
|
|
{% for pgnum in range(0, total_pages) %}
|
|
<li{% if pgnum == page %} class="current"{% endif %}>
|
|
<input type="submit" name="page" value="{{ pgnum }}">
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|
|
</div>
|
|
{% if page + 1 < total_pages %}
|
|
<div class="nav-next">
|
|
<button name="page" value="{{ page + 1 }}" type="submit">Next</button>
|
|
</div>
|
|
{% endif %}
|
|
|
|
<label for="pgsize">Page size: </label>
|
|
<select name="pgsize">
|
|
<option value="25"{% if pgsize == 25 %} selected="selected"{% endif %}>25</option>
|
|
<option value="100"{% if pgsize == 100 %} selected="selected"{% endif %}>100</option>
|
|
<option value="250"{% if pgsize == 250 %} selected="selected"{% endif %}>250</option>
|
|
<option value="1000"{% if pgsize == 1000 %} selected="selected"{% endif %}>1000</option>
|
|
</select>
|
|
</div>
|
|
|
|
<hr>
|
|
<h2>Operation</h2>
|
|
<select name="operation">
|
|
<option value=""></option>
|
|
<option value="add_tags"{% if operation == "add_tags" %} selected{% endif %}>Add Tags</option>
|
|
<option value="remove_tags"{% if operation == "remove_tags" %} selected{% endif %}>Remove Tags</option>
|
|
</select>
|
|
|
|
<input type="submit" value="Go" class="pure-button">
|
|
|
|
<hr />
|
|
|
|
{% if operation == "add_tags" %}
|
|
<h2>Add Tag</h2>
|
|
<div>
|
|
<ul class="tags-picker">
|
|
{% for tag in all_tags %}
|
|
<li>
|
|
<button name="add_tag" value="{{ tag.uuid }}" type="submit">{{ tag.name }}</button>
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|
|
{% endif %}
|
|
|
|
{% if operation == "remove_tags" %}
|
|
<h2>Remove Tag</h2>
|
|
<div>
|
|
<ul class="tags-picker">
|
|
{% for tag in all_tags %}
|
|
<li>
|
|
<button name="remove_tag" value="{{ tag.uuid }}" type="submit">{{ tag.name }}</button>
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|
|
{% endif %}
|
|
</form>
|
|
<!-- query time: {{ query_duration }}s -->
|
|
{% endblock %}
|
|
|