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