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