annotate rhodecode/templates/admin/users/user_edit_my_account.html @ 2624:19daa8d761dc beta

Improvements to my account page - lazy load repositories via ajax results in much faster page load - added pull requests tab to see my pullrequests and the ones i participate in - new style tabs
author Marcin Kuzminski <marcin@python-works.com>
date Mon, 16 Jul 2012 23:19:34 +0200
parents ef71d7e63806
children d5e42c00f3c1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
371
5cd6616b8673 routes python 2.5 compatible
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
1 ## -*- coding: utf-8 -*-
5cd6616b8673 routes python 2.5 compatible
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
2 <%inherit file="/base/base.html"/>
5cd6616b8673 routes python 2.5 compatible
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
3
5cd6616b8673 routes python 2.5 compatible
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
4 <%def name="title()">
619
a1ec653f5f95 #38 updated RhodeCode titles
Marcin Kuzminski <marcin@python-works.com>
parents: 548
diff changeset
5 ${_('My account')} ${c.rhodecode_user.username} - ${c.rhodecode_name}
371
5cd6616b8673 routes python 2.5 compatible
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
6 </%def>
5cd6616b8673 routes python 2.5 compatible
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
7
5cd6616b8673 routes python 2.5 compatible
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
8 <%def name="breadcrumbs_links()">
5cd6616b8673 routes python 2.5 compatible
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
9 ${_('My Account')}
5cd6616b8673 routes python 2.5 compatible
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
10 </%def>
5cd6616b8673 routes python 2.5 compatible
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
11
5cd6616b8673 routes python 2.5 compatible
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
12 <%def name="page_nav()">
5cd6616b8673 routes python 2.5 compatible
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
13 ${self.menu('admin')}
5cd6616b8673 routes python 2.5 compatible
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
14 </%def>
5cd6616b8673 routes python 2.5 compatible
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
15
5cd6616b8673 routes python 2.5 compatible
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
16 <%def name="main()">
447
70c2750531d3 rewrote sorting on main page, to clickable headers.
Marcin Kuzminski <marcin@python-works.com>
parents: 446
diff changeset
17
446
a0a93357f954 started my page rewrite
Marcin Kuzminski <marcin@python-works.com>
parents: 403
diff changeset
18 <div class="box box-left">
371
5cd6616b8673 routes python 2.5 compatible
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
19 <!-- box / title -->
5cd6616b8673 routes python 2.5 compatible
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
20 <div class="title">
1888
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1827
diff changeset
21 ${self.breadcrumbs()}
371
5cd6616b8673 routes python 2.5 compatible
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
22 </div>
5cd6616b8673 routes python 2.5 compatible
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
23 <!-- end box / title -->
2353
ef71d7e63806 highly improved performance of my_account page by removing super heavy htmlfill call on whole page
Marcin Kuzminski <marcin@python-works.com>
parents: 2304
diff changeset
24 ${c.form|n}
1888
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1827
diff changeset
25 </div>
446
a0a93357f954 started my page rewrite
Marcin Kuzminski <marcin@python-works.com>
parents: 403
diff changeset
26
a0a93357f954 started my page rewrite
Marcin Kuzminski <marcin@python-works.com>
parents: 403
diff changeset
27 <div class="box box-right">
a0a93357f954 started my page rewrite
Marcin Kuzminski <marcin@python-works.com>
parents: 403
diff changeset
28 <!-- box / title -->
a0a93357f954 started my page rewrite
Marcin Kuzminski <marcin@python-works.com>
parents: 403
diff changeset
29 <div class="title">
1888
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1827
diff changeset
30 <h5>
2624
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
31 <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" value="${_('quick filter...')}" style="display: none"/>
766
03c242fbca9c added add repository to my view
Marcin Kuzminski <marcin@python-works.com>
parents: 718
diff changeset
32 </h5>
2624
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
33 <ul class="links" style="color:#DADADA">
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
34 <li>
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
35 <span><a id="show_perms" class="link-white current" href="#perms">${_('My permissions')}</a> </span>
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
36 </li>
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
37 <li>
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
38 <span><a id="show_my" class="link-white" href="#my">${_('My repos')}</a> </span>
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
39 </li>
766
03c242fbca9c added add repository to my view
Marcin Kuzminski <marcin@python-works.com>
parents: 718
diff changeset
40 <li>
2624
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
41 <span><a id="show_pullrequests" class="link-white" href="#perms">${_('My pull requests')}</a> </span>
1888
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1827
diff changeset
42 </li>
2624
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
43 %if h.HasPermissionAny('hg.admin','hg.create.repository')():
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
44 <li>
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
45 <span>${h.link_to(_('Add repo'),h.url('admin_settings_create_repository'))}</span>
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
46 </li>
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
47 %endif
1888
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1827
diff changeset
48 </ul>
446
a0a93357f954 started my page rewrite
Marcin Kuzminski <marcin@python-works.com>
parents: 403
diff changeset
49 </div>
a0a93357f954 started my page rewrite
Marcin Kuzminski <marcin@python-works.com>
parents: 403
diff changeset
50 <!-- end box / title -->
2624
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
51 <div id="perms" class="table">
2127
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
52 %for section in sorted(c.rhodecode_user.permissions.keys()):
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
53 <div class="perms_section_head">${section.replace("_"," ").capitalize()}</div>
2129
43481c3d70ca #399 added inheritance of permissions for users group on repos groups
Marcin Kuzminski <marcin@python-works.com>
parents: 2128
diff changeset
54
2127
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
55 <div id='tbl_list_wrap_${section}' class="yui-skin-sam">
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
56 <table id="tbl_list_${section}">
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
57 <thead>
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
58 <tr>
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
59 <th class="left">${_('Name')}</th>
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
60 <th class="left">${_('Permission')}</th>
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
61 </thead>
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
62 <tbody>
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
63 %for k in c.rhodecode_user.permissions[section]:
2131
d683d8bc4be3 don't show empty permissions on my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2129
diff changeset
64 <%
d683d8bc4be3 don't show empty permissions on my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2129
diff changeset
65 if section != 'global':
d683d8bc4be3 don't show empty permissions on my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2129
diff changeset
66 section_perm = c.rhodecode_user.permissions[section].get(k)
d683d8bc4be3 don't show empty permissions on my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2129
diff changeset
67 _perm = section_perm.split('.')[-1]
d683d8bc4be3 don't show empty permissions on my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2129
diff changeset
68 else:
d683d8bc4be3 don't show empty permissions on my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2129
diff changeset
69 _perm = section_perm = None
d683d8bc4be3 don't show empty permissions on my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2129
diff changeset
70 %>
d683d8bc4be3 don't show empty permissions on my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2129
diff changeset
71 %if _perm not in ['none']:
2127
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
72 <tr>
2128
e29c688e6885 linkify perms and make global ones display better
Marcin Kuzminski <marcin@python-works.com>
parents: 2127
diff changeset
73 <td>
e29c688e6885 linkify perms and make global ones display better
Marcin Kuzminski <marcin@python-works.com>
parents: 2127
diff changeset
74 %if section == 'repositories':
e29c688e6885 linkify perms and make global ones display better
Marcin Kuzminski <marcin@python-works.com>
parents: 2127
diff changeset
75 <a href="${h.url('summary_home',repo_name=k)}">${k}</a>
e29c688e6885 linkify perms and make global ones display better
Marcin Kuzminski <marcin@python-works.com>
parents: 2127
diff changeset
76 %elif section == 'repositories_groups':
e29c688e6885 linkify perms and make global ones display better
Marcin Kuzminski <marcin@python-works.com>
parents: 2127
diff changeset
77 <a href="${h.url('repos_group_home',group_name=k)}">${k}</a>
e29c688e6885 linkify perms and make global ones display better
Marcin Kuzminski <marcin@python-works.com>
parents: 2127
diff changeset
78 %else:
e29c688e6885 linkify perms and make global ones display better
Marcin Kuzminski <marcin@python-works.com>
parents: 2127
diff changeset
79 ${k}
e29c688e6885 linkify perms and make global ones display better
Marcin Kuzminski <marcin@python-works.com>
parents: 2127
diff changeset
80 %endif
e29c688e6885 linkify perms and make global ones display better
Marcin Kuzminski <marcin@python-works.com>
parents: 2127
diff changeset
81 </td>
2127
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
82 <td>
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
83 %if section == 'global':
2128
e29c688e6885 linkify perms and make global ones display better
Marcin Kuzminski <marcin@python-works.com>
parents: 2127
diff changeset
84 ${h.bool2icon(True)}
2127
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
85 %else:
2131
d683d8bc4be3 don't show empty permissions on my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2129
diff changeset
86 <span class="perm_tag ${_perm}">${section_perm}</span>
2127
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
87 %endif
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
88 </td>
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
89 </tr>
2131
d683d8bc4be3 don't show empty permissions on my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2129
diff changeset
90 %endif
2127
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
91 %endfor
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
92 </tbody>
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
93 </table>
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
94 </div>
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
95 %endfor
446
a0a93357f954 started my page rewrite
Marcin Kuzminski <marcin@python-works.com>
parents: 403
diff changeset
96 </div>
2624
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
97 <div id="my" class="table" style="display:none">
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
98 </div>
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
99 <div id="pullrequests" class="table" style="display:none">
446
a0a93357f954 started my page rewrite
Marcin Kuzminski <marcin@python-works.com>
parents: 403
diff changeset
100 </div>
1653
b1e1dffd595c one generic qfilter function.
Marcin Kuzminski <marcin@python-works.com>
parents: 1650
diff changeset
101 <script type="text/javascript">
2127
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
102 var filter_activate = function(){
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
103 var nodes = YUQ('#my tr td a.repo_name');
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
104 var func = function(node){
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
105 return node.parentNode.parentNode.parentNode.parentNode;
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
106 }
2129
43481c3d70ca #399 added inheritance of permissions for users group on repos groups
Marcin Kuzminski <marcin@python-works.com>
parents: 2128
diff changeset
107 q_filter('q_filter',YUQ('#my tr td a.repo_name'),func);
1653
b1e1dffd595c one generic qfilter function.
Marcin Kuzminski <marcin@python-works.com>
parents: 1650
diff changeset
108 }
2624
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
109 YUE.on('show_perms','click',function(e){
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
110 YUD.addClass('show_perms', 'current');
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
111 YUD.removeClass('show_my','current');
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
112 YUD.removeClass('show_pullrequests','current');
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
113
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
114 YUD.setStyle('my','display','none');
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
115 YUD.setStyle('pullrequests','display','none');
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
116 YUD.setStyle('perms','display','');
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
117 YUD.setStyle('q_filter','display','none');
2127
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
118 YUE.preventDefault(e);
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
119 })
2624
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
120 YUE.on('show_my','click',function(e){
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
121 YUD.addClass('show_my', 'current');
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
122 YUD.removeClass('show_perms','current');
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
123 YUD.removeClass('show_pullrequests','current');
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
124
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
125 YUD.setStyle('perms','display','none');
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
126 YUD.setStyle('pullrequests','display','none');
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
127 YUD.setStyle('my','display','');
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
128 YUD.setStyle('q_filter','display','');
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
129
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
130 YUE.preventDefault(e);
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
131 var url = "${h.url('admin_settings_my_repos')}";
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
132 ypjax(url, 'my', function(){
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
133 table_sort();
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
134 filter_activate();
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
135 });
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
136 })
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
137 YUE.on('show_pullrequests','click',function(e){
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
138 YUD.addClass('show_pullrequests', 'current');
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
139 YUD.removeClass('show_my','current');
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
140 YUD.removeClass('show_perms','current');
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
141
2127
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
142 YUD.setStyle('my','display','none');
2624
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
143 YUD.setStyle('perms','display','none');
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
144 YUD.setStyle('pullrequests','display','');
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
145 YUD.setStyle('q_filter','display','none');
2127
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
146 YUE.preventDefault(e);
2624
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
147 var url = "${h.url('admin_settings_my_pullrequests')}";
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
148 ypjax(url, 'pullrequests');
2127
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
149 })
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
150
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
151 // main table sorting
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
152 var myColumnDefs = [
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
153 {key:"menu",label:"",sortable:false,className:"quick_repo_menu hidden"},
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
154 {key:"name",label:"${_('Name')}",sortable:true,
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
155 sortOptions: { sortFunction: nameSort }},
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
156 {key:"tip",label:"${_('Tip')}",sortable:true,
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
157 sortOptions: { sortFunction: revisionSort }},
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
158 {key:"action1",label:"",sortable:false},
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
159 {key:"action2",label:"",sortable:false},
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
160 ];
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
161
2624
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
162 function table_sort(){
2127
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
163 var myDataSource = new YAHOO.util.DataSource(YUD.get("repos_list"));
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
164 myDataSource.responseType = YAHOO.util.DataSource.TYPE_HTMLTABLE;
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
165 myDataSource.responseSchema = {
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
166 fields: [
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
167 {key:"menu"},
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
168 {key:"name"},
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
169 {key:"tip"},
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
170 {key:"action1"},
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
171 {key:"action2"},
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
172 ]
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
173 };
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
174 var trans_defs = {
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
175 sortedBy:{key:"name",dir:"asc"},
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
176 MSG_SORTASC:"${_('Click to sort ascending')}",
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
177 MSG_SORTDESC:"${_('Click to sort descending')}",
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
178 MSG_EMPTY:"${_('No records found.')}",
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
179 MSG_ERROR:"${_('Data error.')}",
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
180 MSG_LOADING:"${_('Loading...')}",
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
181 }
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
182 var myDataTable = new YAHOO.widget.DataTable("repos_list_wrap", myColumnDefs, myDataSource,trans_defs);
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
183 myDataTable.subscribe('postRenderEvent',function(oArgs) {
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
184 tooltip_activate();
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
185 quick_repo_menu();
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
186 filter_activate();
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
187 });
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
188
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
189 var permsColumnDefs = [
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
190 {key:"name",label:"${_('Name')}",sortable:true, sortOptions: { sortFunction: permNameSort }},
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
191 {key:"perm",label:"${_('Permission')}",sortable:false,},
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
192 ];
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
193
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
194 // perms repos table
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
195 var myDataSource2 = new YAHOO.util.DataSource(YUD.get("tbl_list_repositories"));
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
196 myDataSource2.responseType = YAHOO.util.DataSource.TYPE_HTMLTABLE;
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
197 myDataSource2.responseSchema = {
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
198 fields: [
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
199 {key:"name"},
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
200 {key:"perm"},
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
201 ]
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
202 };
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
203
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
204 new YAHOO.widget.DataTable("tbl_list_wrap_repositories", permsColumnDefs, myDataSource2, trans_defs);
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
205
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
206 //perms groups table
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
207 var myDataSource3 = new YAHOO.util.DataSource(YUD.get("tbl_list_repositories_groups"));
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
208 myDataSource3.responseType = YAHOO.util.DataSource.TYPE_HTMLTABLE;
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
209 myDataSource3.responseSchema = {
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
210 fields: [
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
211 {key:"name"},
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
212 {key:"perm"},
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
213 ]
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
214 };
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
215
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
216 new YAHOO.widget.DataTable("tbl_list_wrap_repositories_groups", permsColumnDefs, myDataSource3, trans_defs);
2624
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
217 }
1653
b1e1dffd595c one generic qfilter function.
Marcin Kuzminski <marcin@python-works.com>
parents: 1650
diff changeset
218 </script>
1888
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1827
diff changeset
219 </%def>