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