##// END OF EJS Templates
fixed breadcrumbs in few pages
marcink -
r1084:17721a2d beta
parent child Browse files
Show More
@@ -1,339 +1,339
1 ## -*- coding: utf-8 -*-
1 ## -*- coding: utf-8 -*-
2 <%inherit file="/base/base.html"/>
2 <%inherit file="/base/base.html"/>
3
3
4 <%def name="title()">
4 <%def name="title()">
5 ${_('Edit repository')} ${c.repo_info.repo_name} - ${c.rhodecode_name}
5 ${_('Edit repository')} ${c.repo_info.repo_name} - ${c.rhodecode_name}
6 </%def>
6 </%def>
7
7
8 <%def name="breadcrumbs_links()">
8 <%def name="breadcrumbs_links()">
9 ${h.link_to(_('Admin'),h.url('admin_home'))}
9 ${h.link_to(_('Admin'),h.url('admin_home'))}
10 &raquo;
10 &raquo;
11 ${h.link_to(_('Repositories'),h.url('repos'))}
11 ${h.link_to(_('Repositories'),h.url('repos'))}
12 &raquo;
12 &raquo;
13 ${_('edit')} "${c.repo_name}"
13 ${_('edit')} &raquo; ${h.link_to(c.repo_name,h.url('summary_home',repo_name=c.repo_name))}
14 </%def>
14 </%def>
15
15
16 <%def name="page_nav()">
16 <%def name="page_nav()">
17 ${self.menu('admin')}
17 ${self.menu('admin')}
18 </%def>
18 </%def>
19
19
20 <%def name="main()">
20 <%def name="main()">
21 <div class="box box-left">
21 <div class="box box-left">
22 <!-- box / title -->
22 <!-- box / title -->
23 <div class="title">
23 <div class="title">
24 ${self.breadcrumbs()}
24 ${self.breadcrumbs()}
25 </div>
25 </div>
26 ${h.form(url('repo', repo_name=c.repo_info.repo_name),method='put')}
26 ${h.form(url('repo', repo_name=c.repo_info.repo_name),method='put')}
27 <div class="form">
27 <div class="form">
28 <!-- fields -->
28 <!-- fields -->
29 <div class="fields">
29 <div class="fields">
30 <div class="field">
30 <div class="field">
31 <div class="label">
31 <div class="label">
32 <label for="repo_name">${_('Name')}:</label>
32 <label for="repo_name">${_('Name')}:</label>
33 </div>
33 </div>
34 <div class="input">
34 <div class="input">
35 ${h.text('repo_name',class_="medium")}
35 ${h.text('repo_name',class_="medium")}
36 </div>
36 </div>
37 </div>
37 </div>
38 <div class="field">
38 <div class="field">
39 <div class="label">
39 <div class="label">
40 <label for="repo_type">${_('Type')}:</label>
40 <label for="repo_type">${_('Type')}:</label>
41 </div>
41 </div>
42 <div class="input">
42 <div class="input">
43 ${h.select('repo_type','hg',c.backends,class_="medium")}
43 ${h.select('repo_type','hg',c.backends,class_="medium")}
44 </div>
44 </div>
45 </div>
45 </div>
46 <div class="field">
46 <div class="field">
47 <div class="label label-textarea">
47 <div class="label label-textarea">
48 <label for="description">${_('Description')}:</label>
48 <label for="description">${_('Description')}:</label>
49 </div>
49 </div>
50 <div class="textarea text-area editor">
50 <div class="textarea text-area editor">
51 ${h.textarea('description',cols=23,rows=5)}
51 ${h.textarea('description',cols=23,rows=5)}
52 </div>
52 </div>
53 </div>
53 </div>
54
54
55 <div class="field">
55 <div class="field">
56 <div class="label label-checkbox">
56 <div class="label label-checkbox">
57 <label for="private">${_('Private')}:</label>
57 <label for="private">${_('Private')}:</label>
58 </div>
58 </div>
59 <div class="checkboxes">
59 <div class="checkboxes">
60 ${h.checkbox('private',value="True")}
60 ${h.checkbox('private',value="True")}
61 </div>
61 </div>
62 </div>
62 </div>
63 <div class="field">
63 <div class="field">
64 <div class="label label-checkbox">
64 <div class="label label-checkbox">
65 <label for="enable_statistics">${_('Enable statistics')}:</label>
65 <label for="enable_statistics">${_('Enable statistics')}:</label>
66 </div>
66 </div>
67 <div class="checkboxes">
67 <div class="checkboxes">
68 ${h.checkbox('enable_statistics',value="True")}
68 ${h.checkbox('enable_statistics',value="True")}
69 </div>
69 </div>
70 </div>
70 </div>
71 <div class="field">
71 <div class="field">
72 <div class="label label-checkbox">
72 <div class="label label-checkbox">
73 <label for="enable_downloads">${_('Enable downloads')}:</label>
73 <label for="enable_downloads">${_('Enable downloads')}:</label>
74 </div>
74 </div>
75 <div class="checkboxes">
75 <div class="checkboxes">
76 ${h.checkbox('enable_downloads',value="True")}
76 ${h.checkbox('enable_downloads',value="True")}
77 </div>
77 </div>
78 </div>
78 </div>
79 <div class="field">
79 <div class="field">
80 <div class="label">
80 <div class="label">
81 <label for="user">${_('Owner')}:</label>
81 <label for="user">${_('Owner')}:</label>
82 </div>
82 </div>
83 <div class="input input-small ac">
83 <div class="input input-small ac">
84 <div class="perm_ac">
84 <div class="perm_ac">
85 ${h.text('user',class_='yui-ac-input')}
85 ${h.text('user',class_='yui-ac-input')}
86 <div id="owner_container"></div>
86 <div id="owner_container"></div>
87 </div>
87 </div>
88 </div>
88 </div>
89 </div>
89 </div>
90
90
91 <div class="field">
91 <div class="field">
92 <div class="label">
92 <div class="label">
93 <label for="input">${_('Permissions')}:</label>
93 <label for="input">${_('Permissions')}:</label>
94 </div>
94 </div>
95 <div class="input">
95 <div class="input">
96 <%include file="repo_edit_perms.html"/>
96 <%include file="repo_edit_perms.html"/>
97 </div>
97 </div>
98
98
99 <div class="buttons">
99 <div class="buttons">
100 ${h.submit('save','Save',class_="ui-button")}
100 ${h.submit('save','Save',class_="ui-button")}
101 ${h.reset('reset','Reset',class_="ui-button")}
101 ${h.reset('reset','Reset',class_="ui-button")}
102 </div>
102 </div>
103 </div>
103 </div>
104 </div>
104 </div>
105 </div>
105 </div>
106 ${h.end_form()}
106 ${h.end_form()}
107 <script type="text/javascript">
107 <script type="text/javascript">
108 YAHOO.util.Event.onDOMReady(function(){
108 YAHOO.util.Event.onDOMReady(function(){
109 var D = YAHOO.util.Dom;
109 var D = YAHOO.util.Dom;
110 if(!D.hasClass('perm_new_member_name','error')){
110 if(!D.hasClass('perm_new_member_name','error')){
111 D.setStyle('add_perm_input','display','none');
111 D.setStyle('add_perm_input','display','none');
112 }
112 }
113 YAHOO.util.Event.addListener('add_perm','click',function(){
113 YAHOO.util.Event.addListener('add_perm','click',function(){
114 D.setStyle('add_perm_input','display','');
114 D.setStyle('add_perm_input','display','');
115 D.setStyle('add_perm','opacity','0.6');
115 D.setStyle('add_perm','opacity','0.6');
116 D.setStyle('add_perm','cursor','default');
116 D.setStyle('add_perm','cursor','default');
117 });
117 });
118 });
118 });
119 </script>
119 </script>
120 <script type="text/javascript">
120 <script type="text/javascript">
121 YAHOO.example.FnMultipleFields = function(){
121 YAHOO.example.FnMultipleFields = function(){
122 var myUsers = ${c.users_array|n};
122 var myUsers = ${c.users_array|n};
123 var myGroups = ${c.users_groups_array|n};
123 var myGroups = ${c.users_groups_array|n};
124
124
125 // Define a custom search function for the DataSource of users
125 // Define a custom search function for the DataSource of users
126 var matchUsers = function(sQuery) {
126 var matchUsers = function(sQuery) {
127 // Case insensitive matching
127 // Case insensitive matching
128 var query = sQuery.toLowerCase();
128 var query = sQuery.toLowerCase();
129 var i=0;
129 var i=0;
130 var l=myUsers.length;
130 var l=myUsers.length;
131 var matches = [];
131 var matches = [];
132
132
133 // Match against each name of each contact
133 // Match against each name of each contact
134 for(; i<l; i++) {
134 for(; i<l; i++) {
135 contact = myUsers[i];
135 contact = myUsers[i];
136 if((contact.fname.toLowerCase().indexOf(query) > -1) ||
136 if((contact.fname.toLowerCase().indexOf(query) > -1) ||
137 (contact.lname.toLowerCase().indexOf(query) > -1) ||
137 (contact.lname.toLowerCase().indexOf(query) > -1) ||
138 (contact.nname && (contact.nname.toLowerCase().indexOf(query) > -1))) {
138 (contact.nname && (contact.nname.toLowerCase().indexOf(query) > -1))) {
139 matches[matches.length] = contact;
139 matches[matches.length] = contact;
140 }
140 }
141 }
141 }
142 return matches;
142 return matches;
143 };
143 };
144
144
145 // Define a custom search function for the DataSource of usersGroups
145 // Define a custom search function for the DataSource of usersGroups
146 var matchGroups = function(sQuery) {
146 var matchGroups = function(sQuery) {
147 // Case insensitive matching
147 // Case insensitive matching
148 var query = sQuery.toLowerCase();
148 var query = sQuery.toLowerCase();
149 var i=0;
149 var i=0;
150 var l=myGroups.length;
150 var l=myGroups.length;
151 var matches = [];
151 var matches = [];
152
152
153 // Match against each name of each contact
153 // Match against each name of each contact
154 for(; i<l; i++) {
154 for(; i<l; i++) {
155 matched_group = myGroups[i];
155 matched_group = myGroups[i];
156 if(matched_group.grname.toLowerCase().indexOf(query) > -1) {
156 if(matched_group.grname.toLowerCase().indexOf(query) > -1) {
157 matches[matches.length] = matched_group;
157 matches[matches.length] = matched_group;
158 }
158 }
159 }
159 }
160 return matches;
160 return matches;
161 };
161 };
162
162
163 //match all
163 //match all
164 var matchAll = function(sQuery){
164 var matchAll = function(sQuery){
165 u = matchUsers(sQuery);
165 u = matchUsers(sQuery);
166 g = matchGroups(sQuery);
166 g = matchGroups(sQuery);
167 return u.concat(g);
167 return u.concat(g);
168 };
168 };
169
169
170 // DataScheme for members
170 // DataScheme for members
171 var memberDS = new YAHOO.util.FunctionDataSource(matchAll);
171 var memberDS = new YAHOO.util.FunctionDataSource(matchAll);
172 memberDS.responseSchema = {
172 memberDS.responseSchema = {
173 fields: ["id", "fname", "lname", "nname", "grname", "grmembers"]
173 fields: ["id", "fname", "lname", "nname", "grname", "grmembers"]
174 };
174 };
175
175
176 // DataScheme for owner
176 // DataScheme for owner
177 var ownerDS = new YAHOO.util.FunctionDataSource(matchUsers);
177 var ownerDS = new YAHOO.util.FunctionDataSource(matchUsers);
178 ownerDS.responseSchema = {
178 ownerDS.responseSchema = {
179 fields: ["id", "fname", "lname", "nname"]
179 fields: ["id", "fname", "lname", "nname"]
180 };
180 };
181
181
182 // Instantiate AutoComplete for perms
182 // Instantiate AutoComplete for perms
183 var membersAC = new YAHOO.widget.AutoComplete("perm_new_member_name", "perm_container", memberDS);
183 var membersAC = new YAHOO.widget.AutoComplete("perm_new_member_name", "perm_container", memberDS);
184 membersAC.useShadow = false;
184 membersAC.useShadow = false;
185 membersAC.resultTypeList = false;
185 membersAC.resultTypeList = false;
186
186
187 // Instantiate AutoComplete for owner
187 // Instantiate AutoComplete for owner
188 var ownerAC = new YAHOO.widget.AutoComplete("user", "owner_container", ownerDS);
188 var ownerAC = new YAHOO.widget.AutoComplete("user", "owner_container", ownerDS);
189 ownerAC.useShadow = false;
189 ownerAC.useShadow = false;
190 ownerAC.resultTypeList = false;
190 ownerAC.resultTypeList = false;
191
191
192
192
193 // Helper highlight function for the formatter
193 // Helper highlight function for the formatter
194 var highlightMatch = function(full, snippet, matchindex) {
194 var highlightMatch = function(full, snippet, matchindex) {
195 return full.substring(0, matchindex) +
195 return full.substring(0, matchindex) +
196 "<span class='match'>" +
196 "<span class='match'>" +
197 full.substr(matchindex, snippet.length) +
197 full.substr(matchindex, snippet.length) +
198 "</span>" +
198 "</span>" +
199 full.substring(matchindex + snippet.length);
199 full.substring(matchindex + snippet.length);
200 };
200 };
201
201
202 // Custom formatter to highlight the matching letters
202 // Custom formatter to highlight the matching letters
203 var custom_formatter = function(oResultData, sQuery, sResultMatch) {
203 var custom_formatter = function(oResultData, sQuery, sResultMatch) {
204 var query = sQuery.toLowerCase();
204 var query = sQuery.toLowerCase();
205
205
206 if (oResultData.grname != undefined){
206 if (oResultData.grname != undefined){
207 var grname = oResultData.grname;
207 var grname = oResultData.grname;
208 var grmembers = oResultData.grmembers;
208 var grmembers = oResultData.grmembers;
209 var grnameMatchIndex = grname.toLowerCase().indexOf(query);
209 var grnameMatchIndex = grname.toLowerCase().indexOf(query);
210 var grprefix = "${_('Group')}: ";
210 var grprefix = "${_('Group')}: ";
211 var grsuffix = " ("+grmembers+" ${_('members')})";
211 var grsuffix = " ("+grmembers+" ${_('members')})";
212
212
213 if (grnameMatchIndex > -1){
213 if (grnameMatchIndex > -1){
214 return grprefix+highlightMatch(grname,query,grnameMatchIndex)+grsuffix;
214 return grprefix+highlightMatch(grname,query,grnameMatchIndex)+grsuffix;
215 }
215 }
216
216
217 return grprefix+oResultData.grname+grsuffix;
217 return grprefix+oResultData.grname+grsuffix;
218 }
218 }
219 else if(oResultData.fname != undefined){
219 else if(oResultData.fname != undefined){
220
220
221 var fname = oResultData.fname,
221 var fname = oResultData.fname,
222 lname = oResultData.lname,
222 lname = oResultData.lname,
223 nname = oResultData.nname || "", // Guard against null value
223 nname = oResultData.nname || "", // Guard against null value
224 fnameMatchIndex = fname.toLowerCase().indexOf(query),
224 fnameMatchIndex = fname.toLowerCase().indexOf(query),
225 lnameMatchIndex = lname.toLowerCase().indexOf(query),
225 lnameMatchIndex = lname.toLowerCase().indexOf(query),
226 nnameMatchIndex = nname.toLowerCase().indexOf(query),
226 nnameMatchIndex = nname.toLowerCase().indexOf(query),
227 displayfname, displaylname, displaynname;
227 displayfname, displaylname, displaynname;
228
228
229 if(fnameMatchIndex > -1) {
229 if(fnameMatchIndex > -1) {
230 displayfname = highlightMatch(fname, query, fnameMatchIndex);
230 displayfname = highlightMatch(fname, query, fnameMatchIndex);
231 }
231 }
232 else {
232 else {
233 displayfname = fname;
233 displayfname = fname;
234 }
234 }
235
235
236 if(lnameMatchIndex > -1) {
236 if(lnameMatchIndex > -1) {
237 displaylname = highlightMatch(lname, query, lnameMatchIndex);
237 displaylname = highlightMatch(lname, query, lnameMatchIndex);
238 }
238 }
239 else {
239 else {
240 displaylname = lname;
240 displaylname = lname;
241 }
241 }
242
242
243 if(nnameMatchIndex > -1) {
243 if(nnameMatchIndex > -1) {
244 displaynname = "(" + highlightMatch(nname, query, nnameMatchIndex) + ")";
244 displaynname = "(" + highlightMatch(nname, query, nnameMatchIndex) + ")";
245 }
245 }
246 else {
246 else {
247 displaynname = nname ? "(" + nname + ")" : "";
247 displaynname = nname ? "(" + nname + ")" : "";
248 }
248 }
249
249
250 return displayfname + " " + displaylname + " " + displaynname;
250 return displayfname + " " + displaylname + " " + displaynname;
251 }
251 }
252 else{
252 else{
253 return '';
253 return '';
254 }
254 }
255 };
255 };
256 membersAC.formatResult = custom_formatter;
256 membersAC.formatResult = custom_formatter;
257 ownerAC.formatResult = custom_formatter;
257 ownerAC.formatResult = custom_formatter;
258
258
259 var myHandler = function(sType, aArgs) {
259 var myHandler = function(sType, aArgs) {
260
260
261 var myAC = aArgs[0]; // reference back to the AC instance
261 var myAC = aArgs[0]; // reference back to the AC instance
262 var elLI = aArgs[1]; // reference to the selected LI element
262 var elLI = aArgs[1]; // reference to the selected LI element
263 var oData = aArgs[2]; // object literal of selected item's result data
263 var oData = aArgs[2]; // object literal of selected item's result data
264
264
265 //fill the autocomplete with value
265 //fill the autocomplete with value
266 if(oData.nname != undefined){
266 if(oData.nname != undefined){
267 //users
267 //users
268 myAC.getInputEl().value = oData.nname;
268 myAC.getInputEl().value = oData.nname;
269 YUD.get('perm_new_member_type').value = 'user';
269 YUD.get('perm_new_member_type').value = 'user';
270 }
270 }
271 else{
271 else{
272 //groups
272 //groups
273 myAC.getInputEl().value = oData.grname;
273 myAC.getInputEl().value = oData.grname;
274 YUD.get('perm_new_member_type').value = 'users_group';
274 YUD.get('perm_new_member_type').value = 'users_group';
275 }
275 }
276
276
277 };
277 };
278
278
279 membersAC.itemSelectEvent.subscribe(myHandler);
279 membersAC.itemSelectEvent.subscribe(myHandler);
280 ownerAC.itemSelectEvent.subscribe(myHandler);
280 ownerAC.itemSelectEvent.subscribe(myHandler);
281
281
282 return {
282 return {
283 memberDS: memberDS,
283 memberDS: memberDS,
284 ownerDS: ownerDS,
284 ownerDS: ownerDS,
285 membersAC: membersAC,
285 membersAC: membersAC,
286 ownerAC: ownerAC,
286 ownerAC: ownerAC,
287 };
287 };
288 }();
288 }();
289
289
290 </script>
290 </script>
291
291
292 </div>
292 </div>
293
293
294 <div class="box box-right">
294 <div class="box box-right">
295 <div class="title">
295 <div class="title">
296 <h5>${_('Administration')}</h5>
296 <h5>${_('Administration')}</h5>
297 </div>
297 </div>
298
298
299 <h3>${_('Statistics')}</h3>
299 <h3>${_('Statistics')}</h3>
300
300
301 ${h.form(url('repo_stats', repo_name=c.repo_info.repo_name),method='delete')}
301 ${h.form(url('repo_stats', repo_name=c.repo_info.repo_name),method='delete')}
302 <div class="form">
302 <div class="form">
303 <div class="fields">
303 <div class="fields">
304 ${h.submit('reset_stats_%s' % c.repo_info.repo_name,_('Reset current statistics'),class_="refresh_icon action_button",onclick="return confirm('Confirm to remove current statistics');")}
304 ${h.submit('reset_stats_%s' % c.repo_info.repo_name,_('Reset current statistics'),class_="refresh_icon action_button",onclick="return confirm('Confirm to remove current statistics');")}
305
305
306 <div class="field">
306 <div class="field">
307 <ul>
307 <ul>
308 <li>${_('Fetched to rev')}: ${c.stats_revision}/${c.repo_last_rev}</li>
308 <li>${_('Fetched to rev')}: ${c.stats_revision}/${c.repo_last_rev}</li>
309 <li>${_('Percentage of stats gathered')}: ${c.stats_percentage} %</li>
309 <li>${_('Percentage of stats gathered')}: ${c.stats_percentage} %</li>
310 </ul>
310 </ul>
311 </div>
311 </div>
312
312
313 </div>
313 </div>
314 </div>
314 </div>
315 ${h.end_form()}
315 ${h.end_form()}
316
316
317 <h3>${_('Cache')}</h3>
317 <h3>${_('Cache')}</h3>
318 ${h.form(url('repo_cache', repo_name=c.repo_info.repo_name),method='delete')}
318 ${h.form(url('repo_cache', repo_name=c.repo_info.repo_name),method='delete')}
319 <div class="form">
319 <div class="form">
320 <div class="fields">
320 <div class="fields">
321 ${h.submit('reset_cache_%s' % c.repo_info.repo_name,_('Invalidate repository cache'),class_="refresh_icon action_button",onclick="return confirm('Confirm to invalidate repository cache');")}
321 ${h.submit('reset_cache_%s' % c.repo_info.repo_name,_('Invalidate repository cache'),class_="refresh_icon action_button",onclick="return confirm('Confirm to invalidate repository cache');")}
322 </div>
322 </div>
323 </div>
323 </div>
324 ${h.end_form()}
324 ${h.end_form()}
325
325
326
326
327 <h3>${_('Delete')}</h3>
327 <h3>${_('Delete')}</h3>
328 ${h.form(url('repo', repo_name=c.repo_info.repo_name),method='delete')}
328 ${h.form(url('repo', repo_name=c.repo_info.repo_name),method='delete')}
329 <div class="form">
329 <div class="form">
330 <div class="fields">
330 <div class="fields">
331 ${h.submit('remove_%s' % c.repo_info.repo_name,_('Remove this repository'),class_="delete_icon action_button",onclick="return confirm('Confirm to delete this repository');")}
331 ${h.submit('remove_%s' % c.repo_info.repo_name,_('Remove this repository'),class_="delete_icon action_button",onclick="return confirm('Confirm to delete this repository');")}
332 </div>
332 </div>
333 </div>
333 </div>
334 ${h.end_form()}
334 ${h.end_form()}
335
335
336 </div>
336 </div>
337
337
338
338
339 </%def> No newline at end of file
339 </%def>
@@ -1,59 +1,61
1 ## -*- coding: utf-8 -*-
1 ## -*- coding: utf-8 -*-
2 <%inherit file="/base/base.html"/>
2 <%inherit file="/base/base.html"/>
3
3
4 <%def name="title()">
4 <%def name="title()">
5 ${c.repo_name} ${_('Fork')} - ${c.rhodecode_name}
5 ${c.repo_name} ${_('Fork')} - ${c.rhodecode_name}
6 </%def>
6 </%def>
7
7
8 <%def name="breadcrumbs_links()">
8 <%def name="breadcrumbs_links()">
9 ${h.link_to(u'Home',h.url('/'))}
10 &raquo;
9 ${h.link_to(c.repo_info.repo_name,h.url('summary_home',repo_name=c.repo_info.repo_name))}
11 ${h.link_to(c.repo_info.repo_name,h.url('summary_home',repo_name=c.repo_info.repo_name))}
10 &raquo;
12 &raquo;
11 ${_('fork')}
13 ${_('fork')}
12 </%def>
14 </%def>
13
15
14 <%def name="page_nav()">
16 <%def name="page_nav()">
15 ${self.menu('')}
17 ${self.menu('')}
16 </%def>
18 </%def>
17 <%def name="main()">
19 <%def name="main()">
18 <div class="box">
20 <div class="box">
19 <!-- box / title -->
21 <!-- box / title -->
20 <div class="title">
22 <div class="title">
21 ${self.breadcrumbs()}
23 ${self.breadcrumbs()}
22 </div>
24 </div>
23 ${h.form(url('repo_fork_create_home',repo_name=c.repo_info.repo_name))}
25 ${h.form(url('repo_fork_create_home',repo_name=c.repo_info.repo_name))}
24 <div class="form">
26 <div class="form">
25 <!-- fields -->
27 <!-- fields -->
26 <div class="fields">
28 <div class="fields">
27 <div class="field">
29 <div class="field">
28 <div class="label">
30 <div class="label">
29 <label for="repo_name">${_('Fork name')}:</label>
31 <label for="repo_name">${_('Fork name')}:</label>
30 </div>
32 </div>
31 <div class="input">
33 <div class="input">
32 ${h.text('fork_name',class_="small")}
34 ${h.text('fork_name',class_="small")}
33 ${h.hidden('repo_type',c.repo_info.repo_type)}
35 ${h.hidden('repo_type',c.repo_info.repo_type)}
34 </div>
36 </div>
35 </div>
37 </div>
36 <div class="field">
38 <div class="field">
37 <div class="label label-textarea">
39 <div class="label label-textarea">
38 <label for="description">${_('Description')}:</label>
40 <label for="description">${_('Description')}:</label>
39 </div>
41 </div>
40 <div class="textarea text-area editor">
42 <div class="textarea text-area editor">
41 ${h.textarea('description',cols=23,rows=5)}
43 ${h.textarea('description',cols=23,rows=5)}
42 </div>
44 </div>
43 </div>
45 </div>
44 <div class="field">
46 <div class="field">
45 <div class="label label-checkbox">
47 <div class="label label-checkbox">
46 <label for="private">${_('Private')}:</label>
48 <label for="private">${_('Private')}:</label>
47 </div>
49 </div>
48 <div class="checkboxes">
50 <div class="checkboxes">
49 ${h.checkbox('private',value="True")}
51 ${h.checkbox('private',value="True")}
50 </div>
52 </div>
51 </div>
53 </div>
52 <div class="buttons">
54 <div class="buttons">
53 ${h.submit('','fork this repository',class_="ui-button")}
55 ${h.submit('','fork this repository',class_="ui-button")}
54 </div>
56 </div>
55 </div>
57 </div>
56 </div>
58 </div>
57 ${h.end_form()}
59 ${h.end_form()}
58 </div>
60 </div>
59 </%def>
61 </%def>
@@ -1,195 +1,197
1 ## -*- coding: utf-8 -*-
1 ## -*- coding: utf-8 -*-
2 <%inherit file="/base/base.html"/>
2 <%inherit file="/base/base.html"/>
3
3
4 <%def name="title()">
4 <%def name="title()">
5 ${c.repo_name} ${_('Settings')} - ${c.rhodecode_name}
5 ${c.repo_name} ${_('Settings')} - ${c.rhodecode_name}
6 </%def>
6 </%def>
7
7
8 <%def name="breadcrumbs_links()">
8 <%def name="breadcrumbs_links()">
9 ${h.link_to(u'Home',h.url('/'))}
10 &raquo;
9 ${h.link_to(c.repo_info.repo_name,h.url('summary_home',repo_name=c.repo_info.repo_name))}
11 ${h.link_to(c.repo_info.repo_name,h.url('summary_home',repo_name=c.repo_info.repo_name))}
10 &raquo;
12 &raquo;
11 ${_('Settings')}
13 ${_('Settings')}
12 </%def>
14 </%def>
13
15
14 <%def name="page_nav()">
16 <%def name="page_nav()">
15 ${self.menu('settings')}
17 ${self.menu('settings')}
16 </%def>
18 </%def>
17 <%def name="main()">
19 <%def name="main()">
18 <div class="box">
20 <div class="box">
19 <!-- box / title -->
21 <!-- box / title -->
20 <div class="title">
22 <div class="title">
21 ${self.breadcrumbs()}
23 ${self.breadcrumbs()}
22 </div>
24 </div>
23 ${h.form(url('repo_settings_update', repo_name=c.repo_info.repo_name),method='put')}
25 ${h.form(url('repo_settings_update', repo_name=c.repo_info.repo_name),method='put')}
24 <div class="form">
26 <div class="form">
25 <!-- fields -->
27 <!-- fields -->
26 <div class="fields">
28 <div class="fields">
27 <div class="field">
29 <div class="field">
28 <div class="label">
30 <div class="label">
29 <label for="repo_name">${_('Name')}:</label>
31 <label for="repo_name">${_('Name')}:</label>
30 </div>
32 </div>
31 <div class="input input-medium">
33 <div class="input input-medium">
32 ${h.text('repo_name',class_="small")}
34 ${h.text('repo_name',class_="small")}
33 </div>
35 </div>
34 </div>
36 </div>
35
37
36 <div class="field">
38 <div class="field">
37 <div class="label label-textarea">
39 <div class="label label-textarea">
38 <label for="description">${_('Description')}:</label>
40 <label for="description">${_('Description')}:</label>
39 </div>
41 </div>
40 <div class="textarea text-area editor">
42 <div class="textarea text-area editor">
41 ${h.textarea('description',cols=23,rows=5)}
43 ${h.textarea('description',cols=23,rows=5)}
42 </div>
44 </div>
43 </div>
45 </div>
44
46
45 <div class="field">
47 <div class="field">
46 <div class="label label-checkbox">
48 <div class="label label-checkbox">
47 <label for="private">${_('Private')}:</label>
49 <label for="private">${_('Private')}:</label>
48 </div>
50 </div>
49 <div class="checkboxes">
51 <div class="checkboxes">
50 ${h.checkbox('private',value="True")}
52 ${h.checkbox('private',value="True")}
51 </div>
53 </div>
52 </div>
54 </div>
53
55
54 <div class="field">
56 <div class="field">
55 <div class="label">
57 <div class="label">
56 <label for="">${_('Permissions')}:</label>
58 <label for="">${_('Permissions')}:</label>
57 </div>
59 </div>
58 <div class="input">
60 <div class="input">
59 <%include file="../admin/repos/repo_edit_perms.html"/>
61 <%include file="../admin/repos/repo_edit_perms.html"/>
60 </div>
62 </div>
61
63
62 <div class="buttons">
64 <div class="buttons">
63 ${h.submit('update','Update',class_="ui-button")}
65 ${h.submit('update','Update',class_="ui-button")}
64 ${h.reset('reset','Reset',class_="ui-button")}
66 ${h.reset('reset','Reset',class_="ui-button")}
65 </div>
67 </div>
66 </div>
68 </div>
67 </div>
69 </div>
68 ${h.end_form()}
70 ${h.end_form()}
69 <script type="text/javascript">
71 <script type="text/javascript">
70 YAHOO.util.Event.onDOMReady(function(){
72 YAHOO.util.Event.onDOMReady(function(){
71 var D = YAHOO.util.Dom;
73 var D = YAHOO.util.Dom;
72 if(!D.hasClass('perm_new_user_name','error')){
74 if(!D.hasClass('perm_new_user_name','error')){
73 D.setStyle('add_perm_input','display','none');
75 D.setStyle('add_perm_input','display','none');
74 }
76 }
75 YAHOO.util.Event.addListener('add_perm','click',function(){
77 YAHOO.util.Event.addListener('add_perm','click',function(){
76 D.setStyle('add_perm_input','display','');
78 D.setStyle('add_perm_input','display','');
77 D.setStyle('add_perm','opacity','0.6');
79 D.setStyle('add_perm','opacity','0.6');
78 D.setStyle('add_perm','cursor','default');
80 D.setStyle('add_perm','cursor','default');
79 });
81 });
80 });
82 });
81 </script>
83 </script>
82 <script type="text/javascript">
84 <script type="text/javascript">
83 YAHOO.example.FnMultipleFields = function(){
85 YAHOO.example.FnMultipleFields = function(){
84 var myContacts = ${c.users_array|n}
86 var myContacts = ${c.users_array|n}
85
87
86 // Define a custom search function for the DataSource
88 // Define a custom search function for the DataSource
87 var matchNames = function(sQuery) {
89 var matchNames = function(sQuery) {
88 // Case insensitive matching
90 // Case insensitive matching
89 var query = sQuery.toLowerCase(),
91 var query = sQuery.toLowerCase(),
90 contact,
92 contact,
91 i=0,
93 i=0,
92 l=myContacts.length,
94 l=myContacts.length,
93 matches = [];
95 matches = [];
94
96
95 // Match against each name of each contact
97 // Match against each name of each contact
96 for(; i<l; i++) {
98 for(; i<l; i++) {
97 contact = myContacts[i];
99 contact = myContacts[i];
98 if((contact.fname.toLowerCase().indexOf(query) > -1) ||
100 if((contact.fname.toLowerCase().indexOf(query) > -1) ||
99 (contact.lname.toLowerCase().indexOf(query) > -1) ||
101 (contact.lname.toLowerCase().indexOf(query) > -1) ||
100 (contact.nname && (contact.nname.toLowerCase().indexOf(query) > -1))) {
102 (contact.nname && (contact.nname.toLowerCase().indexOf(query) > -1))) {
101 matches[matches.length] = contact;
103 matches[matches.length] = contact;
102 }
104 }
103 }
105 }
104
106
105 return matches;
107 return matches;
106 };
108 };
107
109
108 // Use a FunctionDataSource
110 // Use a FunctionDataSource
109 var oDS = new YAHOO.util.FunctionDataSource(matchNames);
111 var oDS = new YAHOO.util.FunctionDataSource(matchNames);
110 oDS.responseSchema = {
112 oDS.responseSchema = {
111 fields: ["id", "fname", "lname", "nname"]
113 fields: ["id", "fname", "lname", "nname"]
112 }
114 }
113
115
114 // Instantiate AutoComplete for perms
116 // Instantiate AutoComplete for perms
115 var oAC_perms = new YAHOO.widget.AutoComplete("perm_new_user_name", "perm_container", oDS);
117 var oAC_perms = new YAHOO.widget.AutoComplete("perm_new_user_name", "perm_container", oDS);
116 oAC_perms.useShadow = false;
118 oAC_perms.useShadow = false;
117 oAC_perms.resultTypeList = false;
119 oAC_perms.resultTypeList = false;
118
120
119 // Instantiate AutoComplete for owner
121 // Instantiate AutoComplete for owner
120 var oAC_owner = new YAHOO.widget.AutoComplete("user", "owner_container", oDS);
122 var oAC_owner = new YAHOO.widget.AutoComplete("user", "owner_container", oDS);
121 oAC_owner.useShadow = false;
123 oAC_owner.useShadow = false;
122 oAC_owner.resultTypeList = false;
124 oAC_owner.resultTypeList = false;
123
125
124
126
125 // Custom formatter to highlight the matching letters
127 // Custom formatter to highlight the matching letters
126 var custom_formatter = function(oResultData, sQuery, sResultMatch) {
128 var custom_formatter = function(oResultData, sQuery, sResultMatch) {
127 var query = sQuery.toLowerCase(),
129 var query = sQuery.toLowerCase(),
128 fname = oResultData.fname,
130 fname = oResultData.fname,
129 lname = oResultData.lname,
131 lname = oResultData.lname,
130 nname = oResultData.nname || "", // Guard against null value
132 nname = oResultData.nname || "", // Guard against null value
131 query = sQuery.toLowerCase(),
133 query = sQuery.toLowerCase(),
132 fnameMatchIndex = fname.toLowerCase().indexOf(query),
134 fnameMatchIndex = fname.toLowerCase().indexOf(query),
133 lnameMatchIndex = lname.toLowerCase().indexOf(query),
135 lnameMatchIndex = lname.toLowerCase().indexOf(query),
134 nnameMatchIndex = nname.toLowerCase().indexOf(query),
136 nnameMatchIndex = nname.toLowerCase().indexOf(query),
135 displayfname, displaylname, displaynname;
137 displayfname, displaylname, displaynname;
136
138
137 if(fnameMatchIndex > -1) {
139 if(fnameMatchIndex > -1) {
138 displayfname = highlightMatch(fname, query, fnameMatchIndex);
140 displayfname = highlightMatch(fname, query, fnameMatchIndex);
139 }
141 }
140 else {
142 else {
141 displayfname = fname;
143 displayfname = fname;
142 }
144 }
143
145
144 if(lnameMatchIndex > -1) {
146 if(lnameMatchIndex > -1) {
145 displaylname = highlightMatch(lname, query, lnameMatchIndex);
147 displaylname = highlightMatch(lname, query, lnameMatchIndex);
146 }
148 }
147 else {
149 else {
148 displaylname = lname;
150 displaylname = lname;
149 }
151 }
150
152
151 if(nnameMatchIndex > -1) {
153 if(nnameMatchIndex > -1) {
152 displaynname = "(" + highlightMatch(nname, query, nnameMatchIndex) + ")";
154 displaynname = "(" + highlightMatch(nname, query, nnameMatchIndex) + ")";
153 }
155 }
154 else {
156 else {
155 displaynname = nname ? "(" + nname + ")" : "";
157 displaynname = nname ? "(" + nname + ")" : "";
156 }
158 }
157
159
158 return displayfname + " " + displaylname + " " + displaynname;
160 return displayfname + " " + displaylname + " " + displaynname;
159
161
160 };
162 };
161 oAC_perms.formatResult = custom_formatter;
163 oAC_perms.formatResult = custom_formatter;
162 oAC_owner.formatResult = custom_formatter;
164 oAC_owner.formatResult = custom_formatter;
163
165
164 // Helper function for the formatter
166 // Helper function for the formatter
165 var highlightMatch = function(full, snippet, matchindex) {
167 var highlightMatch = function(full, snippet, matchindex) {
166 return full.substring(0, matchindex) +
168 return full.substring(0, matchindex) +
167 "<span class='match'>" +
169 "<span class='match'>" +
168 full.substr(matchindex, snippet.length) +
170 full.substr(matchindex, snippet.length) +
169 "</span>" +
171 "</span>" +
170 full.substring(matchindex + snippet.length);
172 full.substring(matchindex + snippet.length);
171 };
173 };
172
174
173 var myHandler = function(sType, aArgs) {
175 var myHandler = function(sType, aArgs) {
174 var myAC = aArgs[0]; // reference back to the AC instance
176 var myAC = aArgs[0]; // reference back to the AC instance
175 var elLI = aArgs[1]; // reference to the selected LI element
177 var elLI = aArgs[1]; // reference to the selected LI element
176 var oData = aArgs[2]; // object literal of selected item's result data
178 var oData = aArgs[2]; // object literal of selected item's result data
177 myAC.getInputEl().value = oData.nname;
179 myAC.getInputEl().value = oData.nname;
178 };
180 };
179
181
180 oAC_perms.itemSelectEvent.subscribe(myHandler);
182 oAC_perms.itemSelectEvent.subscribe(myHandler);
181 //oAC_owner.itemSelectEvent.subscribe(myHandler);
183 //oAC_owner.itemSelectEvent.subscribe(myHandler);
182
184
183 return {
185 return {
184 oDS: oDS,
186 oDS: oDS,
185 oAC_perms: oAC_perms,
187 oAC_perms: oAC_perms,
186 oAC_owner: oAC_owner,
188 oAC_owner: oAC_owner,
187 };
189 };
188 }();
190 }();
189
191
190 </script>
192 </script>
191 </div>
193 </div>
192 </div>
194 </div>
193 </%def>
195 </%def>
194
196
195
197
General Comments 0
You need to be logged in to leave comments. Login now