{% import "base_widget.html" as b %}

{%- macro view(name, field, prefix) %}
  <h3>{{ name }}</h3>
  <p>{{ field.value }}</p>
{%- endmacro %}

{%- macro table_view(name, field, prefix) %}
  {{ field.value }}
{%- endmacro %}

{%- macro edit(name, field) %}
{{kwargs.____}} {#XXX#}
<div class="control-group {% if field.errors %}error{% endif %}">
    {{ b.label(field, name, **kwargs) }}
    <div class="controls">
      <div class="input-prepend">
        <span class="add-on"><i class="icon-envelope"></i></span><input {{ b.text_attrs(field, name, **kwargs) }}
            value="{{ field.value or field.empty }}" />
      </div>
    {{ b.errors(field) }}
    {% if field.description %}<p class="help-block">{{ field.description }}</p>{% endif %}
    </div>
</div>
{%- endmacro %}

{%- macro inline_edit(name, field) -%}
<input {{ b.text_attrs(field, name, **kwargs) }} 
   value="{{ field.value or field.empty }}" />
{%- endmacro -%}
