annotate rhodecode/templates/admin/users/user_edit_my_account.html @ 3293:09ba877db6d3 beta

user edit and journal: drop "Add repo" - it has a more natural location in the "group"
author Mads Kiilerich <madski@unity3d.com>
date Thu, 31 Jan 2013 23:27:21 +0100
parents c20adbaf16af
children 7854097b189c
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()">
3197
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
13 ${self.menu('admin')}
371
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>
2886
1f2c4bf348ad remember selected tab in my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2722
diff changeset
41 <span><a id="show_pullrequests" class="link-white" href="#pullrequests">${_('My pull requests')}</a> </span>
1888
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1827
diff changeset
42 </li>
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1827
diff changeset
43 </ul>
446
a0a93357f954 started my page rewrite
Marcin Kuzminski <marcin@python-works.com>
parents: 403
diff changeset
44 </div>
a0a93357f954 started my page rewrite
Marcin Kuzminski <marcin@python-works.com>
parents: 403
diff changeset
45 <!-- end box / title -->
3196
809fe2d392f8 my_account: change markup so permission list get perms.table style
Mads Kiilerich <madski@unity3d.com>
parents: 3168
diff changeset
46 <div id="perms_container">
809fe2d392f8 my_account: change markup so permission list get perms.table style
Mads Kiilerich <madski@unity3d.com>
parents: 3168
diff changeset
47 <div id="perms" class="table">
2127
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
48 %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
49 <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
50
2127
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
51 <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
52 <table id="tbl_list_${section}">
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
53 <thead>
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
54 <tr>
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
55 <th class="left">${_('Name')}</th>
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
56 <th class="left">${_('Permission')}</th>
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 <tbody>
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
59 %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
60 <%
d683d8bc4be3 don't show empty permissions on my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2129
diff changeset
61 if section != 'global':
d683d8bc4be3 don't show empty permissions on my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2129
diff changeset
62 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
63 _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
64 else:
d683d8bc4be3 don't show empty permissions on my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2129
diff changeset
65 _perm = section_perm = None
d683d8bc4be3 don't show empty permissions on my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2129
diff changeset
66 %>
d683d8bc4be3 don't show empty permissions on my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2129
diff changeset
67 %if _perm not in ['none']:
2127
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
68 <tr>
2128
e29c688e6885 linkify perms and make global ones display better
Marcin Kuzminski <marcin@python-works.com>
parents: 2127
diff changeset
69 <td>
e29c688e6885 linkify perms and make global ones display better
Marcin Kuzminski <marcin@python-works.com>
parents: 2127
diff changeset
70 %if section == 'repositories':
e29c688e6885 linkify perms and make global ones display better
Marcin Kuzminski <marcin@python-works.com>
parents: 2127
diff changeset
71 <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
72 %elif section == 'repositories_groups':
e29c688e6885 linkify perms and make global ones display better
Marcin Kuzminski <marcin@python-works.com>
parents: 2127
diff changeset
73 <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
74 %else:
e29c688e6885 linkify perms and make global ones display better
Marcin Kuzminski <marcin@python-works.com>
parents: 2127
diff changeset
75 ${k}
e29c688e6885 linkify perms and make global ones display better
Marcin Kuzminski <marcin@python-works.com>
parents: 2127
diff changeset
76 %endif
e29c688e6885 linkify perms and make global ones display better
Marcin Kuzminski <marcin@python-works.com>
parents: 2127
diff changeset
77 </td>
2127
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
78 <td>
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
79 %if section == 'global':
2128
e29c688e6885 linkify perms and make global ones display better
Marcin Kuzminski <marcin@python-works.com>
parents: 2127
diff changeset
80 ${h.bool2icon(True)}
2127
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
81 %else:
2131
d683d8bc4be3 don't show empty permissions on my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2129
diff changeset
82 <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
83 %endif
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
84 </td>
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
85 </tr>
2131
d683d8bc4be3 don't show empty permissions on my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2129
diff changeset
86 %endif
2127
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
87 %endfor
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
88 </tbody>
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
89 </table>
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
90 </div>
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
91 %endfor
3196
809fe2d392f8 my_account: change markup so permission list get perms.table style
Mads Kiilerich <madski@unity3d.com>
parents: 3168
diff changeset
92 </div>
446
a0a93357f954 started my page rewrite
Marcin Kuzminski <marcin@python-works.com>
parents: 403
diff changeset
93 </div>
3154
0226b6d6b2b5 Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents: 3120
diff changeset
94 <div id="my_container" style="display:none">
0226b6d6b2b5 Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents: 3120
diff changeset
95 <div class="table yui-skin-sam" id="repos_list_wrap"></div>
0226b6d6b2b5 Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents: 3120
diff changeset
96 <div id="user-paginator" style="padding: 0px 0px 0px 20px"></div>
2673
d5e42c00f3c1 white space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 2624
diff changeset
97 </div>
3154
0226b6d6b2b5 Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents: 3120
diff changeset
98 <div id="pullrequests_container" class="table" style="display:none">
0226b6d6b2b5 Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents: 3120
diff changeset
99 ## loaded via AJAX
3168
2fb94c52e20e whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 3154
diff changeset
100 ${_('Loading...')}
3154
0226b6d6b2b5 Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents: 3120
diff changeset
101 </div>
446
a0a93357f954 started my page rewrite
Marcin Kuzminski <marcin@python-works.com>
parents: 403
diff changeset
102 </div>
2722
ef7520340c44 fixed missing div on my_account + added nothing here yet when there are no
Marcin Kuzminski <marcin@python-works.com>
parents: 2673
diff changeset
103
1653
b1e1dffd595c one generic qfilter function.
Marcin Kuzminski <marcin@python-works.com>
parents: 1650
diff changeset
104 <script type="text/javascript">
2886
1f2c4bf348ad remember selected tab in my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2722
diff changeset
105
1f2c4bf348ad remember selected tab in my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2722
diff changeset
106 var show_perms = function(e){
1f2c4bf348ad remember selected tab in my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2722
diff changeset
107 YUD.addClass('show_perms', 'current');
1f2c4bf348ad remember selected tab in my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2722
diff changeset
108 YUD.removeClass('show_my','current');
1f2c4bf348ad remember selected tab in my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2722
diff changeset
109 YUD.removeClass('show_pullrequests','current');
2673
d5e42c00f3c1 white space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 2624
diff changeset
110
3154
0226b6d6b2b5 Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents: 3120
diff changeset
111 YUD.setStyle('my_container','display','none');
0226b6d6b2b5 Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents: 3120
diff changeset
112 YUD.setStyle('pullrequests_container','display','none');
0226b6d6b2b5 Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents: 3120
diff changeset
113 YUD.setStyle('perms_container','display','');
2907
0b86972de820 white space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 2886
diff changeset
114 YUD.setStyle('q_filter','display','none');
2886
1f2c4bf348ad remember selected tab in my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2722
diff changeset
115 }
1f2c4bf348ad remember selected tab in my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2722
diff changeset
116 YUE.on('show_perms','click',function(e){
1f2c4bf348ad remember selected tab in my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2722
diff changeset
117 show_perms();
2127
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
118 })
2886
1f2c4bf348ad remember selected tab in my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2722
diff changeset
119
1f2c4bf348ad remember selected tab in my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2722
diff changeset
120 var show_my = function(e){
2624
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');
2673
d5e42c00f3c1 white space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 2624
diff changeset
124
3154
0226b6d6b2b5 Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents: 3120
diff changeset
125 YUD.setStyle('perms_container','display','none');
0226b6d6b2b5 Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents: 3120
diff changeset
126 YUD.setStyle('pullrequests_container','display','none');
0226b6d6b2b5 Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents: 3120
diff changeset
127 YUD.setStyle('my_container','display','');
2624
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
128 YUD.setStyle('q_filter','display','');
3154
0226b6d6b2b5 Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents: 3120
diff changeset
129 if(!YUD.hasClass('show_my', 'loaded')){
3197
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
130 table_renderer(${c.data |n});
3154
0226b6d6b2b5 Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents: 3120
diff changeset
131 YUD.addClass('show_my', 'loaded');
0226b6d6b2b5 Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents: 3120
diff changeset
132 }
2886
1f2c4bf348ad remember selected tab in my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2722
diff changeset
133 }
1f2c4bf348ad remember selected tab in my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2722
diff changeset
134 YUE.on('show_my','click',function(e){
3197
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
135 show_my(e);
2624
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
136 })
2886
1f2c4bf348ad remember selected tab in my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2722
diff changeset
137
1f2c4bf348ad remember selected tab in my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2722
diff changeset
138 var show_pullrequests = function(e){
2624
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
139 YUD.addClass('show_pullrequests', 'current');
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
140 YUD.removeClass('show_my','current');
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
141 YUD.removeClass('show_perms','current');
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
142
3154
0226b6d6b2b5 Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents: 3120
diff changeset
143 YUD.setStyle('my_container','display','none');
0226b6d6b2b5 Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents: 3120
diff changeset
144 YUD.setStyle('perms_container','display','none');
0226b6d6b2b5 Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents: 3120
diff changeset
145 YUD.setStyle('pullrequests_container','display','');
2624
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
146 YUD.setStyle('q_filter','display','none');
2907
0b86972de820 white space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 2886
diff changeset
147
2624
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
148 var url = "${h.url('admin_settings_my_pullrequests')}";
3154
0226b6d6b2b5 Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents: 3120
diff changeset
149 ypjax(url, 'pullrequests_container');
2886
1f2c4bf348ad remember selected tab in my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2722
diff changeset
150 }
1f2c4bf348ad remember selected tab in my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2722
diff changeset
151 YUE.on('show_pullrequests','click',function(e){
3197
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
152 show_pullrequests(e)
2127
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
153 })
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
154
2886
1f2c4bf348ad remember selected tab in my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2722
diff changeset
155 var tabs = {
1f2c4bf348ad remember selected tab in my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2722
diff changeset
156 'perms': show_perms,
1f2c4bf348ad remember selected tab in my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2722
diff changeset
157 'my': show_my,
1f2c4bf348ad remember selected tab in my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2722
diff changeset
158 'pullrequests': show_pullrequests
1f2c4bf348ad remember selected tab in my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2722
diff changeset
159 }
2907
0b86972de820 white space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 2886
diff changeset
160 var url = location.href.split('#');
0b86972de820 white space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 2886
diff changeset
161 if (url[1]) {
0b86972de820 white space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 2886
diff changeset
162 //We have a hash
2886
1f2c4bf348ad remember selected tab in my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2722
diff changeset
163 var tabHash = url[1];
3120
c69006a70e6b fix small issue with anchor autolinks
Marcin Kuzminski <marcin@python-works.com>
parents: 2951
diff changeset
164 var func = tabs[tabHash]
c69006a70e6b fix small issue with anchor autolinks
Marcin Kuzminski <marcin@python-works.com>
parents: 2951
diff changeset
165 if (func){
c69006a70e6b fix small issue with anchor autolinks
Marcin Kuzminski <marcin@python-works.com>
parents: 2951
diff changeset
166 func();
c69006a70e6b fix small issue with anchor autolinks
Marcin Kuzminski <marcin@python-works.com>
parents: 2951
diff changeset
167 }
2886
1f2c4bf348ad remember selected tab in my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2722
diff changeset
168 }
1f2c4bf348ad remember selected tab in my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2722
diff changeset
169
3154
0226b6d6b2b5 Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents: 3120
diff changeset
170 function table_renderer(data){
3198
c20adbaf16af html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents: 3197
diff changeset
171 var myDataSource = new YAHOO.util.DataSource(data);
c20adbaf16af html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents: 3197
diff changeset
172 myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSON;
3154
0226b6d6b2b5 Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents: 3120
diff changeset
173
3198
c20adbaf16af html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents: 3197
diff changeset
174 myDataSource.responseSchema = {
c20adbaf16af html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents: 3197
diff changeset
175 resultsList: "records",
c20adbaf16af html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents: 3197
diff changeset
176 fields: [
c20adbaf16af html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents: 3197
diff changeset
177 {key:"menu"},
c20adbaf16af html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents: 3197
diff changeset
178 {key:"raw_name"},
c20adbaf16af html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents: 3197
diff changeset
179 {key:"name"},
c20adbaf16af html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents: 3197
diff changeset
180 {key:"last_changeset"},
c20adbaf16af html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents: 3197
diff changeset
181 {key:"action"},
c20adbaf16af html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents: 3197
diff changeset
182 ]
c20adbaf16af html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents: 3197
diff changeset
183 };
c20adbaf16af html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents: 3197
diff changeset
184 myDataSource.doBeforeCallback = function(req,raw,res,cb) {
c20adbaf16af html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents: 3197
diff changeset
185 // This is the filter function
c20adbaf16af html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents: 3197
diff changeset
186 var data = res.results || [],
c20adbaf16af html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents: 3197
diff changeset
187 filtered = [],
c20adbaf16af html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents: 3197
diff changeset
188 i,l;
3154
0226b6d6b2b5 Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents: 3120
diff changeset
189
3198
c20adbaf16af html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents: 3197
diff changeset
190 if (req) {
c20adbaf16af html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents: 3197
diff changeset
191 req = req.toLowerCase();
c20adbaf16af html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents: 3197
diff changeset
192 for (i = 0; i<data.length; i++) {
c20adbaf16af html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents: 3197
diff changeset
193 var pos = data[i].raw_name.toLowerCase().indexOf(req)
c20adbaf16af html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents: 3197
diff changeset
194 if (pos != -1) {
c20adbaf16af html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents: 3197
diff changeset
195 filtered.push(data[i]);
c20adbaf16af html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents: 3197
diff changeset
196 }
c20adbaf16af html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents: 3197
diff changeset
197 }
c20adbaf16af html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents: 3197
diff changeset
198 res.results = filtered;
c20adbaf16af html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents: 3197
diff changeset
199 }
c20adbaf16af html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents: 3197
diff changeset
200 return res;
c20adbaf16af html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents: 3197
diff changeset
201 }
3168
2fb94c52e20e whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 3154
diff changeset
202
3197
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
203 // main table sorting
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
204 var myColumnDefs = [
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
205 {key:"menu",label:"",sortable:false,className:"quick_repo_menu hidden"},
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
206 {key:"name",label:"${_('Name')}",sortable:true,
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
207 sortOptions: { sortFunction: nameSort }},
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
208 {key:"last_changeset",label:"${_('Tip')}",sortable:true,
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
209 sortOptions: { sortFunction: revisionSort }},
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
210 {key:"action",label:"${_('Action')}",sortable:false},
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
211 ];
2127
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
212
3197
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
213 var myDataTable = new YAHOO.widget.DataTable("repos_list_wrap", myColumnDefs, myDataSource,{
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
214 sortedBy:{key:"name",dir:"asc"},
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
215 paginator: new YAHOO.widget.Paginator({
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
216 rowsPerPage: 50,
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
217 alwaysVisible: false,
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
218 template : "{PreviousPageLink} {FirstPageLink} {PageLinks} {LastPageLink} {NextPageLink}",
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
219 pageLinks: 5,
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
220 containerClass: 'pagination-wh',
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
221 currentPageClass: 'pager_curpage',
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
222 pageLinkClass: 'pager_link',
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
223 nextPageLinkLabel: '&gt;',
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
224 previousPageLinkLabel: '&lt;',
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
225 firstPageLinkLabel: '&lt;&lt;',
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
226 lastPageLinkLabel: '&gt;&gt;',
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
227 containers:['user-paginator']
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
228 }),
3154
0226b6d6b2b5 Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents: 3120
diff changeset
229
3197
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
230 MSG_SORTASC:"${_('Click to sort ascending')}",
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
231 MSG_SORTDESC:"${_('Click to sort descending')}",
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
232 MSG_EMPTY:"${_('No records found.')}",
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
233 MSG_ERROR:"${_('Data error.')}",
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
234 MSG_LOADING:"${_('Loading...')}",
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
235 }
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
236 );
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
237 myDataTable.subscribe('postRenderEvent',function(oArgs) {
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
238 tooltip_activate();
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
239 quick_repo_menu();
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
240 });
3154
0226b6d6b2b5 Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents: 3120
diff changeset
241
3197
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
242 var filterTimeout = null;
2127
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
243
3197
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
244 updateFilter = function() {
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
245 // Reset timeout
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
246 filterTimeout = null;
2127
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
247
3197
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
248 // Reset sort
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
249 var state = myDataTable.getState();
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
250 state.sortedBy = {key:'name', dir:YAHOO.widget.DataTable.CLASS_ASC};
2127
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
251
3197
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
252 // Get filtered data
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
253 myDataSource.sendRequest(YUD.get('q_filter').value,{
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
254 success : myDataTable.onDataReturnInitializeTable,
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
255 failure : myDataTable.onDataReturnInitializeTable,
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
256 scope : myDataTable,
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
257 argument: state
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
258 });
2127
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
259
3197
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
260 };
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
261 YUE.on('q_filter','click',function(){
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
262 if(!YUD.hasClass('q_filter', 'loaded')){
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
263 YUD.get('q_filter').value = '';
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
264 //TODO: load here full list later to do search within groups
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
265 YUD.addClass('q_filter', 'loaded');
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
266 }
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
267 });
2127
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
268
3197
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
269 YUE.on('q_filter','keyup',function (e) {
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
270 clearTimeout(filterTimeout);
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
271 filterTimeout = setTimeout(updateFilter,600);
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
272 });
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
273 }
1653
b1e1dffd595c one generic qfilter function.
Marcin Kuzminski <marcin@python-works.com>
parents: 1650
diff changeset
274 </script>
1888
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1827
diff changeset
275 </%def>