##// END OF EJS Templates
ux: #4037 use gravatar for commit email and add tooltips for name + email
lisaq -
r410:e0937131 default
parent child Browse files
Show More
@@ -818,6 +818,20 b' def person(author, show_attr="username_a'
818 818 return _author or _email
819 819
820 820
821 def author_string(email):
822 if email:
823 user = User.get_by_email(email, case_insensitive=True, cache=True)
824 if user:
825 if user.firstname or user.lastname:
826 return '%s %s <%s>' % (user.firstname, user.lastname, email)
827 else:
828 return email
829 else:
830 return email
831 else:
832 return None
833
834
821 835 def person_by_id(id_, show_attr="username_and_name"):
822 836 # attr to return from fetched user
823 837 person_getter = lambda usr: getattr(usr, show_attr)
@@ -670,6 +670,13 b' label {'
670 670 }
671 671 }
672 672
673 .user-inline-data {
674 display: inline-block;
675 float: left;
676 padding-left: .5em;
677 line-height: 1.3em;
678 }
679
673 680 .rc-user { // gravatar + user wrapper
674 681 float: left;
675 682 position: relative;
@@ -1864,15 +1871,6 b' h3.files_location{'
1864 1871 }
1865 1872 }
1866 1873
1867 .file_author{
1868 margin-bottom: @padding;
1869
1870 div{
1871 display: inline-block;
1872 margin-right: 0.5em;
1873 }
1874 }
1875
1876 1874 .browser-cur-rev{
1877 1875 margin-bottom: @textmargin;
1878 1876 }
@@ -138,6 +138,10 b''
138 138
139 139 .summary .sidebar-right-content {
140 140 margin-bottom: @space;
141
142 .rc-user {
143 min-width: 0;
144 }
141 145 }
142 146
143 147 .fieldset {
@@ -1,4 +1,6 b''
1 1 ## -*- coding: utf-8 -*-
2 <%namespace name="base" file="/base/base.html"/>
3
2 4 %if c.users_log:
3 5 <table class="rctable admin_log">
4 6 <tr>
@@ -13,7 +15,7 b''
13 15 <tr class="parity${cnt%2}">
14 16 <td class="td-user">
15 17 %if l.user is not None:
16 ${h.link_to(l.user.username,h.url('edit_user', user_id=l.user.user_id))}
18 ${base.gravatar_with_user(l.user.email)}
17 19 %else:
18 20 ${l.username}
19 21 %endif
@@ -135,8 +135,9 b''
135 135
136 136
137 137 <%def name="gravatar_with_user(contact, size=16, show_disabled=False)">
138 <div class="rc-user tooltip" title="${contact}">
139 ${self.gravatar(h.email_or_none(contact), size)}
138 <% email = h.email_or_none(contact) %>
139 <div class="rc-user tooltip" title="${h.author_string(email)}">
140 ${self.gravatar(email, size)}
140 141 <span class="${'user user-disabled' if show_disabled else 'user'}"> ${h.link_to_user(contact)}</span>
141 142 </div>
142 143 </%def>
@@ -131,8 +131,7 b''
131 131 %endif
132 132 </td>
133 133 <td class="td-user">
134 ${self.gravatar(h.email_or_none(commit.author))}
135 <span title="${commit.author}" class="user">${h.link_to_user(commit.author, length=22)}</span>
134 ${self.gravatar_with_user(commit.author)}
136 135 </td>
137 136 <td class="td-time">
138 137 ${h.age_component(commit.date)}
@@ -43,8 +43,7 b''
43 43 </td>
44 44
45 45 <td class="td-user author">
46 ${base.gravatar(h.email_or_none(cs.author), 16)}
47 <span title="${cs.author}" class="user">${h.link_to_user(cs.author, length=22)}</span>
46 ${base.gravatar_with_user(cs.author)}
48 47 </td>
49 48 <td class="td-tags truncate-wrap">
50 49 <div class="truncate tags-truncate"><div class="autoexpand">
@@ -165,10 +165,8 b''
165 165 </h4>
166 166 </div>
167 167 <div class="sidebar-right-content">
168 <img alt="gravatar" class="gravatar" title="${h.email_or_none(c.commit.author)}" src="${h.gravatar_url(h.email_or_none(c.commit.author), 40)}" height="16" width="16">
169 <span class="author">
170 ${h.link_to_user(c.commit.author)} - ${h.age_component(c.commit.date)}
171 </span>
168 ${self.gravatar_with_user(c.commit.author)}
169 <div class="user-inline-data">- ${h.age_component(c.commit.date)}</div>
172 170 </div>
173 171 </div><!-- end sidebar -->
174 172 </div> <!-- end summary -->
@@ -103,7 +103,9 b''
103 103 </%def>
104 104
105 105 <%def name="user_gravatar(email, size=16)">
106 <div class="rc-user tooltip" title="${h.author_string(email)}">
106 107 ${base.gravatar(email, 16)}
108 </div>
107 109 </%def>
108 110
109 111 <%def name="repo_actions(repo_name, super_user=True)">
@@ -12,24 +12,18 b''
12 12 </div>
13 13
14 14 % if c.authors:
15 <ul class="pull-left">
15 <ul class="sidebar-right-content">
16 16 % for email, user in sorted(c.authors, key=lambda e: c.file_last_commit.author_email!=e[0]):
17 17 <li class="file_author">
18 <div class="contributor tooltip" title="${h.tooltip(user)}">
18 <div class="rc-user tooltip" title="${h.author_string(email)}">
19 19 ${base.gravatar(email, 16)}
20 <span class="author user">
21 ## case initial page load we only have last commit author
20 <span class="user">${h.link_to_user(user)}</span>
21 </div>
22 22 % if c.file_author:
23 ${h.link_to_user(user)} - ${h.age_component(c.file_last_commit.date)}
24 % else:
25 % if c.file_last_commit.author_email==email:
26 <strong>${h.link_to_user(user)}</strong> (${_('last author')})
27 % else:
28 ${h.link_to_user(user)}
23 <div class="user-inline-data">- ${h.age_component(c.file_last_commit.date)}</div>
24 % elif c.file_last_commit.author_email==email:
25 <div class="user-inline-data"> (${_('last author')})</div>
29 26 % endif
30 % endif
31 </span>
32 </div>
33 27 </li>
34 28 % endfor
35 29 </ul>
@@ -6,9 +6,7 b''
6 6 </h4>
7 7 </div>
8 8 <div class="sidebar-right-content">
9 ${base.gravatar(h.email_or_none(c.commit.author), 16)}
10 <span class="author user">
11 ${h.link_to_user(c.commit.author)} - ${h.age_component(c.commit.date)}
12 </span>
9 ${base.gravatar_with_user(c.commit.author)}
10 <div class="user-inline-data">- ${h.age_component(c.commit.date)}</div>
13 11 </div>
14 12
General Comments 0
You need to be logged in to leave comments. Login now