Skip to content

Instantly share code, notes, and snippets.

@gilsondev
Created December 15, 2011 11:01
Show Gist options
  • Save gilsondev/1480710 to your computer and use it in GitHub Desktop.
Save gilsondev/1480710 to your computer and use it in GitHub Desktop.
Template implementado usando o twitter bootstrap
{% extends "base.html" %}
{% block cabecalho %}
<h2>Novo Produto</h2>
{% endblock %}
{% block corpo %}
<form action="{% url produtos:novo %}" method="post" class="form-stacked" enctype="multipart/form-data">
{% csrf_token %}
<fieldset>
{% for field in form %}
{% if field.errors %}
<div class="clearfix error">
<label for="xlInput3">{{ field.label }}</label>
<div class="input">{{ field }}</div>
<span class="error">{{ field.errors|striptags }}</span>
</div>
{% else %}
<div class="clearfix">
<label for="xlInput3">{{ field.label }}</label>
<div class="input">{{ field }}</div>
</div>
{% endif %}
{% endfor %}
</fieldset>
<input type="submit" class="btn primary" value="Salvar Produto" name="" />
<button type="reset" class="btn">Cancelar</button>
</form>
{% endblock %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment