Skip to content

Commit

Permalink
Provide a horizontal scroll bar if there are too many DBH Classes
Browse files Browse the repository at this point in the history
  • Loading branch information
ahinz committed Jun 20, 2013
1 parent 02e0392 commit 174c0f8
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 34 deletions.
3 changes: 2 additions & 1 deletion static/css/polygons.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ input {
width: 100%;
}

#polygontable {
.table-container {
overflow: auto;
width: 95%;
}

/** CSS for OTM is screwy... we're just going to give
Expand Down
41 changes: 22 additions & 19 deletions templates/polygons/edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,30 @@
<h1>Polygon #{{ polygonobj.pk }}</h1>

<form method="POST" action="{{ SITE_ROOT}}polygons/{{ polygonobj.pk }}/update">
<table class="polygon-table table" data-id="{{ polygonobj.pk }}" width="100%">
<tr>
<th>Species</th>
{% for cl in classes %}
<th data-dbh-id={{ cl.pk }}>{{ cl.label }}</th>
<div class="table-container">
<table class="polygon-table table" data-id="{{ polygonobj.pk }}" width="100%">
<tr>
<th>Species</th>
{% for cl in classes %}
<th data-dbh-id={{ cl.pk }}>{{ cl.label }}</th>
{% endfor %}
<th></th>
</tr>
{% for row in polygon %}
<tr>
{% for item in row %}
{% if forloop.first %}
<td data-species-id="{{ item.0 }}">{{ item.1 }}</td>
{% else %}
<td><input name="pval_{{ polygonobj.pk }}_{{ row.0.0 }}_{{ item.0 }}" value="{% if item.1 %}{{ item.1 }}{% else %}0{% endif %}"></td>
{% endif %}
{% endfor %}
<td><a href="#" class="removespecies">Remove</a></td>
</tr>
{% endfor %}
<th></th>
</tr>
{% for row in polygon %}
<tr>
{% for item in row %}
{% if forloop.first %}
<td data-species-id="{{ item.0 }}">{{ item.1 }}</td>
{% else %}
<td><input name="pval_{{ polygonobj.pk }}_{{ row.0.0 }}_{{ item.0 }}" value="{% if item.1 %}{{ item.1 }}{% else %}0{% endif %}"></td>
{% endif %}
{% endfor %}
<td><a href="#" class="removespecies">Remove</a></td>
</tr>
{% endfor %}
</table>
</div>

<input type="submit" name="submit" value="Update" />
<a href="{{ SITE_ROOT}}polygons/{{ polygonobj.pk }}">Cancel</a>
</form>
Expand Down
30 changes: 16 additions & 14 deletions templates/polygons/view.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,22 @@ <h1>Polygon #{{ polygonobj.pk }}</h1>
<a href="{{ SITE_ROOT }}polygons/{{ polygonobj.pk }}/edit"><button>Edit</button></a>
{% endif %}

<table id="polygontable" class="table" width="100%">
<tr>
<th>Species</th>
{% for cl in classes %}
<th>{{ cl.label }}</th>
<div class="table-container">
<table id="polygontable" class="table" width="100%">
<tr>
<th>Species</th>
{% for cl in classes %}
<th>{{ cl.label }}</th>
{% endfor %}
</tr>
{% for row in polygon %}
<tr>
{% for item in row %}
<td>{{ item.1 }}</td>
{% endfor %}
</tr>
{% endfor %}
</tr>
{% for row in polygon %}
<tr>
{% for item in row %}
<td>{{ item.1 }}</td>
{% endfor %}
</tr>
{% endfor %}
</table>
</table>
</div>

{% endblock %}

0 comments on commit 174c0f8

Please sign in to comment.