1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
|
{% extends "layout.html" %}
{% block title %}Browse ASE database{% endblock %}
{% block head %}
{{ super() }}
<script src="{{ url_for('static', filename='table.js') }}"></script>
{% endblock %}
{% block bar1 %}
BROWSE DATABASE
{% endblock %}
{% block content %}
<form action="/">
Search:
<input type=hidden name=x value={{ cid }}>
<input type=text name=query value="{{ con.query }}" onchange="this.form.submit()" size=80>
<a href="https://wiki.fysik.dtu.dk/ase/ase/db/db.html#querying">help</a>
<br>
Rows per page:
<input type=text name=limit value={{ con.limit }} onchange="this.form.submit()" size=6>
</form>
<br>
Rows found: {{ nrows }}
<br>
Download:
<a href="/sqlite?x={{ cid }}">db</a>,
<a href="/json?x={{ cid }}">json</a>
<br>
<form action="/">
Add
<input type=hidden name=x value={{ cid }}>
<select name=toggle onchange="this.form.submit()">
<option value="">column</option>
{% for key in addcolumns -%}
<option value={{ key }}>{{ key }}</option>
{% endfor %}
</select>
<a href="/?x={{ cid }}&toggle=reset">Reset</a>
</form>
{% for page, name in pages %}
{% if page < 0 %}
{{ name }}
{% else %}
<a href="/?x={{ cid }}&page={{ page }}">{{ name }}</a>
{% endif %}
{% endfor %}
<br>
Row {{ row1 }}-{{ row2 }}:
<table id=rows>
<tr>
{%- for c in t.columns %}
<th>
{% if con.sort == c %}↓ {% elif con.sort == '-' + c %}↑ {% endif -%}
<a href="/?x={{ cid }}&sort={{ c }}">{{ c }}</a>
<a href="/?x={{ cid }}&toggle={{ c }}">✕</a>
</th>
{%- endfor %}
</tr>
{% for row in t.rows -%}
<tr class="click {{ loop.cycle('even', 'odd') }}"
onclick="document.location.href = '/id/{{ row.dct.id }}';">
{%- autoescape false -%}
{%- for s in row.strings -%}
{% if t.right[loop.index0] -%}
<td class=right>{{ s }}</td>
{% else %}
<td>{{ s }}</td>
{% endif %}
{% endfor %}
{% endautoescape %}
</tr>
{% set dct=row.dct %}
{% set id=dct.id %}
{% if id in con.opened %}
{% include "more.html" %}
{% endif %}
{% endfor %}
</table>
{% endblock content %}
|