Skip to content

Commit

Permalink
Adjust product update template
Browse files Browse the repository at this point in the history
- Ensure variant overview shows attributes
- Use form field partial where appropriate
  • Loading branch information
codeinthehole committed Dec 11, 2013
1 parent 4f709cd commit b62f8ae
Showing 1 changed file with 6 additions and 25 deletions.
31 changes: 6 additions & 25 deletions oscar/templates/oscar/dashboard/catalogue/product_update.html
Original file line number Diff line number Diff line change
Expand Up @@ -163,26 +163,7 @@ <h3>{% trans "Product Details" %}</h3>
{{ field }}
{% endif %}
{% if 'attr' not in field.id_for_label %}
<div class="control-group {% for error in field.errors %}error{% endfor %}">
{% if field.is_hidden %}
{{ field }}
{% else %}
<label for="{{ field.auto_id }}" class="control-label {% if field.field.required %}required{% endif %}">{{ field.label }}{% if field.field.required %} <span>*</span>{% endif %}</label>
<div class="controls">
{{ field }}
{% for error in field.errors %}
<span class="help-block">
{{ error }}
</span>
{% endfor %}
{% if field.help_text %}
<span class='help-block'>
{{ field.help_text }}
</span>
{% endif %}
</div>
{% endif %}
</div>
{% include "partials/form_field.html" with field=field %}
{% endif %}
{% endfor %}

Expand Down Expand Up @@ -211,23 +192,23 @@ <h3>{% trans "Product Details" %}</h3>
{% with parent=product.parent %}
{% if parent %}
<tr>
<th>{% trans "Parent" %}</th>
<th></th>
<th colspan="3">{% trans "Parent" %}</th>
</tr>
<tr>
<td>{{ parent.title }}</td>
<td></td>
<td><a href="{% url 'dashboard:catalogue-product' pk=parent.id %}" class="btn btn-primary" title="{% blocktrans %}Edit {{ parent.title }}{% endblocktrans %}">{% trans "Edit" %}</a></td>
</tr>
{% endif %}
{% endwith %}
<tr>
<th>{% trans "Children" %}</th>
<th></th>
<th colspan="3">{% trans "Children" %}</th>
</tr>

{% for variant in variants %}
<tr>
<td>{{ variant.title }}</td>
<td>{{ variant.get_title }}</td>
<td>{{ variant.attribute_summary }}</td>
<td><a href="{% url 'dashboard:catalogue-product' pk=variant.id %}" class="btn btn-primary">{% trans "Edit" %}</a></td>
</tr>
{% endfor %}
Expand Down

0 comments on commit b62f8ae

Please sign in to comment.