Skip to content

Commit

Permalink
Added some table styling and incomplete jobs table.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lanny committed Jan 3, 2020
1 parent 896b810 commit 348cdff
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 3 deletions.
18 changes: 18 additions & 0 deletions cspace/static/css/stylesheet.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,21 @@ h1,h2,h3 {
.nav a {
color: black;
}

.full-table {
width: 100%;
border-collapse: collapse;
border: 1px solid black;
}

.full-table td, .full-table th {
border-bottom: 1px solid black;
}

.spanning-row {
text-align: center;
}

.form-table th {
text-align: left;
}
31 changes: 30 additions & 1 deletion cspace/templates/cspace/chemical-set-details.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,38 @@ <h2>Chemical Set: {{ chem_set.name }}</h2>
<form action="{% url 'chemical-set' chem_set.pk %}" method="POST">
<h3>Create New Facet</h3>
{% csrf_token %}
<table>
<table class="form-table">
{{ create_facet_form.as_table }}
</table>
<input type="submit" value="Create" />
</form>

<table class="full-table">
<thead>
<tr>
<th class="spanning-row" colspan="3">
Incomplete Jobs
</th>
<tr>
<th>Similarity Measure</th>
<th>Embedding</th>
<th>Status</th>
</tr>
</thead>
<tbody>
{% for job in jobs %}
<tr>
<td>{{ job.get_sim_measure_display }}</td>
<td>{{ job.get_embedding_display }}</td>
<td>{{ job.get_status_display }}</td>
</tr>
{% empty %}
<tr>
<td class="spanning-row" colspan="3">
No Incomplete Jobs
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock %}
14 changes: 12 additions & 2 deletions cspace/templates/cspace/facet-table.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
<table>
<table class="full-table">
<thead>
<tr>
<th
class="spanning-row"
colspan="{% if include_chem_set %}5{% else %}4{% endif %}"
>
Chemical Set Facets
</th>
<tr>
{% if include_chem_set %}
<th>Chemical Set</th>
Expand Down Expand Up @@ -30,7 +37,10 @@
</tr>
{% empty %}
<tr>
<td colspan="{% if include_chem_set %}5{% else %}4{% endif %}">
<td
class="spanning-row"
colspan="{% if include_chem_set %}5{% else %}4{% endif %}"
>
Empty facet set.
</td>
</tr>
Expand Down
2 changes: 2 additions & 0 deletions cspace/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def GET(self, request, sid):
return render(request, 'cspace/chemical-set-details.html', {
'chem_set': chem_set,
'create_facet_form': create_facet_form,
'jobs': chem_set.computefacetjob_set.filter(status__lt=2)
})

def POST(self, request, sid):
Expand All @@ -64,6 +65,7 @@ def POST(self, request, sid):
return render(request, 'cspace/chemical-set-details.html', {
'chem_set': chem_set,
'create_facet_form': create_facet_form,
'jobs': chem_set.computefacetjob_set.filter(status__lt=2)
})

def get_facet_data(request, fid):
Expand Down

0 comments on commit 348cdff

Please sign in to comment.