<div class="emails_wrap">
  <table class="table">
    <tr>
    %if c.visual.use_gravatar:
    <td>${h.gravatar_div(c.user.email, size=16)}</td>
    %endif
    <td><div class="email">${c.user.email}</div></td>
    <td>
        <span class="label label-success">${_('Primary')}</span>
    </td>
    </tr>
    %if c.user_email_map:
        %for em in c.user_email_map:
          <tr>
            %if c.visual.use_gravatar:
            <td>${h.gravatar_div(c.user.email, size=16)}</td>
            %endif
            <td><div class="email">${em.email}</div></td>
            <td>
                ${h.form(url('edit_user_emails_delete', id=c.user.user_id))}
                    ${h.hidden('del_email_id',em.email_id)}
                    <i class="icon-trashcan"></i>
                    ${h.submit('remove_',_('Delete'),id="remove_email_%s" % em.email_id,
                    class_="btn btn-default btn-xs", onclick="return  confirm('"+_('Confirm to delete this email: %s') % em.email+"');")}
                ${h.end_form()}
            </td>
          </tr>
        %endfor
    %else:
    <tr><td colspan="${3 if c.visual.use_gravatar else 2}"><div class="ip">${_('No additional emails specified.')}</div></td></tr>
    %endif
  </table>
</div>

<div>
    ${h.form(url('edit_user_emails_update', id=c.user.user_id))}
    <div class="form">
            <div class="form-group">
                <label class="control-label" for="new_email">${_('New email address')}:</label>
                <div>
                    ${h.text('new_email', class_='form-control')}
                </div>
            </div>
            <div class="form-group">
                <div class="buttons">
                    ${h.submit('save',_('Add'),class_="btn btn-default")}
                    ${h.reset('reset',_('Reset'),class_="btn btn-default")}
                </div>
            </div>
    </div>
    ${h.end_form()}
</div>
