##// END OF EJS Templates
annotations: fixed UI problems in annotation view for newer browsers.
marcink -
r1427:a6bc3e0e stable
parent child Browse files
Show More
@@ -969,17 +969,6 b' table.cb {'
969 969 tr {
970 970 &.cb-annotate {
971 971 border-top: 1px solid #eee;
972
973 &+ .cb-line {
974 border-top: 1px solid #eee;
975 }
976
977 &:first-child {
978 border-top: none;
979 &+ .cb-line {
980 border-top: none;
981 }
982 }
983 972 }
984 973
985 974 &.cb-hunk {
@@ -1114,7 +1103,9 b' table.cb {'
1114 1103 background: #ffdddd;
1115 1104 }
1116 1105 }
1117
1106 &.cb-annotate-message-spacer {
1107 width:8px;
1108 }
1118 1109 &.cb-annotate-info {
1119 1110 width: 320px;
1120 1111 min-width: 320px;
@@ -1122,22 +1113,23 b' table.cb {'
1122 1113 padding: 5px 2px;
1123 1114 font-size: 13px;
1124 1115
1125 strong.cb-annotate-message {
1126 padding: 5px 0;
1116 .cb-annotate-message {
1117 padding: 2px 0px 0px 0px;
1127 1118 white-space: pre-line;
1128 display: inline-block;
1119 overflow: hidden;
1129 1120 }
1130 1121 .rc-user {
1131 1122 float: none;
1132 1123 padding: 0 6px 0 17px;
1133 min-width: auto;
1134 min-height: auto;
1124 min-width: unset;
1125 min-height: unset;
1135 1126 }
1136 1127 }
1137 1128
1138 1129 &.cb-annotate-revision {
1139 1130 cursor: pointer;
1140 1131 text-align: right;
1132 padding: 1px 3px 0px 3px;
1141 1133 }
1142 1134 }
1143 1135 }
@@ -1,16 +1,50 b''
1 1 <%def name="render_line(line_num, tokens,
2 2 annotation=None,
3 bgcolor=None)">
3 bgcolor=None, show_annotation=None)">
4 4 <%
5 5 from rhodecode.lib.codeblocks import render_tokenstream
6 6 # avoid module lookup for performance
7 7 html_escape = h.html_escape
8 8 %>
9 <tr class="cb-line cb-line-fresh"
9 <tr class="cb-line cb-line-fresh ${'cb-annotate' if show_annotation else ''}"
10 10 %if annotation:
11 11 data-revision="${annotation.revision}"
12 12 %endif
13 13 >
14
15 % if annotation:
16 % if show_annotation:
17 <td class="cb-annotate-info tooltip"
18 title="Author: ${annotation.author | entity}<br>Date: ${annotation.date}<br>Message: ${annotation.message | entity}"
19 >
20 ${h.gravatar_with_user(annotation.author, 16) | n}
21 <div class="cb-annotate-message truncate-wrap">${h.chop_at_smart(annotation.message, '\n', suffix_if_chopped='...')}</div>
22 </td>
23 <td class="cb-annotate-message-spacer"></td>
24 <td
25 class="cb-annotate-revision"
26 data-revision="${annotation.revision}"
27 onclick="$('[data-revision=${annotation.revision}]').toggleClass('cb-line-fresh')"
28 style="background: ${bgcolor}">
29 <a class="cb-annotate" href="${h.url('changeset_home',repo_name=c.repo_name,revision=annotation.raw_id)}">
30 r${annotation.revision}
31 </a>
32 </td>
33 % else:
34 <td></td>
35 <td class="cb-annotate-message-spacer"></td>
36 <td
37 class="cb-annotate-revision"
38 data-revision="${annotation.revision}"
39 onclick="$('[data-revision=${annotation.revision}]').toggleClass('cb-line-fresh')"
40 style="background: ${bgcolor}">
41 </td>
42 % endif
43 % else:
44 <td colspan="3"></td>
45 % endif
46
47
14 48 <td class="cb-lineno" id="L${line_num}">
15 49 <a data-line-no="${line_num}" href="#L${line_num}"></a>
16 50 </td>
@@ -27,40 +61,11 b''
27 61 </%def>
28 62
29 63 <%def name="render_annotation_lines(annotation, lines, color_hasher)">
30 <%
31 rowspan = len(lines) + 1 # span the line's <tr> and annotation <tr>
32 %>
33 %if not annotation:
34 <tr class="cb-annotate">
35 <td class="cb-annotate-message" rowspan="${rowspan}"></td>
36 <td class="cb-annotate-revision" rowspan="${rowspan}"></td>
37 </tr>
38 %else:
39 <tr class="cb-annotate">
40 <td class="cb-annotate-info tooltip"
41 rowspan="${rowspan}"
42 title="Author: ${annotation.author | entity}<br>Date: ${annotation.date}<br>Message: ${annotation.message | entity}"
43 >
44 ${h.gravatar_with_user(annotation.author, 16) | n}
45 <strong class="cb-annotate-message">${h.truncate(annotation.message, len(lines) * 30)}</strong>
46 </td>
47 <td
48 class="cb-annotate-revision"
49 rowspan="${rowspan}"
50 data-revision="${annotation.revision}"
51 onclick="$('[data-revision=${annotation.revision}]').toggleClass('cb-line-fresh')"
52 style="background: ${color_hasher(annotation.raw_id)}">
53 <a href="${h.url('changeset_home',repo_name=c.repo_name,revision=annotation.raw_id)}">
54 r${annotation.revision}
55 </a>
56 </td>
57 </tr>
58 %endif
59
60 64 %for line_num, tokens in lines:
61 65 ${render_line(line_num, tokens,
62 66 bgcolor=color_hasher(annotation and annotation.raw_id or ''),
63 annotation=annotation,
67 annotation=annotation, show_annotation=loop.first
64 68 )}
65 69 %endfor
70
66 71 </%def>
General Comments 0
You need to be logged in to leave comments. Login now