changeset 6722:e77f5cd50f1f

style: change some div to span to make it inline and look better without custom styling - especially around gravatars
author Mads Kiilerich <mads@kiilerich.com>
date Sun, 25 Jun 2017 18:28:32 +0200
parents f17431fde3c7
children ee3343f3658f
files kallithea/lib/helpers.py kallithea/public/css/style.css kallithea/templates/admin/gists/index.html kallithea/templates/admin/notifications/notifications_data.html kallithea/templates/files/files_browser.html kallithea/templates/journal/journal_data.html
diffstat 6 files changed, 13 insertions(+), 23 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/lib/helpers.py	Sun Jun 25 18:28:04 2017 +0200
+++ b/kallithea/lib/helpers.py	Sun Jun 25 18:28:32 2017 +0200
@@ -830,7 +830,7 @@
 # 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'.
@@ -844,7 +844,7 @@
     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)))
 
--- a/kallithea/public/css/style.css	Sun Jun 25 18:28:04 2017 +0200
+++ b/kallithea/public/css/style.css	Sun Jun 25 18:28:32 2017 +0200
@@ -1165,14 +1165,6 @@
     margin-right: 10px;
 }
 
-#journal .journal_container {
-    clear: both;
-}
-
-#journal .journal_action_container {
-    padding-left: 18px;
-}
-
 #journal .journal_user {
     color: #747474;
     font-size: 14px;
--- a/kallithea/templates/admin/gists/index.html	Sun Jun 25 18:28:04 2017 +0200
+++ b/kallithea/templates/admin/gists/index.html	Sun Jun 25 18:28:32 2017 +0200
@@ -43,10 +43,10 @@
         % 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">
--- a/kallithea/templates/admin/notifications/notifications_data.html	Sun Jun 25 18:28:04 2017 +0200
+++ b/kallithea/templates/admin/notifications/notifications_data.html	Sun Jun 25 18:28:32 2017 +0200
@@ -3,8 +3,8 @@
 <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">
--- a/kallithea/templates/files/files_browser.html	Sun Jun 25 18:28:04 2017 +0200
+++ b/kallithea/templates/files/files_browser.html	Sun Jun 25 18:28:32 2017 +0200
@@ -29,10 +29,10 @@
         <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>
--- a/kallithea/templates/journal/journal_data.html	Sun Jun 25 18:28:04 2017 +0200
+++ b/kallithea/templates/journal/journal_data.html	Sun Jun 25 18:28:32 2017 +0200
@@ -4,16 +4,15 @@
     %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>
@@ -34,7 +33,6 @@
                     </div>
                   </div>
                 %endfor
-                </div>
             </div>
         %endfor
     %endfor