##// END OF EJS Templates
moved refresh of pull request overview to left, it's more intuitive to be there
marcink -
r2871:b54d1024 beta
parent child Browse files
Show More
@@ -1,202 +1,200 b''
1 <%inherit file="/base/base.html"/>
1 <%inherit file="/base/base.html"/>
2
2
3 <%def name="title()">
3 <%def name="title()">
4 ${c.repo_name} ${_('New pull request')}
4 ${c.repo_name} ${_('New pull request')}
5 </%def>
5 </%def>
6
6
7 <%def name="breadcrumbs_links()">
7 <%def name="breadcrumbs_links()">
8 ${h.link_to(_(u'Home'),h.url('/'))}
8 ${h.link_to(_(u'Home'),h.url('/'))}
9 &raquo;
9 &raquo;
10 ${h.link_to(c.repo_name,h.url('changelog_home',repo_name=c.repo_name))}
10 ${h.link_to(c.repo_name,h.url('changelog_home',repo_name=c.repo_name))}
11 &raquo;
11 &raquo;
12 ${_('New pull request')}
12 ${_('New pull request')}
13 </%def>
13 </%def>
14
14
15 <%def name="main()">
15 <%def name="main()">
16
16
17 <div class="box">
17 <div class="box">
18 <!-- box / title -->
18 <!-- box / title -->
19 <div class="title">
19 <div class="title">
20 ${self.breadcrumbs()}
20 ${self.breadcrumbs()}
21 </div>
21 </div>
22 ${h.form(url('pullrequest', repo_name=c.repo_name), method='post', id='pull_request_form')}
22 ${h.form(url('pullrequest', repo_name=c.repo_name), method='post', id='pull_request_form')}
23 <div style="float:left;padding:0px 30px 30px 30px">
23 <div style="float:left;padding:0px 30px 30px 30px">
24 <div style="padding:0px 5px 5px 5px">
24
25 <span>
26 <a id="refresh" href="#">
27 <img class="icon" title="${_('Refresh')}" alt="${_('Refresh')}" src="${h.url('/images/icons/arrow_refresh.png')}"/>
28 ${_('refresh overview')}
29 </a>
30 </span>
31 </div>
32 ##ORG
25 ##ORG
33 <div style="float:left">
26 <div style="float:left">
34 <div class="fork_user">
27 <div class="fork_user">
35 <div class="gravatar">
28 <div class="gravatar">
36 <img alt="gravatar" src="${h.gravatar_url(c.rhodecode_db_repo.user.email,24)}"/>
29 <img alt="gravatar" src="${h.gravatar_url(c.rhodecode_db_repo.user.email,24)}"/>
37 </div>
30 </div>
38 <span style="font-size: 20px">
31 <span style="font-size: 20px">
39 ${h.select('org_repo','',c.org_repos,class_='refs')}:${h.select('org_ref','',c.org_refs,class_='refs')}
32 ${h.select('org_repo','',c.org_repos,class_='refs')}:${h.select('org_ref','',c.org_refs,class_='refs')}
40 </span>
33 </span>
41 <div style="padding:5px 3px 3px 42px;">${c.rhodecode_db_repo.description}</div>
34 <div style="padding:5px 3px 3px 42px;">${c.rhodecode_db_repo.description}</div>
42 </div>
35 </div>
43 <div style="clear:both;padding-top: 10px"></div>
36 <div style="clear:both;padding-top: 10px"></div>
44 </div>
37 </div>
45 <div style="float:left;font-size:24px;padding:0px 20px">
38 <div style="float:left;font-size:24px;padding:0px 20px">
46 <img height=32 width=32 src="${h.url('/images/arrow_right_64.png')}"/>
39 <img height=32 width=32 src="${h.url('/images/arrow_right_64.png')}"/>
47 </div>
40 </div>
48
41
49 ##OTHER, most Probably the PARENT OF THIS FORK
42 ##OTHER, most Probably the PARENT OF THIS FORK
50 <div style="float:left">
43 <div style="float:left">
51 <div class="fork_user">
44 <div class="fork_user">
52 <div class="gravatar">
45 <div class="gravatar">
53 <img id="other_repo_gravatar" alt="gravatar" src=""/>
46 <img id="other_repo_gravatar" alt="gravatar" src=""/>
54 </div>
47 </div>
55 <span style="font-size: 20px">
48 <span style="font-size: 20px">
56 ${h.select('other_repo',c.default_pull_request ,c.other_repos,class_='refs')}:${h.select('other_ref',c.default_pull_request_rev,c.default_revs,class_='refs')}
49 ${h.select('other_repo',c.default_pull_request ,c.other_repos,class_='refs')}:${h.select('other_ref',c.default_pull_request_rev,c.default_revs,class_='refs')}
57 </span>
50 </span>
51 <span style="padding:3px">
52 <a id="refresh" href="#" class="tooltip" title="${h.tooltip(_('refresh overview'))}">
53 <img style="margin:3px" class="icon" title="${_('Refresh')}" alt="${_('Refresh')}" src="${h.url('/images/icons/arrow_refresh.png')}"/>
54 </a>
55 </span>
58 <div id="other_repo_desc" style="padding:5px 3px 3px 42px;"></div>
56 <div id="other_repo_desc" style="padding:5px 3px 3px 42px;"></div>
59 </div>
57 </div>
60 <div style="clear:both;padding-top: 10px"></div>
58 <div style="clear:both;padding-top: 10px"></div>
61 </div>
59 </div>
62 <div style="clear:both;padding-top: 10px"></div>
60 <div style="clear:both;padding-top: 10px"></div>
63 ## overview pulled by ajax
61 ## overview pulled by ajax
64 <div style="float:left" id="pull_request_overview"></div>
62 <div style="float:left" id="pull_request_overview"></div>
65 <div style="float:left;clear:both;padding:10px 10px 10px 0px;display:none">
63 <div style="float:left;clear:both;padding:10px 10px 10px 0px;display:none">
66 <a id="pull_request_overview_url" href="#">${_('Detailed compare view')}</a>
64 <a id="pull_request_overview_url" href="#">${_('Detailed compare view')}</a>
67 </div>
65 </div>
68 </div>
66 </div>
69 <div style="float:left; border-left:1px dashed #eee">
67 <div style="float:left; border-left:1px dashed #eee">
70 <h4>${_('Pull request reviewers')}</h4>
68 <h4>${_('Pull request reviewers')}</h4>
71 <div id="reviewers" style="padding:0px 0px 0px 15px">
69 <div id="reviewers" style="padding:0px 0px 0px 15px">
72 ## members goes here !
70 ## members goes here !
73 <div class="group_members_wrap">
71 <div class="group_members_wrap">
74 <ul id="review_members" class="group_members">
72 <ul id="review_members" class="group_members">
75 %for member in c.review_members:
73 %for member in c.review_members:
76 <li id="reviewer_${member.user_id}">
74 <li id="reviewer_${member.user_id}">
77 <div class="reviewers_member">
75 <div class="reviewers_member">
78 <div class="gravatar"><img alt="gravatar" src="${h.gravatar_url(member.email,14)}"/> </div>
76 <div class="gravatar"><img alt="gravatar" src="${h.gravatar_url(member.email,14)}"/> </div>
79 <div style="float:left">${member.full_name} (${_('owner')})</div>
77 <div style="float:left">${member.full_name} (${_('owner')})</div>
80 <input type="hidden" value="${member.user_id}" name="review_members" />
78 <input type="hidden" value="${member.user_id}" name="review_members" />
81 <span class="delete_icon action_button" onclick="removeReviewer(${member.user_id})"></span>
79 <span class="delete_icon action_button" onclick="removeReviewer(${member.user_id})"></span>
82 </div>
80 </div>
83 </li>
81 </li>
84 %endfor
82 %endfor
85 </ul>
83 </ul>
86 </div>
84 </div>
87
85
88 <div class='ac'>
86 <div class='ac'>
89 <div class="reviewer_ac">
87 <div class="reviewer_ac">
90 ${h.text('user', class_='yui-ac-input')}
88 ${h.text('user', class_='yui-ac-input')}
91 <span class="help-block">${_('Add reviewer to this pull request.')}</span>
89 <span class="help-block">${_('Add reviewer to this pull request.')}</span>
92 <div id="reviewers_container"></div>
90 <div id="reviewers_container"></div>
93 </div>
91 </div>
94 </div>
92 </div>
95 </div>
93 </div>
96 </div>
94 </div>
97 <h3>${_('Create new pull request')}</h3>
95 <h3>${_('Create new pull request')}</h3>
98
96
99 <div class="form">
97 <div class="form">
100 <!-- fields -->
98 <!-- fields -->
101
99
102 <div class="fields">
100 <div class="fields">
103
101
104 <div class="field">
102 <div class="field">
105 <div class="label">
103 <div class="label">
106 <label for="pullrequest_title">${_('Title')}:</label>
104 <label for="pullrequest_title">${_('Title')}:</label>
107 </div>
105 </div>
108 <div class="input">
106 <div class="input">
109 ${h.text('pullrequest_title',size=30)}
107 ${h.text('pullrequest_title',size=30)}
110 </div>
108 </div>
111 </div>
109 </div>
112
110
113 <div class="field">
111 <div class="field">
114 <div class="label label-textarea">
112 <div class="label label-textarea">
115 <label for="pullrequest_desc">${_('description')}:</label>
113 <label for="pullrequest_desc">${_('description')}:</label>
116 </div>
114 </div>
117 <div class="textarea text-area editor">
115 <div class="textarea text-area editor">
118 ${h.textarea('pullrequest_desc',size=30)}
116 ${h.textarea('pullrequest_desc',size=30)}
119 </div>
117 </div>
120 </div>
118 </div>
121
119
122 <div class="buttons">
120 <div class="buttons">
123 ${h.submit('save',_('Send pull request'),class_="ui-btn large")}
121 ${h.submit('save',_('Send pull request'),class_="ui-btn large")}
124 ${h.reset('reset',_('Reset'),class_="ui-btn large")}
122 ${h.reset('reset',_('Reset'),class_="ui-btn large")}
125 </div>
123 </div>
126 </div>
124 </div>
127 </div>
125 </div>
128 ${h.end_form()}
126 ${h.end_form()}
129
127
130 </div>
128 </div>
131
129
132 <script type="text/javascript">
130 <script type="text/javascript">
133 var _USERS_AC_DATA = ${c.users_array|n};
131 var _USERS_AC_DATA = ${c.users_array|n};
134 var _GROUPS_AC_DATA = ${c.users_groups_array|n};
132 var _GROUPS_AC_DATA = ${c.users_groups_array|n};
135 PullRequestAutoComplete('user', 'reviewers_container', _USERS_AC_DATA, _GROUPS_AC_DATA);
133 PullRequestAutoComplete('user', 'reviewers_container', _USERS_AC_DATA, _GROUPS_AC_DATA);
136
134
137 var other_repos_info = ${c.other_repos_info|n};
135 var other_repos_info = ${c.other_repos_info|n};
138
136
139 var loadPreview = function(){
137 var loadPreview = function(){
140 YUD.setStyle(YUD.get('pull_request_overview_url').parentElement,'display','none');
138 YUD.setStyle(YUD.get('pull_request_overview_url').parentElement,'display','none');
141 var url = "${h.url('compare_url',
139 var url = "${h.url('compare_url',
142 repo_name='org_repo',
140 repo_name='org_repo',
143 org_ref_type='org_ref_type', org_ref='org_ref',
141 org_ref_type='org_ref_type', org_ref='org_ref',
144 other_ref_type='other_ref_type', other_ref='other_ref',
142 other_ref_type='other_ref_type', other_ref='other_ref',
145 repo='other_repo',
143 repo='other_repo',
146 as_form=True)}";
144 as_form=True)}";
147
145
148 var select_refs = YUQ('#pull_request_form select.refs')
146 var select_refs = YUQ('#pull_request_form select.refs')
149 var rev_data = {}; // gather the org/other ref and repo here
147 var rev_data = {}; // gather the org/other ref and repo here
150 for(var i=0;i<select_refs.length;i++){
148 for(var i=0;i<select_refs.length;i++){
151 var select_ref = select_refs[i];
149 var select_ref = select_refs[i];
152 var select_ref_data = select_ref.value.split(':');
150 var select_ref_data = select_ref.value.split(':');
153 var key = null;
151 var key = null;
154 var val = null;
152 var val = null;
155
153
156 if(select_ref_data.length>1){
154 if(select_ref_data.length>1){
157 key = select_ref.name+"_type";
155 key = select_ref.name+"_type";
158 val = select_ref_data[0];
156 val = select_ref_data[0];
159 url = url.replace(key,val);
157 url = url.replace(key,val);
160 rev_data[key] = val;
158 rev_data[key] = val;
161
159
162 key = select_ref.name;
160 key = select_ref.name;
163 val = select_ref_data[1];
161 val = select_ref_data[1];
164 url = url.replace(key,val);
162 url = url.replace(key,val);
165 rev_data[key] = val;
163 rev_data[key] = val;
166
164
167 }else{
165 }else{
168 key = select_ref.name;
166 key = select_ref.name;
169 val = select_ref.value;
167 val = select_ref.value;
170 url = url.replace(key,val);
168 url = url.replace(key,val);
171 rev_data[key] = val;
169 rev_data[key] = val;
172 }
170 }
173 }
171 }
174
172
175 YUE.on('other_repo', 'change', function(e){
173 YUE.on('other_repo', 'change', function(e){
176 var repo_name = e.currentTarget.value;
174 var repo_name = e.currentTarget.value;
177 // replace the <select> of changed repo
175 // replace the <select> of changed repo
178 YUD.get('other_ref').innerHTML = other_repos_info[repo_name]['revs'];
176 YUD.get('other_ref').innerHTML = other_repos_info[repo_name]['revs'];
179 });
177 });
180
178
181 ypjax(url,'pull_request_overview', function(data){
179 ypjax(url,'pull_request_overview', function(data){
182 var sel_box = YUQ('#pull_request_form #other_repo')[0];
180 var sel_box = YUQ('#pull_request_form #other_repo')[0];
183 var repo_name = sel_box.options[sel_box.selectedIndex].value;
181 var repo_name = sel_box.options[sel_box.selectedIndex].value;
184 YUD.get('pull_request_overview_url').href = url;
182 YUD.get('pull_request_overview_url').href = url;
185 YUD.setStyle(YUD.get('pull_request_overview_url').parentElement,'display','');
183 YUD.setStyle(YUD.get('pull_request_overview_url').parentElement,'display','');
186 YUD.get('other_repo_gravatar').src = other_repos_info[repo_name]['gravatar'];
184 YUD.get('other_repo_gravatar').src = other_repos_info[repo_name]['gravatar'];
187 YUD.get('other_repo_desc').innerHTML = other_repos_info[repo_name]['description'];
185 YUD.get('other_repo_desc').innerHTML = other_repos_info[repo_name]['description'];
188 YUD.get('other_ref').innerHTML = other_repos_info[repo_name]['revs'];
186 YUD.get('other_ref').innerHTML = other_repos_info[repo_name]['revs'];
189 // select back the revision that was just compared
187 // select back the revision that was just compared
190 setSelectValue(YUD.get('other_ref'), rev_data['other_ref']);
188 setSelectValue(YUD.get('other_ref'), rev_data['other_ref']);
191 })
189 })
192 }
190 }
193 YUE.on('refresh','click',function(e){
191 YUE.on('refresh','click',function(e){
194 loadPreview()
192 loadPreview()
195 })
193 })
196
194
197 //lazy load overview after 0.5s
195 //lazy load overview after 0.5s
198 setTimeout(loadPreview, 500)
196 setTimeout(loadPreview, 500)
199
197
200 </script>
198 </script>
201
199
202 </%def>
200 </%def>
General Comments 0
You need to be logged in to leave comments. Login now