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