Changeset - e77f5cd50f1f
[Not reviewed]
default
0 6 0
Mads Kiilerich - 8 years ago 2017-06-25 18:28:32
mads@kiilerich.com
style: change some div to span to make it inline and look better without custom styling - especially around gravatars
6 files changed with 13 insertions and 23 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/helpers.py
Show inline comments
 
@@ -827,13 +827,13 @@ from kallithea.lib.auth import HasPermis
 

	
 

	
 
#==============================================================================
 
# GRAVATAR URL
 
#==============================================================================
 
def gravatar_div(email_address, cls='', size=30, **div_attributes):
 
    """Return an html literal with a div around a gravatar if they are enabled.
 
    """Return an html literal with a span around a gravatar if they are enabled.
 
    Extra keyword parameters starting with 'div_' will get the prefix removed
 
    and '_' changed to '-' and be used as attributes on the div. The default
 
    class is 'gravatar'.
 
    """
 
    from tg import tmpl_context as c
 
    if not c.visual.use_gravatar:
 
@@ -841,13 +841,13 @@ def gravatar_div(email_address, cls='', 
 
    if 'div_class' not in div_attributes:
 
        div_attributes['div_class'] = "gravatar"
 
    attributes = []
 
    for k, v in sorted(div_attributes.items()):
 
        assert k.startswith('div_'), k
 
        attributes.append(' %s="%s"' % (k[4:].replace('_', '-'), escape(v)))
 
    return literal("""<div%s>%s</div>""" %
 
    return literal("""<span%s>%s</span>""" %
 
                   (''.join(attributes),
 
                    gravatar(email_address, cls=cls, size=size)))
 

	
 
def gravatar(email_address, cls='', size=30):
 
    """return html element of the gravatar
 

	
kallithea/public/css/style.css
Show inline comments
 
@@ -1162,20 +1162,12 @@ a.metatag[data-tag="license"]:hover {
 
    padding: 10px 0px;
 
    border-bottom: 2px solid #DDD;
 
    margin-left: 10px;
 
    margin-right: 10px;
 
}
 

	
 
#journal .journal_container {
 
    clear: both;
 
}
 

	
 
#journal .journal_action_container {
 
    padding-left: 18px;
 
}
 

	
 
#journal .journal_user {
 
    color: #747474;
 
    font-size: 14px;
 
    font-weight: bold;
 
    height: 30px;
 
}
kallithea/templates/admin/gists/index.html
Show inline comments
 
@@ -40,16 +40,16 @@
 
    </div>
 
    <div class="panel-body">
 
      %if c.gists_pager.item_count>0:
 
        % for gist in c.gists_pager:
 
          <div class="gist-item clearfix">
 
            ${h.gravatar_div(gist.owner.email, size=28)}
 
            <div title="${gist.owner.full_contact}" class="user">
 
            <span title="${gist.owner.full_contact}" class="user">
 
                <b>${h.person(gist.owner.full_contact)}</b> /
 
                <b><a href="${h.url('gist',gist_id=gist.gist_access_id)}">gist: ${gist.gist_access_id}</a></b>
 
            </div>
 
            </span>
 
            <div>
 
                ${_('Created')} ${h.age(gist.created_on)} /
 
                <span class="text-muted">
 
                  %if gist.gist_expires == -1:
 
                   ${_('Expires')}: ${_('Never')}
 
                  %else:
kallithea/templates/admin/notifications/notifications_data.html
Show inline comments
 
%if c.notifications:
 

	
 
<div class="list-group">
 
%for notification in c.notifications:
 
  <div id="notification_${notification.notification.notification_id}" class="list-group-item ${'' if notification.read else 'list-group-item-warning'} clearfix">
 
      ${h.gravatar_div(notification.notification.created_by_user.email, size=24)}
 
      <span class="pull-left">
 
        ${h.gravatar_div(notification.notification.created_by_user.email, size=24)}
 
        <a href="${url('notification', notification_id=notification.notification.notification_id)}">${notification.notification.description}</a>
 
      </span>
 
      <span class="pull-right">
 
        %if not notification.read:
 
          <span id="${notification.notification.notification_id}" class="btn btn-default btn-xs read-notification"><i class="icon-ok"></i>${_('Mark as read')}</span>
 
        %endif
kallithea/templates/files/files_browser.html
Show inline comments
 
@@ -26,16 +26,16 @@
 
</%def>
 
<div id="body" class="panel panel-default">
 
    <div class="panel-heading clearfix">
 
        <div class="browser-nav form-inline pull-left">
 
            ${h.form(h.url.current())}
 
            <div class="info_box">
 
              <div class="info_box_elem rev">${_('Revision')}</div>
 
              <div class="info_box_elem"><a class="btn btn-default btn-xs ypjax-link" href="${c.url_prev}" title="${_('Previous revision')}"><i class="icon-left-open"></i></a></div>
 
              <div class="info_box_elem">${h.text('at_rev',value=c.changeset.revision,size=5,class_='form-control input-sm')}</div>
 
              <div class="info_box_elem"><a class="btn btn-default btn-xs ypjax-link" href="${c.url_next}" title="${_('Next revision')}"><i class="icon-right-open"></i></a></div>
 
              <span class="info_box_elem rev">${_('Revision')}</span>
 
              <span class="info_box_elem"><a class="btn btn-default btn-xs ypjax-link" href="${c.url_prev}" title="${_('Previous revision')}"><i class="icon-left-open"></i></a></span>
 
              <span class="info_box_elem">${h.text('at_rev',value=c.changeset.revision,size=5,class_='form-control input-sm')}</span>
 
              <span class="info_box_elem"><a class="btn btn-default btn-xs ypjax-link" href="${c.url_next}" title="${_('Next revision')}"><i class="icon-right-open"></i></a></span>
 
            </div>
 
            ${h.end_form()}
 
        </div>
 
        <div class="browser-branch form-inline pull-left">
 
            <label>
 
                ${h.checkbox('stay_at_branch',c.changeset.branch,c.changeset.branch==c.branch,class_="form-control")}
kallithea/templates/journal/journal_data.html
Show inline comments
 
## -*- coding: utf-8 -*-
 

	
 
%if c.journal_day_aggregate:
 
    %for day,items in c.journal_day_aggregate:
 
        <h4>${day}</h4>
 
        % for user,entries in items:
 
            <div class="journal_container">
 
            <div class="container-fluid">
 
                ${h.gravatar_div(user.email if user else 'anonymous@kallithea-scm.org', size=24)}
 
                %if user:
 
                    <div class="journal_user">${user.name} ${user.lastname}</div>
 
                    <span class="journal_user">${user.name} ${user.lastname}</span>
 
                %else:
 
                    <div class="journal_user deleted">${entries[0].username}</div>
 
                    <span class="journal_user deleted">${entries[0].username}</span>
 
                %endif
 
                <div class="journal_action_container">
 
                % for entry in entries:
 
                  <div class="container-fluid">
 
                  <div class="clearfix">
 
                    <div class="pull-left">
 
                      <div class="journal_icon"> ${h.action_parser(entry)[2]()}</div>
 
                    </div>
 
                    <div class="pull-left">
 
                      <div class="journal_action">${h.action_parser(entry)[0]()}</div>
 
                      <div class="journal_repo">
 
@@ -31,13 +30,12 @@
 
                      </div>
 
                      <div class="journal_action_params">${h.literal(h.action_parser(entry)[1]())}</div>
 
                      <div class="date"><span data-toggle="tooltip" title="${h.fmt_date(entry.action_date)}">${h.age(entry.action_date)}</span></div>
 
                    </div>
 
                  </div>
 
                %endfor
 
                </div>
 
            </div>
 
        %endfor
 
    %endfor
 

	
 
    <ul class="pagination">
 
        ${c.journal_pager.pager()}
0 comments (0 inline, 0 general)