Show More
@@ -1,170 +1,173 b'' | |||
|
1 | 1 | @font-face { |
|
2 | 2 | font-family: 'rcicons'; |
|
3 | 3 | src: url('../fonts/RCIcons/rcicons.eot?74666722'); |
|
4 | 4 | src: url('../fonts/RCIcons/rcicons.eot?74666722#iefix') format('embedded-opentype'), |
|
5 | 5 | url('../fonts/RCIcons/rcicons.woff2?74666722') format('woff2'), |
|
6 | 6 | url('../fonts/RCIcons/rcicons.woff?74666722') format('woff'), |
|
7 | 7 | url('../fonts/RCIcons/rcicons.ttf?74666722') format('truetype'), |
|
8 | 8 | url('../fonts/RCIcons/rcicons.svg?74666722#rcicons') format('svg'); |
|
9 | 9 | font-weight: normal; |
|
10 | 10 | font-style: normal; |
|
11 | 11 | } |
|
12 | 12 | /* Chrome hack: SVG is rendered more smooth in Windozze. 100% magic, uncomment if you need it. */ |
|
13 | 13 | /* Note, that will break hinting! In other OS-es font will be not as sharp as it could be */ |
|
14 | 14 | /* |
|
15 | 15 | @media screen and (-webkit-min-device-pixel-ratio:0) { |
|
16 | 16 | @font-face { |
|
17 | 17 | font-family: 'rcicons'; |
|
18 | 18 | src: url('../fonts/RCIcons/rcicons.svg?74666722#rcicons') format('svg'); |
|
19 | 19 | } |
|
20 | 20 | } |
|
21 | 21 | */ |
|
22 | 22 | |
|
23 | 23 | [class^="icon-"]:before, [class*=" icon-"]:before { |
|
24 | 24 | font-family: "rcicons"; |
|
25 | 25 | font-style: normal; |
|
26 | 26 | font-weight: normal; |
|
27 | 27 | speak: none; |
|
28 | 28 | |
|
29 | 29 | display: inline-block; |
|
30 | 30 | text-decoration: inherit; |
|
31 | 31 | width: 1em; |
|
32 | 32 | margin-right: .2em; |
|
33 | 33 | text-align: center; |
|
34 | 34 | /* opacity: .8; */ |
|
35 | 35 | |
|
36 | 36 | /* For safety - reset parent styles, that can break glyph codes*/ |
|
37 | 37 | font-variant: normal; |
|
38 | 38 | text-transform: none; |
|
39 | 39 | |
|
40 | 40 | /* fix buttons height, for twitter bootstrap */ |
|
41 | 41 | line-height: 1em; |
|
42 | 42 | |
|
43 | 43 | /* Animation center compensation - margins should be symmetric */ |
|
44 | 44 | /* remove if not needed */ |
|
45 | 45 | margin-left: .2em; |
|
46 | 46 | |
|
47 | 47 | /* you can be more comfortable with increased icons size */ |
|
48 | 48 | /* font-size: 120%; */ |
|
49 | 49 | |
|
50 | 50 | /* Font smoothing. That was taken from TWBS */ |
|
51 | 51 | -webkit-font-smoothing: antialiased; |
|
52 | 52 | -moz-osx-font-smoothing: grayscale; |
|
53 | 53 | |
|
54 | 54 | /* Uncomment for 3D effect */ |
|
55 | 55 | /* text-shadow: 1px 1px 1px rgba(127, 127, 127, 0.3); */ |
|
56 | 56 | } |
|
57 | 57 | |
|
58 | 58 | .icon-no-margin::before { |
|
59 | 59 | margin: 0; |
|
60 | 60 | |
|
61 | 61 | } |
|
62 | 62 | // -- ICON CLASSES -- // |
|
63 | 63 | |
|
64 | 64 | .icon-bookmark:before { content: '\e803'; } /* 'ξ ' */ |
|
65 | 65 | .icon-branch:before { content: '\e804'; } /* 'ξ ' */ |
|
66 | 66 | .icon-lock:before { content: '\e806'; } /* 'ξ ' */ |
|
67 | 67 | .icon-unlock:before { content: '\e807'; } /* 'ξ ' */ |
|
68 | 68 | .icon-delete:before { content: '\e808'; } /* 'ξ ' */ |
|
69 | 69 | .icon-false:before { content: '\e808'; } /* 'ξ ' */ |
|
70 | 70 | |
|
71 | 71 | .icon-ok:before { content: '\e809'; } /* 'ξ ' */ |
|
72 | 72 | .icon-true:before { content: '\e809'; } /* 'ξ ' */ |
|
73 | 73 | |
|
74 | 74 | .icon-comment:before { content: '\e80a'; } /* 'ξ ' */ |
|
75 | 75 | .icon-comment-add:before { content: '\e816'; } /* 'ξ ' */ |
|
76 | 76 | .icon-comment_toggle:before { content: '\e818'; } /* 'ξ ' */ |
|
77 | 77 | |
|
78 | 78 | .icon-feed:before { content: '\e80b'; } /* 'ξ ' */ |
|
79 | 79 | |
|
80 | 80 | .icon-right:before { content: '\e80c'; } /* 'ξ ' */ |
|
81 | 81 | .icon-left:before { content: '\e80d'; } /* 'ξ ' */ |
|
82 | 82 | |
|
83 | 83 | .icon-arrow_down:before { content: '\e80e'; } /* 'ξ ' */ |
|
84 | 84 | .icon-arrow_up:before { content: '\e80e'; } /* 'ξ ' */ |
|
85 | 85 | |
|
86 | 86 | .icon-group:before { content: '\e812'; } /* 'ξ ' */ |
|
87 | 87 | |
|
88 | 88 | .icon-fork:before { content: '\e814'; } /* 'ξ ' */ |
|
89 | 89 | .icon-merge:before { content: '\e814'; } /* 'ξ ' */ |
|
90 | 90 | |
|
91 | 91 | .icon-more:before { content: '\e815'; } /* 'ξ ' */ |
|
92 | 92 | |
|
93 | 93 | .icon-more-linked { cursor: pointer; color: @grey3 } |
|
94 | 94 | .icon-more-linked:before { content: '\e815'; } /* 'ξ ' */ |
|
95 | 95 | |
|
96 | .icon-expand-linked { cursor: pointer; color: @grey3; font-size: 8px } | |
|
97 | .icon-expand-linked:before { content: '\e80e'; } /* 'ξ ' */ | |
|
98 | ||
|
96 | 99 | .icon-git-inv:before { content: '\e80f'; } /* 'ξ ' */ |
|
97 | 100 | .icon-hg-inv:before { content: '\e810'; } /* 'ξ ' */ |
|
98 | 101 | .icon-svn-inv:before { content: '\e811'; } /* 'ξ ' */ |
|
99 | 102 | |
|
100 | 103 | .icon-git:before { content: '\e81a'; } /* 'ξ ' */ |
|
101 | 104 | .icon-hg:before { content: '\e81b'; } /* 'ξ ' */ |
|
102 | 105 | .icon-svn:before { content: '\e820'; } /* 'ξ ' */ |
|
103 | 106 | |
|
104 | 107 | .icon-minus:before { content: '\e81c'; } /* 'ξ ' */ |
|
105 | 108 | .icon-plus:before { content: '\e81d'; } /* 'ξ ' */ |
|
106 | 109 | .icon-remove:before { content: '\e81e'; } /* 'ξ ' */ |
|
107 | 110 | .icon-remove-sign:before { content: '\e81e'; } /* 'ξ ' */ |
|
108 | 111 | |
|
109 | 112 | .icon-rhodecode:before { content: '\e81f'; } /* 'ξ ' */ |
|
110 | 113 | |
|
111 | 114 | .icon-tag:before { content: '\e821'; } /* 'ξ ‘' */ |
|
112 | 115 | .icon-copy:before { content: '\f0c5'; } /* 'ο ' */ |
|
113 | 116 | .icon-clipboard:before { content: '\f0c5'; } /* 'ο ' */ |
|
114 | 117 | |
|
115 | 118 | |
|
116 | 119 | .icon-folder:before { content: '\e813'; } /* 'ξ ' */ |
|
117 | 120 | .icon-folder-close:before { content: '\e813'; } /* 'ξ ' */ |
|
118 | 121 | |
|
119 | 122 | .icon-directory:before { content: '\e800'; } /* 'ξ ' */ |
|
120 | 123 | .icon-directory-empty:before { content: '\f114'; } /* 'ο' */ |
|
121 | 124 | .icon-file-text:before { content: '\f0f6'; } /* 'οΆ' */ |
|
122 | 125 | .icon-file-text-inv:before { content: '\f15c'; } /* 'ο ' */ |
|
123 | 126 | .icon-file-code:before { content: '\f1c9'; } /* 'ο' */ |
|
124 | 127 | |
|
125 | 128 | // MERGED ICONS |
|
126 | 129 | |
|
127 | 130 | .icon-repo-private:before { &:extend(.icon-lock:before); } |
|
128 | 131 | .icon-repo-lock:before { &:extend(.icon-lock:before); } |
|
129 | 132 | .icon-unlock-alt:before { &:extend(.icon-unlock:before); } |
|
130 | 133 | .icon-repo-unlock:before { &:extend(.icon-unlock:before); } |
|
131 | 134 | .icon-repo-public:before { &:extend(.icon-unlock:before); } |
|
132 | 135 | .icon-rss-sign:before { &:extend(.icon-feed:before); } |
|
133 | 136 | .icon-code-fork:before { &:extend(.icon-fork:before); } |
|
134 | 137 | |
|
135 | 138 | // TRANSFORM |
|
136 | 139 | .icon-arrow_up:before {transform: rotate(180deg);} |
|
137 | 140 | .icon-merge:before {transform: rotate(180deg);} |
|
138 | 141 | |
|
139 | 142 | // -- END ICON CLASSES -- // |
|
140 | 143 | |
|
141 | 144 | |
|
142 | 145 | //--- ICONS STYLING ------------------// |
|
143 | 146 | |
|
144 | 147 | .icon-git { color: @color4 !important; } |
|
145 | 148 | .icon-hg { color: @color8 !important; } |
|
146 | 149 | .icon-svn { color: @color1 !important; } |
|
147 | 150 | .icon-git-inv { color: @color4 !important; } |
|
148 | 151 | .icon-hg-inv { color: @color8 !important; } |
|
149 | 152 | .icon-svn-inv { color: @color1 !important; } |
|
150 | 153 | .icon-repo-lock { color: #FF0000; } |
|
151 | 154 | .icon-repo-unlock { color: #FF0000; } |
|
152 | 155 | |
|
153 | 156 | .repo-switcher-dropdown .select2-result-label { |
|
154 | 157 | .icon-git:before { |
|
155 | 158 | &:extend(.icon-git-transparent:before); |
|
156 | 159 | } |
|
157 | 160 | .icon-hg:before { |
|
158 | 161 | &:extend(.icon-hg-transparent:before); |
|
159 | 162 | color: @alert4; |
|
160 | 163 | } |
|
161 | 164 | .icon-svn:before { |
|
162 | 165 | &:extend(.icon-svn-transparent:before); |
|
163 | 166 | } |
|
164 | 167 | } |
|
165 | 168 | |
|
166 | 169 | .icon-user-group:before { |
|
167 | 170 | &:extend(.icon-group:before); |
|
168 | 171 | margin: 0; |
|
169 | 172 | font-size: 16px; |
|
170 | 173 | } |
@@ -1,152 +1,152 b'' | |||
|
1 | 1 | ## small box that displays changed/added/removed details fetched by AJAX |
|
2 | 2 | <%namespace name="base" file="/base/base.mako"/> |
|
3 | 3 | |
|
4 | 4 | |
|
5 | 5 | % if c.prev_page: |
|
6 | 6 | <tr> |
|
7 | 7 | <td colspan="9" class="load-more-commits"> |
|
8 | 8 | <a class="prev-commits" href="#loadPrevCommits" onclick="commitsController.loadPrev(this, ${c.prev_page}, '${c.branch_name}', '${c.commit_id}', '${c.f_path}');return false"> |
|
9 | 9 | ${_('load previous')} |
|
10 | 10 | </a> |
|
11 | 11 | </td> |
|
12 | 12 | </tr> |
|
13 | 13 | % endif |
|
14 | 14 | |
|
15 | 15 | ## to speed up lookups cache some functions before the loop |
|
16 | 16 | <% |
|
17 | 17 | active_patterns = h.get_active_pattern_entries(c.repo_name) |
|
18 | 18 | urlify_commit_message = h.partial(h.urlify_commit_message, active_pattern_entries=active_patterns) |
|
19 | 19 | %> |
|
20 | 20 | |
|
21 | 21 | % for cnt,commit in enumerate(c.pagination): |
|
22 | 22 | <tr id="sha_${commit.raw_id}" class="changelogRow container ${'tablerow%s' % (cnt%2)}"> |
|
23 | 23 | |
|
24 | 24 | <td class="td-checkbox"> |
|
25 | 25 | ${h.checkbox(commit.raw_id,class_="commit-range")} |
|
26 | 26 | </td> |
|
27 | 27 | <td class="td-status"> |
|
28 | 28 | |
|
29 | 29 | %if c.statuses.get(commit.raw_id): |
|
30 | 30 | <div class="changeset-status-ico"> |
|
31 | 31 | %if c.statuses.get(commit.raw_id)[2]: |
|
32 | 32 | <a class="tooltip" title="${_('Commit status: %s\nClick to open associated pull request #%s') % (h.commit_status_lbl(c.statuses.get(commit.raw_id)[0]), c.statuses.get(commit.raw_id)[2])}" href="${h.route_path('pullrequest_show',repo_name=c.statuses.get(commit.raw_id)[3],pull_request_id=c.statuses.get(commit.raw_id)[2])}"> |
|
33 | 33 | <div class="${'flag_status {}'.format(c.statuses.get(commit.raw_id)[0])}"></div> |
|
34 | 34 | </a> |
|
35 | 35 | %else: |
|
36 | 36 | <a class="tooltip" title="${_('Commit status: {}').format(h.commit_status_lbl(c.statuses.get(commit.raw_id)[0]))}" href="${h.route_path('repo_commit',repo_name=c.repo_name,commit_id=commit.raw_id,_anchor='comment-%s' % c.comments[commit.raw_id][0].comment_id)}"> |
|
37 | 37 | <div class="${'flag_status {}'.format(c.statuses.get(commit.raw_id)[0])}"></div> |
|
38 | 38 | </a> |
|
39 | 39 | %endif |
|
40 | 40 | </div> |
|
41 | 41 | %else: |
|
42 | 42 | <div class="tooltip flag_status not_reviewed" title="${_('Commit status: Not Reviewed')}"></div> |
|
43 | 43 | %endif |
|
44 | 44 | </td> |
|
45 | 45 | <td class="td-comments comments-col"> |
|
46 | 46 | %if c.comments.get(commit.raw_id): |
|
47 | 47 | <a title="${_('Commit has comments')}" href="${h.route_path('repo_commit',repo_name=c.repo_name,commit_id=commit.raw_id,_anchor='comment-%s' % c.comments[commit.raw_id][0].comment_id)}"> |
|
48 | 48 | <i class="icon-comment"></i> ${len(c.comments[commit.raw_id])} |
|
49 | 49 | </a> |
|
50 | 50 | %endif |
|
51 | 51 | </td> |
|
52 | 52 | <td class="td-hash"> |
|
53 | 53 | <code> |
|
54 | 54 | |
|
55 | 55 | <a href="${h.route_path('repo_commit',repo_name=c.repo_name,commit_id=commit.raw_id)}"> |
|
56 | 56 | <span class="${'commit_hash obsolete' if getattr(commit, 'obsolete', None) else 'commit_hash'}">${h.show_id(commit)}</span> |
|
57 | 57 | </a> |
|
58 | 58 | <i class="tooltip icon-clipboard clipboard-action" data-clipboard-text="${commit.raw_id}" title="${_('Copy the full commit id')}"></i> |
|
59 | 59 | </code> |
|
60 | 60 | </td> |
|
61 | 61 | <td class="td-tags tags-col"> |
|
62 | 62 | ## phase |
|
63 | 63 | % if hasattr(commit, 'phase'): |
|
64 | 64 | % if commit.phase != 'public': |
|
65 | 65 | <span class="tag phase-${commit.phase} tooltip" title="${_('Commit phase')}">${commit.phase}</span> |
|
66 | 66 | % endif |
|
67 | 67 | % endif |
|
68 | 68 | |
|
69 | 69 | ## obsolete commits |
|
70 | 70 | % if hasattr(commit, 'obsolete'): |
|
71 | 71 | % if commit.obsolete: |
|
72 | 72 | <span class="tag obsolete-${commit.obsolete} tooltip" title="${_('Evolve State')}">${_('obsolete')}</span> |
|
73 | 73 | % endif |
|
74 | 74 | % endif |
|
75 | 75 | |
|
76 | 76 | ## hidden commits |
|
77 | 77 | % if hasattr(commit, 'hidden'): |
|
78 | 78 | % if commit.hidden: |
|
79 | 79 | <span class="tag obsolete-${commit.hidden} tooltip" title="${_('Evolve State')}">${_('hidden')}</span> |
|
80 | 80 | % endif |
|
81 | 81 | % endif |
|
82 | 82 | </td> |
|
83 | 83 | <td class="td-message expand_commit" data-commit-id="${commit.raw_id}" title="${_('Expand commit message')}" onclick="commitsController.expandCommit(this); return false"> |
|
84 | 84 | <div class="show_more_col"> |
|
85 |
<i class="icon- |
|
|
85 | <i class="icon-expand-linked"></i> | |
|
86 | 86 | </div> |
|
87 | 87 | </td> |
|
88 | 88 | <td class="td-description mid"> |
|
89 | 89 | <div class="log-container truncate-wrap"> |
|
90 | 90 | <div class="message truncate" id="c-${commit.raw_id}">${urlify_commit_message(commit.message, c.repo_name)}</div> |
|
91 | 91 | </div> |
|
92 | 92 | </td> |
|
93 | 93 | |
|
94 | 94 | <td class="td-time"> |
|
95 | 95 | ${h.age_component(commit.date)} |
|
96 | 96 | </td> |
|
97 | 97 | <td class="td-user"> |
|
98 | 98 | ${base.gravatar_with_user(commit.author)} |
|
99 | 99 | </td> |
|
100 | 100 | |
|
101 | 101 | <td class="td-tags tags-col"> |
|
102 | 102 | <div id="t-${commit.raw_id}"> |
|
103 | 103 | |
|
104 | 104 | ## merge |
|
105 | 105 | %if commit.merge: |
|
106 | 106 | <span class="tag mergetag"> |
|
107 | 107 | <i class="icon-merge"></i>${_('merge')} |
|
108 | 108 | </span> |
|
109 | 109 | %endif |
|
110 | 110 | |
|
111 | 111 | ## branch |
|
112 | 112 | %if commit.branch: |
|
113 | 113 | <span class="tag branchtag" title="${h.tooltip(_('Branch %s') % commit.branch)}"> |
|
114 | 114 | <a href="${h.route_path('repo_changelog',repo_name=c.repo_name,_query=dict(branch=commit.branch))}"><i class="icon-code-fork"></i>${h.shorter(commit.branch)}</a> |
|
115 | 115 | </span> |
|
116 | 116 | %endif |
|
117 | 117 | |
|
118 | 118 | ## bookmarks |
|
119 | 119 | %if h.is_hg(c.rhodecode_repo): |
|
120 | 120 | %for book in commit.bookmarks: |
|
121 | 121 | <span class="tag booktag" title="${h.tooltip(_('Bookmark %s') % book)}"> |
|
122 | 122 | <a href="${h.route_path('repo_files:default_path',repo_name=c.repo_name,commit_id=commit.raw_id, _query=dict(at=book))}"><i class="icon-bookmark"></i>${h.shorter(book)}</a> |
|
123 | 123 | </span> |
|
124 | 124 | %endfor |
|
125 | 125 | %endif |
|
126 | 126 | |
|
127 | 127 | ## tags |
|
128 | 128 | %for tag in commit.tags: |
|
129 | 129 | <span class="tag tagtag" title="${h.tooltip(_('Tag %s') % tag)}"> |
|
130 | 130 | <a href="${h.route_path('repo_files:default_path',repo_name=c.repo_name,commit_id=commit.raw_id, _query=dict(at=tag))}"><i class="icon-tag"></i>${h.shorter(tag)}</a> |
|
131 | 131 | </span> |
|
132 | 132 | %endfor |
|
133 | 133 | |
|
134 | 134 | </div> |
|
135 | 135 | </td> |
|
136 | 136 | </tr> |
|
137 | 137 | % endfor |
|
138 | 138 | |
|
139 | 139 | % if c.next_page: |
|
140 | 140 | <tr> |
|
141 | 141 | <td colspan="10" class="load-more-commits"> |
|
142 | 142 | <a class="next-commits" href="#loadNextCommits" onclick="commitsController.loadNext(this, ${c.next_page}, '${c.branch_name}', '${c.commit_id}', '${c.f_path}');return false"> |
|
143 | 143 | ${_('load next')} |
|
144 | 144 | </a> |
|
145 | 145 | </td> |
|
146 | 146 | </tr> |
|
147 | 147 | % endif |
|
148 | 148 | <tr class="chunk-graph-data" style="display:none" |
|
149 | 149 | data-graph='${c.graph_data|n}' |
|
150 | 150 | data-node='${c.prev_page}:${c.next_page}' |
|
151 | 151 | data-commits='${c.graph_commits|n}'> |
|
152 | 152 | </tr> No newline at end of file |
@@ -1,117 +1,117 b'' | |||
|
1 | 1 | ## Changesets table ! |
|
2 | 2 | <%namespace name="base" file="/base/base.mako"/> |
|
3 | 3 | |
|
4 | 4 | %if c.ancestor: |
|
5 | 5 | <div class="ancestor">${_('Common Ancestor Commit')}: |
|
6 | 6 | <a href="${h.route_path('repo_commit', repo_name=c.repo_name, commit_id=c.ancestor)}"> |
|
7 | 7 | ${h.short_id(c.ancestor)} |
|
8 | 8 | </a>. ${_('Compare was calculated based on this shared commit.')} |
|
9 | 9 | <input id="common_ancestor" type="hidden" name="common_ancestor" value="${c.ancestor}"> |
|
10 | 10 | </div> |
|
11 | 11 | %endif |
|
12 | 12 | |
|
13 | 13 | <div class="container"> |
|
14 | 14 | <input type="hidden" name="__start__" value="revisions:sequence"> |
|
15 | 15 | <table class="rctable compare_view_commits"> |
|
16 | 16 | <tr> |
|
17 | 17 | <th>${_('Time')}</th> |
|
18 | 18 | <th>${_('Author')}</th> |
|
19 | 19 | <th>${_('Commit')}</th> |
|
20 | 20 | <th></th> |
|
21 | 21 | <th>${_('Description')}</th> |
|
22 | 22 | </tr> |
|
23 | 23 | ## to speed up lookups cache some functions before the loop |
|
24 | 24 | <% |
|
25 | 25 | active_patterns = h.get_active_pattern_entries(c.repo_name) |
|
26 | 26 | urlify_commit_message = h.partial(h.urlify_commit_message, active_pattern_entries=active_patterns) |
|
27 | 27 | %> |
|
28 | 28 | %for commit in c.commit_ranges: |
|
29 | 29 | <tr id="row-${commit.raw_id}" |
|
30 | 30 | commit_id="${commit.raw_id}" |
|
31 | 31 | class="compare_select" |
|
32 | 32 | style="${'display: none' if c.collapse_all_commits else ''}" |
|
33 | 33 | > |
|
34 | 34 | <td class="td-time"> |
|
35 | 35 | ${h.age_component(commit.date)} |
|
36 | 36 | </td> |
|
37 | 37 | <td class="td-user"> |
|
38 | 38 | ${base.gravatar_with_user(commit.author, 16)} |
|
39 | 39 | </td> |
|
40 | 40 | <td class="td-hash"> |
|
41 | 41 | <code> |
|
42 | 42 | <a href="${h.route_path('repo_commit', repo_name=c.target_repo.repo_name, commit_id=commit.raw_id)}"> |
|
43 | 43 | r${commit.idx}:${h.short_id(commit.raw_id)} |
|
44 | 44 | </a> |
|
45 | 45 | ${h.hidden('revisions',commit.raw_id)} |
|
46 | 46 | </code> |
|
47 | 47 | </td> |
|
48 | 48 | <td class="expand_commit" |
|
49 | 49 | data-commit-id="${commit.raw_id}" |
|
50 | 50 | title="${_( 'Expand commit message')}" |
|
51 | 51 | > |
|
52 | 52 | <div class="show_more_col"> |
|
53 |
<i class="icon- |
|
|
53 | <i class="icon-expand-linked"></i> | |
|
54 | 54 | </div> |
|
55 | 55 | </td> |
|
56 | 56 | <td class="mid td-description"> |
|
57 | 57 | <div class="log-container truncate-wrap"> |
|
58 | 58 | <div |
|
59 | 59 | id="c-${commit.raw_id}" |
|
60 | 60 | class="message truncate" |
|
61 | 61 | data-message-raw="${commit.message}" |
|
62 | 62 | > |
|
63 | 63 | ${urlify_commit_message(commit.message, c.repo_name)} |
|
64 | 64 | </div> |
|
65 | 65 | </div> |
|
66 | 66 | </td> |
|
67 | 67 | </tr> |
|
68 | 68 | %endfor |
|
69 | 69 | <tr class="compare_select_hidden" style="${'' if c.collapse_all_commits else 'display: none'}"> |
|
70 | 70 | <td colspan="5"> |
|
71 | 71 | ${_ungettext('%s commit hidden','%s commits hidden', len(c.commit_ranges)) % len(c.commit_ranges)}, |
|
72 | 72 | <a href="#" onclick="$('.compare_select').show();$('.compare_select_hidden').hide(); return false">${_ungettext('show it','show them', len(c.commit_ranges))}</a> |
|
73 | 73 | </td> |
|
74 | 74 | </tr> |
|
75 | 75 | % if not c.commit_ranges: |
|
76 | 76 | <tr class="compare_select"> |
|
77 | 77 | <td colspan="5"> |
|
78 | 78 | ${_('No commits in this compare')} |
|
79 | 79 | </td> |
|
80 | 80 | </tr> |
|
81 | 81 | % endif |
|
82 | 82 | </table> |
|
83 | 83 | <input type="hidden" name="__end__" value="revisions:sequence"> |
|
84 | 84 | |
|
85 | 85 | </div> |
|
86 | 86 | |
|
87 | 87 | <script> |
|
88 | 88 | $('.expand_commit').on('click',function(e){ |
|
89 | 89 | var target_expand = $(this); |
|
90 | 90 | var cid = target_expand.data('commitId'); |
|
91 | 91 | |
|
92 | 92 | // ## TODO: dan: extract styles into css, and just toggleClass('open') here |
|
93 | 93 | if (target_expand.hasClass('open')){ |
|
94 | 94 | $('#c-'+cid).css({ |
|
95 | 95 | 'height': '1.5em', |
|
96 | 96 | 'white-space': 'nowrap', |
|
97 | 97 | 'text-overflow': 'ellipsis', |
|
98 | 98 | 'overflow':'hidden' |
|
99 | 99 | }); |
|
100 | 100 | target_expand.removeClass('open'); |
|
101 | 101 | } |
|
102 | 102 | else { |
|
103 | 103 | $('#c-'+cid).css({ |
|
104 | 104 | 'height': 'auto', |
|
105 | 105 | 'white-space': 'pre-line', |
|
106 | 106 | 'text-overflow': 'initial', |
|
107 | 107 | 'overflow':'visible' |
|
108 | 108 | }); |
|
109 | 109 | target_expand.addClass('open'); |
|
110 | 110 | } |
|
111 | 111 | }); |
|
112 | 112 | |
|
113 | 113 | $('.compare_select').on('click',function(e){ |
|
114 | 114 | var cid = $(this).attr('commit_id'); |
|
115 | 115 | $('#row-'+cid).toggleClass('hl', !$('#row-'+cid).hasClass('hl')); |
|
116 | 116 | }); |
|
117 | 117 | </script> |
@@ -1,874 +1,874 b'' | |||
|
1 | 1 | <%inherit file="/base/base.mako"/> |
|
2 | 2 | <%namespace name="base" file="/base/base.mako"/> |
|
3 | 3 | <%namespace name="dt" file="/data_table/_dt_elements.mako"/> |
|
4 | 4 | |
|
5 | 5 | <%def name="title()"> |
|
6 | 6 | ${_('%s Pull Request #%s') % (c.repo_name, c.pull_request.pull_request_id)} |
|
7 | 7 | %if c.rhodecode_name: |
|
8 | 8 | · ${h.branding(c.rhodecode_name)} |
|
9 | 9 | %endif |
|
10 | 10 | </%def> |
|
11 | 11 | |
|
12 | 12 | <%def name="breadcrumbs_links()"> |
|
13 | 13 | <span id="pr-title"> |
|
14 | 14 | ${c.pull_request.title} |
|
15 | 15 | %if c.pull_request.is_closed(): |
|
16 | 16 | (${_('Closed')}) |
|
17 | 17 | %endif |
|
18 | 18 | </span> |
|
19 | 19 | <div id="pr-title-edit" class="input" style="display: none;"> |
|
20 | 20 | ${h.text('pullrequest_title', id_="pr-title-input", class_="large", value=c.pull_request.title)} |
|
21 | 21 | </div> |
|
22 | 22 | </%def> |
|
23 | 23 | |
|
24 | 24 | <%def name="menu_bar_nav()"> |
|
25 | 25 | ${self.menu_items(active='repositories')} |
|
26 | 26 | </%def> |
|
27 | 27 | |
|
28 | 28 | <%def name="menu_bar_subnav()"> |
|
29 | 29 | ${self.repo_menu(active='showpullrequest')} |
|
30 | 30 | </%def> |
|
31 | 31 | |
|
32 | 32 | <%def name="main()"> |
|
33 | 33 | |
|
34 | 34 | <script type="text/javascript"> |
|
35 | 35 | // TODO: marcink switch this to pyroutes |
|
36 | 36 | AJAX_COMMENT_DELETE_URL = "${h.route_path('pullrequest_comment_delete',repo_name=c.repo_name,pull_request_id=c.pull_request.pull_request_id,comment_id='__COMMENT_ID__')}"; |
|
37 | 37 | templateContext.pull_request_data.pull_request_id = ${c.pull_request.pull_request_id}; |
|
38 | 38 | </script> |
|
39 | 39 | <div class="box"> |
|
40 | 40 | |
|
41 | 41 | <div class="title"> |
|
42 | 42 | ${self.repo_page_title(c.rhodecode_db_repo)} |
|
43 | 43 | </div> |
|
44 | 44 | |
|
45 | 45 | ${self.breadcrumbs()} |
|
46 | 46 | |
|
47 | 47 | <div class="box pr-summary"> |
|
48 | 48 | |
|
49 | 49 | <div class="summary-details block-left"> |
|
50 | 50 | <% summary = lambda n:{False:'summary-short'}.get(n) %> |
|
51 | 51 | <div class="pr-details-title"> |
|
52 | 52 | <a href="${h.route_path('pull_requests_global', pull_request_id=c.pull_request.pull_request_id)}">${_('Pull request #%s') % c.pull_request.pull_request_id}</a> ${_('From')} ${h.format_date(c.pull_request.created_on)} |
|
53 | 53 | %if c.allowed_to_update: |
|
54 | 54 | <div id="delete_pullrequest" class="pull-right action_button ${'' if c.allowed_to_delete else 'disabled' }" style="clear:inherit;padding: 0"> |
|
55 | 55 | % if c.allowed_to_delete: |
|
56 | 56 | ${h.secure_form(h.route_path('pullrequest_delete', repo_name=c.pull_request.target_repo.repo_name, pull_request_id=c.pull_request.pull_request_id), request=request)} |
|
57 | 57 | ${h.submit('remove_%s' % c.pull_request.pull_request_id, _('Delete'), |
|
58 | 58 | class_="btn btn-link btn-danger no-margin",onclick="return confirm('"+_('Confirm to delete this pull request')+"');")} |
|
59 | 59 | ${h.end_form()} |
|
60 | 60 | % else: |
|
61 | 61 | ${_('Delete')} |
|
62 | 62 | % endif |
|
63 | 63 | </div> |
|
64 | 64 | <div id="open_edit_pullrequest" class="pull-right action_button">${_('Edit')}</div> |
|
65 | 65 | <div id="close_edit_pullrequest" class="pull-right action_button" style="display: none;padding: 0">${_('Cancel')}</div> |
|
66 | 66 | %endif |
|
67 | 67 | </div> |
|
68 | 68 | |
|
69 | 69 | <div id="summary" class="fields pr-details-content"> |
|
70 | 70 | <div class="field"> |
|
71 | 71 | <div class="label-summary"> |
|
72 | 72 | <label>${_('Source')}:</label> |
|
73 | 73 | </div> |
|
74 | 74 | <div class="input"> |
|
75 | 75 | <div class="pr-origininfo"> |
|
76 | 76 | ## branch link is only valid if it is a branch |
|
77 | 77 | <span class="tag"> |
|
78 | 78 | %if c.pull_request.source_ref_parts.type == 'branch': |
|
79 | 79 | <a href="${h.route_path('repo_changelog', repo_name=c.pull_request.source_repo.repo_name, _query=dict(branch=c.pull_request.source_ref_parts.name))}">${c.pull_request.source_ref_parts.type}: ${c.pull_request.source_ref_parts.name}</a> |
|
80 | 80 | %else: |
|
81 | 81 | ${c.pull_request.source_ref_parts.type}: ${c.pull_request.source_ref_parts.name} |
|
82 | 82 | %endif |
|
83 | 83 | </span> |
|
84 | 84 | <span class="clone-url"> |
|
85 | 85 | <a href="${h.route_path('repo_summary', repo_name=c.pull_request.source_repo.repo_name)}">${c.pull_request.source_repo.clone_url()}</a> |
|
86 | 86 | </span> |
|
87 | 87 | <br/> |
|
88 | 88 | % if c.ancestor_commit: |
|
89 | 89 | ${_('Common ancestor')}: |
|
90 | 90 | <code><a href="${h.route_path('repo_commit', repo_name=c.target_repo.repo_name, commit_id=c.ancestor_commit.raw_id)}">${h.show_id(c.ancestor_commit)}</a></code> |
|
91 | 91 | % endif |
|
92 | 92 | </div> |
|
93 | 93 | %if h.is_hg(c.pull_request.source_repo): |
|
94 | 94 | <% clone_url = 'hg pull -r {} {}'.format(h.short_id(c.source_ref), c.pull_request.source_repo.clone_url()) %> |
|
95 | 95 | %elif h.is_git(c.pull_request.source_repo): |
|
96 | 96 | <% clone_url = 'git pull {} {}'.format(c.pull_request.source_repo.clone_url(), c.pull_request.source_ref_parts.name) %> |
|
97 | 97 | %endif |
|
98 | 98 | |
|
99 | 99 | <div class=""> |
|
100 | 100 | <input type="text" class="input-monospace pr-pullinfo" value="${clone_url}" readonly="readonly"> |
|
101 | 101 | <i class="tooltip icon-clipboard clipboard-action pull-right pr-pullinfo-copy" data-clipboard-text="${clone_url}" title="${_('Copy the pull url')}"></i> |
|
102 | 102 | </div> |
|
103 | 103 | |
|
104 | 104 | </div> |
|
105 | 105 | </div> |
|
106 | 106 | <div class="field"> |
|
107 | 107 | <div class="label-summary"> |
|
108 | 108 | <label>${_('Target')}:</label> |
|
109 | 109 | </div> |
|
110 | 110 | <div class="input"> |
|
111 | 111 | <div class="pr-targetinfo"> |
|
112 | 112 | ## branch link is only valid if it is a branch |
|
113 | 113 | <span class="tag"> |
|
114 | 114 | %if c.pull_request.target_ref_parts.type == 'branch': |
|
115 | 115 | <a href="${h.route_path('repo_changelog', repo_name=c.pull_request.target_repo.repo_name, _query=dict(branch=c.pull_request.target_ref_parts.name))}">${c.pull_request.target_ref_parts.type}: ${c.pull_request.target_ref_parts.name}</a> |
|
116 | 116 | %else: |
|
117 | 117 | ${c.pull_request.target_ref_parts.type}: ${c.pull_request.target_ref_parts.name} |
|
118 | 118 | %endif |
|
119 | 119 | </span> |
|
120 | 120 | <span class="clone-url"> |
|
121 | 121 | <a href="${h.route_path('repo_summary', repo_name=c.pull_request.target_repo.repo_name)}">${c.pull_request.target_repo.clone_url()}</a> |
|
122 | 122 | </span> |
|
123 | 123 | </div> |
|
124 | 124 | </div> |
|
125 | 125 | </div> |
|
126 | 126 | |
|
127 | 127 | ## Link to the shadow repository. |
|
128 | 128 | <div class="field"> |
|
129 | 129 | <div class="label-summary"> |
|
130 | 130 | <label>${_('Merge')}:</label> |
|
131 | 131 | </div> |
|
132 | 132 | <div class="input"> |
|
133 | 133 | % if not c.pull_request.is_closed() and c.pull_request.shadow_merge_ref: |
|
134 | 134 | %if h.is_hg(c.pull_request.target_repo): |
|
135 | 135 | <% clone_url = 'hg clone --update {} {} pull-request-{}'.format(c.pull_request.shadow_merge_ref.name, c.shadow_clone_url, c.pull_request.pull_request_id) %> |
|
136 | 136 | %elif h.is_git(c.pull_request.target_repo): |
|
137 | 137 | <% clone_url = 'git clone --branch {} {} pull-request-{}'.format(c.pull_request.shadow_merge_ref.name, c.shadow_clone_url, c.pull_request.pull_request_id) %> |
|
138 | 138 | %endif |
|
139 | 139 | <div class=""> |
|
140 | 140 | <input type="text" class="input-monospace pr-mergeinfo" value="${clone_url}" readonly="readonly"> |
|
141 | 141 | <i class="tooltip icon-clipboard clipboard-action pull-right pr-mergeinfo-copy" data-clipboard-text="${clone_url}" title="${_('Copy the clone url')}"></i> |
|
142 | 142 | </div> |
|
143 | 143 | % else: |
|
144 | 144 | <div class=""> |
|
145 | 145 | ${_('Shadow repository data not available')}. |
|
146 | 146 | </div> |
|
147 | 147 | % endif |
|
148 | 148 | </div> |
|
149 | 149 | </div> |
|
150 | 150 | |
|
151 | 151 | <div class="field"> |
|
152 | 152 | <div class="label-summary"> |
|
153 | 153 | <label>${_('Review')}:</label> |
|
154 | 154 | </div> |
|
155 | 155 | <div class="input"> |
|
156 | 156 | %if c.pull_request_review_status: |
|
157 | 157 | <div class="${'flag_status %s' % c.pull_request_review_status} tooltip pull-left"></div> |
|
158 | 158 | <span class="changeset-status-lbl tooltip"> |
|
159 | 159 | %if c.pull_request.is_closed(): |
|
160 | 160 | ${_('Closed')}, |
|
161 | 161 | %endif |
|
162 | 162 | ${h.commit_status_lbl(c.pull_request_review_status)} |
|
163 | 163 | </span> |
|
164 | 164 | - ${_ungettext('calculated based on %s reviewer vote', 'calculated based on %s reviewers votes', len(c.pull_request_reviewers)) % len(c.pull_request_reviewers)} |
|
165 | 165 | %endif |
|
166 | 166 | </div> |
|
167 | 167 | </div> |
|
168 | 168 | <div class="field"> |
|
169 | 169 | <div class="pr-description-label label-summary" title="${_('Rendered using {} renderer').format(c.renderer)}"> |
|
170 | 170 | <label>${_('Description')}:</label> |
|
171 | 171 | </div> |
|
172 | 172 | <div id="pr-desc" class="input"> |
|
173 | 173 | <div class="pr-description">${h.render(c.pull_request.description, renderer=c.renderer)}</div> |
|
174 | 174 | </div> |
|
175 | 175 | <div id="pr-desc-edit" class="input textarea editor" style="display: none;"> |
|
176 | 176 | <input id="pr-renderer-input" type="hidden" name="description_renderer" value="${c.visual.default_renderer}"> |
|
177 | 177 | ${dt.markup_form('pr-description-input', form_text=c.pull_request.description)} |
|
178 | 178 | </div> |
|
179 | 179 | </div> |
|
180 | 180 | |
|
181 | 181 | <div class="field"> |
|
182 | 182 | <div class="label-summary"> |
|
183 | 183 | <label>${_('Versions')}:</label> |
|
184 | 184 | </div> |
|
185 | 185 | |
|
186 | 186 | <% outdated_comm_count_ver = len(c.inline_versions[None]['outdated']) %> |
|
187 | 187 | <% general_outdated_comm_count_ver = len(c.comment_versions[None]['outdated']) %> |
|
188 | 188 | |
|
189 | 189 | <div class="pr-versions"> |
|
190 | 190 | % if c.show_version_changes: |
|
191 | 191 | <% outdated_comm_count_ver = len(c.inline_versions[c.at_version_num]['outdated']) %> |
|
192 | 192 | <% general_outdated_comm_count_ver = len(c.comment_versions[c.at_version_num]['outdated']) %> |
|
193 | 193 | <a id="show-pr-versions" class="input" onclick="return versionController.toggleVersionView(this)" href="#show-pr-versions" |
|
194 | 194 | data-toggle-on="${_ungettext('{} version available for this pull request, show it.', '{} versions available for this pull request, show them.', len(c.versions)).format(len(c.versions))}" |
|
195 | 195 | data-toggle-off="${_('Hide all versions of this pull request')}"> |
|
196 | 196 | ${_ungettext('{} version available for this pull request, show it.', '{} versions available for this pull request, show them.', len(c.versions)).format(len(c.versions))} |
|
197 | 197 | </a> |
|
198 | 198 | <table> |
|
199 | 199 | ## SHOW ALL VERSIONS OF PR |
|
200 | 200 | <% ver_pr = None %> |
|
201 | 201 | |
|
202 | 202 | % for data in reversed(list(enumerate(c.versions, 1))): |
|
203 | 203 | <% ver_pos = data[0] %> |
|
204 | 204 | <% ver = data[1] %> |
|
205 | 205 | <% ver_pr = ver.pull_request_version_id %> |
|
206 | 206 | <% display_row = '' if c.at_version and (c.at_version_num == ver_pr or c.from_version_num == ver_pr) else 'none' %> |
|
207 | 207 | |
|
208 | 208 | <tr class="version-pr" style="display: ${display_row}"> |
|
209 | 209 | <td> |
|
210 | 210 | <code> |
|
211 | 211 | <a href="${request.current_route_path(_query=dict(version=ver_pr or 'latest'))}">v${ver_pos}</a> |
|
212 | 212 | </code> |
|
213 | 213 | </td> |
|
214 | 214 | <td> |
|
215 | 215 | <input ${'checked="checked"' if c.from_version_num == ver_pr else ''} class="compare-radio-button" type="radio" name="ver_source" value="${ver_pr or 'latest'}" data-ver-pos="${ver_pos}"/> |
|
216 | 216 | <input ${'checked="checked"' if c.at_version_num == ver_pr else ''} class="compare-radio-button" type="radio" name="ver_target" value="${ver_pr or 'latest'}" data-ver-pos="${ver_pos}"/> |
|
217 | 217 | </td> |
|
218 | 218 | <td> |
|
219 | 219 | <% review_status = c.review_versions[ver_pr].status if ver_pr in c.review_versions else 'not_reviewed' %> |
|
220 | 220 | <div class="${'flag_status %s' % review_status} tooltip pull-left" title="${_('Your review status at this version')}"> |
|
221 | 221 | </div> |
|
222 | 222 | </td> |
|
223 | 223 | <td> |
|
224 | 224 | % if c.at_version_num != ver_pr: |
|
225 | 225 | <i class="icon-comment"></i> |
|
226 | 226 | <code class="tooltip" title="${_('Comment from pull request version v{0}, general:{1} inline:{2}').format(ver_pos, len(c.comment_versions[ver_pr]['at']), len(c.inline_versions[ver_pr]['at']))}"> |
|
227 | 227 | G:${len(c.comment_versions[ver_pr]['at'])} / I:${len(c.inline_versions[ver_pr]['at'])} |
|
228 | 228 | </code> |
|
229 | 229 | % endif |
|
230 | 230 | </td> |
|
231 | 231 | <td> |
|
232 | 232 | ##<code>${ver.source_ref_parts.commit_id[:6]}</code> |
|
233 | 233 | </td> |
|
234 | 234 | <td> |
|
235 | 235 | ${h.age_component(ver.updated_on, time_is_local=True)} |
|
236 | 236 | </td> |
|
237 | 237 | </tr> |
|
238 | 238 | % endfor |
|
239 | 239 | |
|
240 | 240 | <tr> |
|
241 | 241 | <td colspan="6"> |
|
242 | 242 | <button id="show-version-diff" onclick="return versionController.showVersionDiff()" class="btn btn-sm" style="display: none" |
|
243 | 243 | data-label-text-locked="${_('select versions to show changes')}" |
|
244 | 244 | data-label-text-diff="${_('show changes between versions')}" |
|
245 | 245 | data-label-text-show="${_('show pull request for this version')}" |
|
246 | 246 | > |
|
247 | 247 | ${_('select versions to show changes')} |
|
248 | 248 | </button> |
|
249 | 249 | </td> |
|
250 | 250 | </tr> |
|
251 | 251 | |
|
252 | 252 | ## show comment/inline comments summary |
|
253 | 253 | <%def name="comments_summary()"> |
|
254 | 254 | <tr> |
|
255 | 255 | <td colspan="6" class="comments-summary-td"> |
|
256 | 256 | |
|
257 | 257 | % if c.at_version: |
|
258 | 258 | <% inline_comm_count_ver = len(c.inline_versions[c.at_version_num]['display']) %> |
|
259 | 259 | <% general_comm_count_ver = len(c.comment_versions[c.at_version_num]['display']) %> |
|
260 | 260 | ${_('Comments at this version')}: |
|
261 | 261 | % else: |
|
262 | 262 | <% inline_comm_count_ver = len(c.inline_versions[c.at_version_num]['until']) %> |
|
263 | 263 | <% general_comm_count_ver = len(c.comment_versions[c.at_version_num]['until']) %> |
|
264 | 264 | ${_('Comments for this pull request')}: |
|
265 | 265 | % endif |
|
266 | 266 | |
|
267 | 267 | |
|
268 | 268 | %if general_comm_count_ver: |
|
269 | 269 | <a href="#comments">${_("%d General ") % general_comm_count_ver}</a> |
|
270 | 270 | %else: |
|
271 | 271 | ${_("%d General ") % general_comm_count_ver} |
|
272 | 272 | %endif |
|
273 | 273 | |
|
274 | 274 | %if inline_comm_count_ver: |
|
275 | 275 | , <a href="#" onclick="return Rhodecode.comments.nextComment();" id="inline-comments-counter">${_("%d Inline") % inline_comm_count_ver}</a> |
|
276 | 276 | %else: |
|
277 | 277 | , ${_("%d Inline") % inline_comm_count_ver} |
|
278 | 278 | %endif |
|
279 | 279 | |
|
280 | 280 | %if outdated_comm_count_ver: |
|
281 | 281 | , <a href="#" onclick="showOutdated(); Rhodecode.comments.nextOutdatedComment(); return false;">${_("%d Outdated") % outdated_comm_count_ver}</a> |
|
282 | 282 | <a href="#" class="showOutdatedComments" onclick="showOutdated(this); return false;"> | ${_('show outdated comments')}</a> |
|
283 | 283 | <a href="#" class="hideOutdatedComments" style="display: none" onclick="hideOutdated(this); return false;"> | ${_('hide outdated comments')}</a> |
|
284 | 284 | %else: |
|
285 | 285 | , ${_("%d Outdated") % outdated_comm_count_ver} |
|
286 | 286 | %endif |
|
287 | 287 | </td> |
|
288 | 288 | </tr> |
|
289 | 289 | </%def> |
|
290 | 290 | ${comments_summary()} |
|
291 | 291 | </table> |
|
292 | 292 | % else: |
|
293 | 293 | <div class="input"> |
|
294 | 294 | ${_('Pull request versions not available')}. |
|
295 | 295 | </div> |
|
296 | 296 | <div> |
|
297 | 297 | <table> |
|
298 | 298 | ${comments_summary()} |
|
299 | 299 | </table> |
|
300 | 300 | </div> |
|
301 | 301 | % endif |
|
302 | 302 | </div> |
|
303 | 303 | </div> |
|
304 | 304 | |
|
305 | 305 | <div id="pr-save" class="field" style="display: none;"> |
|
306 | 306 | <div class="label-summary"></div> |
|
307 | 307 | <div class="input"> |
|
308 | 308 | <span id="edit_pull_request" class="btn btn-small no-margin">${_('Save Changes')}</span> |
|
309 | 309 | </div> |
|
310 | 310 | </div> |
|
311 | 311 | </div> |
|
312 | 312 | </div> |
|
313 | 313 | <div> |
|
314 | 314 | ## AUTHOR |
|
315 | 315 | <div class="reviewers-title block-right"> |
|
316 | 316 | <div class="pr-details-title"> |
|
317 | 317 | ${_('Author of this pull request')} |
|
318 | 318 | </div> |
|
319 | 319 | </div> |
|
320 | 320 | <div class="block-right pr-details-content reviewers"> |
|
321 | 321 | <ul class="group_members"> |
|
322 | 322 | <li> |
|
323 | 323 | ${self.gravatar_with_user(c.pull_request.author.email, 16)} |
|
324 | 324 | </li> |
|
325 | 325 | </ul> |
|
326 | 326 | </div> |
|
327 | 327 | |
|
328 | 328 | ## REVIEW RULES |
|
329 | 329 | <div id="review_rules" style="display: none" class="reviewers-title block-right"> |
|
330 | 330 | <div class="pr-details-title"> |
|
331 | 331 | ${_('Reviewer rules')} |
|
332 | 332 | %if c.allowed_to_update: |
|
333 | 333 | <span id="close_edit_reviewers" class="block-right action_button last-item" style="display: none;">${_('Close')}</span> |
|
334 | 334 | %endif |
|
335 | 335 | </div> |
|
336 | 336 | <div class="pr-reviewer-rules"> |
|
337 | 337 | ## review rules will be appended here, by default reviewers logic |
|
338 | 338 | </div> |
|
339 | 339 | <input id="review_data" type="hidden" name="review_data" value=""> |
|
340 | 340 | </div> |
|
341 | 341 | |
|
342 | 342 | ## REVIEWERS |
|
343 | 343 | <div class="reviewers-title block-right"> |
|
344 | 344 | <div class="pr-details-title"> |
|
345 | 345 | ${_('Pull request reviewers')} |
|
346 | 346 | %if c.allowed_to_update: |
|
347 | 347 | <span id="open_edit_reviewers" class="block-right action_button last-item">${_('Edit')}</span> |
|
348 | 348 | %endif |
|
349 | 349 | </div> |
|
350 | 350 | </div> |
|
351 | 351 | <div id="reviewers" class="block-right pr-details-content reviewers"> |
|
352 | 352 | |
|
353 | 353 | ## members redering block |
|
354 | 354 | <input type="hidden" name="__start__" value="review_members:sequence"> |
|
355 | 355 | <ul id="review_members" class="group_members"> |
|
356 | 356 | |
|
357 | 357 | % for review_obj, member, reasons, mandatory, status in c.pull_request_reviewers: |
|
358 | 358 | <script> |
|
359 | 359 | var member = ${h.json.dumps(h.reviewer_as_json(member, reasons=reasons, mandatory=mandatory, user_group=review_obj.rule_user_group_data()))|n}; |
|
360 | 360 | var status = "${(status[0][1].status if status else 'not_reviewed')}"; |
|
361 | 361 | var status_lbl = "${h.commit_status_lbl(status[0][1].status if status else 'not_reviewed')}"; |
|
362 | 362 | var allowed_to_update = ${h.json.dumps(c.allowed_to_update)}; |
|
363 | 363 | |
|
364 | 364 | var entry = renderTemplate('reviewMemberEntry', { |
|
365 | 365 | 'member': member, |
|
366 | 366 | 'mandatory': member.mandatory, |
|
367 | 367 | 'reasons': member.reasons, |
|
368 | 368 | 'allowed_to_update': allowed_to_update, |
|
369 | 369 | 'review_status': status, |
|
370 | 370 | 'review_status_label': status_lbl, |
|
371 | 371 | 'user_group': member.user_group, |
|
372 | 372 | 'create': false |
|
373 | 373 | }); |
|
374 | 374 | $('#review_members').append(entry) |
|
375 | 375 | </script> |
|
376 | 376 | |
|
377 | 377 | % endfor |
|
378 | 378 | |
|
379 | 379 | </ul> |
|
380 | 380 | <input type="hidden" name="__end__" value="review_members:sequence"> |
|
381 | 381 | ## end members redering block |
|
382 | 382 | |
|
383 | 383 | %if not c.pull_request.is_closed(): |
|
384 | 384 | <div id="add_reviewer" class="ac" style="display: none;"> |
|
385 | 385 | %if c.allowed_to_update: |
|
386 | 386 | % if not c.forbid_adding_reviewers: |
|
387 | 387 | <div id="add_reviewer_input" class="reviewer_ac"> |
|
388 | 388 | ${h.text('user', class_='ac-input', placeholder=_('Add reviewer or reviewer group'))} |
|
389 | 389 | <div id="reviewers_container"></div> |
|
390 | 390 | </div> |
|
391 | 391 | % endif |
|
392 | 392 | <div class="pull-right"> |
|
393 | 393 | <button id="update_pull_request" class="btn btn-small no-margin">${_('Save Changes')}</button> |
|
394 | 394 | </div> |
|
395 | 395 | %endif |
|
396 | 396 | </div> |
|
397 | 397 | %endif |
|
398 | 398 | </div> |
|
399 | 399 | </div> |
|
400 | 400 | </div> |
|
401 | 401 | <div class="box"> |
|
402 | 402 | ##DIFF |
|
403 | 403 | <div class="table" > |
|
404 | 404 | <div id="changeset_compare_view_content"> |
|
405 | 405 | ##CS |
|
406 | 406 | % if c.missing_requirements: |
|
407 | 407 | <div class="box"> |
|
408 | 408 | <div class="alert alert-warning"> |
|
409 | 409 | <div> |
|
410 | 410 | <strong>${_('Missing requirements:')}</strong> |
|
411 | 411 | ${_('These commits cannot be displayed, because this repository uses the Mercurial largefiles extension, which was not enabled.')} |
|
412 | 412 | </div> |
|
413 | 413 | </div> |
|
414 | 414 | </div> |
|
415 | 415 | % elif c.missing_commits: |
|
416 | 416 | <div class="box"> |
|
417 | 417 | <div class="alert alert-warning"> |
|
418 | 418 | <div> |
|
419 | 419 | <strong>${_('Missing commits')}:</strong> |
|
420 | 420 | ${_('This pull request cannot be displayed, because one or more commits no longer exist in the source repository.')} |
|
421 | 421 | ${_('Please update this pull request, push the commits back into the source repository, or consider closing this pull request.')} |
|
422 | 422 | ${_('Consider doing a {force_refresh_url} in case you think this is an error.').format(force_refresh_url=h.link_to('force refresh', h.current_route_path(request, force_refresh='1')))|n} |
|
423 | 423 | </div> |
|
424 | 424 | </div> |
|
425 | 425 | </div> |
|
426 | 426 | % endif |
|
427 | 427 | |
|
428 | 428 | <div class="compare_view_commits_title"> |
|
429 | 429 | % if not c.compare_mode: |
|
430 | 430 | |
|
431 | 431 | % if c.at_version_pos: |
|
432 | 432 | <h4> |
|
433 | 433 | ${_('Showing changes at v%d, commenting is disabled.') % c.at_version_pos} |
|
434 | 434 | </h4> |
|
435 | 435 | % endif |
|
436 | 436 | |
|
437 | 437 | <div class="pull-left"> |
|
438 | 438 | <div class="btn-group"> |
|
439 | 439 | <a |
|
440 | 440 | class="btn" |
|
441 | 441 | href="#" |
|
442 | 442 | onclick="$('.compare_select').show();$('.compare_select_hidden').hide(); return false"> |
|
443 | 443 | ${_ungettext('Expand %s commit','Expand %s commits', len(c.commit_ranges)) % len(c.commit_ranges)} |
|
444 | 444 | </a> |
|
445 | 445 | <a |
|
446 | 446 | class="btn" |
|
447 | 447 | href="#" |
|
448 | 448 | onclick="$('.compare_select').hide();$('.compare_select_hidden').show(); return false"> |
|
449 | 449 | ${_ungettext('Collapse %s commit','Collapse %s commits', len(c.commit_ranges)) % len(c.commit_ranges)} |
|
450 | 450 | </a> |
|
451 | 451 | </div> |
|
452 | 452 | </div> |
|
453 | 453 | |
|
454 | 454 | <div class="pull-right"> |
|
455 | 455 | % if c.allowed_to_update and not c.pull_request.is_closed(): |
|
456 | 456 | <a id="update_commits" class="btn btn-primary no-margin pull-right">${_('Update commits')}</a> |
|
457 | 457 | % else: |
|
458 | 458 | <a class="tooltip btn disabled pull-right" disabled="disabled" title="${_('Update is disabled for current view')}">${_('Update commits')}</a> |
|
459 | 459 | % endif |
|
460 | 460 | |
|
461 | 461 | </div> |
|
462 | 462 | % endif |
|
463 | 463 | </div> |
|
464 | 464 | |
|
465 | 465 | % if not c.missing_commits: |
|
466 | 466 | % if c.compare_mode: |
|
467 | 467 | % if c.at_version: |
|
468 | 468 | <h4> |
|
469 | 469 | ${_('Commits and changes between v{ver_from} and {ver_to} of this pull request, commenting is disabled').format(ver_from=c.from_version_pos, ver_to=c.at_version_pos if c.at_version_pos else 'latest')}: |
|
470 | 470 | </h4> |
|
471 | 471 | |
|
472 | 472 | <div class="subtitle-compare"> |
|
473 | 473 | ${_('commits added: {}, removed: {}').format(len(c.commit_changes_summary.added), len(c.commit_changes_summary.removed))} |
|
474 | 474 | </div> |
|
475 | 475 | |
|
476 | 476 | <div class="container"> |
|
477 | 477 | <table class="rctable compare_view_commits"> |
|
478 | 478 | <tr> |
|
479 | 479 | <th></th> |
|
480 | 480 | <th>${_('Time')}</th> |
|
481 | 481 | <th>${_('Author')}</th> |
|
482 | 482 | <th>${_('Commit')}</th> |
|
483 | 483 | <th></th> |
|
484 | 484 | <th>${_('Description')}</th> |
|
485 | 485 | </tr> |
|
486 | 486 | |
|
487 | 487 | % for c_type, commit in c.commit_changes: |
|
488 | 488 | % if c_type in ['a', 'r']: |
|
489 | 489 | <% |
|
490 | 490 | if c_type == 'a': |
|
491 | 491 | cc_title = _('Commit added in displayed changes') |
|
492 | 492 | elif c_type == 'r': |
|
493 | 493 | cc_title = _('Commit removed in displayed changes') |
|
494 | 494 | else: |
|
495 | 495 | cc_title = '' |
|
496 | 496 | %> |
|
497 | 497 | <tr id="row-${commit.raw_id}" commit_id="${commit.raw_id}" class="compare_select"> |
|
498 | 498 | <td> |
|
499 | 499 | <div class="commit-change-indicator color-${c_type}-border"> |
|
500 | 500 | <div class="commit-change-content color-${c_type} tooltip" title="${h.tooltip(cc_title)}"> |
|
501 | 501 | ${c_type.upper()} |
|
502 | 502 | </div> |
|
503 | 503 | </div> |
|
504 | 504 | </td> |
|
505 | 505 | <td class="td-time"> |
|
506 | 506 | ${h.age_component(commit.date)} |
|
507 | 507 | </td> |
|
508 | 508 | <td class="td-user"> |
|
509 | 509 | ${base.gravatar_with_user(commit.author, 16)} |
|
510 | 510 | </td> |
|
511 | 511 | <td class="td-hash"> |
|
512 | 512 | <code> |
|
513 | 513 | <a href="${h.route_path('repo_commit', repo_name=c.target_repo.repo_name, commit_id=commit.raw_id)}"> |
|
514 | 514 | r${commit.idx}:${h.short_id(commit.raw_id)} |
|
515 | 515 | </a> |
|
516 | 516 | ${h.hidden('revisions', commit.raw_id)} |
|
517 | 517 | </code> |
|
518 | 518 | </td> |
|
519 | 519 | <td class="expand_commit" data-commit-id="${commit.raw_id}" title="${_( 'Expand commit message')}"> |
|
520 | 520 | <div class="show_more_col"> |
|
521 |
<i class="icon- |
|
|
521 | <i class="icon-expand-linked"></i> | |
|
522 | 522 | </div> |
|
523 | 523 | </td> |
|
524 | 524 | <td class="mid td-description"> |
|
525 | 525 | <div class="log-container truncate-wrap"> |
|
526 | 526 | <div class="message truncate" id="c-${commit.raw_id}" data-message-raw="${commit.message}"> |
|
527 | 527 | ${h.urlify_commit_message(commit.message, c.repo_name)} |
|
528 | 528 | </div> |
|
529 | 529 | </div> |
|
530 | 530 | </td> |
|
531 | 531 | </tr> |
|
532 | 532 | % endif |
|
533 | 533 | % endfor |
|
534 | 534 | </table> |
|
535 | 535 | </div> |
|
536 | 536 | |
|
537 | 537 | <script> |
|
538 | 538 | $('.expand_commit').on('click',function(e){ |
|
539 | 539 | var target_expand = $(this); |
|
540 | 540 | var cid = target_expand.data('commitId'); |
|
541 | 541 | |
|
542 | 542 | if (target_expand.hasClass('open')){ |
|
543 | 543 | $('#c-'+cid).css({ |
|
544 | 544 | 'height': '1.5em', |
|
545 | 545 | 'white-space': 'nowrap', |
|
546 | 546 | 'text-overflow': 'ellipsis', |
|
547 | 547 | 'overflow':'hidden' |
|
548 | 548 | }); |
|
549 | 549 | target_expand.removeClass('open'); |
|
550 | 550 | } |
|
551 | 551 | else { |
|
552 | 552 | $('#c-'+cid).css({ |
|
553 | 553 | 'height': 'auto', |
|
554 | 554 | 'white-space': 'pre-line', |
|
555 | 555 | 'text-overflow': 'initial', |
|
556 | 556 | 'overflow':'visible' |
|
557 | 557 | }); |
|
558 | 558 | target_expand.addClass('open'); |
|
559 | 559 | } |
|
560 | 560 | }); |
|
561 | 561 | </script> |
|
562 | 562 | |
|
563 | 563 | % endif |
|
564 | 564 | |
|
565 | 565 | % else: |
|
566 | 566 | <%include file="/compare/compare_commits.mako" /> |
|
567 | 567 | % endif |
|
568 | 568 | |
|
569 | 569 | <div class="cs_files"> |
|
570 | 570 | <%namespace name="cbdiffs" file="/codeblocks/diffs.mako"/> |
|
571 | 571 | |
|
572 | 572 | ${cbdiffs.render_diffset_menu(c.diffset, range_diff_on=c.range_diff_on)} |
|
573 | 573 | |
|
574 | 574 | % if c.range_diff_on: |
|
575 | 575 | % for commit in c.commit_ranges: |
|
576 | 576 | ${cbdiffs.render_diffset( |
|
577 | 577 | c.changes[commit.raw_id], |
|
578 | 578 | commit=commit, use_comments=True, |
|
579 | 579 | collapse_when_files_over=5, |
|
580 | 580 | disable_new_comments=True, |
|
581 | 581 | deleted_files_comments=c.deleted_files_comments, |
|
582 | 582 | inline_comments=c.inline_comments)} |
|
583 | 583 | % endfor |
|
584 | 584 | % else: |
|
585 | 585 | ${cbdiffs.render_diffset( |
|
586 | 586 | c.diffset, use_comments=True, |
|
587 | 587 | collapse_when_files_over=30, |
|
588 | 588 | disable_new_comments=not c.allowed_to_comment, |
|
589 | 589 | deleted_files_comments=c.deleted_files_comments, |
|
590 | 590 | inline_comments=c.inline_comments)} |
|
591 | 591 | % endif |
|
592 | 592 | |
|
593 | 593 | </div> |
|
594 | 594 | % else: |
|
595 | 595 | ## skipping commits we need to clear the view for missing commits |
|
596 | 596 | <div style="clear:both;"></div> |
|
597 | 597 | % endif |
|
598 | 598 | |
|
599 | 599 | </div> |
|
600 | 600 | </div> |
|
601 | 601 | |
|
602 | 602 | ## template for inline comment form |
|
603 | 603 | <%namespace name="comment" file="/changeset/changeset_file_comment.mako"/> |
|
604 | 604 | |
|
605 | 605 | ## render general comments |
|
606 | 606 | |
|
607 | 607 | <div id="comment-tr-show"> |
|
608 | 608 | <div class="comment"> |
|
609 | 609 | % if general_outdated_comm_count_ver: |
|
610 | 610 | <div class="meta"> |
|
611 | 611 | % if general_outdated_comm_count_ver == 1: |
|
612 | 612 | ${_('there is {num} general comment from older versions').format(num=general_outdated_comm_count_ver)}, |
|
613 | 613 | <a href="#show-hidden-comments" onclick="$('.comment-general.comment-outdated').show(); $(this).parent().hide(); return false;">${_('show it')}</a> |
|
614 | 614 | % else: |
|
615 | 615 | ${_('there are {num} general comments from older versions').format(num=general_outdated_comm_count_ver)}, |
|
616 | 616 | <a href="#show-hidden-comments" onclick="$('.comment-general.comment-outdated').show(); $(this).parent().hide(); return false;">${_('show them')}</a> |
|
617 | 617 | % endif |
|
618 | 618 | </div> |
|
619 | 619 | % endif |
|
620 | 620 | </div> |
|
621 | 621 | </div> |
|
622 | 622 | |
|
623 | 623 | ${comment.generate_comments(c.comments, include_pull_request=True, is_pull_request=True)} |
|
624 | 624 | |
|
625 | 625 | % if not c.pull_request.is_closed(): |
|
626 | 626 | ## merge status, and merge action |
|
627 | 627 | <div class="pull-request-merge"> |
|
628 | 628 | <%include file="/pullrequests/pullrequest_merge_checks.mako"/> |
|
629 | 629 | </div> |
|
630 | 630 | |
|
631 | 631 | ## main comment form and it status |
|
632 | 632 | ${comment.comments(h.route_path('pullrequest_comment_create', repo_name=c.repo_name, |
|
633 | 633 | pull_request_id=c.pull_request.pull_request_id), |
|
634 | 634 | c.pull_request_review_status, |
|
635 | 635 | is_pull_request=True, change_status=c.allowed_to_change_status)} |
|
636 | 636 | %endif |
|
637 | 637 | |
|
638 | 638 | <script type="text/javascript"> |
|
639 | 639 | if (location.hash) { |
|
640 | 640 | var result = splitDelimitedHash(location.hash); |
|
641 | 641 | var line = $('html').find(result.loc); |
|
642 | 642 | // show hidden comments if we use location.hash |
|
643 | 643 | if (line.hasClass('comment-general')) { |
|
644 | 644 | $(line).show(); |
|
645 | 645 | } else if (line.hasClass('comment-inline')) { |
|
646 | 646 | $(line).show(); |
|
647 | 647 | var $cb = $(line).closest('.cb'); |
|
648 | 648 | $cb.removeClass('cb-collapsed') |
|
649 | 649 | } |
|
650 | 650 | if (line.length > 0){ |
|
651 | 651 | offsetScroll(line, 70); |
|
652 | 652 | } |
|
653 | 653 | } |
|
654 | 654 | |
|
655 | 655 | versionController = new VersionController(); |
|
656 | 656 | versionController.init(); |
|
657 | 657 | |
|
658 | 658 | reviewersController = new ReviewersController(); |
|
659 | 659 | |
|
660 | 660 | $(function(){ |
|
661 | 661 | |
|
662 | 662 | // custom code mirror |
|
663 | 663 | var codeMirrorInstance = $('#pr-description-input').get(0).MarkupForm.cm; |
|
664 | 664 | |
|
665 | 665 | var PRDetails = { |
|
666 | 666 | editButton: $('#open_edit_pullrequest'), |
|
667 | 667 | closeButton: $('#close_edit_pullrequest'), |
|
668 | 668 | deleteButton: $('#delete_pullrequest'), |
|
669 | 669 | viewFields: $('#pr-desc, #pr-title'), |
|
670 | 670 | editFields: $('#pr-desc-edit, #pr-title-edit, #pr-save'), |
|
671 | 671 | |
|
672 | 672 | init: function() { |
|
673 | 673 | var that = this; |
|
674 | 674 | this.editButton.on('click', function(e) { that.edit(); }); |
|
675 | 675 | this.closeButton.on('click', function(e) { that.view(); }); |
|
676 | 676 | }, |
|
677 | 677 | |
|
678 | 678 | edit: function(event) { |
|
679 | 679 | this.viewFields.hide(); |
|
680 | 680 | this.editButton.hide(); |
|
681 | 681 | this.deleteButton.hide(); |
|
682 | 682 | this.closeButton.show(); |
|
683 | 683 | this.editFields.show(); |
|
684 | 684 | codeMirrorInstance.refresh(); |
|
685 | 685 | }, |
|
686 | 686 | |
|
687 | 687 | view: function(event) { |
|
688 | 688 | this.editButton.show(); |
|
689 | 689 | this.deleteButton.show(); |
|
690 | 690 | this.editFields.hide(); |
|
691 | 691 | this.closeButton.hide(); |
|
692 | 692 | this.viewFields.show(); |
|
693 | 693 | } |
|
694 | 694 | }; |
|
695 | 695 | |
|
696 | 696 | var ReviewersPanel = { |
|
697 | 697 | editButton: $('#open_edit_reviewers'), |
|
698 | 698 | closeButton: $('#close_edit_reviewers'), |
|
699 | 699 | addButton: $('#add_reviewer'), |
|
700 | 700 | removeButtons: $('.reviewer_member_remove,.reviewer_member_mandatory_remove'), |
|
701 | 701 | |
|
702 | 702 | init: function() { |
|
703 | 703 | var self = this; |
|
704 | 704 | this.editButton.on('click', function(e) { self.edit(); }); |
|
705 | 705 | this.closeButton.on('click', function(e) { self.close(); }); |
|
706 | 706 | }, |
|
707 | 707 | |
|
708 | 708 | edit: function(event) { |
|
709 | 709 | this.editButton.hide(); |
|
710 | 710 | this.closeButton.show(); |
|
711 | 711 | this.addButton.show(); |
|
712 | 712 | this.removeButtons.css('visibility', 'visible'); |
|
713 | 713 | // review rules |
|
714 | 714 | reviewersController.loadReviewRules( |
|
715 | 715 | ${c.pull_request.reviewer_data_json | n}); |
|
716 | 716 | }, |
|
717 | 717 | |
|
718 | 718 | close: function(event) { |
|
719 | 719 | this.editButton.show(); |
|
720 | 720 | this.closeButton.hide(); |
|
721 | 721 | this.addButton.hide(); |
|
722 | 722 | this.removeButtons.css('visibility', 'hidden'); |
|
723 | 723 | // hide review rules |
|
724 | 724 | reviewersController.hideReviewRules() |
|
725 | 725 | } |
|
726 | 726 | }; |
|
727 | 727 | |
|
728 | 728 | PRDetails.init(); |
|
729 | 729 | ReviewersPanel.init(); |
|
730 | 730 | |
|
731 | 731 | showOutdated = function(self){ |
|
732 | 732 | $('.comment-inline.comment-outdated').show(); |
|
733 | 733 | $('.filediff-outdated').show(); |
|
734 | 734 | $('.showOutdatedComments').hide(); |
|
735 | 735 | $('.hideOutdatedComments').show(); |
|
736 | 736 | }; |
|
737 | 737 | |
|
738 | 738 | hideOutdated = function(self){ |
|
739 | 739 | $('.comment-inline.comment-outdated').hide(); |
|
740 | 740 | $('.filediff-outdated').hide(); |
|
741 | 741 | $('.hideOutdatedComments').hide(); |
|
742 | 742 | $('.showOutdatedComments').show(); |
|
743 | 743 | }; |
|
744 | 744 | |
|
745 | 745 | refreshMergeChecks = function(){ |
|
746 | 746 | var loadUrl = "${request.current_route_path(_query=dict(merge_checks=1))}"; |
|
747 | 747 | $('.pull-request-merge').css('opacity', 0.3); |
|
748 | 748 | $('.action-buttons-extra').css('opacity', 0.3); |
|
749 | 749 | |
|
750 | 750 | $('.pull-request-merge').load( |
|
751 | 751 | loadUrl, function() { |
|
752 | 752 | $('.pull-request-merge').css('opacity', 1); |
|
753 | 753 | |
|
754 | 754 | $('.action-buttons-extra').css('opacity', 1); |
|
755 | 755 | injectCloseAction(); |
|
756 | 756 | } |
|
757 | 757 | ); |
|
758 | 758 | }; |
|
759 | 759 | |
|
760 | 760 | injectCloseAction = function() { |
|
761 | 761 | var closeAction = $('#close-pull-request-action').html(); |
|
762 | 762 | var $actionButtons = $('.action-buttons-extra'); |
|
763 | 763 | // clear the action before |
|
764 | 764 | $actionButtons.html(""); |
|
765 | 765 | $actionButtons.html(closeAction); |
|
766 | 766 | }; |
|
767 | 767 | |
|
768 | 768 | closePullRequest = function (status) { |
|
769 | 769 | // inject closing flag |
|
770 | 770 | $('.action-buttons-extra').append('<input type="hidden" class="close-pr-input" id="close_pull_request" value="1">'); |
|
771 | 771 | $(generalCommentForm.statusChange).select2("val", status).trigger('change'); |
|
772 | 772 | $(generalCommentForm.submitForm).submit(); |
|
773 | 773 | }; |
|
774 | 774 | |
|
775 | 775 | $('#show-outdated-comments').on('click', function(e){ |
|
776 | 776 | var button = $(this); |
|
777 | 777 | var outdated = $('.comment-outdated'); |
|
778 | 778 | |
|
779 | 779 | if (button.html() === "(Show)") { |
|
780 | 780 | button.html("(Hide)"); |
|
781 | 781 | outdated.show(); |
|
782 | 782 | } else { |
|
783 | 783 | button.html("(Show)"); |
|
784 | 784 | outdated.hide(); |
|
785 | 785 | } |
|
786 | 786 | }); |
|
787 | 787 | |
|
788 | 788 | $('.show-inline-comments').on('change', function(e){ |
|
789 | 789 | var show = 'none'; |
|
790 | 790 | var target = e.currentTarget; |
|
791 | 791 | if(target.checked){ |
|
792 | 792 | show = '' |
|
793 | 793 | } |
|
794 | 794 | var boxid = $(target).attr('id_for'); |
|
795 | 795 | var comments = $('#{0} .inline-comments'.format(boxid)); |
|
796 | 796 | var fn_display = function(idx){ |
|
797 | 797 | $(this).css('display', show); |
|
798 | 798 | }; |
|
799 | 799 | $(comments).each(fn_display); |
|
800 | 800 | var btns = $('#{0} .inline-comments-button'.format(boxid)); |
|
801 | 801 | $(btns).each(fn_display); |
|
802 | 802 | }); |
|
803 | 803 | |
|
804 | 804 | $('#merge_pull_request_form').submit(function() { |
|
805 | 805 | if (!$('#merge_pull_request').attr('disabled')) { |
|
806 | 806 | $('#merge_pull_request').attr('disabled', 'disabled'); |
|
807 | 807 | } |
|
808 | 808 | return true; |
|
809 | 809 | }); |
|
810 | 810 | |
|
811 | 811 | $('#edit_pull_request').on('click', function(e){ |
|
812 | 812 | var title = $('#pr-title-input').val(); |
|
813 | 813 | var description = codeMirrorInstance.getValue(); |
|
814 | 814 | var renderer = $('#pr-renderer-input').val(); |
|
815 | 815 | editPullRequest( |
|
816 | 816 | "${c.repo_name}", "${c.pull_request.pull_request_id}", |
|
817 | 817 | title, description, renderer); |
|
818 | 818 | }); |
|
819 | 819 | |
|
820 | 820 | $('#update_pull_request').on('click', function(e){ |
|
821 | 821 | $(this).attr('disabled', 'disabled'); |
|
822 | 822 | $(this).addClass('disabled'); |
|
823 | 823 | $(this).html(_gettext('Saving...')); |
|
824 | 824 | reviewersController.updateReviewers( |
|
825 | 825 | "${c.repo_name}", "${c.pull_request.pull_request_id}"); |
|
826 | 826 | }); |
|
827 | 827 | |
|
828 | 828 | $('#update_commits').on('click', function(e){ |
|
829 | 829 | var isDisabled = !$(e.currentTarget).attr('disabled'); |
|
830 | 830 | $(e.currentTarget).attr('disabled', 'disabled'); |
|
831 | 831 | $(e.currentTarget).addClass('disabled'); |
|
832 | 832 | $(e.currentTarget).removeClass('btn-primary'); |
|
833 | 833 | $(e.currentTarget).text(_gettext('Updating...')); |
|
834 | 834 | if(isDisabled){ |
|
835 | 835 | updateCommits( |
|
836 | 836 | "${c.repo_name}", "${c.pull_request.pull_request_id}"); |
|
837 | 837 | } |
|
838 | 838 | }); |
|
839 | 839 | // fixing issue with caches on firefox |
|
840 | 840 | $('#update_commits').removeAttr("disabled"); |
|
841 | 841 | |
|
842 | 842 | $('.show-inline-comments').on('click', function(e){ |
|
843 | 843 | var boxid = $(this).attr('data-comment-id'); |
|
844 | 844 | var button = $(this); |
|
845 | 845 | |
|
846 | 846 | if(button.hasClass("comments-visible")) { |
|
847 | 847 | $('#{0} .inline-comments'.format(boxid)).each(function(index){ |
|
848 | 848 | $(this).hide(); |
|
849 | 849 | }); |
|
850 | 850 | button.removeClass("comments-visible"); |
|
851 | 851 | } else { |
|
852 | 852 | $('#{0} .inline-comments'.format(boxid)).each(function(index){ |
|
853 | 853 | $(this).show(); |
|
854 | 854 | }); |
|
855 | 855 | button.addClass("comments-visible"); |
|
856 | 856 | } |
|
857 | 857 | }); |
|
858 | 858 | |
|
859 | 859 | // register submit callback on commentForm form to track TODOs |
|
860 | 860 | window.commentFormGlobalSubmitSuccessCallback = function(){ |
|
861 | 861 | refreshMergeChecks(); |
|
862 | 862 | }; |
|
863 | 863 | // initial injection |
|
864 | 864 | injectCloseAction(); |
|
865 | 865 | |
|
866 | 866 | ReviewerAutoComplete('#user'); |
|
867 | 867 | |
|
868 | 868 | }) |
|
869 | 869 | </script> |
|
870 | 870 | |
|
871 | 871 | </div> |
|
872 | 872 | </div> |
|
873 | 873 | |
|
874 | 874 | </%def> |
@@ -1,82 +1,82 b'' | |||
|
1 | 1 | <%namespace name="base" file="/base/base.mako"/> |
|
2 | 2 | |
|
3 | 3 | <table class="rctable search-results"> |
|
4 | 4 | <tr> |
|
5 | 5 | <th>${_('Repository')}</th> |
|
6 | 6 | <th>${_('Commit')}</th> |
|
7 | 7 | <th></th> |
|
8 | 8 | <th>${_('Commit message')}</th> |
|
9 | 9 | <th> |
|
10 | 10 | %if c.sort == 'newfirst': |
|
11 | 11 | <a href="${c.url_generator(sort='oldfirst')}">${_('Age (new first)')}</a> |
|
12 | 12 | %else: |
|
13 | 13 | <a href="${c.url_generator(sort='newfirst')}">${_('Age (old first)')}</a> |
|
14 | 14 | %endif |
|
15 | 15 | </th> |
|
16 | 16 | <th>${_('Author')}</th> |
|
17 | 17 | </tr> |
|
18 | 18 | %for entry in c.formatted_results: |
|
19 | 19 | ## search results are additionally filtered, and this check is just a safe gate |
|
20 | 20 | % if h.HasRepoPermissionAny('repository.write','repository.read','repository.admin')(entry['repository'], 'search results commit check'): |
|
21 | 21 | <tr class="body"> |
|
22 | 22 | <td class="td-componentname"> |
|
23 | 23 | %if h.get_repo_type_by_name(entry.get('repository')) == 'hg': |
|
24 | 24 | <i class="icon-hg"></i> |
|
25 | 25 | %elif h.get_repo_type_by_name(entry.get('repository')) == 'git': |
|
26 | 26 | <i class="icon-git"></i> |
|
27 | 27 | %elif h.get_repo_type_by_name(entry.get('repository')) == 'svn': |
|
28 | 28 | <i class="icon-svn"></i> |
|
29 | 29 | %endif |
|
30 | 30 | ${h.link_to(entry['repository'], h.route_path('repo_summary',repo_name=entry['repository']))} |
|
31 | 31 | </td> |
|
32 | 32 | <td class="td-commit"> |
|
33 | 33 | ${h.link_to(h._shorten_commit_id(entry['commit_id']), |
|
34 | 34 | h.route_path('repo_commit',repo_name=entry['repository'],commit_id=entry['commit_id']))} |
|
35 | 35 | </td> |
|
36 | 36 | <td class="td-message expand_commit search open" data-commit-id="${h.md5_safe(entry['repository'])+entry['commit_id']}" id="t-${h.md5_safe(entry['repository'])+entry['commit_id']}" title="${_('Expand commit message')}"> |
|
37 | 37 | <div class="show_more_col"> |
|
38 |
<i class="icon- |
|
|
38 | <i class="icon-expand-linked"></i> | |
|
39 | 39 | </div> |
|
40 | 40 | </td> |
|
41 | 41 | <td data-commit-id="${h.md5_safe(entry['repository'])+entry['commit_id']}" id="c-${h.md5_safe(entry['repository'])+entry['commit_id']}" class="message td-description open"> |
|
42 | 42 | %if entry.get('message_hl'): |
|
43 | 43 | ${h.literal(entry['message_hl'])} |
|
44 | 44 | %else: |
|
45 | 45 | ${h.urlify_commit_message(entry['message'], entry['repository'])} |
|
46 | 46 | %endif |
|
47 | 47 | </td> |
|
48 | 48 | <td class="td-time"> |
|
49 | 49 | ${h.age_component(h.time_to_utcdatetime(entry['date']))} |
|
50 | 50 | </td> |
|
51 | 51 | |
|
52 | 52 | <td class="td-user author"> |
|
53 | 53 | ${base.gravatar_with_user(entry['author'])} |
|
54 | 54 | </td> |
|
55 | 55 | </tr> |
|
56 | 56 | % endif |
|
57 | 57 | %endfor |
|
58 | 58 | </table> |
|
59 | 59 | |
|
60 | 60 | %if c.cur_query and c.formatted_results: |
|
61 | 61 | <div class="pagination-wh pagination-left"> |
|
62 | 62 | ${c.formatted_results.pager('$link_previous ~2~ $link_next')} |
|
63 | 63 | </div> |
|
64 | 64 | %endif |
|
65 | 65 | |
|
66 | 66 | <script> |
|
67 | 67 | $('.expand_commit').on('click',function(e){ |
|
68 | 68 | var target_expand = $(this); |
|
69 | 69 | var cid = target_expand.data('commit-id'); |
|
70 | 70 | |
|
71 | 71 | if (target_expand.hasClass('open')){ |
|
72 | 72 | $('#c-'+cid).css({'height': '1.5em', 'white-space': 'nowrap', 'text-overflow': 'ellipsis', 'overflow':'hidden'}) |
|
73 | 73 | $('#t-'+cid).css({'height': 'auto', 'line-height': '.9em', 'text-overflow': 'ellipsis', 'overflow':'hidden'}) |
|
74 | 74 | target_expand.removeClass('open'); |
|
75 | 75 | } |
|
76 | 76 | else { |
|
77 | 77 | $('#c-'+cid).css({'height': 'auto', 'white-space': 'normal', 'text-overflow': 'initial', 'overflow':'visible'}) |
|
78 | 78 | $('#t-'+cid).css({'height': 'auto', 'max-height': 'none', 'text-overflow': 'initial', 'overflow':'visible'}) |
|
79 | 79 | target_expand.addClass('open'); |
|
80 | 80 | } |
|
81 | 81 | }); |
|
82 | 82 | </script> |
General Comments 0
You need to be logged in to leave comments.
Login now