annotate rhodecode/templates/admin/users/user_edit_my_account.html @ 3404:7854097b189c beta

Hide closed pull requests on my page.
author Marcin Kuzminski <marcin@python-works.com>
date Mon, 25 Feb 2013 23:17:33 +0100
parents 09ba877db6d3
children d79f3505549e
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">
3404
7854097b189c Hide closed pull requests on my page.
Marcin Kuzminski <marcin@python-works.com>
parents: 3293
diff changeset
105 pyroutes.register('admin_settings_my_pullrequests', "${url('admin_settings_my_pullrequests')}", []);
2886
1f2c4bf348ad remember selected tab in my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2722
diff changeset
106
1f2c4bf348ad remember selected tab in my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2722
diff changeset
107 var show_perms = function(e){
1f2c4bf348ad remember selected tab in my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2722
diff changeset
108 YUD.addClass('show_perms', 'current');
1f2c4bf348ad remember selected tab in my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2722
diff changeset
109 YUD.removeClass('show_my','current');
1f2c4bf348ad remember selected tab in my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2722
diff changeset
110 YUD.removeClass('show_pullrequests','current');
2673
d5e42c00f3c1 white space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 2624
diff changeset
111
3154
0226b6d6b2b5 Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents: 3120
diff changeset
112 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
113 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
114 YUD.setStyle('perms_container','display','');
2907
0b86972de820 white space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 2886
diff changeset
115 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
116 }
1f2c4bf348ad remember selected tab in my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2722
diff changeset
117 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
118 show_perms();
2127
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
119 })
2886
1f2c4bf348ad remember selected tab in my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2722
diff changeset
120
1f2c4bf348ad remember selected tab in my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2722
diff changeset
121 var show_my = function(e){
2624
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
122 YUD.addClass('show_my', 'current');
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
123 YUD.removeClass('show_perms','current');
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
124 YUD.removeClass('show_pullrequests','current');
2673
d5e42c00f3c1 white space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 2624
diff changeset
125
3154
0226b6d6b2b5 Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents: 3120
diff changeset
126 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
127 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
128 YUD.setStyle('my_container','display','');
2624
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
129 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
130 if(!YUD.hasClass('show_my', 'loaded')){
3197
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
131 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
132 YUD.addClass('show_my', 'loaded');
0226b6d6b2b5 Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents: 3120
diff changeset
133 }
2886
1f2c4bf348ad remember selected tab in my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2722
diff changeset
134 }
1f2c4bf348ad remember selected tab in my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2722
diff changeset
135 YUE.on('show_my','click',function(e){
3197
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
136 show_my(e);
2624
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
137 })
2886
1f2c4bf348ad remember selected tab in my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2722
diff changeset
138
1f2c4bf348ad remember selected tab in my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2722
diff changeset
139 var show_pullrequests = function(e){
2624
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
140 YUD.addClass('show_pullrequests', 'current');
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
141 YUD.removeClass('show_my','current');
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
142 YUD.removeClass('show_perms','current');
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
143
3154
0226b6d6b2b5 Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents: 3120
diff changeset
144 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
145 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
146 YUD.setStyle('pullrequests_container','display','');
2624
19daa8d761dc Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2353
diff changeset
147 YUD.setStyle('q_filter','display','none');
2907
0b86972de820 white space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 2886
diff changeset
148
3404
7854097b189c Hide closed pull requests on my page.
Marcin Kuzminski <marcin@python-works.com>
parents: 3293
diff changeset
149 var url = pyroutes.url('admin_settings_my_pullrequests');
7854097b189c Hide closed pull requests on my page.
Marcin Kuzminski <marcin@python-works.com>
parents: 3293
diff changeset
150 if(YUD.get('show_closed') && YUD.get('show_closed').checked) {
7854097b189c Hide closed pull requests on my page.
Marcin Kuzminski <marcin@python-works.com>
parents: 3293
diff changeset
151 var url = pyroutes.url('admin_settings_my_pullrequests', {'pr_show_closed': '1'});
7854097b189c Hide closed pull requests on my page.
Marcin Kuzminski <marcin@python-works.com>
parents: 3293
diff changeset
152 }
7854097b189c Hide closed pull requests on my page.
Marcin Kuzminski <marcin@python-works.com>
parents: 3293
diff changeset
153 ypjax(url, 'pullrequests_container', function(){
7854097b189c Hide closed pull requests on my page.
Marcin Kuzminski <marcin@python-works.com>
parents: 3293
diff changeset
154 YUE.on('show_closed','change',function (e) {
7854097b189c Hide closed pull requests on my page.
Marcin Kuzminski <marcin@python-works.com>
parents: 3293
diff changeset
155 show_pullrequests(e);
7854097b189c Hide closed pull requests on my page.
Marcin Kuzminski <marcin@python-works.com>
parents: 3293
diff changeset
156 });
7854097b189c Hide closed pull requests on my page.
Marcin Kuzminski <marcin@python-works.com>
parents: 3293
diff changeset
157 });
2886
1f2c4bf348ad remember selected tab in my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2722
diff changeset
158 }
1f2c4bf348ad remember selected tab in my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2722
diff changeset
159 YUE.on('show_pullrequests','click',function(e){
3197
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
160 show_pullrequests(e)
2127
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
161 })
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
162
2886
1f2c4bf348ad remember selected tab in my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2722
diff changeset
163 var tabs = {
1f2c4bf348ad remember selected tab in my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2722
diff changeset
164 'perms': show_perms,
1f2c4bf348ad remember selected tab in my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2722
diff changeset
165 'my': show_my,
1f2c4bf348ad remember selected tab in my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2722
diff changeset
166 'pullrequests': show_pullrequests
1f2c4bf348ad remember selected tab in my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2722
diff changeset
167 }
2907
0b86972de820 white space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 2886
diff changeset
168 var url = location.href.split('#');
0b86972de820 white space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 2886
diff changeset
169 if (url[1]) {
0b86972de820 white space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 2886
diff changeset
170 //We have a hash
2886
1f2c4bf348ad remember selected tab in my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2722
diff changeset
171 var tabHash = url[1];
3120
c69006a70e6b fix small issue with anchor autolinks
Marcin Kuzminski <marcin@python-works.com>
parents: 2951
diff changeset
172 var func = tabs[tabHash]
c69006a70e6b fix small issue with anchor autolinks
Marcin Kuzminski <marcin@python-works.com>
parents: 2951
diff changeset
173 if (func){
c69006a70e6b fix small issue with anchor autolinks
Marcin Kuzminski <marcin@python-works.com>
parents: 2951
diff changeset
174 func();
c69006a70e6b fix small issue with anchor autolinks
Marcin Kuzminski <marcin@python-works.com>
parents: 2951
diff changeset
175 }
2886
1f2c4bf348ad remember selected tab in my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2722
diff changeset
176 }
1f2c4bf348ad remember selected tab in my account page
Marcin Kuzminski <marcin@python-works.com>
parents: 2722
diff changeset
177
3154
0226b6d6b2b5 Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents: 3120
diff changeset
178 function table_renderer(data){
3198
c20adbaf16af html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents: 3197
diff changeset
179 var myDataSource = new YAHOO.util.DataSource(data);
c20adbaf16af html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents: 3197
diff changeset
180 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
181
3198
c20adbaf16af html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents: 3197
diff changeset
182 myDataSource.responseSchema = {
c20adbaf16af html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents: 3197
diff changeset
183 resultsList: "records",
c20adbaf16af html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents: 3197
diff changeset
184 fields: [
c20adbaf16af html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents: 3197
diff changeset
185 {key:"menu"},
c20adbaf16af html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents: 3197
diff changeset
186 {key:"raw_name"},
c20adbaf16af html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents: 3197
diff changeset
187 {key:"name"},
c20adbaf16af html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents: 3197
diff changeset
188 {key:"last_changeset"},
c20adbaf16af html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents: 3197
diff changeset
189 {key:"action"},
c20adbaf16af html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents: 3197
diff changeset
190 ]
c20adbaf16af html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents: 3197
diff changeset
191 };
c20adbaf16af html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents: 3197
diff changeset
192 myDataSource.doBeforeCallback = function(req,raw,res,cb) {
c20adbaf16af html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents: 3197
diff changeset
193 // This is the filter function
c20adbaf16af html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents: 3197
diff changeset
194 var data = res.results || [],
c20adbaf16af html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents: 3197
diff changeset
195 filtered = [],
c20adbaf16af html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents: 3197
diff changeset
196 i,l;
3154
0226b6d6b2b5 Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents: 3120
diff changeset
197
3198
c20adbaf16af html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents: 3197
diff changeset
198 if (req) {
c20adbaf16af html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents: 3197
diff changeset
199 req = req.toLowerCase();
c20adbaf16af html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents: 3197
diff changeset
200 for (i = 0; i<data.length; i++) {
c20adbaf16af html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents: 3197
diff changeset
201 var pos = data[i].raw_name.toLowerCase().indexOf(req)
c20adbaf16af html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents: 3197
diff changeset
202 if (pos != -1) {
c20adbaf16af html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents: 3197
diff changeset
203 filtered.push(data[i]);
c20adbaf16af html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents: 3197
diff changeset
204 }
c20adbaf16af html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents: 3197
diff changeset
205 }
c20adbaf16af html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents: 3197
diff changeset
206 res.results = filtered;
c20adbaf16af html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents: 3197
diff changeset
207 }
c20adbaf16af html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents: 3197
diff changeset
208 return res;
c20adbaf16af html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents: 3197
diff changeset
209 }
3168
2fb94c52e20e whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 3154
diff changeset
210
3197
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
211 // main table sorting
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
212 var myColumnDefs = [
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
213 {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
214 {key:"name",label:"${_('Name')}",sortable:true,
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
215 sortOptions: { sortFunction: nameSort }},
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
216 {key:"last_changeset",label:"${_('Tip')}",sortable:true,
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
217 sortOptions: { sortFunction: revisionSort }},
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
218 {key:"action",label:"${_('Action')}",sortable:false},
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
219 ];
2127
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
220
3197
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
221 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
222 sortedBy:{key:"name",dir:"asc"},
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
223 paginator: new YAHOO.widget.Paginator({
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
224 rowsPerPage: 50,
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
225 alwaysVisible: false,
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
226 template : "{PreviousPageLink} {FirstPageLink} {PageLinks} {LastPageLink} {NextPageLink}",
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
227 pageLinks: 5,
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
228 containerClass: 'pagination-wh',
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
229 currentPageClass: 'pager_curpage',
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
230 pageLinkClass: 'pager_link',
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
231 nextPageLinkLabel: '&gt;',
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
232 previousPageLinkLabel: '&lt;',
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
233 firstPageLinkLabel: '&lt;&lt;',
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
234 lastPageLinkLabel: '&gt;&gt;',
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
235 containers:['user-paginator']
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
236 }),
3154
0226b6d6b2b5 Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents: 3120
diff changeset
237
3197
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
238 MSG_SORTASC:"${_('Click to sort ascending')}",
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
239 MSG_SORTDESC:"${_('Click to sort descending')}",
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
240 MSG_EMPTY:"${_('No records found.')}",
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
241 MSG_ERROR:"${_('Data error.')}",
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
242 MSG_LOADING:"${_('Loading...')}",
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
243 }
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
244 );
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
245 myDataTable.subscribe('postRenderEvent',function(oArgs) {
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
246 tooltip_activate();
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
247 quick_repo_menu();
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
248 });
3154
0226b6d6b2b5 Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents: 3120
diff changeset
249
3197
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
250 var filterTimeout = null;
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 updateFilter = function() {
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
253 // Reset timeout
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
254 filterTimeout = null;
2127
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
255
3197
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
256 // Reset sort
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
257 var state = myDataTable.getState();
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
258 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
259
3197
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
260 // Get filtered data
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
261 myDataSource.sendRequest(YUD.get('q_filter').value,{
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
262 success : myDataTable.onDataReturnInitializeTable,
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
263 failure : myDataTable.onDataReturnInitializeTable,
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
264 scope : myDataTable,
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
265 argument: state
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
266 });
2127
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
267
3197
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
268 };
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
269 YUE.on('q_filter','click',function(){
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
270 if(!YUD.hasClass('q_filter', 'loaded')){
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
271 YUD.get('q_filter').value = '';
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
272 //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
273 YUD.addClass('q_filter', 'loaded');
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
274 }
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
275 });
2127
b745d5d2563c implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents: 1961
diff changeset
276
3197
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
277 YUE.on('q_filter','keyup',function (e) {
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
278 clearTimeout(filterTimeout);
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
279 filterTimeout = setTimeout(updateFilter,600);
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
280 });
3404
7854097b189c Hide closed pull requests on my page.
Marcin Kuzminski <marcin@python-works.com>
parents: 3293
diff changeset
281
3197
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3196
diff changeset
282 }
1653
b1e1dffd595c one generic qfilter function.
Marcin Kuzminski <marcin@python-works.com>
parents: 1650
diff changeset
283 </script>
1888
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1827
diff changeset
284 </%def>