##// END OF EJS Templates
repository pages: cleanup of use of repository context menu
repository pages: cleanup of use of repository context menu

File last commit:

r3582:1f334a68 beta
r3601:51da0e01 beta
Show More
user_edit_my_account.html
284 lines | 9.1 KiB | text/html | HtmlLexer
/ rhodecode / templates / admin / users / user_edit_my_account.html
renamed project to rhodecode
r547 ## -*- coding: utf-8 -*-
<%inherit file="/base/base.html"/>
<%def name="title()">
improved title consistency...
r3582 ${_('My account')} ${c.rhodecode_user.username} &middot; ${c.rhodecode_name}
renamed project to rhodecode
r547 </%def>
<%def name="breadcrumbs_links()">
${_('My Account')}
</%def>
<%def name="page_nav()">
Mads Kiilerich
html: don't use tabs
r3197 ${self.menu('admin')}
renamed project to rhodecode
r547 </%def>
<%def name="main()">
<div class="box box-left">
<!-- box / title -->
<div class="title">
White-space cleanup
r1888 ${self.breadcrumbs()}
renamed project to rhodecode
r547 </div>
<!-- end box / title -->
highly improved performance of my_account page by removing super heavy htmlfill call on whole page
r2353 ${c.form|n}
White-space cleanup
r1888 </div>
renamed project to rhodecode
r547
<div class="box box-right">
<!-- box / title -->
<div class="title">
White-space cleanup
r1888 <h5>
Improvements to my account page...
r2624 <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" value="${_('quick filter...')}" style="display: none"/>
added add repository to my view
r766 </h5>
Improvements to my account page...
r2624 <ul class="links" style="color:#DADADA">
<li>
<span><a id="show_perms" class="link-white current" href="#perms">${_('My permissions')}</a> </span>
</li>
<li>
<span><a id="show_my" class="link-white" href="#my">${_('My repos')}</a> </span>
</li>
added add repository to my view
r766 <li>
remember selected tab in my account page
r2886 <span><a id="show_pullrequests" class="link-white" href="#pullrequests">${_('My pull requests')}</a> </span>
White-space cleanup
r1888 </li>
</ul>
renamed project to rhodecode
r547 </div>
<!-- end box / title -->
Mads Kiilerich
my_account: change markup so permission list get perms.table style
r3196 <div id="perms_container">
<div id="perms" class="table">
implemented #377 Users view own permissions...
r2127 %for section in sorted(c.rhodecode_user.permissions.keys()):
<div class="perms_section_head">${section.replace("_"," ").capitalize()}</div>
#399 added inheritance of permissions for users group on repos groups
r2129
implemented #377 Users view own permissions...
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]:
don't show empty permissions on my account page
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']:
implemented #377 Users view own permissions...
r2127 <tr>
linkify perms and make global ones display better
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>
implemented #377 Users view own permissions...
r2127 <td>
%if section == 'global':
linkify perms and make global ones display better
r2128 ${h.bool2icon(True)}
implemented #377 Users view own permissions...
r2127 %else:
don't show empty permissions on my account page
r2131 <span class="perm_tag ${_perm}">${section_perm}</span>
implemented #377 Users view own permissions...
r2127 %endif
</td>
</tr>
don't show empty permissions on my account page
r2131 %endif
implemented #377 Users view own permissions...
r2127 %endfor
</tbody>
</table>
</div>
%endfor
Mads Kiilerich
my_account: change markup so permission list get perms.table style
r3196 </div>
renamed project to rhodecode
r547 </div>
Use common function for generation of grid data...
r3154 <div id="my_container" style="display:none">
<div class="table yui-skin-sam" id="repos_list_wrap"></div>
<div id="user-paginator" style="padding: 0px 0px 0px 20px"></div>
white space cleanup
r2673 </div>
Use common function for generation of grid data...
r3154 <div id="pullrequests_container" class="table" style="display:none">
## loaded via AJAX
whitespace cleanup
r3168 ${_('Loading...')}
Use common function for generation of grid data...
r3154 </div>
renamed project to rhodecode
r547 </div>
fixed missing div on my_account + added nothing here yet when there are no...
r2722
one generic qfilter function.
r1653 <script type="text/javascript">
Hide closed pull requests on my page.
r3404 pyroutes.register('admin_settings_my_pullrequests', "${url('admin_settings_my_pullrequests')}", []);
remember selected tab in my account page
r2886
var show_perms = function(e){
YUD.addClass('show_perms', 'current');
YUD.removeClass('show_my','current');
YUD.removeClass('show_pullrequests','current');
white space cleanup
r2673
Use common function for generation of grid data...
r3154 YUD.setStyle('my_container','display','none');
YUD.setStyle('pullrequests_container','display','none');
YUD.setStyle('perms_container','display','');
white space cleanup
r2907 YUD.setStyle('q_filter','display','none');
remember selected tab in my account page
r2886 }
YUE.on('show_perms','click',function(e){
show_perms();
implemented #377 Users view own permissions...
r2127 })
remember selected tab in my account page
r2886
var show_my = function(e){
Improvements to my account page...
r2624 YUD.addClass('show_my', 'current');
YUD.removeClass('show_perms','current');
YUD.removeClass('show_pullrequests','current');
white space cleanup
r2673
Use common function for generation of grid data...
r3154 YUD.setStyle('perms_container','display','none');
YUD.setStyle('pullrequests_container','display','none');
YUD.setStyle('my_container','display','');
Improvements to my account page...
r2624 YUD.setStyle('q_filter','display','');
Use common function for generation of grid data...
r3154 if(!YUD.hasClass('show_my', 'loaded')){
Mads Kiilerich
html: don't use tabs
r3197 table_renderer(${c.data |n});
Use common function for generation of grid data...
r3154 YUD.addClass('show_my', 'loaded');
}
remember selected tab in my account page
r2886 }
YUE.on('show_my','click',function(e){
Mads Kiilerich
html: don't use tabs
r3197 show_my(e);
Improvements to my account page...
r2624 })
remember selected tab in my account page
r2886
var show_pullrequests = function(e){
Improvements to my account page...
r2624 YUD.addClass('show_pullrequests', 'current');
YUD.removeClass('show_my','current');
YUD.removeClass('show_perms','current');
Use common function for generation of grid data...
r3154 YUD.setStyle('my_container','display','none');
YUD.setStyle('perms_container','display','none');
YUD.setStyle('pullrequests_container','display','');
Improvements to my account page...
r2624 YUD.setStyle('q_filter','display','none');
white space cleanup
r2907
Hide closed pull requests on my page.
r3404 var url = pyroutes.url('admin_settings_my_pullrequests');
if(YUD.get('show_closed') && YUD.get('show_closed').checked) {
codecleaner, fix tabs -> spaces
r3449 var url = pyroutes.url('admin_settings_my_pullrequests', {'pr_show_closed': '1'});
Hide closed pull requests on my page.
r3404 }
ypjax(url, 'pullrequests_container', function(){
YUE.on('show_closed','change',function (e) {
show_pullrequests(e);
whitespace cleanup
r3413 });
Hide closed pull requests on my page.
r3404 });
remember selected tab in my account page
r2886 }
YUE.on('show_pullrequests','click',function(e){
Mads Kiilerich
html: don't use tabs
r3197 show_pullrequests(e)
implemented #377 Users view own permissions...
r2127 })
remember selected tab in my account page
r2886 var tabs = {
'perms': show_perms,
'my': show_my,
'pullrequests': show_pullrequests
}
white space cleanup
r2907 var url = location.href.split('#');
if (url[1]) {
//We have a hash
remember selected tab in my account page
r2886 var tabHash = url[1];
fix small issue with anchor autolinks
r3120 var func = tabs[tabHash]
if (func){
func();
}
remember selected tab in my account page
r2886 }
Use common function for generation of grid data...
r3154 function table_renderer(data){
Mads Kiilerich
html: random indentation fixes
r3198 var myDataSource = new YAHOO.util.DataSource(data);
myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSON;
Use common function for generation of grid data...
r3154
Mads Kiilerich
html: random indentation fixes
r3198 myDataSource.responseSchema = {
resultsList: "records",
fields: [
{key:"menu"},
{key:"raw_name"},
{key:"name"},
{key:"last_changeset"},
{key:"action"},
]
};
myDataSource.doBeforeCallback = function(req,raw,res,cb) {
// This is the filter function
var data = res.results || [],
filtered = [],
i,l;
Use common function for generation of grid data...
r3154
Mads Kiilerich
html: random indentation fixes
r3198 if (req) {
req = req.toLowerCase();
for (i = 0; i<data.length; i++) {
var pos = data[i].raw_name.toLowerCase().indexOf(req)
if (pos != -1) {
filtered.push(data[i]);
}
}
res.results = filtered;
}
return res;
}
whitespace cleanup
r3168
Mads Kiilerich
html: don't use tabs
r3197 // 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:"last_changeset",label:"${_('Tip')}",sortable:true,
sortOptions: { sortFunction: revisionSort }},
{key:"action",label:"${_('Action')}",sortable:false},
];
implemented #377 Users view own permissions...
r2127
Mads Kiilerich
html: don't use tabs
r3197 var myDataTable = new YAHOO.widget.DataTable("repos_list_wrap", myColumnDefs, myDataSource,{
sortedBy:{key:"name",dir:"asc"},
paginator: new YAHOO.widget.Paginator({
rowsPerPage: 50,
alwaysVisible: false,
template : "{PreviousPageLink} {FirstPageLink} {PageLinks} {LastPageLink} {NextPageLink}",
pageLinks: 5,
containerClass: 'pagination-wh',
currentPageClass: 'pager_curpage',
pageLinkClass: 'pager_link',
nextPageLinkLabel: '&gt;',
previousPageLinkLabel: '&lt;',
firstPageLinkLabel: '&lt;&lt;',
lastPageLinkLabel: '&gt;&gt;',
containers:['user-paginator']
}),
Use common function for generation of grid data...
r3154
Mads Kiilerich
html: don't use tabs
r3197 MSG_SORTASC:"${_('Click to sort ascending')}",
MSG_SORTDESC:"${_('Click to sort descending')}",
MSG_EMPTY:"${_('No records found.')}",
MSG_ERROR:"${_('Data error.')}",
MSG_LOADING:"${_('Loading...')}",
}
);
myDataTable.subscribe('postRenderEvent',function(oArgs) {
tooltip_activate();
quick_repo_menu();
});
Use common function for generation of grid data...
r3154
Mads Kiilerich
html: don't use tabs
r3197 var filterTimeout = null;
implemented #377 Users view own permissions...
r2127
Mads Kiilerich
html: don't use tabs
r3197 updateFilter = function() {
// Reset timeout
filterTimeout = null;
implemented #377 Users view own permissions...
r2127
Mads Kiilerich
html: don't use tabs
r3197 // Reset sort
var state = myDataTable.getState();
state.sortedBy = {key:'name', dir:YAHOO.widget.DataTable.CLASS_ASC};
implemented #377 Users view own permissions...
r2127
Mads Kiilerich
html: don't use tabs
r3197 // Get filtered data
myDataSource.sendRequest(YUD.get('q_filter').value,{
success : myDataTable.onDataReturnInitializeTable,
failure : myDataTable.onDataReturnInitializeTable,
scope : myDataTable,
argument: state
});
implemented #377 Users view own permissions...
r2127
Mads Kiilerich
html: don't use tabs
r3197 };
YUE.on('q_filter','click',function(){
if(!YUD.hasClass('q_filter', 'loaded')){
YUD.get('q_filter').value = '';
//TODO: load here full list later to do search within groups
YUD.addClass('q_filter', 'loaded');
}
});
implemented #377 Users view own permissions...
r2127
Mads Kiilerich
html: don't use tabs
r3197 YUE.on('q_filter','keyup',function (e) {
clearTimeout(filterTimeout);
filterTimeout = setTimeout(updateFilter,600);
});
Hide closed pull requests on my page.
r3404
Mads Kiilerich
html: don't use tabs
r3197 }
one generic qfilter function.
r1653 </script>
White-space cleanup
r1888 </%def>