Variation matrix: CSS sugar

This commit is contained in:
Raphael Michel
2014-10-25 11:55:04 +02:00
parent 3d8ea6095d
commit 94d3d4c6f3
2 changed files with 54 additions and 33 deletions

View File

@@ -49,4 +49,19 @@ td > .form-group > .checkbox {
.container ul.nav-pills {
margin: 20px 0;
}
.variation-matrix {
td .form-group, .checkbox {
margin: 0;
}
}
@media (min-width: @screen-sm-min) {
.variation-matrix > tbody > tr > td {
line-height: 34px;
input[type=checkbox] {
margin-top: 10px;
}
}
}

View File

@@ -2,42 +2,48 @@
{% load i18n %}
{% load bootstrap3 %}
{% block inside %}
<form action="" method="post">
{% csrf_token %}
{% for major in forms %}
<form action="" method="post">
{% csrf_token %}
{% for major in forms %}
{% if major.row %}
<h3>{{ major.row }}</h3>
<h3>{{ major.row }}</h3>
{% endif %}
<table class="table">
<thead>
<tr>
<th></th>
{% for val in properties.1.values.all %}
<th>{{ val.value }}</th>
{% endfor %}
</tr>
</thead>
<tbody>
{% for sub in major.forms %}
<tr>
<td>{{ sub.row.value }}</td>
{% for form in sub.forms %}
<td>
{% bootstrap_field form.active layout='inline' %}
{% bootstrap_field form.default_price layout='inline' %}
{{ form.default_price.errors }}
</td>
{% endfor %}
</tr>
{% endfor %}
</tbody>
</table>
{% endfor %}
<div class="form-group submit-group">
<table class="table variation-matrix">
<thead>
<tr>
<th></th>
{% for val in properties.1.values.all %}
<th>{{ val.value }}</th>
{% endfor %}
</tr>
</thead>
<tbody>
{% for sub in major.forms %}
<tr>
<td>{{ sub.row.value }}</td>
{% for form in sub.forms %}
<td>
<div class="row">
<div class="col-sm-5">
{% bootstrap_field form.active layout='inline' %}
</div>
<div class="col-sm-7">
{% bootstrap_field form.default_price layout='inline' %}
</div>
</div>
{{ form.default_price.errors }}
</td>
{% endfor %}
</tr>
{% endfor %}
</tbody>
</table>
{% endfor %}
<div class="form-group submit-group">
<button type="submit" class="btn btn-primary btn-save">
{% trans "Save" %}
</button>
</div>
</form>
</div>
</form>
{% endblock %}