Mercurial > kallithea
annotate rhodecode/templates/admin/users/user_edit_my_account.html @ 4000:f60edcc45cfa
quick filter: do an initial filtering on page load if it has a search criteria - for instance after back
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Wed, 12 Jun 2013 21:57:11 +0200 |
parents | 5293d4bbb1ea |
children | 5ee04157cadc |
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()"> |
3582
1f334a68d057
improved title consistency
Marcin Kuzminski <marcin@python-works.com>
parents:
3449
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> |
3665
690a955ba785
use placeholders in qfilter, not the ugly JS logic
Marcin Kuzminski <marcin@python-works.com>
parents:
3627
diff
changeset
|
31 <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value="" 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 --> |
3666
fda60c2ad65f
fixed sort of permissions summary it's now perm+name
Marcin Kuzminski <marcin@python-works.com>
parents:
3665
diff
changeset
|
46 ## permissions overview |
3678
a0a692cb0bec
fixed my account page tabs
Marcin Kuzminski <marcin@python-works.com>
parents:
3666
diff
changeset
|
47 <div id="perms_container"> |
3666
fda60c2ad65f
fixed sort of permissions summary it's now perm+name
Marcin Kuzminski <marcin@python-works.com>
parents:
3665
diff
changeset
|
48 <%namespace name="p" file="/base/perms_summary.html"/> |
fda60c2ad65f
fixed sort of permissions summary it's now perm+name
Marcin Kuzminski <marcin@python-works.com>
parents:
3665
diff
changeset
|
49 ${p.perms_summary(c.perm_user.permissions)} |
3678
a0a692cb0bec
fixed my account page tabs
Marcin Kuzminski <marcin@python-works.com>
parents:
3666
diff
changeset
|
50 </div> |
2129
43481c3d70ca
#399 added inheritance of permissions for users group on repos groups
Marcin Kuzminski <marcin@python-works.com>
parents:
2128
diff
changeset
|
51 |
3154
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3120
diff
changeset
|
52 <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
|
53 <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
|
54 <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
|
55 </div> |
3154
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3120
diff
changeset
|
56 <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
|
57 ## loaded via AJAX |
3168
2fb94c52e20e
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3154
diff
changeset
|
58 ${_('Loading...')} |
3154
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3120
diff
changeset
|
59 </div> |
446
a0a93357f954
started my page rewrite
Marcin Kuzminski <marcin@python-works.com>
parents:
403
diff
changeset
|
60 </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
|
61 |
1653
b1e1dffd595c
one generic qfilter function.
Marcin Kuzminski <marcin@python-works.com>
parents:
1650
diff
changeset
|
62 <script type="text/javascript"> |
3404
7854097b189c
Hide closed pull requests on my page.
Marcin Kuzminski <marcin@python-works.com>
parents:
3293
diff
changeset
|
63 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
|
64 |
1f2c4bf348ad
remember selected tab in my account page
Marcin Kuzminski <marcin@python-works.com>
parents:
2722
diff
changeset
|
65 var show_perms = function(e){ |
1f2c4bf348ad
remember selected tab in my account page
Marcin Kuzminski <marcin@python-works.com>
parents:
2722
diff
changeset
|
66 YUD.addClass('show_perms', 'current'); |
1f2c4bf348ad
remember selected tab in my account page
Marcin Kuzminski <marcin@python-works.com>
parents:
2722
diff
changeset
|
67 YUD.removeClass('show_my','current'); |
1f2c4bf348ad
remember selected tab in my account page
Marcin Kuzminski <marcin@python-works.com>
parents:
2722
diff
changeset
|
68 YUD.removeClass('show_pullrequests','current'); |
2673
d5e42c00f3c1
white space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
2624
diff
changeset
|
69 |
3154
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3120
diff
changeset
|
70 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
|
71 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
|
72 YUD.setStyle('perms_container','display',''); |
2907
0b86972de820
white space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
2886
diff
changeset
|
73 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
|
74 } |
1f2c4bf348ad
remember selected tab in my account page
Marcin Kuzminski <marcin@python-works.com>
parents:
2722
diff
changeset
|
75 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
|
76 show_perms(); |
2127
b745d5d2563c
implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents:
1961
diff
changeset
|
77 }) |
2886
1f2c4bf348ad
remember selected tab in my account page
Marcin Kuzminski <marcin@python-works.com>
parents:
2722
diff
changeset
|
78 |
1f2c4bf348ad
remember selected tab in my account page
Marcin Kuzminski <marcin@python-works.com>
parents:
2722
diff
changeset
|
79 var show_my = function(e){ |
2624
19daa8d761dc
Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents:
2353
diff
changeset
|
80 YUD.addClass('show_my', 'current'); |
19daa8d761dc
Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents:
2353
diff
changeset
|
81 YUD.removeClass('show_perms','current'); |
19daa8d761dc
Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents:
2353
diff
changeset
|
82 YUD.removeClass('show_pullrequests','current'); |
2673
d5e42c00f3c1
white space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
2624
diff
changeset
|
83 |
3154
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3120
diff
changeset
|
84 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
|
85 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
|
86 YUD.setStyle('my_container','display',''); |
2624
19daa8d761dc
Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents:
2353
diff
changeset
|
87 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
|
88 if(!YUD.hasClass('show_my', 'loaded')){ |
3197 | 89 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
|
90 YUD.addClass('show_my', 'loaded'); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3120
diff
changeset
|
91 } |
2886
1f2c4bf348ad
remember selected tab in my account page
Marcin Kuzminski <marcin@python-works.com>
parents:
2722
diff
changeset
|
92 } |
1f2c4bf348ad
remember selected tab in my account page
Marcin Kuzminski <marcin@python-works.com>
parents:
2722
diff
changeset
|
93 YUE.on('show_my','click',function(e){ |
3197 | 94 show_my(e); |
2624
19daa8d761dc
Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents:
2353
diff
changeset
|
95 }) |
2886
1f2c4bf348ad
remember selected tab in my account page
Marcin Kuzminski <marcin@python-works.com>
parents:
2722
diff
changeset
|
96 |
1f2c4bf348ad
remember selected tab in my account page
Marcin Kuzminski <marcin@python-works.com>
parents:
2722
diff
changeset
|
97 var show_pullrequests = function(e){ |
2624
19daa8d761dc
Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents:
2353
diff
changeset
|
98 YUD.addClass('show_pullrequests', 'current'); |
19daa8d761dc
Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents:
2353
diff
changeset
|
99 YUD.removeClass('show_my','current'); |
19daa8d761dc
Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents:
2353
diff
changeset
|
100 YUD.removeClass('show_perms','current'); |
19daa8d761dc
Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents:
2353
diff
changeset
|
101 |
3154
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3120
diff
changeset
|
102 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
|
103 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
|
104 YUD.setStyle('pullrequests_container','display',''); |
2624
19daa8d761dc
Improvements to my account page
Marcin Kuzminski <marcin@python-works.com>
parents:
2353
diff
changeset
|
105 YUD.setStyle('q_filter','display','none'); |
2907
0b86972de820
white space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
2886
diff
changeset
|
106 |
3404
7854097b189c
Hide closed pull requests on my page.
Marcin Kuzminski <marcin@python-works.com>
parents:
3293
diff
changeset
|
107 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
|
108 if(YUD.get('show_closed') && YUD.get('show_closed').checked) { |
3449
95a226b35b91
codecleaner, fix tabs -> spaces
Marcin Kuzminski <marcin@python-works.com>
parents:
3413
diff
changeset
|
109 var url = pyroutes.url('admin_settings_my_pullrequests', {'pr_show_closed': '1'}); |
3404
7854097b189c
Hide closed pull requests on my page.
Marcin Kuzminski <marcin@python-works.com>
parents:
3293
diff
changeset
|
110 } |
7854097b189c
Hide closed pull requests on my page.
Marcin Kuzminski <marcin@python-works.com>
parents:
3293
diff
changeset
|
111 ypjax(url, 'pullrequests_container', function(){ |
7854097b189c
Hide closed pull requests on my page.
Marcin Kuzminski <marcin@python-works.com>
parents:
3293
diff
changeset
|
112 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
|
113 show_pullrequests(e); |
3413
d79f3505549e
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3404
diff
changeset
|
114 }); |
3404
7854097b189c
Hide closed pull requests on my page.
Marcin Kuzminski <marcin@python-works.com>
parents:
3293
diff
changeset
|
115 }); |
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_pullrequests','click',function(e){ |
3197 | 118 show_pullrequests(e) |
2127
b745d5d2563c
implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents:
1961
diff
changeset
|
119 }) |
b745d5d2563c
implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents:
1961
diff
changeset
|
120 |
2886
1f2c4bf348ad
remember selected tab in my account page
Marcin Kuzminski <marcin@python-works.com>
parents:
2722
diff
changeset
|
121 var tabs = { |
1f2c4bf348ad
remember selected tab in my account page
Marcin Kuzminski <marcin@python-works.com>
parents:
2722
diff
changeset
|
122 'perms': show_perms, |
1f2c4bf348ad
remember selected tab in my account page
Marcin Kuzminski <marcin@python-works.com>
parents:
2722
diff
changeset
|
123 'my': show_my, |
1f2c4bf348ad
remember selected tab in my account page
Marcin Kuzminski <marcin@python-works.com>
parents:
2722
diff
changeset
|
124 'pullrequests': show_pullrequests |
1f2c4bf348ad
remember selected tab in my account page
Marcin Kuzminski <marcin@python-works.com>
parents:
2722
diff
changeset
|
125 } |
2907
0b86972de820
white space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
2886
diff
changeset
|
126 var url = location.href.split('#'); |
0b86972de820
white space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
2886
diff
changeset
|
127 if (url[1]) { |
0b86972de820
white space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
2886
diff
changeset
|
128 //We have a hash |
2886
1f2c4bf348ad
remember selected tab in my account page
Marcin Kuzminski <marcin@python-works.com>
parents:
2722
diff
changeset
|
129 var tabHash = url[1]; |
3120
c69006a70e6b
fix small issue with anchor autolinks
Marcin Kuzminski <marcin@python-works.com>
parents:
2951
diff
changeset
|
130 var func = tabs[tabHash] |
c69006a70e6b
fix small issue with anchor autolinks
Marcin Kuzminski <marcin@python-works.com>
parents:
2951
diff
changeset
|
131 if (func){ |
c69006a70e6b
fix small issue with anchor autolinks
Marcin Kuzminski <marcin@python-works.com>
parents:
2951
diff
changeset
|
132 func(); |
c69006a70e6b
fix small issue with anchor autolinks
Marcin Kuzminski <marcin@python-works.com>
parents:
2951
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 |
3154
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3120
diff
changeset
|
136 function table_renderer(data){ |
3198
c20adbaf16af
html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents:
3197
diff
changeset
|
137 var myDataSource = new YAHOO.util.DataSource(data); |
c20adbaf16af
html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents:
3197
diff
changeset
|
138 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
|
139 |
3198
c20adbaf16af
html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents:
3197
diff
changeset
|
140 myDataSource.responseSchema = { |
c20adbaf16af
html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents:
3197
diff
changeset
|
141 resultsList: "records", |
c20adbaf16af
html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents:
3197
diff
changeset
|
142 fields: [ |
c20adbaf16af
html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents:
3197
diff
changeset
|
143 {key:"menu"}, |
c20adbaf16af
html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents:
3197
diff
changeset
|
144 {key:"raw_name"}, |
c20adbaf16af
html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents:
3197
diff
changeset
|
145 {key:"name"}, |
c20adbaf16af
html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents:
3197
diff
changeset
|
146 {key:"last_changeset"}, |
c20adbaf16af
html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents:
3197
diff
changeset
|
147 {key:"action"}, |
c20adbaf16af
html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents:
3197
diff
changeset
|
148 ] |
c20adbaf16af
html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents:
3197
diff
changeset
|
149 }; |
c20adbaf16af
html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents:
3197
diff
changeset
|
150 myDataSource.doBeforeCallback = function(req,raw,res,cb) { |
c20adbaf16af
html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents:
3197
diff
changeset
|
151 // This is the filter function |
c20adbaf16af
html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents:
3197
diff
changeset
|
152 var data = res.results || [], |
c20adbaf16af
html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents:
3197
diff
changeset
|
153 filtered = [], |
c20adbaf16af
html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents:
3197
diff
changeset
|
154 i,l; |
3154
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3120
diff
changeset
|
155 |
3198
c20adbaf16af
html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents:
3197
diff
changeset
|
156 if (req) { |
c20adbaf16af
html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents:
3197
diff
changeset
|
157 req = req.toLowerCase(); |
c20adbaf16af
html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents:
3197
diff
changeset
|
158 for (i = 0; i<data.length; i++) { |
c20adbaf16af
html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents:
3197
diff
changeset
|
159 var pos = data[i].raw_name.toLowerCase().indexOf(req) |
c20adbaf16af
html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents:
3197
diff
changeset
|
160 if (pos != -1) { |
c20adbaf16af
html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents:
3197
diff
changeset
|
161 filtered.push(data[i]); |
c20adbaf16af
html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents:
3197
diff
changeset
|
162 } |
c20adbaf16af
html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents:
3197
diff
changeset
|
163 } |
c20adbaf16af
html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents:
3197
diff
changeset
|
164 res.results = filtered; |
c20adbaf16af
html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents:
3197
diff
changeset
|
165 } |
c20adbaf16af
html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents:
3197
diff
changeset
|
166 return res; |
c20adbaf16af
html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents:
3197
diff
changeset
|
167 } |
3168
2fb94c52e20e
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3154
diff
changeset
|
168 |
3197 | 169 // main table sorting |
170 var myColumnDefs = [ | |
171 {key:"menu",label:"",sortable:false,className:"quick_repo_menu hidden"}, | |
172 {key:"name",label:"${_('Name')}",sortable:true, | |
173 sortOptions: { sortFunction: nameSort }}, | |
174 {key:"last_changeset",label:"${_('Tip')}",sortable:true, | |
175 sortOptions: { sortFunction: revisionSort }}, | |
176 {key:"action",label:"${_('Action')}",sortable:false}, | |
177 ]; | |
2127
b745d5d2563c
implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents:
1961
diff
changeset
|
178 |
3197 | 179 var myDataTable = new YAHOO.widget.DataTable("repos_list_wrap", myColumnDefs, myDataSource,{ |
180 sortedBy:{key:"name",dir:"asc"}, | |
3776
13241a4075e9
Unified the paginators for pylons and YUI.
Marcin Kuzminski <marcin@python-works.com>
parents:
3678
diff
changeset
|
181 paginator: YUI_paginator(50, ['user-paginator']), |
3154
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3120
diff
changeset
|
182 |
3197 | 183 MSG_SORTASC:"${_('Click to sort ascending')}", |
184 MSG_SORTDESC:"${_('Click to sort descending')}", | |
185 MSG_EMPTY:"${_('No records found.')}", | |
186 MSG_ERROR:"${_('Data error.')}", | |
187 MSG_LOADING:"${_('Loading...')}", | |
188 } | |
189 ); | |
190 myDataTable.subscribe('postRenderEvent',function(oArgs) { | |
191 tooltip_activate(); | |
192 quick_repo_menu(); | |
193 }); | |
3154
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3120
diff
changeset
|
194 |
3197 | 195 var filterTimeout = null; |
2127
b745d5d2563c
implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents:
1961
diff
changeset
|
196 |
3197 | 197 updateFilter = function() { |
198 // Reset timeout | |
199 filterTimeout = null; | |
2127
b745d5d2563c
implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents:
1961
diff
changeset
|
200 |
3197 | 201 // Reset sort |
202 var state = myDataTable.getState(); | |
203 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
|
204 |
3197 | 205 // Get filtered data |
206 myDataSource.sendRequest(YUD.get('q_filter').value,{ | |
207 success : myDataTable.onDataReturnInitializeTable, | |
208 failure : myDataTable.onDataReturnInitializeTable, | |
209 scope : myDataTable, | |
210 argument: state | |
211 }); | |
2127
b745d5d2563c
implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents:
1961
diff
changeset
|
212 |
3197 | 213 }; |
214 YUE.on('q_filter','click',function(){ | |
215 if(!YUD.hasClass('q_filter', 'loaded')){ | |
216 //TODO: load here full list later to do search within groups | |
217 YUD.addClass('q_filter', 'loaded'); | |
218 } | |
219 }); | |
2127
b745d5d2563c
implemented #377 Users view own permissions
Marcin Kuzminski <marcin@python-works.com>
parents:
1961
diff
changeset
|
220 |
3197 | 221 YUE.on('q_filter','keyup',function (e) { |
222 clearTimeout(filterTimeout); | |
223 filterTimeout = setTimeout(updateFilter,600); | |
224 }); | |
3404
7854097b189c
Hide closed pull requests on my page.
Marcin Kuzminski <marcin@python-works.com>
parents:
3293
diff
changeset
|
225 |
4000
f60edcc45cfa
quick filter: do an initial filtering on page load if it has a search criteria - for instance after back
Mads Kiilerich <madski@unity3d.com>
parents:
3960
diff
changeset
|
226 if(YUD.get('q_filter').value) { |
f60edcc45cfa
quick filter: do an initial filtering on page load if it has a search criteria - for instance after back
Mads Kiilerich <madski@unity3d.com>
parents:
3960
diff
changeset
|
227 updateFilter(); |
f60edcc45cfa
quick filter: do an initial filtering on page load if it has a search criteria - for instance after back
Mads Kiilerich <madski@unity3d.com>
parents:
3960
diff
changeset
|
228 } |
f60edcc45cfa
quick filter: do an initial filtering on page load if it has a search criteria - for instance after back
Mads Kiilerich <madski@unity3d.com>
parents:
3960
diff
changeset
|
229 |
3197 | 230 } |
1653
b1e1dffd595c
one generic qfilter function.
Marcin Kuzminski <marcin@python-works.com>
parents:
1650
diff
changeset
|
231 </script> |
1888
f91d3f9b7230
White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
1827
diff
changeset
|
232 </%def> |