##// END OF EJS Templates
mercurial middleware now returns 500's instead of 404 on errors and 404 when repo not found, added tracebacks
mercurial middleware now returns 500's instead of 404 on errors and 404 when repo not found, added tracebacks

File last commit:

r328:cec5cbc9 default
r334:6c23e724 default
Show More
repo_edit.html
248 lines | 8.6 KiB | text/html | HtmlLexer
Cleaned the way based was used to generate submenu for admin, now it's much more clear to use submenu. Cleaned admin and added comment to middleware
r216 ## -*- coding: utf-8 -*-
<%inherit file="/base/base.html"/>
Html changes and cleanups, made folders for html templates, implemented tags and branches pages
r127 <%def name="title()">
Cleaned the way based was used to generate submenu for admin, now it's much more clear to use submenu. Cleaned admin and added comment to middleware
r216 ${_('Repositories administration')}
Html changes and cleanups, made folders for html templates, implemented tags and branches pages
r127 </%def>
<%def name="breadcrumbs()">
Cleaned the way based was used to generate submenu for admin, now it's much more clear to use submenu. Cleaned admin and added comment to middleware
r216 ${h.link_to(u'Admin',h.url('admin_home'))}
/
Admin templating updates, added rest permission controllers
r230 ${_('Repos')}
Html changes and cleanups, made folders for html templates, implemented tags and branches pages
r127 </%def>
<%def name="page_nav()">
new way of menu generation for base, and all admin pages
r182 ${self.menu('admin')}
Cleaned the way based was used to generate submenu for admin, now it's much more clear to use submenu. Cleaned admin and added comment to middleware
r216 ${self.submenu('repos')}
Html changes and cleanups, made folders for html templates, implemented tags and branches pages
r127 </%def>
<%def name="main()">
<div>
repos crud controllers - change id into repo_name for compatability, added ajax repo perm user function variuos html fixes, permissions forms and managment fixes....
r299 <h2>${_('Repositories')} - ${_('edit')} "${c.repo_name}"</h2>
${h.form(url('repo', repo_name=c.repo_info.repo_name),method='put')}
Cleaned the way based was used to generate submenu for admin, now it's much more clear to use submenu. Cleaned admin and added comment to middleware
r216 <table>
<tr>
<td>${_('Name')}</td>
repos crud controllers - change id into repo_name for compatability, added ajax repo perm user function variuos html fixes, permissions forms and managment fixes....
r299 <td>${h.text('repo_name',size="28")}</td>
Implemented basic repository managment. Implemented repo2db mappings, model, helpers updates and code cleanups
r265 <td>${self.get_form_error('repo_name')}</td>
Cleaned the way based was used to generate submenu for admin, now it's much more clear to use submenu. Cleaned admin and added comment to middleware
r216 </tr>
<tr>
<td>${_('Description')}</td>
repos crud controllers - change id into repo_name for compatability, added ajax repo perm user function variuos html fixes, permissions forms and managment fixes....
r299 <td>${h.textarea('description',cols=32,rows=5)}</td>
Implemented basic repository managment. Implemented repo2db mappings, model, helpers updates and code cleanups
r265 <td>${self.get_form_error('description')}</td>
Cleaned the way based was used to generate submenu for admin, now it's much more clear to use submenu. Cleaned admin and added comment to middleware
r216 </tr>
<tr>
<td>${_('Private')}</td>
repos crud controllers - change id into repo_name for compatability, added ajax repo perm user function variuos html fixes, permissions forms and managment fixes....
r299 <td>${h.checkbox('private',value="True")}</td>
Implemented basic repository managment. Implemented repo2db mappings, model, helpers updates and code cleanups
r265 <td>${self.get_form_error('private')}</td>
</tr>
<tr>
<td>${_('Owner')}</td>
autocomplete for repository managment of users
r298 <td class='ac'>
Repository managment permissions, fixed found bugs updated js, added extra checks for doubled users and non active ones
r328 <div class="perm_ac">
autocomplete for repository managment of users
r298 ${h.text('user',class_='yui-ac-input')}
<div id="owner_container"></div>
</div>
</td>
Implemented basic repository managment. Implemented repo2db mappings, model, helpers updates and code cleanups
r265 <td>${self.get_form_error('user')}</td>
Cleaned the way based was used to generate submenu for admin, now it's much more clear to use submenu. Cleaned admin and added comment to middleware
r216 </tr>
<tr>
first permissions commit: added permission managment on repository edit. Changed db rmissions, validators.
r296 <td>${_('Permissions')}</td>
<td>
<table>
<tr>
<td>${_('none')}</td>
<td>${_('read')}</td>
<td>${_('write')}</td>
<td>${_('admin')}</td>
<td>${_('user')}</td>
</tr>
%for r2p in c.repo_info.repo2perm:
repos crud controllers - change id into repo_name for compatability, added ajax repo perm user function variuos html fixes, permissions forms and managment fixes....
r299 %if r2p.user.username =='default' and c.repo_info.private:
<tr>
<td colspan="4">
<span style="font-size: 0.8em">${_('disabled for private repository')}</span></td>
<td>${r2p.user.username}</td>
</tr>
%else:
Repository managment permissions, fixed found bugs updated js, added extra checks for doubled users and non active ones
r328 <tr id="id${id(r2p.user.username)}">
first permissions commit: added permission managment on repository edit. Changed db rmissions, validators.
r296 <td>${h.radio('perm_%s' % r2p.user.username,'repository.none')}</td>
<td>${h.radio('perm_%s' % r2p.user.username,'repository.read')}</td>
<td>${h.radio('perm_%s' % r2p.user.username,'repository.write')}</td>
<td>${h.radio('perm_%s' % r2p.user.username,'repository.admin')}</td>
<td>${r2p.user.username}</td>
repos crud controllers - change id into repo_name for compatability, added ajax repo perm user function variuos html fixes, permissions forms and managment fixes....
r299 <td>
%if r2p.user.username !='default':
Repository managment permissions, fixed found bugs updated js, added extra checks for doubled users and non active ones
r328 <span class="delete_icon action_button" onclick="ajaxAction(${r2p.user.user_id},'${'id%s'%id(r2p.user.username)}')">
repos crud controllers - change id into repo_name for compatability, added ajax repo perm user function variuos html fixes, permissions forms and managment fixes....
r299 <script type="text/javascript">
function ajaxAction(user_id,field_id){
var sUrl = "${h.url('delete_repo_user',repo_name=c.repo_name)}";
var callback = { success:function(o){
Repository managment permissions, fixed found bugs updated js, added extra checks for doubled users and non active ones
r328 var tr = YAHOO.util.Dom.get(String(field_id));
tr.parentNode.removeChild(tr);}};
repos crud controllers - change id into repo_name for compatability, added ajax repo perm user function variuos html fixes, permissions forms and managment fixes....
r299 var postData = '_method=delete&user_id='+user_id;
Repository managment permissions, fixed found bugs updated js, added extra checks for doubled users and non active ones
r328 var request = YAHOO.util.Connect.asyncRequest('POST', sUrl, callback, postData);};
repos crud controllers - change id into repo_name for compatability, added ajax repo perm user function variuos html fixes, permissions forms and managment fixes....
r299 </script>
</span>
%endif
</td>
first permissions commit: added permission managment on repository edit. Changed db rmissions, validators.
r296 </tr>
repos crud controllers - change id into repo_name for compatability, added ajax repo perm user function variuos html fixes, permissions forms and managment fixes....
r299 %endif
first permissions commit: added permission managment on repository edit. Changed db rmissions, validators.
r296 %endfor
<%
if not hasattr(c,'form_errors'):
d = 'display:none;'
else:
d=''
%>
<tr id="add_perm_input" style="${d}">
<td>${h.radio('perm_new_user','repository.none')}</td>
<td>${h.radio('perm_new_user','repository.read')}</td>
<td>${h.radio('perm_new_user','repository.write')}</td>
<td>${h.radio('perm_new_user','repository.admin')}</td>
autocomplete for repository managment of users
r298 <td class='ac'>
Repository managment permissions, fixed found bugs updated js, added extra checks for doubled users and non active ones
r328 <div class="perm_ac" id="perm_ac">
autocomplete for repository managment of users
r298 ${h.text('perm_new_user_name',class_='yui-ac-input')}
<div id="perm_container"></div>
</div>
</td>
first permissions commit: added permission managment on repository edit. Changed db rmissions, validators.
r296 <td>${self.get_form_error('perm_new_user_name')}</td>
</tr>
<tr>
<td colspan="4">
<span id="add_perm" class="add_icon" style="cursor: pointer;">
${_('Add another user')}
</span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
Cleaned the way based was used to generate submenu for admin, now it's much more clear to use submenu. Cleaned admin and added comment to middleware
r216 <td></td>
repo edit
r220 <td>${h.submit('update','update')}</td>
Cleaned the way based was used to generate submenu for admin, now it's much more clear to use submenu. Cleaned admin and added comment to middleware
r216 </tr>
</table>
${h.end_form()}
first permissions commit: added permission managment on repository edit. Changed db rmissions, validators.
r296 <script type="text/javascript">
YAHOO.util.Event.onDOMReady(function(){
var D = YAHOO.util.Dom;
YAHOO.util.Event.addListener('add_perm','click',function(){
D.setStyle('add_perm_input','display','');
D.setStyle('add_perm','opacity','0.6');
D.setStyle('add_perm','cursor','default');
});
});
</script>
autocomplete for repository managment of users
r298 <script type="text/javascript">
YAHOO.example.FnMultipleFields = function(){
var myContacts = ${c.users_array|n}
// Define a custom search function for the DataSource
var matchNames = function(sQuery) {
// Case insensitive matching
var query = sQuery.toLowerCase(),
contact,
i=0,
l=myContacts.length,
matches = [];
// Match against each name of each contact
for(; i<l; i++) {
contact = myContacts[i];
if((contact.fname.toLowerCase().indexOf(query) > -1) ||
(contact.lname.toLowerCase().indexOf(query) > -1) ||
(contact.nname && (contact.nname.toLowerCase().indexOf(query) > -1))) {
matches[matches.length] = contact;
}
}
return matches;
};
// Use a FunctionDataSource
var oDS = new YAHOO.util.FunctionDataSource(matchNames);
oDS.responseSchema = {
fields: ["id", "fname", "lname", "nname"]
}
// Instantiate AutoComplete for perms
var oAC_perms = new YAHOO.widget.AutoComplete("perm_new_user_name", "perm_container", oDS);
oAC_perms.useShadow = false;
oAC_perms.resultTypeList = false;
// Instantiate AutoComplete for owner
var oAC_owner = new YAHOO.widget.AutoComplete("user", "owner_container", oDS);
oAC_owner.useShadow = false;
oAC_owner.resultTypeList = false;
// Custom formatter to highlight the matching letters
var custom_formatter = function(oResultData, sQuery, sResultMatch) {
var query = sQuery.toLowerCase(),
fname = oResultData.fname,
lname = oResultData.lname,
nname = oResultData.nname || "", // Guard against null value
query = sQuery.toLowerCase(),
fnameMatchIndex = fname.toLowerCase().indexOf(query),
lnameMatchIndex = lname.toLowerCase().indexOf(query),
nnameMatchIndex = nname.toLowerCase().indexOf(query),
displayfname, displaylname, displaynname;
if(fnameMatchIndex > -1) {
displayfname = highlightMatch(fname, query, fnameMatchIndex);
}
else {
displayfname = fname;
}
if(lnameMatchIndex > -1) {
displaylname = highlightMatch(lname, query, lnameMatchIndex);
}
else {
displaylname = lname;
}
if(nnameMatchIndex > -1) {
displaynname = "(" + highlightMatch(nname, query, nnameMatchIndex) + ")";
}
else {
displaynname = nname ? "(" + nname + ")" : "";
}
return displayfname + " " + displaylname + " " + displaynname;
};
oAC_perms.formatResult = custom_formatter;
oAC_owner.formatResult = custom_formatter;
// Helper function for the formatter
var highlightMatch = function(full, snippet, matchindex) {
return full.substring(0, matchindex) +
"<span class='match'>" +
full.substr(matchindex, snippet.length) +
"</span>" +
full.substring(matchindex + snippet.length);
};
var myHandler = function(sType, aArgs) {
var myAC = aArgs[0]; // reference back to the AC instance
var elLI = aArgs[1]; // reference to the selected LI element
var oData = aArgs[2]; // object literal of selected item's result data
myAC.getInputEl().value = oData.nname;
};
oAC_perms.itemSelectEvent.subscribe(myHandler);
oAC_owner.itemSelectEvent.subscribe(myHandler);
return {
oDS: oDS,
oAC_perms: oAC_perms,
oAC_owner: oAC_owner,
};
}();
</script>
Html changes and cleanups, made folders for html templates, implemented tags and branches pages
r127 </div>
Cleaned the way based was used to generate submenu for admin, now it's much more clear to use submenu. Cleaned admin and added comment to middleware
r216 </%def>