Show More
@@ -2551,6 +2551,11 b' h3.files_location {' | |||||
2551 | margin: 0px 0px 0px 3px; |
|
2551 | margin: 0px 0px 0px 3px; | |
2552 | } |
|
2552 | } | |
2553 |
|
2553 | |||
|
2554 | #graph_content #rev_range_clear { | |||
|
2555 | float: left; | |||
|
2556 | margin: 0px 0px 0px 3px; | |||
|
2557 | } | |||
|
2558 | ||||
2554 | #graph_content .container { |
|
2559 | #graph_content .container { | |
2555 | border-bottom: 1px solid #DDD; |
|
2560 | border-bottom: 1px solid #DDD; | |
2556 | height: 56px; |
|
2561 | height: 56px; |
@@ -45,7 +45,10 b'' | |||||
45 | 'Group':"${_('Group')}", |
|
45 | 'Group':"${_('Group')}", | |
46 | 'members':"${_('members')}", |
|
46 | 'members':"${_('members')}", | |
47 | 'search truncated': "${_('search truncated')}", |
|
47 | 'search truncated': "${_('search truncated')}", | |
48 | 'no matching files': "${_('no matching files')}" |
|
48 | 'no matching files': "${_('no matching files')}", | |
|
49 | 'Open new pull request': "${_('Open new pull request')}", | |||
|
50 | 'Open new pull request for selected changesets': "${_('Open new pull request for selected changesets')}", | |||
|
51 | 'Show selected changes __S -> __E': "${_('Show selected changes __S -> __E')}", | |||
49 |
|
52 | |||
50 | }; |
|
53 | }; | |
51 | var _TM = TRANSLATION_MAP; |
|
54 | var _TM = TRANSLATION_MAP; |
@@ -34,11 +34,13 b'' | |||||
34 | <div id="graph_content"> |
|
34 | <div id="graph_content"> | |
35 | <div class="info_box" style="clear: both;padding: 10px 6px;vertical-align: right;text-align: right;"> |
|
35 | <div class="info_box" style="clear: both;padding: 10px 6px;vertical-align: right;text-align: right;"> | |
36 | <a href="#" class="ui-btn small" id="rev_range_container" style="display:none"></a> |
|
36 | <a href="#" class="ui-btn small" id="rev_range_container" style="display:none"></a> | |
|
37 | <a href="#" class="ui-btn small" id="rev_range_clear" style="display:none">${_('Clear selection')}</a> | |||
|
38 | ||||
37 | %if c.rhodecode_db_repo.fork: |
|
39 | %if c.rhodecode_db_repo.fork: | |
38 | <a title="${_('compare fork with %s' % c.rhodecode_db_repo.fork.repo_name)}" href="${h.url('compare_url',repo_name=c.repo_name,org_ref_type='branch',org_ref='default',other_ref_type='branch',other_ref='default',repo=c.rhodecode_db_repo.fork.repo_name)}" class="ui-btn small">${_('Compare fork')}</a> |
|
40 | <a title="${_('compare fork with %s' % c.rhodecode_db_repo.fork.repo_name)}" href="${h.url('compare_url',repo_name=c.repo_name,org_ref_type='branch',org_ref='default',other_ref_type='branch',other_ref='default',repo=c.rhodecode_db_repo.fork.repo_name)}" class="ui-btn small">${_('Compare fork')}</a> | |
39 | %endif |
|
41 | %endif | |
40 | %if h.is_hg(c.rhodecode_repo): |
|
42 | %if h.is_hg(c.rhodecode_repo): | |
41 | <a href="${h.url('pullrequest_home',repo_name=c.repo_name)}" class="ui-btn small">${_('Open new pull request')}</a> |
|
43 | <a id="open_new_pr" href="${h.url('pullrequest_home',repo_name=c.repo_name)}" class="ui-btn small">${_('Open new pull request')}</a> | |
42 | %endif |
|
44 | %endif | |
43 | </div> |
|
45 | </div> | |
44 | <div class="container_header"> |
|
46 | <div class="container_header"> | |
@@ -148,31 +150,71 b'' | |||||
148 | var checkboxes = YUD.getElementsByClassName('changeset_range'); |
|
150 | var checkboxes = YUD.getElementsByClassName('changeset_range'); | |
149 | var url_tmpl = "${h.url('changeset_home',repo_name=c.repo_name,revision='__REVRANGE__')}"; |
|
151 | var url_tmpl = "${h.url('changeset_home',repo_name=c.repo_name,revision='__REVRANGE__')}"; | |
150 | YUE.on(checkboxes,'click',function(e){ |
|
152 | YUE.on(checkboxes,'click',function(e){ | |
|
153 | var clicked_cb = e.currentTarget; | |||
151 | var checked_checkboxes = []; |
|
154 | var checked_checkboxes = []; | |
152 | for (pos in checkboxes){ |
|
155 | for (pos in checkboxes){ | |
153 | if(checkboxes[pos].checked){ |
|
156 | if(checkboxes[pos].checked){ | |
154 | checked_checkboxes.push(checkboxes[pos]); |
|
157 | checked_checkboxes.push(checkboxes[pos]); | |
155 | } |
|
158 | } | |
156 | } |
|
159 | } | |
|
160 | ||||
|
161 | if(checked_checkboxes.length>0){ | |||
|
162 | // modify open pull request to show we have selected cs | |||
|
163 | YUD.get('open_new_pr').innerHTML = _TM['Open new pull request for selected changesets']; | |||
|
164 | ||||
|
165 | }else{ | |||
|
166 | YUD.get('open_new_pr').innerHTML = _TM['Open new pull request']; | |||
|
167 | } | |||
|
168 | ||||
157 | if(checked_checkboxes.length>1){ |
|
169 | if(checked_checkboxes.length>1){ | |
158 | var rev_end = checked_checkboxes[0].name; |
|
170 | var rev_end = checked_checkboxes[0].name; | |
159 | var rev_start = checked_checkboxes[checked_checkboxes.length-1].name; |
|
171 | var rev_start = checked_checkboxes[checked_checkboxes.length-1].name; | |
160 |
|
172 | |||
|
173 | // now select all checkboxes in the middle. | |||
|
174 | var checked = false; | |||
|
175 | for (var i=0; i<checkboxes.length; i++){ | |||
|
176 | var cb = checkboxes[i]; | |||
|
177 | var rev = cb.name; | |||
|
178 | ||||
|
179 | if (rev == rev_end){ | |||
|
180 | checked = true; | |||
|
181 | } | |||
|
182 | if (checked){ | |||
|
183 | cb.checked = true; | |||
|
184 | } | |||
|
185 | else{ | |||
|
186 | cb.checked = false; | |||
|
187 | } | |||
|
188 | if (rev == rev_start){ | |||
|
189 | checked = false; | |||
|
190 | } | |||
|
191 | ||||
|
192 | } | |||
|
193 | ||||
161 | var url = url_tmpl.replace('__REVRANGE__', |
|
194 | var url = url_tmpl.replace('__REVRANGE__', | |
162 | rev_start+'...'+rev_end); |
|
195 | rev_start+'...'+rev_end); | |
163 |
|
196 | |||
164 |
var link = |
|
197 | var link = _TM['Show selected changes __S -> __E']; | |
165 | link = link.replace('__S',rev_start.substr(0,6)); |
|
198 | link = link.replace('__S',rev_start.substr(0,6)); | |
166 | link = link.replace('__E',rev_end.substr(0,6)); |
|
199 | link = link.replace('__E',rev_end.substr(0,6)); | |
167 | YUD.get('rev_range_container').href = url; |
|
200 | YUD.get('rev_range_container').href = url; | |
168 | YUD.get('rev_range_container').innerHTML = link; |
|
201 | YUD.get('rev_range_container').innerHTML = link; | |
169 | YUD.setStyle('rev_range_container','display',''); |
|
202 | YUD.setStyle('rev_range_container','display',''); | |
|
203 | YUD.setStyle('rev_range_clear','display',''); | |||
|
204 | ||||
170 | } |
|
205 | } | |
171 | else{ |
|
206 | else{ | |
172 | YUD.setStyle('rev_range_container','display','none'); |
|
207 | YUD.setStyle('rev_range_container','display','none'); | |
|
208 | YUD.setStyle('rev_range_clear','display','none'); | |||
173 | } |
|
209 | } | |
174 | }); |
|
210 | }); | |
175 |
|
211 | YUE.on('rev_range_clear','click',function(e){ | ||
|
212 | for (var i=0; i<checkboxes.length; i++){ | |||
|
213 | var cb = checkboxes[i]; | |||
|
214 | cb.checked = false; | |||
|
215 | } | |||
|
216 | YUE.preventDefault(e); | |||
|
217 | }) | |||
176 | var msgs = YUQ('.message'); |
|
218 | var msgs = YUQ('.message'); | |
177 | // get first element height |
|
219 | // get first element height | |
178 | var el = YUQ('#graph_content .container')[0]; |
|
220 | var el = YUQ('#graph_content .container')[0]; |
General Comments 0
You need to be logged in to leave comments.
Login now