##// 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 return _author or _email
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 def person_by_id(id_, show_attr="username_and_name"):
835 def person_by_id(id_, show_attr="username_and_name"):
822 # attr to return from fetched user
836 # attr to return from fetched user
823 person_getter = lambda usr: getattr(usr, show_attr)
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 .rc-user { // gravatar + user wrapper
680 .rc-user { // gravatar + user wrapper
674 float: left;
681 float: left;
675 position: relative;
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 .browser-cur-rev{
1874 .browser-cur-rev{
1877 margin-bottom: @textmargin;
1875 margin-bottom: @textmargin;
1878 }
1876 }
@@ -138,6 +138,10 b''
138
138
139 .summary .sidebar-right-content {
139 .summary .sidebar-right-content {
140 margin-bottom: @space;
140 margin-bottom: @space;
141
142 .rc-user {
143 min-width: 0;
144 }
141 }
145 }
142
146
143 .fieldset {
147 .fieldset {
@@ -1,4 +1,6 b''
1 ## -*- coding: utf-8 -*-
1 ## -*- coding: utf-8 -*-
2 <%namespace name="base" file="/base/base.html"/>
3
2 %if c.users_log:
4 %if c.users_log:
3 <table class="rctable admin_log">
5 <table class="rctable admin_log">
4 <tr>
6 <tr>
@@ -13,7 +15,7 b''
13 <tr class="parity${cnt%2}">
15 <tr class="parity${cnt%2}">
14 <td class="td-user">
16 <td class="td-user">
15 %if l.user is not None:
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 %else:
19 %else:
18 ${l.username}
20 ${l.username}
19 %endif
21 %endif
@@ -135,8 +135,9 b''
135
135
136
136
137 <%def name="gravatar_with_user(contact, size=16, show_disabled=False)">
137 <%def name="gravatar_with_user(contact, size=16, show_disabled=False)">
138 <div class="rc-user tooltip" title="${contact}">
138 <% email = h.email_or_none(contact) %>
139 ${self.gravatar(h.email_or_none(contact), size)}
139 <div class="rc-user tooltip" title="${h.author_string(email)}">
140 ${self.gravatar(email, size)}
140 <span class="${'user user-disabled' if show_disabled else 'user'}"> ${h.link_to_user(contact)}</span>
141 <span class="${'user user-disabled' if show_disabled else 'user'}"> ${h.link_to_user(contact)}</span>
141 </div>
142 </div>
142 </%def>
143 </%def>
@@ -131,8 +131,7 b''
131 %endif
131 %endif
132 </td>
132 </td>
133 <td class="td-user">
133 <td class="td-user">
134 ${self.gravatar(h.email_or_none(commit.author))}
134 ${self.gravatar_with_user(commit.author)}
135 <span title="${commit.author}" class="user">${h.link_to_user(commit.author, length=22)}</span>
136 </td>
135 </td>
137 <td class="td-time">
136 <td class="td-time">
138 ${h.age_component(commit.date)}
137 ${h.age_component(commit.date)}
@@ -43,8 +43,7 b''
43 </td>
43 </td>
44
44
45 <td class="td-user author">
45 <td class="td-user author">
46 ${base.gravatar(h.email_or_none(cs.author), 16)}
46 ${base.gravatar_with_user(cs.author)}
47 <span title="${cs.author}" class="user">${h.link_to_user(cs.author, length=22)}</span>
48 </td>
47 </td>
49 <td class="td-tags truncate-wrap">
48 <td class="td-tags truncate-wrap">
50 <div class="truncate tags-truncate"><div class="autoexpand">
49 <div class="truncate tags-truncate"><div class="autoexpand">
@@ -165,10 +165,8 b''
165 </h4>
165 </h4>
166 </div>
166 </div>
167 <div class="sidebar-right-content">
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">
168 ${self.gravatar_with_user(c.commit.author)}
169 <span class="author">
169 <div class="user-inline-data">- ${h.age_component(c.commit.date)}</div>
170 ${h.link_to_user(c.commit.author)} - ${h.age_component(c.commit.date)}
171 </span>
172 </div>
170 </div>
173 </div><!-- end sidebar -->
171 </div><!-- end sidebar -->
174 </div> <!-- end summary -->
172 </div> <!-- end summary -->
@@ -103,7 +103,9 b''
103 </%def>
103 </%def>
104
104
105 <%def name="user_gravatar(email, size=16)">
105 <%def name="user_gravatar(email, size=16)">
106 <div class="rc-user tooltip" title="${h.author_string(email)}">
106 ${base.gravatar(email, 16)}
107 ${base.gravatar(email, 16)}
108 </div>
107 </%def>
109 </%def>
108
110
109 <%def name="repo_actions(repo_name, super_user=True)">
111 <%def name="repo_actions(repo_name, super_user=True)">
@@ -12,24 +12,18 b''
12 </div>
12 </div>
13
13
14 % if c.authors:
14 % if c.authors:
15 <ul class="pull-left">
15 <ul class="sidebar-right-content">
16 % for email, user in sorted(c.authors, key=lambda e: c.file_last_commit.author_email!=e[0]):
16 % for email, user in sorted(c.authors, key=lambda e: c.file_last_commit.author_email!=e[0]):
17 <li class="file_author">
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 ${base.gravatar(email, 16)}
19 ${base.gravatar(email, 16)}
20 <span class="author user">
20 <span class="user">${h.link_to_user(user)}</span>
21 ## case initial page load we only have last commit author
21 </div>
22 % if c.file_author:
22 % if c.file_author:
23 ${h.link_to_user(user)} - ${h.age_component(c.file_last_commit.date)}
23 <div class="user-inline-data">- ${h.age_component(c.file_last_commit.date)}</div>
24 % else:
24 % elif c.file_last_commit.author_email==email:
25 % if c.file_last_commit.author_email==email:
25 <div class="user-inline-data"> (${_('last author')})</div>
26 <strong>${h.link_to_user(user)}</strong> (${_('last author')})
27 % else:
28 ${h.link_to_user(user)}
29 % endif
26 % endif
30 % endif
31 </span>
32 </div>
33 </li>
27 </li>
34 % endfor
28 % endfor
35 </ul>
29 </ul>
@@ -6,9 +6,7 b''
6 </h4>
6 </h4>
7 </div>
7 </div>
8 <div class="sidebar-right-content">
8 <div class="sidebar-right-content">
9 ${base.gravatar(h.email_or_none(c.commit.author), 16)}
9 ${base.gravatar_with_user(c.commit.author)}
10 <span class="author user">
10 <div class="user-inline-data">- ${h.age_component(c.commit.date)}</div>
11 ${h.link_to_user(c.commit.author)} - ${h.age_component(c.commit.date)}
12 </span>
13 </div>
11 </div>
14
12
General Comments 0
You need to be logged in to leave comments. Login now