annotate rhodecode/templates/index_base.html @ 3972:3cb5a35a319d

added migrations for column change for gists expiration date
author Marcin Kuzminski <marcin@python-works.com>
date Tue, 11 Jun 2013 14:22:54 +0200
parents 13241a4075e9
children d690d0ea9393
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1888
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1780
diff changeset
1 <%page args="parent" />
1403
fc286aed92fe fixes #209, repos groups and index page now share same common page.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
2 <div class="box">
fc286aed92fe fixes #209, repos groups and index page now share same common page.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
3 <!-- box / title -->
fc286aed92fe fixes #209, repos groups and index page now share same common page.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
4 <div class="title">
1475
aa805ee6ee09 fixes code view issue on chrome
Marcin Kuzminski <marcin@python-works.com>
parents: 1458
diff changeset
5 <h5>
3665
690a955ba785 use placeholders in qfilter, not the ugly JS logic
Marcin Kuzminski <marcin@python-works.com>
parents: 3659
diff changeset
6 <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/> ${parent.breadcrumbs()} <span id="repo_count">0</span> ${_('repositories')}
1403
fc286aed92fe fixes #209, repos groups and index page now share same common page.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
7 </h5>
fc286aed92fe fixes #209, repos groups and index page now share same common page.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
8 %if c.rhodecode_user.username != 'default':
3222
b4daef4cc26d Group management delegation:
Marcin Kuzminski <marcin@python-works.com>
parents: 3201
diff changeset
9 <ul class="links">
3333
069884383cc7 Implemented #738 Giving a user WRITE+ permissions on folder should not allow repo creation in root folder.
Marcin Kuzminski <marcin@python-works.com>
parents: 3295
diff changeset
10 %if h.HasPermissionAny('hg.admin','hg.create.repository')() or h.HasReposGroupPermissionAny('group.write', 'group.admin')(c.group.group_name if c.group else None):
1403
fc286aed92fe fixes #209, repos groups and index page now share same common page.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
11 <li>
2130
5242b1619603 #401 repository group is automatically pre-selected when adding repos inside a repository group
Marcin Kuzminski <marcin@python-works.com>
parents: 2121
diff changeset
12 %if c.group:
3659
77e6e941001f fixed admin link for creating repos, and refactored the routes name
Marcin Kuzminski <marcin@python-works.com>
parents: 3625
diff changeset
13 <span>${h.link_to(_('Add repository'),h.url('new_repo',parent_group=c.group.group_id))}</span>
3369
667630c98eaa added "add group" shortcuts for admins, and group admins
Marcin Kuzminski <marcin@python-works.com>
parents: 3333
diff changeset
14 %if h.HasPermissionAny('hg.admin')() or h.HasReposGroupPermissionAny('group.admin')(c.group.group_name):
667630c98eaa added "add group" shortcuts for admins, and group admins
Marcin Kuzminski <marcin@python-works.com>
parents: 3333
diff changeset
15 <span>${h.link_to(_(u'Add group'),h.url('new_repos_group', parent_group=c.group.group_id))}</span>
3394
fe2bb88bf7ac whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 3369
diff changeset
16 %endif
2130
5242b1619603 #401 repository group is automatically pre-selected when adding repos inside a repository group
Marcin Kuzminski <marcin@python-works.com>
parents: 2121
diff changeset
17 %else:
3659
77e6e941001f fixed admin link for creating repos, and refactored the routes name
Marcin Kuzminski <marcin@python-works.com>
parents: 3625
diff changeset
18 <span>${h.link_to(_('Add repository'),h.url('new_repo'))}</span>
3369
667630c98eaa added "add group" shortcuts for admins, and group admins
Marcin Kuzminski <marcin@python-works.com>
parents: 3333
diff changeset
19 %if h.HasPermissionAny('hg.admin')():
667630c98eaa added "add group" shortcuts for admins, and group admins
Marcin Kuzminski <marcin@python-works.com>
parents: 3333
diff changeset
20 <span>${h.link_to(_(u'Add group'),h.url('new_repos_group'))}</span>
667630c98eaa added "add group" shortcuts for admins, and group admins
Marcin Kuzminski <marcin@python-works.com>
parents: 3333
diff changeset
21 %endif
2150
a8c9c0094ddf White space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 2133
diff changeset
22 %endif
1888
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1780
diff changeset
23 </li>
1403
fc286aed92fe fixes #209, repos groups and index page now share same common page.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
24 %endif
3222
b4daef4cc26d Group management delegation:
Marcin Kuzminski <marcin@python-works.com>
parents: 3201
diff changeset
25 %if c.group and h.HasReposGroupPermissionAny('group.admin')(c.group.group_name):
b4daef4cc26d Group management delegation:
Marcin Kuzminski <marcin@python-works.com>
parents: 3201
diff changeset
26 <li>
b4daef4cc26d Group management delegation:
Marcin Kuzminski <marcin@python-works.com>
parents: 3201
diff changeset
27 <span>${h.link_to(_('Edit group'),h.url('edit_repos_group',group_name=c.group.group_name), title=_('You have admin right to this group, and can edit it'))}</span>
b4daef4cc26d Group management delegation:
Marcin Kuzminski <marcin@python-works.com>
parents: 3201
diff changeset
28 </li>
b4daef4cc26d Group management delegation:
Marcin Kuzminski <marcin@python-works.com>
parents: 3201
diff changeset
29 %endif
b4daef4cc26d Group management delegation:
Marcin Kuzminski <marcin@python-works.com>
parents: 3201
diff changeset
30 </ul>
1403
fc286aed92fe fixes #209, repos groups and index page now share same common page.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
31 %endif
fc286aed92fe fixes #209, repos groups and index page now share same common page.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
32 </div>
fc286aed92fe fixes #209, repos groups and index page now share same common page.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
33 <!-- end box / title -->
fc286aed92fe fixes #209, repos groups and index page now share same common page.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
34 <div class="table">
fc286aed92fe fixes #209, repos groups and index page now share same common page.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
35 % if c.groups:
1778
defcf245f3e9 fixes #229 repo sorting is not working.
Marcin Kuzminski <marcin@python-works.com>
parents: 1770
diff changeset
36 <div id='groups_list_wrap' class="yui-skin-sam">
defcf245f3e9 fixes #229 repo sorting is not working.
Marcin Kuzminski <marcin@python-works.com>
parents: 1770
diff changeset
37 <table id="groups_list">
defcf245f3e9 fixes #229 repo sorting is not working.
Marcin Kuzminski <marcin@python-works.com>
parents: 1770
diff changeset
38 <thead>
defcf245f3e9 fixes #229 repo sorting is not working.
Marcin Kuzminski <marcin@python-works.com>
parents: 1770
diff changeset
39 <tr>
defcf245f3e9 fixes #229 repo sorting is not working.
Marcin Kuzminski <marcin@python-works.com>
parents: 1770
diff changeset
40 <th class="left"><a href="#">${_('Group name')}</a></th>
defcf245f3e9 fixes #229 repo sorting is not working.
Marcin Kuzminski <marcin@python-works.com>
parents: 1770
diff changeset
41 <th class="left"><a href="#">${_('Description')}</a></th>
defcf245f3e9 fixes #229 repo sorting is not working.
Marcin Kuzminski <marcin@python-works.com>
parents: 1770
diff changeset
42 ##<th class="left"><a href="#">${_('Number of repositories')}</a></th>
defcf245f3e9 fixes #229 repo sorting is not working.
Marcin Kuzminski <marcin@python-works.com>
parents: 1770
diff changeset
43 </tr>
defcf245f3e9 fixes #229 repo sorting is not working.
Marcin Kuzminski <marcin@python-works.com>
parents: 1770
diff changeset
44 </thead>
1888
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1780
diff changeset
45
1778
defcf245f3e9 fixes #229 repo sorting is not working.
Marcin Kuzminski <marcin@python-works.com>
parents: 1770
diff changeset
46 ## REPO GROUPS
defcf245f3e9 fixes #229 repo sorting is not working.
Marcin Kuzminski <marcin@python-works.com>
parents: 1770
diff changeset
47 % for gr in c.groups:
1403
fc286aed92fe fixes #209, repos groups and index page now share same common page.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
48 <tr>
1778
defcf245f3e9 fixes #229 repo sorting is not working.
Marcin Kuzminski <marcin@python-works.com>
parents: 1770
diff changeset
49 <td>
defcf245f3e9 fixes #229 repo sorting is not working.
Marcin Kuzminski <marcin@python-works.com>
parents: 1770
diff changeset
50 <div style="white-space: nowrap">
3416
5706f6ab60cf follow-up on texts missing from 'users groups'/'repositories group' cleanup
Mads Kiilerich <madski@unity3d.com>
parents: 3394
diff changeset
51 <img class="icon" alt="${_('Repository group')}" src="${h.url('/images/icons/database_link.png')}"/>
1778
defcf245f3e9 fixes #229 repo sorting is not working.
Marcin Kuzminski <marcin@python-works.com>
parents: 1770
diff changeset
52 ${h.link_to(gr.name,url('repos_group_home',group_name=gr.group_name))}
defcf245f3e9 fixes #229 repo sorting is not working.
Marcin Kuzminski <marcin@python-works.com>
parents: 1770
diff changeset
53 </div>
defcf245f3e9 fixes #229 repo sorting is not working.
Marcin Kuzminski <marcin@python-works.com>
parents: 1770
diff changeset
54 </td>
2674
a221706dab50 merged + fixed pull request #62: Implemented metatags and visualisation options.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
55 %if c.visual.stylify_metatags:
2785
f1f01e951008 urlify group description also
Marcin Kuzminski <marcin@python-works.com>
parents: 2686
diff changeset
56 <td>${h.urlify_text(h.desc_stylize(gr.group_description))}</td>
2674
a221706dab50 merged + fixed pull request #62: Implemented metatags and visualisation options.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
57 %else:
a221706dab50 merged + fixed pull request #62: Implemented metatags and visualisation options.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
58 <td>${gr.group_description}</td>
a221706dab50 merged + fixed pull request #62: Implemented metatags and visualisation options.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
59 %endif
1982
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents: 1888
diff changeset
60 ## this is commented out since for multi nested repos can be HEAVY!
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents: 1888
diff changeset
61 ## in number of executed queries during traversing uncomment at will
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents: 1888
diff changeset
62 ##<td><b>${gr.repositories_recursive_count}</b></td>
1403
fc286aed92fe fixes #209, repos groups and index page now share same common page.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
63 </tr>
1778
defcf245f3e9 fixes #229 repo sorting is not working.
Marcin Kuzminski <marcin@python-works.com>
parents: 1770
diff changeset
64 % endfor
defcf245f3e9 fixes #229 repo sorting is not working.
Marcin Kuzminski <marcin@python-works.com>
parents: 1770
diff changeset
65 </table>
defcf245f3e9 fixes #229 repo sorting is not working.
Marcin Kuzminski <marcin@python-works.com>
parents: 1770
diff changeset
66 </div>
3155
0cb48c083c6b fixes issues with groups paginator
Marcin Kuzminski <marcin@python-works.com>
parents: 3154
diff changeset
67 <div id="group-user-paginator" style="padding: 0px 0px 0px 0px"></div>
1403
fc286aed92fe fixes #209, repos groups and index page now share same common page.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
68 <div style="height: 20px"></div>
fc286aed92fe fixes #209, repos groups and index page now share same common page.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
69 % endif
1437
7a46d67c263c added welcome message if no repositories are present in current view
Marcin Kuzminski <marcin@python-works.com>
parents: 1426
diff changeset
70 <div id="welcome" style="display:none;text-align:center">
7a46d67c263c added welcome message if no repositories are present in current view
Marcin Kuzminski <marcin@python-works.com>
parents: 1426
diff changeset
71 <h1><a href="${h.url('home')}">${c.rhodecode_name} ${c.rhodecode_version}</a></h1>
7a46d67c263c added welcome message if no repositories are present in current view
Marcin Kuzminski <marcin@python-works.com>
parents: 1426
diff changeset
72 </div>
3752
1e5bb8ed77d6 index: always use lightweight - there shouldn't be any reason not to
Mads Kiilerich <madski@unity3d.com>
parents: 3665
diff changeset
73 <%cnt=0%>
1e5bb8ed77d6 index: always use lightweight - there shouldn't be any reason not to
Mads Kiilerich <madski@unity3d.com>
parents: 3665
diff changeset
74 <%namespace name="dt" file="/data_table/_dt_elements.html"/>
1e5bb8ed77d6 index: always use lightweight - there shouldn't be any reason not to
Mads Kiilerich <madski@unity3d.com>
parents: 3665
diff changeset
75 <div class="yui-skin-sam" id="repos_list_wrap"></div>
1e5bb8ed77d6 index: always use lightweight - there shouldn't be any reason not to
Mads Kiilerich <madski@unity3d.com>
parents: 3665
diff changeset
76 <div id="user-paginator" style="padding: 0px 0px 0px 0px"></div>
1778
defcf245f3e9 fixes #229 repo sorting is not working.
Marcin Kuzminski <marcin@python-works.com>
parents: 1770
diff changeset
77 </div>
1403
fc286aed92fe fixes #209, repos groups and index page now share same common page.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
78 </div>
1779
9edd6ac132f0 Added sorting into journal and admin pages
Marcin Kuzminski <marcin@python-works.com>
parents: 1778
diff changeset
79
2936
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
80 <script>
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
81 var data = ${c.data|n};
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
82 var myDataSource = new YAHOO.util.DataSource(data);
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
83 myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSON;
2973
9937afa7f093 whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 2937
diff changeset
84
2936
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
85 myDataSource.responseSchema = {
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
86 resultsList: "records",
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
87 fields: [
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
88 {key:"menu"},
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
89 {key:"raw_name"},
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
90 {key:"name"},
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
91 {key:"desc"},
2937
d439d408b415 Update last_change from VCS data on request.
Marcin Kuzminski <marcin@python-works.com>
parents: 2936
diff changeset
92 {key:"last_change"},
3154
0226b6d6b2b5 Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents: 3149
diff changeset
93 {key:"last_changeset"},
2936
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
94 {key:"owner"},
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
95 {key:"atom"},
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
96 ]
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
97 };
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
98 myDataSource.doBeforeCallback = function(req,raw,res,cb) {
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
99 // This is the filter function
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
100 var data = res.results || [],
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
101 filtered = [],
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
102 i,l;
2973
9937afa7f093 whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 2937
diff changeset
103
2936
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
104 if (req) {
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
105 req = req.toLowerCase();
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
106 for (i = 0; i<data.length; i++) {
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
107 var pos = data[i].raw_name.toLowerCase().indexOf(req)
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
108 if (pos != -1) {
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
109 filtered.push(data[i]);
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
110 }
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
111 }
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
112 res.results = filtered;
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
113 }
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
114 YUD.get('repo_count').innerHTML = res.results.length;
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
115 return res;
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
116 }
2973
9937afa7f093 whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 2937
diff changeset
117
2936
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
118 // main table sorting
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
119 var myColumnDefs = [
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
120 {key:"menu",label:"",sortable:false,className:"quick_repo_menu hidden"},
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
121 {key:"name",label:"${_('Name')}",sortable:true,
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
122 sortOptions: { sortFunction: nameSort }},
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
123 {key:"desc",label:"${_('Description')}",sortable:true},
2937
d439d408b415 Update last_change from VCS data on request.
Marcin Kuzminski <marcin@python-works.com>
parents: 2936
diff changeset
124 {key:"last_change",label:"${_('Last Change')}",sortable:true,
d439d408b415 Update last_change from VCS data on request.
Marcin Kuzminski <marcin@python-works.com>
parents: 2936
diff changeset
125 sortOptions: { sortFunction: ageSort }},
3154
0226b6d6b2b5 Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents: 3149
diff changeset
126 {key:"last_changeset",label:"${_('Tip')}",sortable:true,
3149
68f9c216377d white space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 3147
diff changeset
127 sortOptions: { sortFunction: revisionSort }},
2936
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
128 {key:"owner",label:"${_('Owner')}",sortable:true},
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
129 {key:"atom",label:"",sortable:false},
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
130 ];
2973
9937afa7f093 whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 2937
diff changeset
131
2936
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
132 var myDataTable = new YAHOO.widget.DataTable("repos_list_wrap", myColumnDefs, myDataSource,{
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
133 sortedBy:{key:"name",dir:"asc"},
3776
13241a4075e9 Unified the paginators for pylons and YUI.
Marcin Kuzminski <marcin@python-works.com>
parents: 3752
diff changeset
134 paginator: YUI_paginator(${c.visual.dashboard_items},['user-paginator']),
2973
9937afa7f093 whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 2937
diff changeset
135
2936
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
136 MSG_SORTASC:"${_('Click to sort ascending')}",
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
137 MSG_SORTDESC:"${_('Click to sort descending')}",
3526
79c980b628e3 Small wording improvement.
Leonardo <leo@unity3d.com>
parents: 3394
diff changeset
138 MSG_EMPTY:"${_('No repositories found.')}",
2936
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
139 MSG_ERROR:"${_('Data error.')}",
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
140 MSG_LOADING:"${_('Loading...')}",
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
141 }
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
142 );
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
143 myDataTable.subscribe('postRenderEvent',function(oArgs) {
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
144 tooltip_activate();
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
145 quick_repo_menu();
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
146 });
2973
9937afa7f093 whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 2937
diff changeset
147
2936
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
148 var filterTimeout = null;
2973
9937afa7f093 whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 2937
diff changeset
149
2936
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
150 updateFilter = function () {
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
151 // Reset timeout
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
152 filterTimeout = null;
2973
9937afa7f093 whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 2937
diff changeset
153
2936
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
154 // Reset sort
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
155 var state = myDataTable.getState();
3154
0226b6d6b2b5 Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents: 3149
diff changeset
156 state.sortedBy = {key:'name', dir:YAHOO.widget.DataTable.CLASS_ASC};
2973
9937afa7f093 whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 2937
diff changeset
157
2936
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
158 // Get filtered data
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
159 myDataSource.sendRequest(YUD.get('q_filter').value,{
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
160 success : myDataTable.onDataReturnInitializeTable,
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
161 failure : myDataTable.onDataReturnInitializeTable,
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
162 scope : myDataTable,
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
163 argument: state
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
164 });
2973
9937afa7f093 whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 2937
diff changeset
165
2936
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
166 };
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
167 YUE.on('q_filter','click',function(){
3154
0226b6d6b2b5 Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents: 3149
diff changeset
168 if(!YUD.hasClass('q_filter', 'loaded')){
0226b6d6b2b5 Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents: 3149
diff changeset
169 //TODO: load here full list later to do search within groups
0226b6d6b2b5 Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents: 3149
diff changeset
170 YUD.addClass('q_filter', 'loaded');
0226b6d6b2b5 Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents: 3149
diff changeset
171 }
2936
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
172 });
2973
9937afa7f093 whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 2937
diff changeset
173
2936
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
174 YUE.on('q_filter','keyup',function (e) {
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
175 clearTimeout(filterTimeout);
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
176 filterTimeout = setTimeout(updateFilter,600);
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
177 });
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
178 </script>