Browse Source

Add dataset template

pull/10/head
Hironsan 7 years ago
parent
commit
4ca8366a24
3 changed files with 21 additions and 2 deletions
  1. 3
      app/server/templates/admin/admin_base.html
  2. 18
      app/server/templates/admin/dataset.html
  3. 2
      app/server/views.py

3
app/server/templates/admin/admin_base.html

@ -8,7 +8,7 @@
<aside class="column is-2 aside">
<div>
<div class="main">
<a href="#" class="item active">
<a href="{% url 'dataset' project.id %}" class="item active">
<span class="icon">
<i class="fa fa-inbox"></i>
</span>
@ -36,6 +36,7 @@
</div>
</aside>
<div class="column is-10 messages hero is-fullheight" id="message-feed">
{% block content-area %}{% endblock %}
</div>
</div>
{% endblock %}

18
app/server/templates/admin/dataset.html

@ -0,0 +1,18 @@
{% extends "admin/admin_base.html" %} {% load static %} {% block content-area %}
<table class="table is-fullwidth is-hoverable">
<thead>
<tr>
<th>Text</th>
<th>Label</th>
</tr>
</thead>
<tbody>
{% for doc in project.documents.all %}
<tr>
<td>{{ doc.text|truncatechars:100 }}</td>
<td>label</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock %}

2
app/server/views.py

@ -47,7 +47,7 @@ class ProjectsView(LoginRequiredMixin, ListView):
class DatasetView(LoginRequiredMixin, DetailView):
model = Project
template_name = 'admin/admin_base.html'
template_name = 'admin/dataset.html'
class RawDataAPI(View):

Loading…
Cancel
Save