##// END OF EJS Templates
added link for detailed overview in pull-request form
marcink -
r2396:51e3d60f codereview
parent child Browse files
Show More
@@ -1,185 +1,192
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} ${_('Pull request')}
4 ${c.repo_name} ${_('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 ${_('Pull request')}
12 ${_('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('#'),method='put', id='pull_request_form')}
22 ${h.form(url('#'),method='put', id='pull_request_form')}
23 <div style="float:left;padding:30px">
23 <div style="float:left;padding:30px">
24 ##ORG
24 ##ORG
25 <div style="float:left">
25 <div style="float:left">
26 <div class="fork_user">
26 <div class="fork_user">
27 <div class="gravatar">
27 <div class="gravatar">
28 <img alt="gravatar" src="${h.gravatar_url(c.rhodecode_db_repo.user.email,24)}"/>
28 <img alt="gravatar" src="${h.gravatar_url(c.rhodecode_db_repo.user.email,24)}"/>
29 </div>
29 </div>
30 <span style="font-size: 20px">
30 <span style="font-size: 20px">
31 ${h.select('org_repo','',c.org_repos,class_='refs')}:${h.select('org_ref','',c.org_refs,class_='refs')}
31 ${h.select('org_repo','',c.org_repos,class_='refs')}:${h.select('org_ref','',c.org_refs,class_='refs')}
32 </span>
32 </span>
33 <div style="padding:5px 3px 3px 42px;">${c.rhodecode_db_repo.description}</div>
33 <div style="padding:5px 3px 3px 42px;">${c.rhodecode_db_repo.description}</div>
34 </div>
34 </div>
35 <div style="clear:both;padding-top: 10px"></div>
35 <div style="clear:both;padding-top: 10px"></div>
36 </div>
36 </div>
37 <div style="float:left;font-size:24px;padding:0px 20px">
37 <div style="float:left;font-size:24px;padding:0px 20px">
38 <img height=32 width=32 src="${h.url('/images/arrow_right_64.png')}"/>
38 <img height=32 width=32 src="${h.url('/images/arrow_right_64.png')}"/>
39 </div>
39 </div>
40
40
41 ##OTHER, most Probably the PARENT OF THIS FORK
41 ##OTHER, most Probably the PARENT OF THIS FORK
42 <div style="float:left">
42 <div style="float:left">
43 <div class="fork_user">
43 <div class="fork_user">
44 <div class="gravatar">
44 <div class="gravatar">
45 <img alt="gravatar" src="${h.gravatar_url(c.rhodecode_db_repo.user.email,24)}"/>
45 <img alt="gravatar" src="${h.gravatar_url(c.rhodecode_db_repo.user.email,24)}"/>
46 </div>
46 </div>
47 <span style="font-size: 20px">
47 <span style="font-size: 20px">
48 ${h.select('other_repo','',c.other_repos,class_='refs')}:${h.select('other_ref','',c.other_refs,class_='refs')}
48 ${h.select('other_repo','',c.other_repos,class_='refs')}:${h.select('other_ref','',c.other_refs,class_='refs')}
49 </span>
49 </span>
50 <div style="padding:5px 3px 3px 42px;">${c.rhodecode_db_repo.description}</div>
50 <div style="padding:5px 3px 3px 42px;">${c.rhodecode_db_repo.description}</div>
51 </div>
51 </div>
52 <div style="clear:both;padding-top: 10px"></div>
52 <div style="clear:both;padding-top: 10px"></div>
53 </div>
53 </div>
54 <div style="float:left;padding:5px 5px 5px 15px">
54 <div style="float:left;padding:5px 5px 5px 15px">
55 <span>
55 <span>
56 <a id="refresh" href="#">
56 <a id="refresh" href="#">
57 <img class="icon" title="${_('Refresh')}" alt="${_('Refresh')}" src="${h.url('/images/icons/arrow_refresh.png')}"/>
57 <img class="icon" title="${_('Refresh')}" alt="${_('Refresh')}" src="${h.url('/images/icons/arrow_refresh.png')}"/>
58 ${_('refresh overview')}
58 ${_('refresh overview')}
59 </a>
59 </a>
60 </span>
60 </span>
61 </div>
61 </div>
62 <div style="clear:both;padding-top: 10px"></div>
62 <div style="clear:both;padding-top: 10px"></div>
63 <div style="float:left" id="pull_request_overview">
63 <div style="float:left" id="pull_request_overview">
64 </div>
64 </div>
65 <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>
67 </div>
65 </div>
68 </div>
66 <div style="float:left; border-left:1px dashed #eee">
69 <div style="float:left; border-left:1px dashed #eee">
67 <h4>${_('Pull request reviewers')}</h4>
70 <h4>${_('Pull request reviewers')}</h4>
68 <div id="reviewers" style="padding:0px 0px 0px 15px">
71 <div id="reviewers" style="padding:0px 0px 0px 15px">
69 ##TODO: make this nicer :)
72 ##TODO: make this nicer :)
70 <table class="table noborder">
73 <table class="table noborder">
71 <tr>
74 <tr>
72 <td>
75 <td>
73 <div>
76 <div>
74 <div style="float:left">
77 <div style="float:left">
75 <div class="text" style="padding: 0px 0px 6px;">${_('Choosen reviewers')}</div>
78 <div class="text" style="padding: 0px 0px 6px;">${_('Choosen reviewers')}</div>
76 ${h.select('review_members',[x[0] for x in c.review_members],c.review_members,multiple=True,size=8,style="min-width:210px")}
79 ${h.select('review_members',[x[0] for x in c.review_members],c.review_members,multiple=True,size=8,style="min-width:210px")}
77 <div id="remove_all_elements" style="cursor:pointer;text-align:center">
80 <div id="remove_all_elements" style="cursor:pointer;text-align:center">
78 ${_('Remove all elements')}
81 ${_('Remove all elements')}
79 <img alt="remove" style="vertical-align:text-bottom" src="${h.url('/images/icons/arrow_right.png')}"/>
82 <img alt="remove" style="vertical-align:text-bottom" src="${h.url('/images/icons/arrow_right.png')}"/>
80 </div>
83 </div>
81 </div>
84 </div>
82 <div style="float:left;width:20px;padding-top:50px">
85 <div style="float:left;width:20px;padding-top:50px">
83 <img alt="add" id="add_element"
86 <img alt="add" id="add_element"
84 style="padding:2px;cursor:pointer"
87 style="padding:2px;cursor:pointer"
85 src="${h.url('/images/icons/arrow_left.png')}"/>
88 src="${h.url('/images/icons/arrow_left.png')}"/>
86 <br />
89 <br />
87 <img alt="remove" id="remove_element"
90 <img alt="remove" id="remove_element"
88 style="padding:2px;cursor:pointer"
91 style="padding:2px;cursor:pointer"
89 src="${h.url('/images/icons/arrow_right.png')}"/>
92 src="${h.url('/images/icons/arrow_right.png')}"/>
90 </div>
93 </div>
91 <div style="float:left">
94 <div style="float:left">
92 <div class="text" style="padding: 0px 0px 6px;">${_('Available reviewers')}</div>
95 <div class="text" style="padding: 0px 0px 6px;">${_('Available reviewers')}</div>
93 ${h.select('available_members',[],c.available_members,multiple=True,size=8,style="min-width:210px")}
96 ${h.select('available_members',[],c.available_members,multiple=True,size=8,style="min-width:210px")}
94 <div id="add_all_elements" style="cursor:pointer;text-align:center">
97 <div id="add_all_elements" style="cursor:pointer;text-align:center">
95 <img alt="add" style="vertical-align:text-bottom" src="${h.url('/images/icons/arrow_left.png')}"/>
98 <img alt="add" style="vertical-align:text-bottom" src="${h.url('/images/icons/arrow_left.png')}"/>
96 ${_('Add all elements')}
99 ${_('Add all elements')}
97 </div>
100 </div>
98 </div>
101 </div>
99 </div>
102 </div>
100 </td>
103 </td>
101 </tr>
104 </tr>
102 </table>
105 </table>
103 </div>
106 </div>
104 </div>
107 </div>
105 <h3>${_('Create new pull request')}</h3>
108 <h3>${_('Create new pull request')}</h3>
106
109
107 <div class="form">
110 <div class="form">
108 <!-- fields -->
111 <!-- fields -->
109
112
110 <div class="fields">
113 <div class="fields">
111
114
112 <div class="field">
115 <div class="field">
113 <div class="label">
116 <div class="label">
114 <label for="pullrequest_title">${_('Title')}:</label>
117 <label for="pullrequest_title">${_('Title')}:</label>
115 </div>
118 </div>
116 <div class="input">
119 <div class="input">
117 ${h.text('pullrequest_title',size=30)}
120 ${h.text('pullrequest_title',size=30)}
118 </div>
121 </div>
119 </div>
122 </div>
120
123
121 <div class="field">
124 <div class="field">
122 <div class="label label-textarea">
125 <div class="label label-textarea">
123 <label for="pullrequest_desc">${_('description')}:</label>
126 <label for="pullrequest_desc">${_('description')}:</label>
124 </div>
127 </div>
125 <div class="textarea text-area editor">
128 <div class="textarea text-area editor">
126 ${h.textarea('pullrequest_desc',size=30)}
129 ${h.textarea('pullrequest_desc',size=30)}
127 </div>
130 </div>
128 </div>
131 </div>
129
132
130 <div class="buttons">
133 <div class="buttons">
131 ${h.submit('save',_('Send pull request'),class_="ui-button")}
134 ${h.submit('save',_('Send pull request'),class_="ui-button")}
132 ${h.reset('reset',_('Reset'),class_="ui-button")}
135 ${h.reset('reset',_('Reset'),class_="ui-button")}
133 </div>
136 </div>
134 </div>
137 </div>
135 </div>
138 </div>
136 ${h.end_form()}
139 ${h.end_form()}
137
140
138 </div>
141 </div>
139
142
140 <script type="text/javascript">
143 <script type="text/javascript">
141 MultiSelectWidget('review_members','available_members','pull_request_form');
144 MultiSelectWidget('review_members','available_members','pull_request_form');
142
145
143 var loadPreview = function(){
146 var loadPreview = function(){
147 YUD.setStyle(YUD.get('pull_request_overview_url').parentElement,'display','none');
144 var url = "${h.url('compare_url',
148 var url = "${h.url('compare_url',
145 repo_name='org_repo',
149 repo_name='org_repo',
146 org_ref_type='branch', org_ref='org_ref',
150 org_ref_type='branch', org_ref='org_ref',
147 other_ref_type='branch', other_ref='other_ref',
151 other_ref_type='branch', other_ref='other_ref',
148 repo='other_repo')}";
152 repo='other_repo')}";
149
153
150 var select_refs = YUQ('#pull_request_form select.refs')
154 var select_refs = YUQ('#pull_request_form select.refs')
151
155
152 for(var i=0;i<select_refs.length;i++){
156 for(var i=0;i<select_refs.length;i++){
153 var select_ref = select_refs[i];
157 var select_ref = select_refs[i];
154 var select_ref_data = select_ref.value.split(':');
158 var select_ref_data = select_ref.value.split(':');
155 var key = null;
159 var key = null;
156 var val = null;
160 var val = null;
157 if(select_ref_data.length>1){
161 if(select_ref_data.length>1){
158 key = select_ref.name+"_type";
162 key = select_ref.name+"_type";
159 val = select_ref_data[0];
163 val = select_ref_data[0];
160 url = url.replace(key,val);
164 url = url.replace(key,val);
161
165
162 key = select_ref.name;
166 key = select_ref.name;
163 val = select_ref_data[1];
167 val = select_ref_data[1];
164 url = url.replace(key,val);
168 url = url.replace(key,val);
165
169
166 }else{
170 }else{
167 key = select_ref.name;
171 key = select_ref.name;
168 val = select_ref.value;
172 val = select_ref.value;
169 url = url.replace(key,val);
173 url = url.replace(key,val);
170 }
174 }
171 }
175 }
172
176
173 ypjax(url,'pull_request_overview', function(data){})
177 ypjax(url,'pull_request_overview', function(data){
178 YUD.get('pull_request_overview_url').href = url;
179 YUD.setStyle(YUD.get('pull_request_overview_url').parentElement,'display','');
180 })
174 }
181 }
175 YUE.on('refresh','click',function(e){
182 YUE.on('refresh','click',function(e){
176 loadPreview()
183 loadPreview()
177 })
184 })
178
185
179 //lazy load after 0.5
186 //lazy load after 0.5
180
187
181 setTimeout(loadPreview,500)
188 setTimeout(loadPreview,500)
182
189
183 </script>
190 </script>
184
191
185 </%def>
192 </%def>
General Comments 0
You need to be logged in to leave comments. Login now