annotate rhodecode/templates/admin/repos/repos.html @ 3179:cd50d1b5f35b

merged with beta
author Marcin Kuzminski <marcin@python-works.com>
date Mon, 21 Jan 2013 00:03:44 +0100
parents 63e58ef80ef1 2fb94c52e20e
children 3563bb7b4b82
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
216
c8162373f214 Cleaned the way based was used to generate submenu for admin, now it's much more clear to use submenu. Cleaned admin and added comment to middleware
Marcin Kuzminski <marcin@python-works.com>
parents: 182
diff changeset
1 ## -*- coding: utf-8 -*-
127
20dc7a5eb748 Html changes and cleanups, made folders for html templates, implemented tags and branches pages
Marcin Kuzminski <marcin@python-works.com>
parents: 105
diff changeset
2 <%inherit file="/base/base.html"/>
216
c8162373f214 Cleaned the way based was used to generate submenu for admin, now it's much more clear to use submenu. Cleaned admin and added comment to middleware
Marcin Kuzminski <marcin@python-works.com>
parents: 182
diff changeset
3
44
d924b931b488 Added managment pages.
marcink
parents:
diff changeset
4 <%def name="title()">
619
a1ec653f5f95 #38 updated RhodeCode titles
Marcin Kuzminski <marcin@python-works.com>
parents: 581
diff changeset
5 ${_('Repositories administration')} - ${c.rhodecode_name}
44
d924b931b488 Added managment pages.
marcink
parents:
diff changeset
6 </%def>
362
558eb7c5028f version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents: 324
diff changeset
7
558eb7c5028f version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents: 324
diff changeset
8 <%def name="breadcrumbs_links()">
2664
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
9 <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" value="${_('quick filter...')}"/> ${h.link_to(_('Admin'),h.url('admin_home'))} &raquo; <span id="repo_count">0</span> ${_('repositories')}
44
d924b931b488 Added managment pages.
marcink
parents:
diff changeset
10 </%def>
d924b931b488 Added managment pages.
marcink
parents:
diff changeset
11 <%def name="page_nav()">
182
11e8eb5a92e3 new way of menu generation for base, and all admin pages
Marcin Kuzminski <marcin@python-works.com>
parents: 174
diff changeset
12 ${self.menu('admin')}
44
d924b931b488 Added managment pages.
marcink
parents:
diff changeset
13 </%def>
d924b931b488 Added managment pages.
marcink
parents:
diff changeset
14 <%def name="main()">
362
558eb7c5028f version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents: 324
diff changeset
15 <div class="box">
1779
9edd6ac132f0 Added sorting into journal and admin pages
Marcin Kuzminski <marcin@python-works.com>
parents: 1770
diff changeset
16
362
558eb7c5028f version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents: 324
diff changeset
17 <div class="title">
558eb7c5028f version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents: 324
diff changeset
18 ${self.breadcrumbs()}
558eb7c5028f version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents: 324
diff changeset
19 <ul class="links">
558eb7c5028f version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents: 324
diff changeset
20 <li>
1770
184557472f5c Implements #304
Marcin Kuzminski <marcin@python-works.com>
parents: 1701
diff changeset
21 <span>${h.link_to(_(u'ADD REPOSITORY'),h.url('new_repo'))}</span>
1888
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1827
diff changeset
22 </li>
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1827
diff changeset
23 </ul>
362
558eb7c5028f version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents: 324
diff changeset
24 </div>
2664
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
25 <div class="table yui-skin-sam" id="repos_list_wrap"></div>
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
26 <div id="user-paginator" style="padding: 0px 0px 0px 20px"></div>
2673
d5e42c00f3c1 white space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 2664
diff changeset
27
1888
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1827
diff changeset
28
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1827
diff changeset
29 </div>
1779
9edd6ac132f0 Added sorting into journal and admin pages
Marcin Kuzminski <marcin@python-works.com>
parents: 1770
diff changeset
30 <script>
2664
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
31 var url = "${h.url('formatted_users', format='json')}";
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
32 var data = ${c.data|n};
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
33 var myDataSource = new YAHOO.util.DataSource(data);
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
34 myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSON;
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
35
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
36 myDataSource.responseSchema = {
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
37 resultsList: "records",
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
38 fields: [
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
39 {key:"menu"},
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
40 {key:"raw_name"},
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
41 {key:"name"},
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
42 {key:"desc"},
3154
0226b6d6b2b5 Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents: 2673
diff changeset
43 {key:"last_changeset"},
2664
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
44 {key:"owner"},
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
45 {key:"action"},
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
46 ]
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
47 };
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
48 myDataSource.doBeforeCallback = function(req,raw,res,cb) {
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
49 // This is the filter function
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
50 var data = res.results || [],
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
51 filtered = [],
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
52 i,l;
2673
d5e42c00f3c1 white space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 2664
diff changeset
53
2664
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
54 if (req) {
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
55 req = req.toLowerCase();
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
56 for (i = 0; i<data.length; i++) {
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
57 var pos = data[i].raw_name.toLowerCase().indexOf(req)
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
58 if (pos != -1) {
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
59 filtered.push(data[i]);
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
60 }
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
61 }
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
62 res.results = filtered;
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
63 }
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
64 YUD.get('repo_count').innerHTML = res.results.length;
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
65 return res;
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
66 }
1888
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1827
diff changeset
67
1779
9edd6ac132f0 Added sorting into journal and admin pages
Marcin Kuzminski <marcin@python-works.com>
parents: 1770
diff changeset
68 // main table sorting
9edd6ac132f0 Added sorting into journal and admin pages
Marcin Kuzminski <marcin@python-works.com>
parents: 1770
diff changeset
69 var myColumnDefs = [
9edd6ac132f0 Added sorting into journal and admin pages
Marcin Kuzminski <marcin@python-works.com>
parents: 1770
diff changeset
70 {key:"menu",label:"",sortable:false,className:"quick_repo_menu hidden"},
9edd6ac132f0 Added sorting into journal and admin pages
Marcin Kuzminski <marcin@python-works.com>
parents: 1770
diff changeset
71 {key:"name",label:"${_('Name')}",sortable:true,
2664
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
72 sortOptions: { sortFunction: nameSort }},
1779
9edd6ac132f0 Added sorting into journal and admin pages
Marcin Kuzminski <marcin@python-works.com>
parents: 1770
diff changeset
73 {key:"desc",label:"${_('Description')}",sortable:true},
3154
0226b6d6b2b5 Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents: 2673
diff changeset
74 {key:"last_changeset",label:"${_('Tip')}",sortable:true,
3168
2fb94c52e20e whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 3154
diff changeset
75 sortOptions: { sortFunction: revisionSort }},
1779
9edd6ac132f0 Added sorting into journal and admin pages
Marcin Kuzminski <marcin@python-works.com>
parents: 1770
diff changeset
76 {key:"owner",label:"${_('Owner')}",sortable:true},
9edd6ac132f0 Added sorting into journal and admin pages
Marcin Kuzminski <marcin@python-works.com>
parents: 1770
diff changeset
77 {key:"action",label:"${_('Action')}",sortable:false},
9edd6ac132f0 Added sorting into journal and admin pages
Marcin Kuzminski <marcin@python-works.com>
parents: 1770
diff changeset
78 ];
9edd6ac132f0 Added sorting into journal and admin pages
Marcin Kuzminski <marcin@python-works.com>
parents: 1770
diff changeset
79
2664
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
80 var myDataTable = new YAHOO.widget.DataTable("repos_list_wrap", myColumnDefs, myDataSource,{
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
81 sortedBy:{key:"name",dir:"asc"},
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
82 paginator: new YAHOO.widget.Paginator({
3154
0226b6d6b2b5 Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents: 2673
diff changeset
83 rowsPerPage: 25,
2664
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
84 alwaysVisible: false,
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
85 template : "{PreviousPageLink} {FirstPageLink} {PageLinks} {LastPageLink} {NextPageLink}",
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
86 pageLinks: 5,
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
87 containerClass: 'pagination-wh',
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
88 currentPageClass: 'pager_curpage',
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
89 pageLinkClass: 'pager_link',
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
90 nextPageLinkLabel: '&gt;',
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
91 previousPageLinkLabel: '&lt;',
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
92 firstPageLinkLabel: '&lt;&lt;',
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
93 lastPageLinkLabel: '&gt;&gt;',
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
94 containers:['user-paginator']
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
95 }),
1888
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1827
diff changeset
96
2664
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
97 MSG_SORTASC:"${_('Click to sort ascending')}",
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
98 MSG_SORTDESC:"${_('Click to sort descending')}",
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
99 MSG_EMPTY:"${_('No records found.')}",
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
100 MSG_ERROR:"${_('Data error.')}",
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
101 MSG_LOADING:"${_('Loading...')}",
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
102 }
1779
9edd6ac132f0 Added sorting into journal and admin pages
Marcin Kuzminski <marcin@python-works.com>
parents: 1770
diff changeset
103 );
9edd6ac132f0 Added sorting into journal and admin pages
Marcin Kuzminski <marcin@python-works.com>
parents: 1770
diff changeset
104 myDataTable.subscribe('postRenderEvent',function(oArgs) {
9edd6ac132f0 Added sorting into journal and admin pages
Marcin Kuzminski <marcin@python-works.com>
parents: 1770
diff changeset
105 tooltip_activate();
9edd6ac132f0 Added sorting into journal and admin pages
Marcin Kuzminski <marcin@python-works.com>
parents: 1770
diff changeset
106 quick_repo_menu();
1888
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1827
diff changeset
107 });
2673
d5e42c00f3c1 white space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 2664
diff changeset
108
2664
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
109 var filterTimeout = null;
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
110
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
111 updateFilter = function () {
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
112 // Reset timeout
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
113 filterTimeout = null;
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
114
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
115 // Reset sort
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
116 var state = myDataTable.getState();
3154
0226b6d6b2b5 Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents: 2673
diff changeset
117 state.sortedBy = {key:'name', dir:YAHOO.widget.DataTable.CLASS_ASC};
2664
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
118
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
119 // Get filtered data
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
120 myDataSource.sendRequest(YUD.get('q_filter').value,{
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
121 success : myDataTable.onDataReturnInitializeTable,
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
122 failure : myDataTable.onDataReturnInitializeTable,
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
123 scope : myDataTable,
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
124 argument: state
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
125 });
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
126
2673
d5e42c00f3c1 white space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 2664
diff changeset
127 };
2664
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
128 YUE.on('q_filter','click',function(){
3154
0226b6d6b2b5 Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents: 2673
diff changeset
129 if(!YUD.hasClass('q_filter', 'loaded')){
0226b6d6b2b5 Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents: 2673
diff changeset
130 YUD.get('q_filter').value = '';
0226b6d6b2b5 Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents: 2673
diff changeset
131 //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: 2673
diff changeset
132 YUD.addClass('q_filter', 'loaded');
0226b6d6b2b5 Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents: 2673
diff changeset
133 }
2664
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
134 });
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
135
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
136 YUE.on('q_filter','keyup',function (e) {
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
137 clearTimeout(filterTimeout);
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
138 filterTimeout = setTimeout(updateFilter,600);
2673
d5e42c00f3c1 white space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 2664
diff changeset
139 });
1888
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1827
diff changeset
140 </script>
2664
c525d7e641a6 rewrote admin repos page.
Marcin Kuzminski <marcin@python-works.com>
parents: 2548
diff changeset
141
1888
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1827
diff changeset
142 </%def>