Changeset - a1f8bf0428c5
[Not reviewed]
default
0 5 0
Mads Kiilerich - 9 years ago 2017-04-15 01:56:27
mads@kiilerich.com
admin: clean-up of Gravatar and IP in user profile headers

Move things around and use Bootstrap compatible markup.

The user IP will rarely be relevant - especially not on the admin pages; the IP
configuration there is more for other user's IP. It might however be somewhat
relevant for a (non-admin) user to know his own IP. There is no obvious place
to show that - it doesn't really fit in as a part of the user profile. Anyway,
just show it under Show Permissions.
5 files changed with 24 insertions and 34 deletions:
0 comments (0 inline, 0 general)
kallithea/templates/admin/my_account/my_account.html
Show inline comments
 
@@ -22,14 +22,6 @@
 
    ##main
 
    <div class="panel-body settings">
 
        <ul class="nav nav-pills nav-stacked">
 
            <li>
 
              <div class="gravatar_box" style="height: 26px">
 
                ${h.gravatar_div(c.user.email, div_style="float: left")}
 
                <div class="truncate" style="margin:10px 0px 10px 0px; color:#5f5f5f; float:left; width: 100px">
 
                    <strong>${c.user.username}</strong>
 
                </div>
 
              </div>
 
            </li>
 
            <li class="${'active' if c.active=='profile' else ''}"><a href="${h.url('my_account')}">${_('Profile')}</a></li>
 
            <li class="${'active' if c.active=='emails' else ''}"><a href="${h.url('my_account_emails')}">${_('Email Addresses')}</a></li>
 
            <li class="${'active' if c.active=='password' else ''}"><a href="${h.url('my_account_password')}">${_('Password')}</a></li>
kallithea/templates/admin/my_account/my_account_perms.html
Show inline comments
 
## permissions overview
 
<div id="perms_container">
 
<h4>${_('Current IP')}</h4>
 
<div>
 
  ${request.ip_addr}
 
</div>
 
<%namespace name="p" file="/base/perms_summary.html"/>
 
${p.perms_summary(c.perm_user.permissions, actions=False)}
 
</div>
kallithea/templates/admin/my_account/my_account_profile.html
Show inline comments
 
@@ -2,18 +2,16 @@ ${h.form(url('my_account'), method='post
 
    <div class="form">
 
        <div class="form-horizontal">
 
            <div class="form-group">
 
                <div class="gravatar_box">
 
                <label class="control-label">${_('Gravatar')}:</label>
 
                <div class="gravatar_box clearfix">
 
                    ${h.gravatar_div(c.user.email)}
 
                    <p>
 
                </div>
 
                <div>
 
                    %if c.visual.use_gravatar:
 
                        <strong>${_('Change your avatar at')} <a href="http://gravatar.com">gravatar.com</a></strong>
 
                        <br/>${_('Using')} ${c.user.email}
 
                        ${_('Change %s avatar at') % c.user.email} <a href="http://gravatar.com">gravatar.com</a>
 
                    %else:
 
                        <strong>${_('Avatars are disabled')}</strong>
 
                        <br/>${c.user.email or _('Missing email, please update your user email address.')}
 
                        [${_('Current IP')}: ${request.ip_addr}]
 
                        ${_('Avatars are disabled')}
 
                    %endif
 
                    </p>
 
                </div>
 
            </div>
 

	
kallithea/templates/admin/settings/settings_visual.html
Show inline comments
 
@@ -25,7 +25,7 @@ ${h.form(url('admin_settings_visual'), m
 
                    <div class="checkbox">
 
                        <label>
 
                            ${h.checkbox('use_gravatar','True')}
 
                            ${_('Use Gravatars in Kallithea')}
 
                            ${_('Show user Gravatars')}
 
                        </label>
 
                    </div>
 
                    ${h.text('gravatar_url', size=80, class_='form-control')}
kallithea/templates/admin/users/user_edit_profile.html
Show inline comments
 
${h.form(url('update_user', id=c.user.user_id))}
 
    <div class="form">
 
        <div class="form-group">
 
            <div class="gravatar_box">
 
                ${h.gravatar_div(c.user.email)}
 
                <p>
 
                %if c.visual.use_gravatar:
 
                <strong>${_('Change avatar at')} <a href="http://gravatar.com">gravatar.com</a></strong>
 
                <br/>${_('Using')} ${c.user.email}
 
                %else:
 
                <strong>${_('Avatars are disabled')}</strong>
 
                <br/>${c.user.email or _('Missing email, please update this user email address.')}
 
                        ##show current ip just if we show ourself
 
                        %if request.authuser.username == c.user.username:
 
                            [${_('Current IP')}: ${request.ip_addr}]
 
                        %endif
 
                %endif
 
        <div class="form-horizontal">
 
            <div class="form-group">
 
                <label class="control-label">${_('Gravatar')}:</label>
 
                <div class="gravatar_box clearfix">
 
                    ${h.gravatar_div(c.user.email)}
 
                </div>
 
                <div>
 
                    %if c.visual.use_gravatar:
 
                        ${_('Change %s avatar at') % c.user.email} <a href="http://gravatar.com">gravatar.com</a>
 
                    %else:
 
                        ${_('Avatars are disabled')}
 
                    %endif
 
                </div>
 
            </div>
 
        </div>
 
        <div class="form-horizontal">
 

	
 
            <div class="form-group">
 
                <label class="control-label" for="username">${_('Username')}:</label>
0 comments (0 inline, 0 general)