Use cards in place of document table.

This commit is contained in:
Edward Betts 2018-05-31 14:59:31 +01:00
parent 92e72a09c8
commit 6731730c03

View file

@ -5,26 +5,31 @@
{% block content %} {% block content %}
<h1>{{ self.title() }}</h1> <h1>{{ self.title() }}</h1>
<table class="table"> <div class="container-fluid">
<thead> <div class="row">
<tr> <div class="col-md-2">
<th>item</th> item type<br>
<th>type</th> {% for item_type in 'xanadoc', 'xanalink', 'sourcedoc' %}
<th>user</th> <input type="checkbox" checked="checked" id="{{ item_type }}" value="{{ item_type }}"> <label for="{{ item_type }}"> {{ item_type }}</label><br>
<th>date</th>
</tr>
</thead>
<tbody>
{% for doc in docs %}
<tr>
<td><a href="{{ doc.url }}">{{ doc.title() }}</a></td>
<td>{{ doc.type }}</td>
<td>{{ doc.user.username }}</td>
<td>{{ doc.created | datetime }}</td>
</tr>
{% endfor %} {% endfor %}
</tbody> </div>
</table> <div class="col-md-10">
{% for doc in docs %}
<div class="card border-primary w-50 my-2">
<h5 class="card-header"><a href="{{ doc.url }}">{{ doc.title() }}</a>
&mdash; {{ doc.user.username }} &mdash; {{ doc.created | datetime }}</h5>
<div class="card-body">
<p class="card-text">
{%- for line in doc.snippet().splitlines() -%}
{{ nbsp_at_start(line) }}<br/>
{%- endfor -%}
</p>
</div>
</div>
{% endfor %}
</div>
</div>
</div>
<p> <p>
<a href="{{ url_for('.new_sourcedoc') }}" class="btn btn-primary">new source document</a> <a href="{{ url_for('.new_sourcedoc') }}" class="btn btn-primary">new source document</a>