annotate rhodecode/templates/index_base.html @ 4147:1c8f818787b3 rhodecode-2.2.5-gpl

old style: show the full link box on summary page - no overlap or truncation
author Mads Kiilerich <madski@unity3d.com>
date Wed, 02 Jul 2014 19:03:23 -0400
parents ffd45b185016
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3999
e1ecc8622884 group index: quick search should not search the common part of repo names
Mads Kiilerich <madski@unity3d.com>
parents: 3990
diff changeset
1 <%page args="parent,group_name=''" />
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">
4116
ffd45b185016 Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 4002
diff changeset
10 <li>
ffd45b185016 Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 4002
diff changeset
11 <%
ffd45b185016 Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 4002
diff changeset
12 gr_name = c.group.group_name if c.group else None
ffd45b185016 Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 4002
diff changeset
13 # create repositories with write permission on group is set to true
ffd45b185016 Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 4002
diff changeset
14 create_on_write = h.HasPermissionAny('hg.create.write_on_repogroup.true')()
ffd45b185016 Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 4002
diff changeset
15 group_admin = h.HasRepoGroupPermissionAny('group.admin')(gr_name, 'can write into group index page')
ffd45b185016 Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 4002
diff changeset
16 group_write = h.HasRepoGroupPermissionAny('group.write')(gr_name, 'can write into group index page')
ffd45b185016 Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 4002
diff changeset
17 %>
ffd45b185016 Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 4002
diff changeset
18 %if h.HasPermissionAny('hg.admin','hg.create.repository')() or (group_admin or (group_write and create_on_write)):
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
19 %if c.group:
4116
ffd45b185016 Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 4002
diff changeset
20 <a href="${h.url('new_repo',parent_group=c.group.group_id)}" class="btn btn-small btn-success"><i class="icon-plus"></i> ${_('Add Repository')}</a>
ffd45b185016 Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 4002
diff changeset
21 %if h.HasPermissionAny('hg.admin')() or h.HasRepoGroupPermissionAny('group.admin')(c.group.group_name):
ffd45b185016 Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 4002
diff changeset
22 <a href="${h.url('new_repos_group', parent_group=c.group.group_id)}" class="btn btn-small"><i class="icon-plus"></i> ${_(u'Add Repository Group')}</a>
3394
fe2bb88bf7ac whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 3369
diff changeset
23 %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
24 %else:
4116
ffd45b185016 Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 4002
diff changeset
25 <a href="${h.url('new_repo')}" class="btn btn-small btn-success"><i class="icon-plus"></i> ${_('Add Repository')}</a>
3369
667630c98eaa added "add group" shortcuts for admins, and group admins
Marcin Kuzminski <marcin@python-works.com>
parents: 3333
diff changeset
26 %if h.HasPermissionAny('hg.admin')():
4116
ffd45b185016 Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 4002
diff changeset
27 <a href="${h.url('new_repos_group')}" class="btn btn-small"><i class="icon-plus"></i> ${_(u'Add Repository Group')}</a>
3369
667630c98eaa added "add group" shortcuts for admins, and group admins
Marcin Kuzminski <marcin@python-works.com>
parents: 3333
diff changeset
28 %endif
2150
a8c9c0094ddf White space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 2133
diff changeset
29 %endif
1403
fc286aed92fe fixes #209, repos groups and index page now share same common page.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
30 %endif
4116
ffd45b185016 Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 4002
diff changeset
31 %if c.group and h.HasRepoGroupPermissionAny('group.admin')(c.group.group_name):
ffd45b185016 Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 4002
diff changeset
32 <a href="${h.url('edit_repo_group',group_name=c.group.group_name)}" title="${_('You have admin right to this group, and can edit it')}" class="btn btn-small"><i class="icon-pencil"></i> ${_('Edit Repository Group')}</a>
ffd45b185016 Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 4002
diff changeset
33 %endif
3222
b4daef4cc26d Group management delegation:
Marcin Kuzminski <marcin@python-works.com>
parents: 3201
diff changeset
34 </li>
b4daef4cc26d Group management delegation:
Marcin Kuzminski <marcin@python-works.com>
parents: 3201
diff changeset
35 </ul>
1403
fc286aed92fe fixes #209, repos groups and index page now share same common page.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
36 %endif
fc286aed92fe fixes #209, repos groups and index page now share same common page.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
37 </div>
fc286aed92fe fixes #209, repos groups and index page now share same common page.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
38 <!-- 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
39 <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
40 % if c.groups:
1778
defcf245f3e9 fixes #229 repo sorting is not working.
Marcin Kuzminski <marcin@python-works.com>
parents: 1770
diff changeset
41 <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
42 <table id="groups_list">
defcf245f3e9 fixes #229 repo sorting is not working.
Marcin Kuzminski <marcin@python-works.com>
parents: 1770
diff changeset
43 <thead>
defcf245f3e9 fixes #229 repo sorting is not working.
Marcin Kuzminski <marcin@python-works.com>
parents: 1770
diff changeset
44 <tr>
4116
ffd45b185016 Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 4002
diff changeset
45 <th class="left"><a href="#">${_('Group Name')}</a></th>
1778
defcf245f3e9 fixes #229 repo sorting is not working.
Marcin Kuzminski <marcin@python-works.com>
parents: 1770
diff changeset
46 <th class="left"><a href="#">${_('Description')}</a></th>
4116
ffd45b185016 Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 4002
diff changeset
47 ##<th class="left"><a href="#">${_('Number of Repositories')}</a></th>
1778
defcf245f3e9 fixes #229 repo sorting is not working.
Marcin Kuzminski <marcin@python-works.com>
parents: 1770
diff changeset
48 </tr>
defcf245f3e9 fixes #229 repo sorting is not working.
Marcin Kuzminski <marcin@python-works.com>
parents: 1770
diff changeset
49 </thead>
1888
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1780
diff changeset
50
1778
defcf245f3e9 fixes #229 repo sorting is not working.
Marcin Kuzminski <marcin@python-works.com>
parents: 1770
diff changeset
51 ## REPO GROUPS
defcf245f3e9 fixes #229 repo sorting is not working.
Marcin Kuzminski <marcin@python-works.com>
parents: 1770
diff changeset
52 % 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
53 <tr>
1778
defcf245f3e9 fixes #229 repo sorting is not working.
Marcin Kuzminski <marcin@python-works.com>
parents: 1770
diff changeset
54 <td>
defcf245f3e9 fixes #229 repo sorting is not working.
Marcin Kuzminski <marcin@python-works.com>
parents: 1770
diff changeset
55 <div style="white-space: nowrap">
4116
ffd45b185016 Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 4002
diff changeset
56 <a href="${url('repos_group_home',group_name=gr.group_name)}"><i class="icon-folder-close"></i> ${gr.name}</a>
1778
defcf245f3e9 fixes #229 repo sorting is not working.
Marcin Kuzminski <marcin@python-works.com>
parents: 1770
diff changeset
57 </div>
defcf245f3e9 fixes #229 repo sorting is not working.
Marcin Kuzminski <marcin@python-works.com>
parents: 1770
diff changeset
58 </td>
2674
a221706dab50 merged + fixed pull request #62: Implemented metatags and visualisation options.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
59 %if c.visual.stylify_metatags:
2785
f1f01e951008 urlify group description also
Marcin Kuzminski <marcin@python-works.com>
parents: 2686
diff changeset
60 <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
61 %else:
a221706dab50 merged + fixed pull request #62: Implemented metatags and visualisation options.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
62 <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
63 %endif
1982
87f0800abc7b #227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents: 1888
diff changeset
64 ## 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
65 ## 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
66 ##<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
67 </tr>
1778
defcf245f3e9 fixes #229 repo sorting is not working.
Marcin Kuzminski <marcin@python-works.com>
parents: 1770
diff changeset
68 % endfor
defcf245f3e9 fixes #229 repo sorting is not working.
Marcin Kuzminski <marcin@python-works.com>
parents: 1770
diff changeset
69 </table>
defcf245f3e9 fixes #229 repo sorting is not working.
Marcin Kuzminski <marcin@python-works.com>
parents: 1770
diff changeset
70 </div>
3155
0cb48c083c6b fixes issues with groups paginator
Marcin Kuzminski <marcin@python-works.com>
parents: 3154
diff changeset
71 <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
72 <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
73 % endif
1437
7a46d67c263c added welcome message if no repositories are present in current view
Marcin Kuzminski <marcin@python-works.com>
parents: 1426
diff changeset
74 <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
75 <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
76 </div>
3752
1e5bb8ed77d6 index: always use lightweight - there shouldn't be any reason not to
Mads Kiilerich <madski@unity3d.com>
parents: 3665
diff changeset
77 <%cnt=0%>
1e5bb8ed77d6 index: always use lightweight - there shouldn't be any reason not to
Mads Kiilerich <madski@unity3d.com>
parents: 3665
diff changeset
78 <%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
79 <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
80 <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
81 </div>
1403
fc286aed92fe fixes #209, repos groups and index page now share same common page.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
82 </div>
1779
9edd6ac132f0 Added sorting into journal and admin pages
Marcin Kuzminski <marcin@python-works.com>
parents: 1778
diff changeset
83
2936
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
84 <script>
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
85 var data = ${c.data|n};
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
86 var myDataSource = new YAHOO.util.DataSource(data);
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
87 myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSON;
2973
9937afa7f093 whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 2937
diff changeset
88
2936
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
89 myDataSource.responseSchema = {
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
90 resultsList: "records",
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
91 fields: [
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
92 {key:"menu"},
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
93 {key:"raw_name"},
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
94 {key:"name"},
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
95 {key:"desc"},
2937
d439d408b415 Update last_change from VCS data on request.
Marcin Kuzminski <marcin@python-works.com>
parents: 2936
diff changeset
96 {key:"last_change"},
3154
0226b6d6b2b5 Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents: 3149
diff changeset
97 {key:"last_changeset"},
4116
ffd45b185016 Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 4002
diff changeset
98 {key:"last_rev_raw"},
2936
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
99 {key:"owner"},
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
100 {key:"atom"},
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
101 ]
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
102 };
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
103 myDataSource.doBeforeCallback = function(req,raw,res,cb) {
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
104 // This is the filter function
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
105 var data = res.results || [],
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
106 filtered = [],
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
107 i,l;
2973
9937afa7f093 whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 2937
diff changeset
108
2936
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
109 if (req) {
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
110 req = req.toLowerCase();
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
111 for (i = 0; i<data.length; i++) {
3999
e1ecc8622884 group index: quick search should not search the common part of repo names
Mads Kiilerich <madski@unity3d.com>
parents: 3990
diff changeset
112 var pos = data[i].raw_name.toLowerCase().indexOf(req, ${len(group_name)})
2936
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
113 if (pos != -1) {
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
114 filtered.push(data[i]);
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
115 }
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
116 }
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
117 res.results = filtered;
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
118 }
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
119 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
120 return res;
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
121 }
2973
9937afa7f093 whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 2937
diff changeset
122
2936
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
123 // main table sorting
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
124 var myColumnDefs = [
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
125 {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
126 {key:"name",label:"${_('Name')}",sortable:true,
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
127 sortOptions: { sortFunction: nameSort }},
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
128 {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
129 {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
130 sortOptions: { sortFunction: ageSort }},
3154
0226b6d6b2b5 Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents: 3149
diff changeset
131 {key:"last_changeset",label:"${_('Tip')}",sortable:true,
3149
68f9c216377d white space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 3147
diff changeset
132 sortOptions: { sortFunction: revisionSort }},
2936
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
133 {key:"owner",label:"${_('Owner')}",sortable:true},
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
134 {key:"atom",label:"",sortable:false},
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
135 ];
2973
9937afa7f093 whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 2937
diff changeset
136
2936
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
137 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
138 sortedBy:{key:"name",dir:"asc"},
3776
13241a4075e9 Unified the paginators for pylons and YUI.
Marcin Kuzminski <marcin@python-works.com>
parents: 3752
diff changeset
139 paginator: YUI_paginator(${c.visual.dashboard_items},['user-paginator']),
2973
9937afa7f093 whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 2937
diff changeset
140
2936
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
141 MSG_SORTASC:"${_('Click to sort ascending')}",
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
142 MSG_SORTDESC:"${_('Click to sort descending')}",
3526
79c980b628e3 Small wording improvement.
Leonardo <leo@unity3d.com>
parents: 3394
diff changeset
143 MSG_EMPTY:"${_('No repositories found.')}",
2936
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
144 MSG_ERROR:"${_('Data error.')}",
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
145 MSG_LOADING:"${_('Loading...')}",
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
146 }
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
147 );
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
148 myDataTable.subscribe('postRenderEvent',function(oArgs) {
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
149 tooltip_activate();
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
150 quick_repo_menu();
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
151 });
2973
9937afa7f093 whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 2937
diff changeset
152
2936
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
153 var filterTimeout = null;
2973
9937afa7f093 whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 2937
diff changeset
154
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: 3999
diff changeset
155 updateFilter = function () {
2936
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
156 // Reset timeout
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
157 filterTimeout = null;
2973
9937afa7f093 whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 2937
diff changeset
158
2936
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
159 // Reset sort
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
160 var state = myDataTable.getState();
3154
0226b6d6b2b5 Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents: 3149
diff changeset
161 state.sortedBy = {key:'name', dir:YAHOO.widget.DataTable.CLASS_ASC};
2973
9937afa7f093 whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 2937
diff changeset
162
2936
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
163 // Get filtered data
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
164 myDataSource.sendRequest(YUD.get('q_filter').value,{
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
165 success : myDataTable.onDataReturnInitializeTable,
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
166 failure : myDataTable.onDataReturnInitializeTable,
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
167 scope : myDataTable,
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
168 argument: state
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
169 });
2973
9937afa7f093 whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 2937
diff changeset
170
2936
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
171 };
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
172 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
173 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
174 //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
175 YUD.addClass('q_filter', 'loaded');
0226b6d6b2b5 Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents: 3149
diff changeset
176 }
2936
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
177 });
2973
9937afa7f093 whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 2937
diff changeset
178
2936
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
179 YUE.on('q_filter','keyup',function (e) {
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
180 clearTimeout(filterTimeout);
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
181 filterTimeout = setTimeout(updateFilter,600);
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
182 });
4002
5ee04157cadc codecleaner
Marcin Kuzminski <marcin@python-works.com>
parents: 4000
diff changeset
183
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: 3999
diff changeset
184 if(YUD.get('q_filter').value) {
4002
5ee04157cadc codecleaner
Marcin Kuzminski <marcin@python-works.com>
parents: 4000
diff changeset
185 updateFilter();
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: 3999
diff changeset
186 }
2936
62e493c7f436 Added lightweight dashboard option. ref #500
Marcin Kuzminski <marcin@python-works.com>
parents: 2785
diff changeset
187 </script>