Mercurial > kallithea
comparison rhodecode/templates/index_base.html @ 1403:fc286aed92fe beta
fixes #209, repos groups and index page now share same common page.
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Thu, 30 Jun 2011 21:44:31 +0200 |
parents | |
children | 241a5167c4e0 |
comparison
equal
deleted
inserted
replaced
1402:edfbf3ee9965 | 1403:fc286aed92fe |
---|---|
1 <%page args="parent" /> | |
2 <%def name="get_sort(name)"> | |
3 <%name_slug = name.lower().replace(' ','_') %> | |
4 | |
5 %if name_slug == c.sort_slug: | |
6 %if c.sort_by.startswith('-'): | |
7 <a href="?sort=${name_slug}">${name}↑</a> | |
8 %else: | |
9 <a href="?sort=-${name_slug}">${name}↓</a> | |
10 %endif: | |
11 %else: | |
12 <a href="?sort=${name_slug}">${name}</a> | |
13 %endif | |
14 </%def> | |
15 | |
16 <div class="box"> | |
17 <!-- box / title --> | |
18 <div class="title"> | |
19 <h5><input class="top-right-rounded-corner top-left-rounded-corner | |
20 bottom-left-rounded-corner bottom-right-rounded-corner" | |
21 id="q_filter" size="15" type="text" name="filter" | |
22 value="${_('quick filter...')}"/> | |
23 ${parent.breadcrumbs()} <span id="repo_count"></span> ${_('repositories')} | |
24 </h5> | |
25 %if c.rhodecode_user.username != 'default': | |
26 %if h.HasPermissionAny('hg.admin','hg.create.repository')(): | |
27 <ul class="links"> | |
28 <li> | |
29 <span>${h.link_to(_('ADD NEW REPOSITORY'),h.url('admin_settings_create_repository'))}</span> | |
30 </li> | |
31 </ul> | |
32 %endif | |
33 %endif | |
34 </div> | |
35 <!-- end box / title --> | |
36 <div class="table"> | |
37 % if c.groups: | |
38 <table> | |
39 | |
40 <thead> | |
41 <tr> | |
42 <th class="left"><a href="#">${_('Group name')}</a></th> | |
43 <th class="left"><a href="#">${_('Description')}</a></th> | |
44 <th class="left"><a href="#">${_('Number of repositories')}</a></th> | |
45 </tr> | |
46 </thead> | |
47 | |
48 ## REPO GROUPS | |
49 | |
50 % for gr in c.groups: | |
51 <tr> | |
52 <td> | |
53 <div style="white-space: nowrap"> | |
54 <img class="icon" alt="${_('Repositories group')}" src="${h.url('/images/icons/database_link.png')}"/> | |
55 ${h.link_to(gr.group_name,url('repos_group',id=gr.group_id))} | |
56 </div> | |
57 </td> | |
58 <td>${gr.group_description}</td> | |
59 <td><b>${gr.repositories.count()}</b></td> | |
60 </tr> | |
61 % endfor | |
62 | |
63 </table> | |
64 <div style="height: 20px"></div> | |
65 % endif | |
66 <table> | |
67 <thead> | |
68 <tr> | |
69 <th class="left">${get_sort(_('Name'))}</th> | |
70 <th class="left">${get_sort(_('Description'))}</th> | |
71 <th class="left">${get_sort(_('Last change'))}</th> | |
72 <th class="left">${get_sort(_('Tip'))}</th> | |
73 <th class="left">${get_sort(_('Owner'))}</th> | |
74 <th class="left">${_('RSS')}</th> | |
75 <th class="left">${_('Atom')}</th> | |
76 </tr> | |
77 </thead> | |
78 <tbody> | |
79 %for cnt,repo in enumerate(c.repos_list): | |
80 <tr class="parity${cnt%2}"> | |
81 <td> | |
82 <div style="white-space: nowrap"> | |
83 ## TYPE OF REPO | |
84 %if repo['dbrepo']['repo_type'] =='hg': | |
85 <img class="icon" title="${_('Mercurial repository')}" alt="${_('Mercurial repository')}" src="${h.url("/images/icons/hgicon.png")}"/> | |
86 %elif repo['dbrepo']['repo_type'] =='git': | |
87 <img class="icon" title="${_('Git repository')}" alt="${_('Git repository')}" src="${h.url("/images/icons/giticon.png")}"/> | |
88 %else: | |
89 | |
90 %endif | |
91 | |
92 ##PRIVATE/PUBLIC | |
93 %if repo['dbrepo']['private']: | |
94 <img class="icon" title="${_('private repository')}" alt="${_('private repository')}" src="${h.url("/images/icons/lock.png")}"/> | |
95 %else: | |
96 <img class="icon" title="${_('public repository')}" alt="${_('public repository')}" src="${h.url("/images/icons/lock_open.png")}"/> | |
97 %endif | |
98 | |
99 ##NAME | |
100 ${h.link_to(repo['name'], | |
101 h.url('summary_home',repo_name=repo['name']),class_="repo_name")} | |
102 %if repo['dbrepo_fork']: | |
103 <a href="${h.url('summary_home',repo_name=repo['dbrepo_fork']['repo_name'])}"> | |
104 <img class="icon" alt="${_('fork')}" | |
105 title="${_('Fork of')} ${repo['dbrepo_fork']['repo_name']}" | |
106 src="${h.url("/images/icons/arrow_divide.png")}"/></a> | |
107 %endif | |
108 </div> | |
109 </td> | |
110 ##DESCRIPTION | |
111 <td><span class="tooltip" title="${h.tooltip(repo['description'])}"> | |
112 ${h.truncate(repo['description'],60)}</span> | |
113 </td> | |
114 ##LAST CHANGE | |
115 <td> | |
116 <span class="tooltip" title="${repo['last_change']}"> | |
117 ${h.age(repo['last_change'])}</span> | |
118 </td> | |
119 <td> | |
120 %if repo['rev']>=0: | |
121 ${h.link_to('r%s:%s' % (repo['rev'],h.short_id(repo['tip'])), | |
122 h.url('changeset_home',repo_name=repo['name'],revision=repo['tip']), | |
123 class_="tooltip", | |
124 title=h.tooltip(repo['last_msg']))} | |
125 %else: | |
126 ${_('No changesets yet')} | |
127 %endif | |
128 </td> | |
129 <td title="${repo['contact']}">${h.person(repo['contact'])}</td> | |
130 <td> | |
131 %if c.rhodecode_user.username != 'default': | |
132 <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> | |
133 %else: | |
134 <a title="${_('Subscribe to %s rss feed')%repo['name']}" class="rss_icon" href="${h.url('rss_feed_home',repo_name=repo['name'])}"></a> | |
135 %endif: | |
136 </td> | |
137 <td> | |
138 %if c.rhodecode_user.username != 'default': | |
139 <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> | |
140 %else: | |
141 <a title="${_('Subscribe to %s atom feed')%repo['name']}" class="atom_icon" href="${h.url('atom_feed_home',repo_name=repo['name'])}"></a> | |
142 %endif: | |
143 </td> | |
144 </tr> | |
145 %endfor | |
146 | |
147 </tbody> | |
148 </table> | |
149 </div> | |
150 </div> | |
151 | |
152 | |
153 <script type="text/javascript"> | |
154 var D = YAHOO.util.Dom; | |
155 var E = YAHOO.util.Event; | |
156 var S = YAHOO.util.Selector; | |
157 | |
158 var q_filter = D.get('q_filter'); | |
159 var F = YAHOO.namespace('q_filter'); | |
160 | |
161 E.on(q_filter,'click',function(){ | |
162 q_filter.value = ''; | |
163 }); | |
164 | |
165 F.filterTimeout = null; | |
166 | |
167 //set initial count for repos | |
168 var nodes = S.query('div.table tr td div a.repo_name'); | |
169 YUD.get('repo_count').innerHTML = nodes.length; | |
170 F.updateFilter = function() { | |
171 // Reset timeout | |
172 F.filterTimeout = null; | |
173 | |
174 var obsolete = []; | |
175 nodes = S.query('div.table tr td div a.repo_name'); | |
176 var req = q_filter.value.toLowerCase(); | |
177 for (n in nodes){ | |
178 D.setStyle(nodes[n].parentNode.parentNode.parentNode,'display','') | |
179 } | |
180 if (req){ | |
181 for (n in nodes){ | |
182 if (nodes[n].innerHTML.toLowerCase().indexOf(req) == -1) { | |
183 obsolete.push(nodes[n]); | |
184 } | |
185 } | |
186 if(obsolete){ | |
187 for (n in obsolete){ | |
188 D.setStyle(obsolete[n].parentNode.parentNode.parentNode,'display','none'); | |
189 } | |
190 } | |
191 } | |
192 // set new count into dashboard | |
193 YUD.get('repo_count').innerHTML = nodes.length - obsolete.length; | |
194 } | |
195 | |
196 E.on(q_filter,'keyup',function(e){ | |
197 clearTimeout(F.filterTimeout); | |
198 setTimeout(F.updateFilter,600); | |
199 }); | |
200 | |
201 </script> |