user_edit_my_account.html
229 lines
| 7.8 KiB
| text/html
|
HtmlLexer
r547 | ## -*- coding: utf-8 -*- | |||
<%inherit file="/base/base.html"/> | ||||
<%def name="title()"> | ||||
r619 | ${_('My account')} ${c.rhodecode_user.username} - ${c.rhodecode_name} | |||
r547 | </%def> | |||
<%def name="breadcrumbs_links()"> | ||||
${_('My Account')} | ||||
</%def> | ||||
<%def name="page_nav()"> | ||||
${self.menu('admin')} | ||||
</%def> | ||||
<%def name="main()"> | ||||
<div class="box box-left"> | ||||
<!-- box / title --> | ||||
<div class="title"> | ||||
r1888 | ${self.breadcrumbs()} | |||
r547 | </div> | |||
<!-- end box / title --> | ||||
r2353 | ${c.form|n} | |||
r1888 | </div> | |||
r547 | ||||
<div class="box box-right"> | ||||
<!-- box / title --> | ||||
<div class="title"> | ||||
r1888 | <h5> | |||
<input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" value="${_('quick filter...')}"/> | ||||
r2127 | <a id="show_my" class="link-white" href="#my">${_('My repos')}</a> / <a id="show_perms" class="link-white" href="#perms">${_('My permissions')}</a> | |||
r766 | </h5> | |||
%if h.HasPermissionAny('hg.admin','hg.create.repository')(): | ||||
<ul class="links"> | ||||
<li> | ||||
r2127 | <span>${h.link_to(_('ADD'),h.url('admin_settings_create_repository'))}</span> | |||
r1888 | </li> | |||
</ul> | ||||
%endif | ||||
r547 | </div> | |||
<!-- end box / title --> | ||||
r2127 | <div id="my" class="table"> | |||
<div id='repos_list_wrap' class="yui-skin-sam"> | ||||
<table id="repos_list"> | ||||
r663 | <thead> | |||
<tr> | ||||
r2127 | <th></th> | |||
r663 | <th class="left">${_('Name')}</th> | |||
r2127 | <th class="left">${_('Revision')}</th> | |||
<th class="left">${_('Action')}</th> | ||||
<th class="left">${_('Action')}</th> | ||||
r663 | </thead> | |||
r547 | <tbody> | |||
Vincent Duvert
|
r2304 | <%namespace name="dt" file="/data_table/_dt_elements.html"/> | ||
r547 | %if c.user_repos: | |||
r2129 | %for repo in c.user_repos: | |||
r547 | <tr> | |||
r2127 | ##QUICK MENU | |||
<td class="quick_repo_menu"> | ||||
${dt.quick_menu(repo['name'])} | ||||
r2129 | </td> | |||
r2127 | ##REPO NAME AND ICONS | |||
<td class="reponame"> | ||||
${dt.repo_name(repo['name'],repo['dbrepo']['repo_type'],repo['dbrepo']['private'],repo['dbrepo_fork'].get('repo_name'))} | ||||
</td> | ||||
##LAST REVISION | ||||
<td> | ||||
${dt.revision(repo['name'],repo['rev'],repo['tip'],repo['author'],repo['last_msg'])} | ||||
</td> | ||||
r1469 | <td><a href="${h.url('repo_settings_home',repo_name=repo['name'])}" title="${_('edit')}"><img class="icon" alt="${_('private')}" src="${h.url('/images/icons/application_form_edit.png')}"/></a></td> | |||
r547 | <td> | |||
r1171 | ${h.form(url('repo_settings_delete', repo_name=repo['name']),method='delete')} | |||
r1827 | ${h.submit('remove_%s' % repo['name'],'',class_="delete_icon action_button",onclick="return confirm('"+_('Confirm to delete this repository: %s') % repo['name']+"');")} | |||
r1888 | ${h.end_form()} | |||
r547 | </td> | |||
</tr> | ||||
%endfor | ||||
%else: | ||||
r1597 | <div style="padding:5px 0px 10px 0px;"> | |||
r1888 | ${_('No repositories yet')} | |||
r547 | %if h.HasPermissionAny('hg.admin','hg.create.repository')(): | |||
r1756 | ${h.link_to(_('create one now'),h.url('admin_settings_create_repository'),class_="ui-btn")} | |||
r547 | %endif | |||
r1597 | </div> | |||
r547 | %endif | |||
</tbody> | ||||
</table> | ||||
r2127 | </div> | |||
</div> | ||||
<div id="perms" class="table" style="display:none"> | ||||
%for section in sorted(c.rhodecode_user.permissions.keys()): | ||||
<div class="perms_section_head">${section.replace("_"," ").capitalize()}</div> | ||||
r2129 | ||||
r2127 | <div id='tbl_list_wrap_${section}' class="yui-skin-sam"> | |||
<table id="tbl_list_${section}"> | ||||
<thead> | ||||
<tr> | ||||
<th class="left">${_('Name')}</th> | ||||
<th class="left">${_('Permission')}</th> | ||||
</thead> | ||||
<tbody> | ||||
%for k in c.rhodecode_user.permissions[section]: | ||||
r2131 | <% | |||
if section != 'global': | ||||
section_perm = c.rhodecode_user.permissions[section].get(k) | ||||
_perm = section_perm.split('.')[-1] | ||||
else: | ||||
_perm = section_perm = None | ||||
%> | ||||
%if _perm not in ['none']: | ||||
r2127 | <tr> | |||
r2128 | <td> | |||
%if section == 'repositories': | ||||
<a href="${h.url('summary_home',repo_name=k)}">${k}</a> | ||||
%elif section == 'repositories_groups': | ||||
<a href="${h.url('repos_group_home',group_name=k)}">${k}</a> | ||||
%else: | ||||
${k} | ||||
%endif | ||||
</td> | ||||
r2127 | <td> | |||
%if section == 'global': | ||||
r2128 | ${h.bool2icon(True)} | |||
r2127 | %else: | |||
r2131 | <span class="perm_tag ${_perm}">${section_perm}</span> | |||
r2127 | %endif | |||
</td> | ||||
</tr> | ||||
r2131 | %endif | |||
r2127 | %endfor | |||
</tbody> | ||||
</table> | ||||
</div> | ||||
%endfor | ||||
r547 | </div> | |||
</div> | ||||
r1653 | <script type="text/javascript"> | |||
r2127 | var filter_activate = function(){ | |||
var nodes = YUQ('#my tr td a.repo_name'); | ||||
var func = function(node){ | ||||
return node.parentNode.parentNode.parentNode.parentNode; | ||||
} | ||||
r2129 | q_filter('q_filter',YUQ('#my tr td a.repo_name'),func); | |||
r1653 | } | |||
r2127 | ||||
YUE.on('show_my','click',function(e){ | ||||
YUD.setStyle('perms','display','none'); | ||||
YUD.setStyle('my','display',''); | ||||
YUD.get('q_filter').removeAttribute('disabled'); | ||||
filter_activate(); | ||||
YUE.preventDefault(e); | ||||
}) | ||||
YUE.on('show_perms','click',function(e){ | ||||
YUD.setStyle('my','display','none'); | ||||
YUD.setStyle('perms','display',''); | ||||
YUD.setAttribute('q_filter','disabled','disabled'); | ||||
YUE.preventDefault(e); | ||||
}) | ||||
// main table sorting | ||||
var myColumnDefs = [ | ||||
{key:"menu",label:"",sortable:false,className:"quick_repo_menu hidden"}, | ||||
{key:"name",label:"${_('Name')}",sortable:true, | ||||
sortOptions: { sortFunction: nameSort }}, | ||||
{key:"tip",label:"${_('Tip')}",sortable:true, | ||||
sortOptions: { sortFunction: revisionSort }}, | ||||
{key:"action1",label:"",sortable:false}, | ||||
{key:"action2",label:"",sortable:false}, | ||||
]; | ||||
var myDataSource = new YAHOO.util.DataSource(YUD.get("repos_list")); | ||||
myDataSource.responseType = YAHOO.util.DataSource.TYPE_HTMLTABLE; | ||||
myDataSource.responseSchema = { | ||||
fields: [ | ||||
{key:"menu"}, | ||||
{key:"name"}, | ||||
{key:"tip"}, | ||||
{key:"action1"}, | ||||
{key:"action2"}, | ||||
] | ||||
}; | ||||
var trans_defs = { | ||||
sortedBy:{key:"name",dir:"asc"}, | ||||
MSG_SORTASC:"${_('Click to sort ascending')}", | ||||
MSG_SORTDESC:"${_('Click to sort descending')}", | ||||
MSG_EMPTY:"${_('No records found.')}", | ||||
MSG_ERROR:"${_('Data error.')}", | ||||
MSG_LOADING:"${_('Loading...')}", | ||||
} | ||||
var myDataTable = new YAHOO.widget.DataTable("repos_list_wrap", myColumnDefs, myDataSource,trans_defs); | ||||
myDataTable.subscribe('postRenderEvent',function(oArgs) { | ||||
tooltip_activate(); | ||||
quick_repo_menu(); | ||||
filter_activate(); | ||||
}); | ||||
var permsColumnDefs = [ | ||||
{key:"name",label:"${_('Name')}",sortable:true, sortOptions: { sortFunction: permNameSort }}, | ||||
{key:"perm",label:"${_('Permission')}",sortable:false,}, | ||||
]; | ||||
// perms repos table | ||||
var myDataSource2 = new YAHOO.util.DataSource(YUD.get("tbl_list_repositories")); | ||||
myDataSource2.responseType = YAHOO.util.DataSource.TYPE_HTMLTABLE; | ||||
myDataSource2.responseSchema = { | ||||
fields: [ | ||||
{key:"name"}, | ||||
{key:"perm"}, | ||||
] | ||||
}; | ||||
new YAHOO.widget.DataTable("tbl_list_wrap_repositories", permsColumnDefs, myDataSource2, trans_defs); | ||||
//perms groups table | ||||
var myDataSource3 = new YAHOO.util.DataSource(YUD.get("tbl_list_repositories_groups")); | ||||
myDataSource3.responseType = YAHOO.util.DataSource.TYPE_HTMLTABLE; | ||||
myDataSource3.responseSchema = { | ||||
fields: [ | ||||
{key:"name"}, | ||||
{key:"perm"}, | ||||
] | ||||
}; | ||||
new YAHOO.widget.DataTable("tbl_list_wrap_repositories_groups", permsColumnDefs, myDataSource3, trans_defs); | ||||
r1653 | </script> | |||
r1888 | </%def> | |||