Files @ ee3343f3658f
Branch filter:

Location: kallithea/kallithea/templates/admin/users/user_edit_emails.html

mads
style: drop form-horizontal - our style is much closer to plain Bootstrap forms

form-horizontal is made for grid markup. It give form-groups a negative margin
to break out of the grid ... but the way we use it for settings, we have to do
weird things to undo that. The default styling for forms is much closer to what
we want. It looks ok without our custom styling and is easier to style to our
style.

If we want grid markup with form-horizontal, it would be correct to
re-introduce both at once.
<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-minus-circled"></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>