##// END OF EJS Templates
fixes count on main page broken after py2.5 compatibility fixes
marcink -
r2121:47d7bcbe beta
parent child Browse files
Show More
@@ -1,197 +1,197 b''
1 1 <%page args="parent" />
2 2 <div class="box">
3 3 <!-- box / title -->
4 4 <div class="title">
5 5 <h5>
6 6 <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" value="${_('quick filter...')}"/> ${parent.breadcrumbs()} <span id="repo_count">0</span> ${_('repositories')}
7 7 </h5>
8 8 %if c.rhodecode_user.username != 'default':
9 9 %if h.HasPermissionAny('hg.admin','hg.create.repository')():
10 10 <ul class="links">
11 11 <li>
12 12 <span>${h.link_to(_('ADD REPOSITORY'),h.url('admin_settings_create_repository'))}</span>
13 13 </li>
14 14 </ul>
15 15 %endif
16 16 %endif
17 17 </div>
18 18 <!-- end box / title -->
19 19 <div class="table">
20 20 % if c.groups:
21 21 <div id='groups_list_wrap' class="yui-skin-sam">
22 22 <table id="groups_list">
23 23 <thead>
24 24 <tr>
25 25 <th class="left"><a href="#">${_('Group name')}</a></th>
26 26 <th class="left"><a href="#">${_('Description')}</a></th>
27 27 ##<th class="left"><a href="#">${_('Number of repositories')}</a></th>
28 28 </tr>
29 29 </thead>
30 30
31 31 ## REPO GROUPS
32 32 % for gr in c.groups:
33 33 <tr>
34 34 <td>
35 35 <div style="white-space: nowrap">
36 36 <img class="icon" alt="${_('Repositories group')}" src="${h.url('/images/icons/database_link.png')}"/>
37 37 ${h.link_to(gr.name,url('repos_group_home',group_name=gr.group_name))}
38 38 </div>
39 39 </td>
40 40 <td>${gr.group_description}</td>
41 41 ## this is commented out since for multi nested repos can be HEAVY!
42 42 ## in number of executed queries during traversing uncomment at will
43 43 ##<td><b>${gr.repositories_recursive_count}</b></td>
44 44 </tr>
45 45 % endfor
46 46
47 47 </table>
48 48 </div>
49 49 <div style="height: 20px"></div>
50 50 % endif
51 51 <div id="welcome" style="display:none;text-align:center">
52 52 <h1><a href="${h.url('home')}">${c.rhodecode_name} ${c.rhodecode_version}</a></h1>
53 53 </div>
54 54 <div id='repos_list_wrap' class="yui-skin-sam">
55 55 <%cnt=0%>
56 56 <%namespace name="dt" file="/_data_table/_dt_elements.html"/>
57 57
58 58 <table id="repos_list">
59 59 <thead>
60 60 <tr>
61 61 <th class="left"></th>
62 62 <th class="left">${_('Name')}</th>
63 63 <th class="left">${_('Description')}</th>
64 64 <th class="left">${_('Last change')}</th>
65 65 <th class="left">${_('Tip')}</th>
66 66 <th class="left">${_('Owner')}</th>
67 67 <th class="left">${_('RSS')}</th>
68 68 <th class="left">${_('Atom')}</th>
69 69 </tr>
70 70 </thead>
71 71 <tbody>
72 72 %for cnt,repo in enumerate(c.repos_list):
73 73 <tr class="parity${(cnt+1)%2}">
74 74 ##QUICK MENU
75 75 <td class="quick_repo_menu">
76 76 ${dt.quick_menu(repo['name'])}
77 77 </td>
78 78 ##REPO NAME AND ICONS
79 79 <td class="reponame">
80 80 ${dt.repo_name(repo['name'],repo['dbrepo']['repo_type'],repo['dbrepo']['private'],repo['dbrepo_fork'].get('repo_name'))}
81 81 </td>
82 82 ##DESCRIPTION
83 83 <td><span class="tooltip" title="${h.tooltip(repo['description'])}">
84 84 ${h.truncate(repo['description'],60)}</span>
85 85 </td>
86 86 ##LAST CHANGE DATE
87 87 <td>
88 88 <span class="tooltip" title="${repo['last_change']}">${h.age(repo['last_change'])}</span>
89 89 </td>
90 90 ##LAST REVISION
91 91 <td>
92 92 ${dt.revision(repo['name'],repo['rev'],repo['tip'],repo['author'],repo['last_msg'])}
93 93 </td>
94 94 ##
95 95 <td title="${repo['contact']}">${h.person(repo['contact'])}</td>
96 96 <td>
97 97 %if c.rhodecode_user.username != 'default':
98 98 <a title="${_('Subscribe to %s rss feed')%repo['name']}" class="rss_icon" href="${h.url('rss_feed_home',repo_name=repo['name'],api_key=c.rhodecode_user.api_key)}"></a>
99 99 %else:
100 100 <a title="${_('Subscribe to %s rss feed')%repo['name']}" class="rss_icon" href="${h.url('rss_feed_home',repo_name=repo['name'])}"></a>
101 101 %endif:
102 102 </td>
103 103 <td>
104 104 %if c.rhodecode_user.username != 'default':
105 105 <a title="${_('Subscribe to %s atom feed')%repo['name']}" class="atom_icon" href="${h.url('atom_feed_home',repo_name=repo['name'],api_key=c.rhodecode_user.api_key)}"></a>
106 106 %else:
107 107 <a title="${_('Subscribe to %s atom feed')%repo['name']}" class="atom_icon" href="${h.url('atom_feed_home',repo_name=repo['name'])}"></a>
108 108 %endif:
109 109 </td>
110 110 </tr>
111 111 %endfor
112 112 </tbody>
113 113 </table>
114 114 </div>
115 115 </div>
116 116 </div>
117 117 <script>
118 YUD.get('repo_count').innerHTML = ${cnt+1};
118 YUD.get('repo_count').innerHTML = ${cnt};
119 119 var func = function(node){
120 120 return node.parentNode.parentNode.parentNode.parentNode;
121 121 }
122 122
123 123
124 124 // groups table sorting
125 125 var myColumnDefs = [
126 126 {key:"name",label:"${_('Group Name')}",sortable:true,
127 127 sortOptions: { sortFunction: groupNameSort }},
128 128 {key:"desc",label:"${_('Description')}",sortable:true},
129 129 ];
130 130
131 131 var myDataSource = new YAHOO.util.DataSource(YUD.get("groups_list"));
132 132
133 133 myDataSource.responseType = YAHOO.util.DataSource.TYPE_HTMLTABLE;
134 134 myDataSource.responseSchema = {
135 135 fields: [
136 136 {key:"name"},
137 137 {key:"desc"},
138 138 ]
139 139 };
140 140
141 141 var myDataTable = new YAHOO.widget.DataTable("groups_list_wrap", myColumnDefs, myDataSource,
142 142 {
143 143 sortedBy:{key:"name",dir:"asc"},
144 144 MSG_SORTASC:"${_('Click to sort ascending')}",
145 145 MSG_SORTDESC:"${_('Click to sort descending')}"
146 146 }
147 147 );
148 148
149 149 // main table sorting
150 150 var myColumnDefs = [
151 151 {key:"menu",label:"",sortable:false,className:"quick_repo_menu hidden"},
152 152 {key:"name",label:"${_('Name')}",sortable:true,
153 153 sortOptions: { sortFunction: nameSort }},
154 154 {key:"desc",label:"${_('Description')}",sortable:true},
155 155 {key:"last_change",label:"${_('Last Change')}",sortable:true,
156 156 sortOptions: { sortFunction: ageSort }},
157 157 {key:"tip",label:"${_('Tip')}",sortable:true,
158 158 sortOptions: { sortFunction: revisionSort }},
159 159 {key:"owner",label:"${_('Owner')}",sortable:true},
160 160 {key:"rss",label:"",sortable:false},
161 161 {key:"atom",label:"",sortable:false},
162 162 ];
163 163
164 164 var myDataSource = new YAHOO.util.DataSource(YUD.get("repos_list"));
165 165
166 166 myDataSource.responseType = YAHOO.util.DataSource.TYPE_HTMLTABLE;
167 167
168 168 myDataSource.responseSchema = {
169 169 fields: [
170 170 {key:"menu"},
171 171 {key:"name"},
172 172 {key:"desc"},
173 173 {key:"last_change"},
174 174 {key:"tip"},
175 175 {key:"owner"},
176 176 {key:"rss"},
177 177 {key:"atom"},
178 178 ]
179 179 };
180 180
181 181 var myDataTable = new YAHOO.widget.DataTable("repos_list_wrap", myColumnDefs, myDataSource,
182 182 {
183 183 sortedBy:{key:"name",dir:"asc"},
184 184 MSG_SORTASC:"${_('Click to sort ascending')}",
185 185 MSG_SORTDESC:"${_('Click to sort descending')}",
186 186 MSG_EMPTY:"${_('No records found.')}",
187 187 MSG_ERROR:"${_('Data error.')}",
188 188 MSG_LOADING:"${_('Loading...')}",
189 189 }
190 190 );
191 191 myDataTable.subscribe('postRenderEvent',function(oArgs) {
192 192 tooltip_activate();
193 193 quick_repo_menu();
194 194 q_filter('q_filter',YUQ('div.table tr td a.repo_name'),func);
195 195 });
196 196
197 197 </script>
General Comments 0
You need to be logged in to leave comments. Login now