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