Skip to content

Commit

Permalink
Template update.
Browse files Browse the repository at this point in the history
  • Loading branch information
tonioo committed Apr 8, 2015
1 parent 41ce818 commit 204306a
Showing 1 changed file with 36 additions and 11 deletions.
47 changes: 36 additions & 11 deletions modoboa_webmail/templates/modoboa_webmail/compose.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,67 @@

<form class="form-horizontal" method="POST" action="{{ posturl }}" id="composemail">
{% csrf_token %}

<div id="compose-container">
<div id="mailheader">
<div class="form-group{% if form.errors.to %} has-error{% endif %}">

{# handling to field #}
<label class="col-sm-1 control-label" for="id_to">{% trans "To" %}</label>
<div class="col-sm-8">
<input id="id_to" name="to" class="form-control" value="{% if form.to.value %}{{ form.to.value }}{% endif %}"{% if form.to.errors %} placeholder="{% for error in form.to.errors %}{{ error }}{% endfor %}" title="{% for error in form.to.errors %}{{ error }}{% endfor %}"{% endif %}>
<input id="id_to" name="to" class="form-control" value="{% if form.to.value %}{{ form.to.value }}{% endif %}" placeholder="{% trans 'This field is required' %}">
{% if form.to.errors %}
{% for error in form.to.errors %}
<p class="help-block">{{ error }}</p>
{% endfor %}
{% endif %}
</div>
{% if not form.cc.value %}

{# handling cc and cci buttons #}
{% if not form.cc.value or not form.cci.value %}
<div class="col-sm-2">
<button id="add_cc" class="btn btn-default btn-xs"><span class="fa fa-plus"></span> {% trans "Cc" %}</button>
<button id="add_cci" class="btn btn-default btn-xs"><span class="fa fa-plus"> {% trans "Cci" %}</span></button>
{% if not form.cc.value %}
<button id="add_cc" class="btn btn-default btn-xs">
<span class="fa fa-plus"></span> {% trans "Cc" %}
</button>
{% endif %}
{% if not form.cci.value %}
<button id="add_cci" class="btn btn-default btn-xs">
<span class="fa fa-plus"> {% trans "Cci" %}</span>
</button>
{% endif %}
</div>
{% endif %}
{% endif %}
</div>

{# display cc field when required #}
{% if form.cc.value %}
{% render_field form.cc label_width="col-sm-1" %}
{% render_field form.cci label_width="col-sm-1" %}
{% else %}
{% render_field form.cc label_width="col-sm-1" hidden=True %}
{% endif %}

{# display cci field when required #}
{% if form.cci.value %}
{% render_field form.cci label_width="col-sm-1" %}
{% else %}
{% render_field form.cci label_width="col-sm-1" hidden=True %}
{% endif %}

{% render_field form.subject label_width="col-sm-1" %}

</div>

<div id="body_container">
{% if body %}
<textarea id="id_body" name="body" class="form-control editor">{% if bodyheader %}{{ bodyheader }}{% endif %}
<textarea id="id_body" name="body" class="form-control editor">
{% if bodyheader %}{{ bodyheader }}{% endif %}
{{ body }}
</textarea>
{% else %}
<textarea id="id_body" name="body" class="form-control editor"></textarea>
{% endif %}
</div>
</div>

</div>
</form>

0 comments on commit 204306a

Please sign in to comment.