##// END OF EJS Templates
enabled quick link to enabling statistics in admin page, for admins
marcink -
r917:de8b95f4 beta
parent child Browse files
Show More
@@ -1,385 +1,385
1 ## -*- coding: utf-8 -*-
1 ## -*- coding: utf-8 -*-
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" id="mainhtml">
3 <html xmlns="http://www.w3.org/1999/xhtml" id="mainhtml">
4 <head>
4 <head>
5 <title>${next.title()}</title>
5 <title>${next.title()}</title>
6 <link rel="icon" href="/images/icons/database_gear.png" type="image/png" />
6 <link rel="icon" href="/images/icons/database_gear.png" type="image/png" />
7 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
7 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
8 <meta name="robots" content="index, nofollow"/>
8 <meta name="robots" content="index, nofollow"/>
9 <!-- stylesheets -->
9 <!-- stylesheets -->
10 ${self.css()}
10 ${self.css()}
11 <!-- scripts -->
11 <!-- scripts -->
12 ${self.js()}
12 ${self.js()}
13 %if c.ga_code:
13 %if c.ga_code:
14 <script type="text/javascript">
14 <script type="text/javascript">
15
15
16 var _gaq = _gaq || [];
16 var _gaq = _gaq || [];
17 _gaq.push(['_setAccount', '${c.ga_code}']);
17 _gaq.push(['_setAccount', '${c.ga_code}']);
18 _gaq.push(['_trackPageview']);
18 _gaq.push(['_trackPageview']);
19
19
20 (function() {
20 (function() {
21 var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
21 var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
22 ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
22 ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
23 var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
23 var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
24 })();
24 })();
25
25
26
26
27 </script>
27 </script>
28 %endif
28 %endif
29 </head>
29 </head>
30 <body>
30 <body>
31 <!-- header -->
31 <!-- header -->
32 <div id="header">
32 <div id="header">
33 <!-- user -->
33 <!-- user -->
34 <ul id="logged-user">
34 <ul id="logged-user">
35 <li class="first">
35 <li class="first">
36 <div class="gravatar">
36 <div class="gravatar">
37 <img alt="gravatar" src="${h.gravatar_url(c.rhodecode_user.email,20)}" />
37 <img alt="gravatar" src="${h.gravatar_url(c.rhodecode_user.email,20)}" />
38 </div>
38 </div>
39 <div class="account">
39 <div class="account">
40 %if c.rhodecode_user.username == 'default':
40 %if c.rhodecode_user.username == 'default':
41 %if h.HasPermissionAny('hg.admin', 'hg.register.auto_activate', 'hg.register.manual_activate')():
41 %if h.HasPermissionAny('hg.admin', 'hg.register.auto_activate', 'hg.register.manual_activate')():
42 ${h.link_to('anonymous',h.url('register'),title='%s %s'%(c.rhodecode_user.name,c.rhodecode_user.lastname))}
42 ${h.link_to('anonymous',h.url('register'),title='%s %s'%(c.rhodecode_user.name,c.rhodecode_user.lastname))}
43 %else:
43 %else:
44 ${h.link_to('anonymous',h.url('#'),title='%s %s'%(c.rhodecode_user.name,c.rhodecode_user.lastname))}
44 ${h.link_to('anonymous',h.url('#'),title='%s %s'%(c.rhodecode_user.name,c.rhodecode_user.lastname))}
45 %endif
45 %endif
46
46
47 %else:
47 %else:
48 ${h.link_to(c.rhodecode_user.username,h.url('admin_settings_my_account'),title='%s %s'%(c.rhodecode_user.name,c.rhodecode_user.lastname))}
48 ${h.link_to(c.rhodecode_user.username,h.url('admin_settings_my_account'),title='%s %s'%(c.rhodecode_user.name,c.rhodecode_user.lastname))}
49 %endif
49 %endif
50 </div>
50 </div>
51 </li>
51 </li>
52 <li>
52 <li>
53 <a href="${h.url('home')}">${_('Home')}</a>
53 <a href="${h.url('home')}">${_('Home')}</a>
54 </li>
54 </li>
55 %if c.rhodecode_user.username != 'default':
55 %if c.rhodecode_user.username != 'default':
56 <li>
56 <li>
57 <a href="${h.url('journal')}">${_('Journal')}</a>
57 <a href="${h.url('journal')}">${_('Journal')}</a>
58 ##(${c.unread_journal})</a>
58 ##(${c.unread_journal})</a>
59 </li>
59 </li>
60 %endif
60 %endif
61 %if c.rhodecode_user.username == 'default':
61 %if c.rhodecode_user.username == 'default':
62 <li class="last highlight">${h.link_to(u'Login',h.url('login_home'))}</li>
62 <li class="last highlight">${h.link_to(u'Login',h.url('login_home'))}</li>
63 %else:
63 %else:
64 <li class="last highlight">${h.link_to(u'Log Out',h.url('logout_home'))}</li>
64 <li class="last highlight">${h.link_to(u'Log Out',h.url('logout_home'))}</li>
65 %endif
65 %endif
66 </ul>
66 </ul>
67 <!-- end user -->
67 <!-- end user -->
68 <div id="header-inner" class="title top-left-rounded-corner top-right-rounded-corner">
68 <div id="header-inner" class="title top-left-rounded-corner top-right-rounded-corner">
69 <!-- logo -->
69 <!-- logo -->
70 <div id="logo">
70 <div id="logo">
71 <h1><a href="${h.url('home')}">${c.rhodecode_name}</a></h1>
71 <h1><a href="${h.url('home')}">${c.rhodecode_name}</a></h1>
72 </div>
72 </div>
73 <!-- end logo -->
73 <!-- end logo -->
74 <!-- menu -->
74 <!-- menu -->
75 ${self.page_nav()}
75 ${self.page_nav()}
76 <!-- quick -->
76 <!-- quick -->
77 </div>
77 </div>
78 </div>
78 </div>
79 <!-- end header -->
79 <!-- end header -->
80
80
81 <!-- CONTENT -->
81 <!-- CONTENT -->
82 <div id="content">
82 <div id="content">
83 <div class="flash_msg">
83 <div class="flash_msg">
84 <% messages = h.flash.pop_messages() %>
84 <% messages = h.flash.pop_messages() %>
85 % if messages:
85 % if messages:
86 <ul id="flash-messages">
86 <ul id="flash-messages">
87 % for message in messages:
87 % for message in messages:
88 <li class="${message.category}_msg">${message}</li>
88 <li class="${message.category}_msg">${message}</li>
89 % endfor
89 % endfor
90 </ul>
90 </ul>
91 % endif
91 % endif
92 </div>
92 </div>
93 <div id="main">
93 <div id="main">
94 ${next.main()}
94 ${next.main()}
95 </div>
95 </div>
96 </div>
96 </div>
97 <!-- END CONTENT -->
97 <!-- END CONTENT -->
98
98
99 <!-- footer -->
99 <!-- footer -->
100 <div id="footer">
100 <div id="footer">
101 <div id="footer-inner" class="title bottom-left-rounded-corner bottom-right-rounded-corner">
101 <div id="footer-inner" class="title bottom-left-rounded-corner bottom-right-rounded-corner">
102 <div>
102 <div>
103 <p class="footer-link">${h.link_to(_('Submit a bug'),h.url('bugtracker'))}</p>
103 <p class="footer-link">${h.link_to(_('Submit a bug'),h.url('bugtracker'))}</p>
104 <p class="footer-link">${h.link_to(_('GPL license'),h.url('gpl_license'))}</p>
104 <p class="footer-link">${h.link_to(_('GPL license'),h.url('gpl_license'))}</p>
105 <p>RhodeCode ${c.rhodecode_version} &copy; 2010 by Marcin Kuzminski</p>
105 <p>RhodeCode ${c.rhodecode_version} &copy; 2010 by Marcin Kuzminski</p>
106 </div>
106 </div>
107 </div>
107 </div>
108 <script type="text/javascript">${h.tooltip.activate()}</script>
108 <script type="text/javascript">${h.tooltip.activate()}</script>
109 </div>
109 </div>
110 <!-- end footer -->
110 <!-- end footer -->
111 </body>
111 </body>
112
112
113 </html>
113 </html>
114
114
115 ### MAKO DEFS ###
115 ### MAKO DEFS ###
116 <%def name="page_nav()">
116 <%def name="page_nav()">
117 ${self.menu()}
117 ${self.menu()}
118 </%def>
118 </%def>
119
119
120 <%def name="menu(current=None)">
120 <%def name="menu(current=None)">
121 <%
121 <%
122 def is_current(selected):
122 def is_current(selected):
123 if selected == current:
123 if selected == current:
124 return h.literal('class="current"')
124 return h.literal('class="current"')
125 %>
125 %>
126 %if current not in ['home','admin']:
126 %if current not in ['home','admin']:
127 ##REGULAR MENU
127 ##REGULAR MENU
128 <ul id="quick">
128 <ul id="quick">
129 <!-- repo switcher -->
129 <!-- repo switcher -->
130 <li>
130 <li>
131 <a id="repo_switcher" title="${_('Switch repository')}" href="#">
131 <a id="repo_switcher" title="${_('Switch repository')}" href="#">
132 <span class="icon">
132 <span class="icon">
133 <img src="/images/icons/database.png" alt="${_('Products')}" />
133 <img src="/images/icons/database.png" alt="${_('Products')}" />
134 </span>
134 </span>
135 <span>&darr;</span>
135 <span>&darr;</span>
136 </a>
136 </a>
137 <ul class="repo_switcher">
137 <ul class="repo_switcher">
138 %for repo in c.cached_repo_list:
138 %for repo in c.cached_repo_list:
139
139
140 %if repo['repo'].dbrepo.private:
140 %if repo['repo'].dbrepo.private:
141 <li><img src="/images/icons/lock.png" alt="${_('Private repository')}" class="repo_switcher_type"/>${h.link_to(repo['repo'].name,h.url('summary_home',repo_name=repo['repo'].name),class_="%s" % repo['repo'].dbrepo.repo_type)}</li>
141 <li><img src="/images/icons/lock.png" alt="${_('Private repository')}" class="repo_switcher_type"/>${h.link_to(repo['repo'].name,h.url('summary_home',repo_name=repo['repo'].name),class_="%s" % repo['repo'].dbrepo.repo_type)}</li>
142 %else:
142 %else:
143 <li><img src="/images/icons/lock_open.png" alt="${_('Public repository')}" class="repo_switcher_type" />${h.link_to(repo['repo'].name,h.url('summary_home',repo_name=repo['repo'].name),class_="%s" % repo['repo'].dbrepo.repo_type)}</li>
143 <li><img src="/images/icons/lock_open.png" alt="${_('Public repository')}" class="repo_switcher_type" />${h.link_to(repo['repo'].name,h.url('summary_home',repo_name=repo['repo'].name),class_="%s" % repo['repo'].dbrepo.repo_type)}</li>
144 %endif
144 %endif
145 %endfor
145 %endfor
146 </ul>
146 </ul>
147 </li>
147 </li>
148
148
149 <li ${is_current('summary')}>
149 <li ${is_current('summary')}>
150 <a title="${_('Summary')}" href="${h.url('summary_home',repo_name=c.repo_name)}">
150 <a title="${_('Summary')}" href="${h.url('summary_home',repo_name=c.repo_name)}">
151 <span class="icon">
151 <span class="icon">
152 <img src="/images/icons/clipboard_16.png" alt="${_('Summary')}" />
152 <img src="/images/icons/clipboard_16.png" alt="${_('Summary')}" />
153 </span>
153 </span>
154 <span>${_('Summary')}</span>
154 <span>${_('Summary')}</span>
155 </a>
155 </a>
156 </li>
156 </li>
157 ##<li ${is_current('shortlog')}>
157 ##<li ${is_current('shortlog')}>
158 ## <a title="${_('Shortlog')}" href="${h.url('shortlog_home',repo_name=c.repo_name)}">
158 ## <a title="${_('Shortlog')}" href="${h.url('shortlog_home',repo_name=c.repo_name)}">
159 ## <span class="icon">
159 ## <span class="icon">
160 ## <img src="/images/icons/application_view_list.png" alt="${_('Shortlog')}" />
160 ## <img src="/images/icons/application_view_list.png" alt="${_('Shortlog')}" />
161 ## </span>
161 ## </span>
162 ## <span>${_('Shortlog')}</span>
162 ## <span>${_('Shortlog')}</span>
163 ## </a>
163 ## </a>
164 ##</li>
164 ##</li>
165 <li ${is_current('changelog')}>
165 <li ${is_current('changelog')}>
166 <a title="${_('Changelog')}" href="${h.url('changelog_home',repo_name=c.repo_name)}">
166 <a title="${_('Changelog')}" href="${h.url('changelog_home',repo_name=c.repo_name)}">
167 <span class="icon">
167 <span class="icon">
168 <img src="/images/icons/time.png" alt="${_('Changelog')}" />
168 <img src="/images/icons/time.png" alt="${_('Changelog')}" />
169 </span>
169 </span>
170 <span>${_('Changelog')}</span>
170 <span>${_('Changelog')}</span>
171 </a>
171 </a>
172 </li>
172 </li>
173
173
174 <li ${is_current('switch_to')}>
174 <li ${is_current('switch_to')}>
175 <a title="${_('Switch to')}" href="#">
175 <a title="${_('Switch to')}" href="#">
176 <span class="icon">
176 <span class="icon">
177 <img src="/images/icons/arrow_switch.png" alt="${_('Switch to')}" />
177 <img src="/images/icons/arrow_switch.png" alt="${_('Switch to')}" />
178 </span>
178 </span>
179 <span>${_('Switch to')}</span>
179 <span>${_('Switch to')}</span>
180 </a>
180 </a>
181 <ul>
181 <ul>
182 <li>
182 <li>
183 ${h.link_to('%s (%s)' % (_('branches'),len(c.repository_branches.values()),),h.url('branches_home',repo_name=c.repo_name),class_='branches childs')}
183 ${h.link_to('%s (%s)' % (_('branches'),len(c.repository_branches.values()),),h.url('branches_home',repo_name=c.repo_name),class_='branches childs')}
184 <ul>
184 <ul>
185 %if c.repository_branches.values():
185 %if c.repository_branches.values():
186 %for cnt,branch in enumerate(c.repository_branches.items()):
186 %for cnt,branch in enumerate(c.repository_branches.items()):
187 <li>${h.link_to('%s - %s' % (branch[0],h.short_id(branch[1])),h.url('files_home',repo_name=c.repo_name,revision=branch[1]))}</li>
187 <li>${h.link_to('%s - %s' % (branch[0],h.short_id(branch[1])),h.url('files_home',repo_name=c.repo_name,revision=branch[1]))}</li>
188 %endfor
188 %endfor
189 %else:
189 %else:
190 <li>${h.link_to(_('There are no branches yet'),'#')}</li>
190 <li>${h.link_to(_('There are no branches yet'),'#')}</li>
191 %endif
191 %endif
192 </ul>
192 </ul>
193 </li>
193 </li>
194 <li>
194 <li>
195 ${h.link_to('%s (%s)' % (_('tags'),len(c.repository_tags.values()),),h.url('tags_home',repo_name=c.repo_name),class_='tags childs')}
195 ${h.link_to('%s (%s)' % (_('tags'),len(c.repository_tags.values()),),h.url('tags_home',repo_name=c.repo_name),class_='tags childs')}
196 <ul>
196 <ul>
197 %if c.repository_tags.values():
197 %if c.repository_tags.values():
198 %for cnt,tag in enumerate(c.repository_tags.items()):
198 %for cnt,tag in enumerate(c.repository_tags.items()):
199 <li>${h.link_to('%s - %s' % (tag[0],h.short_id(tag[1])),h.url('files_home',repo_name=c.repo_name,revision=tag[1]))}</li>
199 <li>${h.link_to('%s - %s' % (tag[0],h.short_id(tag[1])),h.url('files_home',repo_name=c.repo_name,revision=tag[1]))}</li>
200 %endfor
200 %endfor
201 %else:
201 %else:
202 <li>${h.link_to(_('There are no tags yet'),'#')}</li>
202 <li>${h.link_to(_('There are no tags yet'),'#')}</li>
203 %endif
203 %endif
204 </ul>
204 </ul>
205 </li>
205 </li>
206 </ul>
206 </ul>
207 </li>
207 </li>
208 <li ${is_current('files')}>
208 <li ${is_current('files')}>
209 <a title="${_('Files')}" href="${h.url('files_home',repo_name=c.repo_name)}">
209 <a title="${_('Files')}" href="${h.url('files_home',repo_name=c.repo_name)}">
210 <span class="icon">
210 <span class="icon">
211 <img src="/images/icons/file.png" alt="${_('Files')}" />
211 <img src="/images/icons/file.png" alt="${_('Files')}" />
212 </span>
212 </span>
213 <span>${_('Files')}</span>
213 <span>${_('Files')}</span>
214 </a>
214 </a>
215 </li>
215 </li>
216
216
217 <li ${is_current('options')}>
217 <li ${is_current('options')}>
218 <a title="${_('Options')}" href="#">
218 <a title="${_('Options')}" href="#">
219 <span class="icon">
219 <span class="icon">
220 <img src="/images/icons/table_gear.png" alt="${_('Admin')}" />
220 <img src="/images/icons/table_gear.png" alt="${_('Admin')}" />
221 </span>
221 </span>
222 <span>${_('Options')}</span>
222 <span>${_('Options')}</span>
223 </a>
223 </a>
224 <ul>
224 <ul>
225 %if h.HasRepoPermissionAll('repository.admin')(c.repo_name):
225 %if h.HasRepoPermissionAll('repository.admin')(c.repo_name):
226 %if h.HasPermissionAll('hg.admin')('access admin main page'):
226 %if h.HasPermissionAll('hg.admin')('access settings on repository'):
227 <li>${h.link_to(_('settings'),h.url('edit_repo',repo_name=c.repo_name),class_='settings')}</li>
227 <li>${h.link_to(_('settings'),h.url('edit_repo',repo_name=c.repo_name),class_='settings')}</li>
228 %else:
228 %else:
229 <li>${h.link_to(_('settings'),h.url('repo_settings_home',repo_name=c.repo_name),class_='settings')}</li>
229 <li>${h.link_to(_('settings'),h.url('repo_settings_home',repo_name=c.repo_name),class_='settings')}</li>
230 %endif
230 %endif
231 <li>${h.link_to(_('fork'),h.url('repo_fork_home',repo_name=c.repo_name),class_='fork')}</li>
231 <li>${h.link_to(_('fork'),h.url('repo_fork_home',repo_name=c.repo_name),class_='fork')}</li>
232 %endif
232 %endif
233 <li>${h.link_to(_('search'),h.url('search_repo',search_repo=c.repo_name),class_='search')}</li>
233 <li>${h.link_to(_('search'),h.url('search_repo',search_repo=c.repo_name),class_='search')}</li>
234
234
235 %if h.HasPermissionAll('hg.admin')('access admin main page'):
235 %if h.HasPermissionAll('hg.admin')('access admin main page'):
236 <li>
236 <li>
237 ${h.link_to(_('admin'),h.url('admin_home'),class_='admin')}
237 ${h.link_to(_('admin'),h.url('admin_home'),class_='admin')}
238 <%def name="admin_menu()">
238 <%def name="admin_menu()">
239 <ul>
239 <ul>
240 <li>${h.link_to(_('journal'),h.url('admin_home'),class_='journal')}</li>
240 <li>${h.link_to(_('journal'),h.url('admin_home'),class_='journal')}</li>
241 <li>${h.link_to(_('repositories'),h.url('repos'),class_='repos')}</li>
241 <li>${h.link_to(_('repositories'),h.url('repos'),class_='repos')}</li>
242 <li>${h.link_to(_('users'),h.url('users'),class_='users')}</li>
242 <li>${h.link_to(_('users'),h.url('users'),class_='users')}</li>
243 <li>${h.link_to(_('permissions'),h.url('edit_permission',id='default'),class_='permissions')}</li>
243 <li>${h.link_to(_('permissions'),h.url('edit_permission',id='default'),class_='permissions')}</li>
244 <li>${h.link_to(_('ldap'),h.url('ldap_home'),class_='ldap')}</li>
244 <li>${h.link_to(_('ldap'),h.url('ldap_home'),class_='ldap')}</li>
245 <li class="last">${h.link_to(_('settings'),h.url('admin_settings'),class_='settings')}</li>
245 <li class="last">${h.link_to(_('settings'),h.url('admin_settings'),class_='settings')}</li>
246 </ul>
246 </ul>
247 </%def>
247 </%def>
248
248
249 ${admin_menu()}
249 ${admin_menu()}
250 </li>
250 </li>
251 %endif
251 %endif
252
252
253 </ul>
253 </ul>
254 </li>
254 </li>
255
255
256 <li>
256 <li>
257 <a title="${_('Followers')}" href="#">
257 <a title="${_('Followers')}" href="#">
258 <span class="icon_short">
258 <span class="icon_short">
259 <img src="/images/icons/heart.png" alt="${_('Followers')}" />
259 <img src="/images/icons/heart.png" alt="${_('Followers')}" />
260 </span>
260 </span>
261 <span class="short">${c.repository_followers}</span>
261 <span class="short">${c.repository_followers}</span>
262 </a>
262 </a>
263 </li>
263 </li>
264 <li>
264 <li>
265 <a title="${_('Forks')}" href="#">
265 <a title="${_('Forks')}" href="#">
266 <span class="icon_short">
266 <span class="icon_short">
267 <img src="/images/icons/arrow_divide.png" alt="${_('Forks')}" />
267 <img src="/images/icons/arrow_divide.png" alt="${_('Forks')}" />
268 </span>
268 </span>
269 <span class="short">${c.repository_forks}</span>
269 <span class="short">${c.repository_forks}</span>
270 </a>
270 </a>
271 </li>
271 </li>
272
272
273
273
274
274
275 </ul>
275 </ul>
276 %else:
276 %else:
277 ##ROOT MENU
277 ##ROOT MENU
278 <ul id="quick">
278 <ul id="quick">
279 <li>
279 <li>
280 <a title="${_('Home')}" href="${h.url('home')}">
280 <a title="${_('Home')}" href="${h.url('home')}">
281 <span class="icon">
281 <span class="icon">
282 <img src="/images/icons/home_16.png" alt="${_('Home')}" />
282 <img src="/images/icons/home_16.png" alt="${_('Home')}" />
283 </span>
283 </span>
284 <span>${_('Home')}</span>
284 <span>${_('Home')}</span>
285 </a>
285 </a>
286 </li>
286 </li>
287 %if c.rhodecode_user.username != 'default':
287 %if c.rhodecode_user.username != 'default':
288 <li>
288 <li>
289 <a title="${_('Journal')}" href="${h.url('journal')}">
289 <a title="${_('Journal')}" href="${h.url('journal')}">
290 <span class="icon">
290 <span class="icon">
291 <img src="/images/icons/book.png" alt="${_('Journal')}" />
291 <img src="/images/icons/book.png" alt="${_('Journal')}" />
292 </span>
292 </span>
293 <span>${_('Journal')}</span>
293 <span>${_('Journal')}</span>
294 </a>
294 </a>
295 </li>
295 </li>
296 %endif
296 %endif
297 <li>
297 <li>
298 <a title="${_('Search')}" href="${h.url('search')}">
298 <a title="${_('Search')}" href="${h.url('search')}">
299 <span class="icon">
299 <span class="icon">
300 <img src="/images/icons/search_16.png" alt="${_('Search')}" />
300 <img src="/images/icons/search_16.png" alt="${_('Search')}" />
301 </span>
301 </span>
302 <span>${_('Search')}</span>
302 <span>${_('Search')}</span>
303 </a>
303 </a>
304 </li>
304 </li>
305
305
306 %if h.HasPermissionAll('hg.admin')('access admin main page'):
306 %if h.HasPermissionAll('hg.admin')('access admin main page'):
307 <li ${is_current('admin')}>
307 <li ${is_current('admin')}>
308 <a title="${_('Admin')}" href="${h.url('admin_home')}">
308 <a title="${_('Admin')}" href="${h.url('admin_home')}">
309 <span class="icon">
309 <span class="icon">
310 <img src="/images/icons/cog_edit.png" alt="${_('Admin')}" />
310 <img src="/images/icons/cog_edit.png" alt="${_('Admin')}" />
311 </span>
311 </span>
312 <span>${_('Admin')}</span>
312 <span>${_('Admin')}</span>
313 </a>
313 </a>
314 ${admin_menu()}
314 ${admin_menu()}
315 </li>
315 </li>
316 %endif
316 %endif
317 </ul>
317 </ul>
318 %endif
318 %endif
319 </%def>
319 </%def>
320
320
321
321
322 <%def name="css()">
322 <%def name="css()">
323 <link rel="stylesheet" type="text/css" href="/css/style.css" media="screen" />
323 <link rel="stylesheet" type="text/css" href="/css/style.css" media="screen" />
324 <link rel="stylesheet" type="text/css" href="/css/pygments.css" />
324 <link rel="stylesheet" type="text/css" href="/css/pygments.css" />
325 <link rel="stylesheet" type="text/css" href="/css/diff.css" />
325 <link rel="stylesheet" type="text/css" href="/css/diff.css" />
326 </%def>
326 </%def>
327
327
328 <%def name="js()">
328 <%def name="js()">
329 ##<script type="text/javascript" src="/js/yui/utilities/utilities.js"></script>
329 ##<script type="text/javascript" src="/js/yui/utilities/utilities.js"></script>
330 ##<script type="text/javascript" src="/js/yui/container/container.js"></script>
330 ##<script type="text/javascript" src="/js/yui/container/container.js"></script>
331 ##<script type="text/javascript" src="/js/yui/datasource/datasource.js"></script>
331 ##<script type="text/javascript" src="/js/yui/datasource/datasource.js"></script>
332 ##<script type="text/javascript" src="/js/yui/autocomplete/autocomplete.js"></script>
332 ##<script type="text/javascript" src="/js/yui/autocomplete/autocomplete.js"></script>
333 ##<script type="text/javascript" src="/js/yui/selector/selector-min.js"></script>
333 ##<script type="text/javascript" src="/js/yui/selector/selector-min.js"></script>
334
334
335 <script type="text/javascript" src="/js/yui2a.js"></script>
335 <script type="text/javascript" src="/js/yui2a.js"></script>
336 <!--[if IE]><script language="javascript" type="text/javascript" src="/js/excanvas.min.js"></script><![endif]-->
336 <!--[if IE]><script language="javascript" type="text/javascript" src="/js/excanvas.min.js"></script><![endif]-->
337 <script type="text/javascript" src="/js/yui.flot.js"></script>
337 <script type="text/javascript" src="/js/yui.flot.js"></script>
338
338
339 <script type="text/javascript">
339 <script type="text/javascript">
340 var base_url ='/_admin/toggle_following';
340 var base_url ='/_admin/toggle_following';
341 var YUC = YAHOO.util.Connect;
341 var YUC = YAHOO.util.Connect;
342 var YUD = YAHOO.util.Dom;
342 var YUD = YAHOO.util.Dom;
343 var YUE = YAHOO.util.Event;
343 var YUE = YAHOO.util.Event;
344
344
345 function onSuccess(){
345 function onSuccess(){
346
346
347 var f = YUD.get('follow_toggle');
347 var f = YUD.get('follow_toggle');
348 if(f.getAttribute('class')=='follow'){
348 if(f.getAttribute('class')=='follow'){
349 f.setAttribute('class','following');
349 f.setAttribute('class','following');
350 f.setAttribute('title',"${_('Stop following this repository')}");
350 f.setAttribute('title',"${_('Stop following this repository')}");
351 }
351 }
352 else{
352 else{
353 f.setAttribute('class','follow');
353 f.setAttribute('class','follow');
354 f.setAttribute('title',"${_('Start following this repository')}");
354 f.setAttribute('title',"${_('Start following this repository')}");
355 }
355 }
356 }
356 }
357
357
358 function toggleFollowingUser(fallows_user_id,token){
358 function toggleFollowingUser(fallows_user_id,token){
359 args = 'follows_user_id='+fallows_user_id;
359 args = 'follows_user_id='+fallows_user_id;
360 args+= '&amp;auth_token='+token;
360 args+= '&amp;auth_token='+token;
361 YUC.asyncRequest('POST',base_url,{
361 YUC.asyncRequest('POST',base_url,{
362 success:function(o){
362 success:function(o){
363 onSuccess();
363 onSuccess();
364 }
364 }
365 },args); return false;
365 },args); return false;
366 }
366 }
367
367
368 function toggleFollowingRepo(fallows_repo_id,token){
368 function toggleFollowingRepo(fallows_repo_id,token){
369 args = 'follows_repo_id='+fallows_repo_id;
369 args = 'follows_repo_id='+fallows_repo_id;
370 args+= '&amp;auth_token='+token;
370 args+= '&amp;auth_token='+token;
371 YUC.asyncRequest('POST',base_url,{
371 YUC.asyncRequest('POST',base_url,{
372 success:function(o){
372 success:function(o){
373 onSuccess();
373 onSuccess();
374 }
374 }
375 },args); return false;
375 },args); return false;
376 }
376 }
377 </script>
377 </script>
378
378
379 </%def>
379 </%def>
380
380
381 <%def name="breadcrumbs()">
381 <%def name="breadcrumbs()">
382 <div class="breadcrumbs">
382 <div class="breadcrumbs">
383 ${self.breadcrumbs_links()}
383 ${self.breadcrumbs_links()}
384 </div>
384 </div>
385 </%def> No newline at end of file
385 </%def>
@@ -1,643 +1,647
1 <%inherit file="/base/base.html"/>
1 <%inherit file="/base/base.html"/>
2
2
3 <%def name="title()">
3 <%def name="title()">
4 ${c.repo_name} ${_('Summary')} - ${c.rhodecode_name}
4 ${c.repo_name} ${_('Summary')} - ${c.rhodecode_name}
5 </%def>
5 </%def>
6
6
7 <%def name="breadcrumbs_links()">
7 <%def name="breadcrumbs_links()">
8 ${h.link_to(u'Home',h.url('/'))}
8 ${h.link_to(u'Home',h.url('/'))}
9 &raquo;
9 &raquo;
10 ${h.link_to(c.repo_name,h.url('summary_home',repo_name=c.repo_name))}
10 ${h.link_to(c.repo_name,h.url('summary_home',repo_name=c.repo_name))}
11 &raquo;
11 &raquo;
12 ${_('summary')}
12 ${_('summary')}
13 </%def>
13 </%def>
14
14
15 <%def name="page_nav()">
15 <%def name="page_nav()">
16 ${self.menu('summary')}
16 ${self.menu('summary')}
17 </%def>
17 </%def>
18
18
19 <%def name="main()">
19 <%def name="main()">
20 <div class="box box-left">
20 <div class="box box-left">
21 <!-- box / title -->
21 <!-- box / title -->
22 <div class="title">
22 <div class="title">
23 ${self.breadcrumbs()}
23 ${self.breadcrumbs()}
24 </div>
24 </div>
25 <!-- end box / title -->
25 <!-- end box / title -->
26 <div class="form">
26 <div class="form">
27 <div class="fields">
27 <div class="fields">
28
28
29 <div class="field">
29 <div class="field">
30 <div class="label">
30 <div class="label">
31 <label>${_('Name')}:</label>
31 <label>${_('Name')}:</label>
32 </div>
32 </div>
33 <div class="input-short">
33 <div class="input-short">
34 %if c.repo_info.dbrepo.repo_type =='hg':
34 %if c.repo_info.dbrepo.repo_type =='hg':
35 <img style="margin-bottom:2px" class="icon" title="${_('Mercurial repository')}" alt="${_('Mercurial repository')}" src="/images/icons/hgicon.png"/>
35 <img style="margin-bottom:2px" class="icon" title="${_('Mercurial repository')}" alt="${_('Mercurial repository')}" src="/images/icons/hgicon.png"/>
36 %endif
36 %endif
37 %if c.repo_info.dbrepo.repo_type =='git':
37 %if c.repo_info.dbrepo.repo_type =='git':
38 <img style="margin-bottom:2px" class="icon" title="${_('Git repository')}" alt="${_('Git repository')}" src="/images/icons/giticon.png"/>
38 <img style="margin-bottom:2px" class="icon" title="${_('Git repository')}" alt="${_('Git repository')}" src="/images/icons/giticon.png"/>
39 %endif
39 %endif
40
40
41 %if c.repo_info.dbrepo.private:
41 %if c.repo_info.dbrepo.private:
42 <img style="margin-bottom:2px" class="icon" title="${_('private repository')}" alt="${_('private repository')}" src="/images/icons/lock.png"/>
42 <img style="margin-bottom:2px" class="icon" title="${_('private repository')}" alt="${_('private repository')}" src="/images/icons/lock.png"/>
43 %else:
43 %else:
44 <img style="margin-bottom:2px" class="icon" title="${_('public repository')}" alt="${_('public repository')}" src="/images/icons/lock_open.png"/>
44 <img style="margin-bottom:2px" class="icon" title="${_('public repository')}" alt="${_('public repository')}" src="/images/icons/lock_open.png"/>
45 %endif
45 %endif
46 <span style="font-size: 1.6em;font-weight: bold;vertical-align: baseline;">${c.repo_info.name}</span>
46 <span style="font-size: 1.6em;font-weight: bold;vertical-align: baseline;">${c.repo_info.name}</span>
47 %if c.rhodecode_user.username != 'default':
47 %if c.rhodecode_user.username != 'default':
48 %if c.following:
48 %if c.following:
49 <span id="follow_toggle" class="following" title="${_('Stop following this repository')}"
49 <span id="follow_toggle" class="following" title="${_('Stop following this repository')}"
50 onclick="javascript:toggleFollowingRepo(${c.repo_info.dbrepo.repo_id},'${str(h.get_token())}')">
50 onclick="javascript:toggleFollowingRepo(${c.repo_info.dbrepo.repo_id},'${str(h.get_token())}')">
51 </span>
51 </span>
52 %else:
52 %else:
53 <span id="follow_toggle" class="follow" title="${_('Start following this repository')}"
53 <span id="follow_toggle" class="follow" title="${_('Start following this repository')}"
54 onclick="javascript:toggleFollowingRepo(${c.repo_info.dbrepo.repo_id},'${str(h.get_token())}')">
54 onclick="javascript:toggleFollowingRepo(${c.repo_info.dbrepo.repo_id},'${str(h.get_token())}')">
55 </span>
55 </span>
56 %endif
56 %endif
57 %endif:
57 %endif:
58 <br/>
58 <br/>
59 %if c.repo_info.dbrepo.fork:
59 %if c.repo_info.dbrepo.fork:
60 <span style="margin-top:5px">
60 <span style="margin-top:5px">
61 <a href="${h.url('summary_home',repo_name=c.repo_info.dbrepo.fork.repo_name)}">
61 <a href="${h.url('summary_home',repo_name=c.repo_info.dbrepo.fork.repo_name)}">
62 <img class="icon" alt="${_('public')}"
62 <img class="icon" alt="${_('public')}"
63 title="${_('Fork of')} ${c.repo_info.dbrepo.fork.repo_name}"
63 title="${_('Fork of')} ${c.repo_info.dbrepo.fork.repo_name}"
64 src="/images/icons/arrow_divide.png"/>
64 src="/images/icons/arrow_divide.png"/>
65 ${_('Fork of')} ${c.repo_info.dbrepo.fork.repo_name}
65 ${_('Fork of')} ${c.repo_info.dbrepo.fork.repo_name}
66 </a>
66 </a>
67 </span>
67 </span>
68 %endif
68 %endif
69 </div>
69 </div>
70 </div>
70 </div>
71
71
72
72
73 <div class="field">
73 <div class="field">
74 <div class="label">
74 <div class="label">
75 <label>${_('Description')}:</label>
75 <label>${_('Description')}:</label>
76 </div>
76 </div>
77 <div class="input-short">
77 <div class="input-short">
78 ${c.repo_info.dbrepo.description}
78 ${c.repo_info.dbrepo.description}
79 </div>
79 </div>
80 </div>
80 </div>
81
81
82
82
83 <div class="field">
83 <div class="field">
84 <div class="label">
84 <div class="label">
85 <label>${_('Contact')}:</label>
85 <label>${_('Contact')}:</label>
86 </div>
86 </div>
87 <div class="input-short">
87 <div class="input-short">
88 <div class="gravatar">
88 <div class="gravatar">
89 <img alt="gravatar" src="${h.gravatar_url(c.repo_info.dbrepo.user.email)}"/>
89 <img alt="gravatar" src="${h.gravatar_url(c.repo_info.dbrepo.user.email)}"/>
90 </div>
90 </div>
91 ${_('Username')}: ${c.repo_info.dbrepo.user.username}<br/>
91 ${_('Username')}: ${c.repo_info.dbrepo.user.username}<br/>
92 ${_('Name')}: ${c.repo_info.dbrepo.user.name} ${c.repo_info.dbrepo.user.lastname}<br/>
92 ${_('Name')}: ${c.repo_info.dbrepo.user.name} ${c.repo_info.dbrepo.user.lastname}<br/>
93 ${_('Email')}: <a href="mailto:${c.repo_info.dbrepo.user.email}">${c.repo_info.dbrepo.user.email}</a>
93 ${_('Email')}: <a href="mailto:${c.repo_info.dbrepo.user.email}">${c.repo_info.dbrepo.user.email}</a>
94 </div>
94 </div>
95 </div>
95 </div>
96
96
97 <div class="field">
97 <div class="field">
98 <div class="label">
98 <div class="label">
99 <label>${_('Last change')}:</label>
99 <label>${_('Last change')}:</label>
100 </div>
100 </div>
101 <div class="input-short">
101 <div class="input-short">
102 ${h.age(c.repo_info.last_change)} - ${c.repo_info.last_change}
102 ${h.age(c.repo_info.last_change)} - ${c.repo_info.last_change}
103 ${_('by')} ${h.get_changeset_safe(c.repo_info,'tip').author}
103 ${_('by')} ${h.get_changeset_safe(c.repo_info,'tip').author}
104
104
105 </div>
105 </div>
106 </div>
106 </div>
107
107
108 <div class="field">
108 <div class="field">
109 <div class="label">
109 <div class="label">
110 <label>${_('Clone url')}:</label>
110 <label>${_('Clone url')}:</label>
111 </div>
111 </div>
112 <div class="input-short">
112 <div class="input-short">
113 <input type="text" id="clone_url" readonly="readonly" value="hg clone ${c.clone_repo_url}" size="70"/>
113 <input type="text" id="clone_url" readonly="readonly" value="hg clone ${c.clone_repo_url}" size="70"/>
114 </div>
114 </div>
115 </div>
115 </div>
116
116
117 <div class="field">
117 <div class="field">
118 <div class="label">
118 <div class="label">
119 <label>${_('Trending source files')}:</label>
119 <label>${_('Trending source files')}:</label>
120 </div>
120 </div>
121 <div class="input-short">
121 <div class="input-short">
122 <div id="lang_stats">
122 <div id="lang_stats">
123
123
124 </div>
124 </div>
125 <script type="text/javascript">
125 <script type="text/javascript">
126 YUE.onDOMReady(function(e){
126 YUE.onDOMReady(function(e){
127 id = 'clone_url';
127 id = 'clone_url';
128 YUE.on(id,'click',function(e){
128 YUE.on(id,'click',function(e){
129 YUD.get('clone_url').select();
129 YUD.get('clone_url').select();
130 })
130 })
131 })
131 })
132 var data = ${c.trending_languages|n};
132 var data = ${c.trending_languages|n};
133 var total = 0;
133 var total = 0;
134 var no_data = true;
134 var no_data = true;
135 for (k in data){
135 for (k in data){
136 total += data[k];
136 total += data[k];
137 no_data = false;
137 no_data = false;
138 }
138 }
139 var tbl = document.createElement('table');
139 var tbl = document.createElement('table');
140 tbl.setAttribute('class','trending_language_tbl');
140 tbl.setAttribute('class','trending_language_tbl');
141 var cnt =0;
141 var cnt =0;
142 for (k in data){
142 for (k in data){
143 cnt+=1;
143 cnt+=1;
144 var hide = cnt>2;
144 var hide = cnt>2;
145 var tr = document.createElement('tr');
145 var tr = document.createElement('tr');
146 if (hide){
146 if (hide){
147 tr.setAttribute('style','display:none');
147 tr.setAttribute('style','display:none');
148 tr.setAttribute('class','stats_hidden');
148 tr.setAttribute('class','stats_hidden');
149 }
149 }
150 var percentage = Math.round((data[k]/total*100),2);
150 var percentage = Math.round((data[k]/total*100),2);
151 var value = data[k];
151 var value = data[k];
152 var td1 = document.createElement('td');
152 var td1 = document.createElement('td');
153 td1.width=150;
153 td1.width=150;
154 var trending_language_label = document.createElement('div');
154 var trending_language_label = document.createElement('div');
155 trending_language_label.innerHTML = k;
155 trending_language_label.innerHTML = k;
156 td1.appendChild(trending_language_label);
156 td1.appendChild(trending_language_label);
157
157
158 var td2 = document.createElement('td');
158 var td2 = document.createElement('td');
159 td2.setAttribute('style','padding-right:14px !important');
159 td2.setAttribute('style','padding-right:14px !important');
160 var trending_language = document.createElement('div');
160 var trending_language = document.createElement('div');
161 var nr_files = value+" ${_('files')}";
161 var nr_files = value+" ${_('files')}";
162
162
163 trending_language.title = k+" "+nr_files;
163 trending_language.title = k+" "+nr_files;
164
164
165 if (percentage>20){
165 if (percentage>20){
166 trending_language.innerHTML = "<b style='font-size:0.8em'>"+percentage+"% "+nr_files+ "</b>";
166 trending_language.innerHTML = "<b style='font-size:0.8em'>"+percentage+"% "+nr_files+ "</b>";
167 }
167 }
168 else{
168 else{
169 trending_language.innerHTML = "<b style='font-size:0.8em'>"+percentage+"%</b>";
169 trending_language.innerHTML = "<b style='font-size:0.8em'>"+percentage+"%</b>";
170 }
170 }
171
171
172 trending_language.setAttribute("class", 'trending_language top-right-rounded-corner bottom-right-rounded-corner');
172 trending_language.setAttribute("class", 'trending_language top-right-rounded-corner bottom-right-rounded-corner');
173 trending_language.style.width=percentage+"%";
173 trending_language.style.width=percentage+"%";
174 td2.appendChild(trending_language);
174 td2.appendChild(trending_language);
175
175
176 tr.appendChild(td1);
176 tr.appendChild(td1);
177 tr.appendChild(td2);
177 tr.appendChild(td2);
178 tbl.appendChild(tr);
178 tbl.appendChild(tr);
179 if(cnt == 2){
179 if(cnt == 2){
180 var show_more = document.createElement('tr');
180 var show_more = document.createElement('tr');
181 var td=document.createElement('td');
181 var td=document.createElement('td');
182 lnk = document.createElement('a');
182 lnk = document.createElement('a');
183 lnk.href='#';
183 lnk.href='#';
184 lnk.innerHTML = "${_("show more")}";
184 lnk.innerHTML = "${_("show more")}";
185 lnk.id='code_stats_show_more';
185 lnk.id='code_stats_show_more';
186 td.appendChild(lnk);
186 td.appendChild(lnk);
187 show_more.appendChild(td);
187 show_more.appendChild(td);
188 show_more.appendChild(document.createElement('td'));
188 show_more.appendChild(document.createElement('td'));
189 tbl.appendChild(show_more);
189 tbl.appendChild(show_more);
190 }
190 }
191
191
192 }
192 }
193 if(no_data){
193 if(no_data){
194 var tr = document.createElement('tr');
194 var tr = document.createElement('tr');
195 var td1 = document.createElement('td');
195 var td1 = document.createElement('td');
196 td1.innerHTML = "${c.no_data_msg}";
196 td1.innerHTML = "${c.no_data_msg}";
197 tr.appendChild(td1);
197 tr.appendChild(td1);
198 tbl.appendChild(tr);
198 tbl.appendChild(tr);
199 }
199 }
200 YUD.get('lang_stats').appendChild(tbl);
200 YUD.get('lang_stats').appendChild(tbl);
201 YUE.on('code_stats_show_more','click',function(){
201 YUE.on('code_stats_show_more','click',function(){
202 l = YUD.getElementsByClassName('stats_hidden')
202 l = YUD.getElementsByClassName('stats_hidden')
203 for (e in l){
203 for (e in l){
204 YUD.setStyle(l[e],'display','');
204 YUD.setStyle(l[e],'display','');
205 };
205 };
206 YUD.setStyle(YUD.get('code_stats_show_more'),
206 YUD.setStyle(YUD.get('code_stats_show_more'),
207 'display','none');
207 'display','none');
208 })
208 })
209
209
210 </script>
210 </script>
211
211
212 </div>
212 </div>
213 </div>
213 </div>
214
214
215 <div class="field">
215 <div class="field">
216 <div class="label">
216 <div class="label">
217 <label>${_('Download')}:</label>
217 <label>${_('Download')}:</label>
218 </div>
218 </div>
219 <div class="input-short">
219 <div class="input-short">
220 %for cnt,archive in enumerate(c.repo_info._get_archives()):
220 %for cnt,archive in enumerate(c.repo_info._get_archives()):
221 %if cnt >=1:
221 %if cnt >=1:
222 |
222 |
223 %endif
223 %endif
224 ${h.link_to(c.repo_info.name+'.'+archive['type'],
224 ${h.link_to(c.repo_info.name+'.'+archive['type'],
225 h.url('files_archive_home',repo_name=c.repo_info.name,
225 h.url('files_archive_home',repo_name=c.repo_info.name,
226 fname='tip'+archive['extension']),class_="archive_icon")}
226 fname='tip'+archive['extension']),class_="archive_icon")}
227 %endfor
227 %endfor
228 </div>
228 </div>
229 </div>
229 </div>
230
230
231 <div class="field">
231 <div class="field">
232 <div class="label">
232 <div class="label">
233 <label>${_('Feeds')}:</label>
233 <label>${_('Feeds')}:</label>
234 </div>
234 </div>
235 <div class="input-short">
235 <div class="input-short">
236 ${h.link_to(_('RSS'),h.url('rss_feed_home',repo_name=c.repo_info.name),class_='rss_icon')}
236 ${h.link_to(_('RSS'),h.url('rss_feed_home',repo_name=c.repo_info.name),class_='rss_icon')}
237 ${h.link_to(_('Atom'),h.url('atom_feed_home',repo_name=c.repo_info.name),class_='atom_icon')}
237 ${h.link_to(_('Atom'),h.url('atom_feed_home',repo_name=c.repo_info.name),class_='atom_icon')}
238 </div>
238 </div>
239 </div>
239 </div>
240 </div>
240 </div>
241 </div>
241 </div>
242 </div>
242 </div>
243
243
244 <div class="box box-right" style="min-height:455px">
244 <div class="box box-right" style="min-height:455px">
245 <!-- box / title -->
245 <!-- box / title -->
246 <div class="title">
246 <div class="title">
247 <h5>${_('Commit activity by day / author')}</h5>
247 <h5>${_('Commit activity by day / author')}</h5>
248 </div>
248 </div>
249
249
250 <div class="table">
250 <div class="table">
251
251
252 %if c.no_data:
252 %if c.no_data:
253 <div style="padding:0 10px 10px 15px;font-size: 1.2em;">${c.no_data_msg}</div>
253 <div style="padding:0 10px 10px 15px;font-size: 1.2em;">${c.no_data_msg}
254 %if h.HasPermissionAll('hg.admin')('enable stats on from summary'):
255 [${h.link_to(_('enable'),h.url('edit_repo',repo_name=c.repo_name))}]
256 %endif
257 </div>
254 %endif:
258 %endif:
255 <div id="commit_history" style="width:460px;height:300px;float:left"></div>
259 <div id="commit_history" style="width:460px;height:300px;float:left"></div>
256 <div style="clear: both;height: 10px"></div>
260 <div style="clear: both;height: 10px"></div>
257 <div id="overview" style="width:460px;height:100px;float:left"></div>
261 <div id="overview" style="width:460px;height:100px;float:left"></div>
258
262
259 <div id="legend_data" style="clear:both;margin-top:10px;">
263 <div id="legend_data" style="clear:both;margin-top:10px;">
260 <div id="legend_container"></div>
264 <div id="legend_container"></div>
261 <div id="legend_choices">
265 <div id="legend_choices">
262 <table id="legend_choices_tables" style="font-size:smaller;color:#545454"></table>
266 <table id="legend_choices_tables" style="font-size:smaller;color:#545454"></table>
263 </div>
267 </div>
264 </div>
268 </div>
265 <script type="text/javascript">
269 <script type="text/javascript">
266 /**
270 /**
267 * Plots summary graph
271 * Plots summary graph
268 *
272 *
269 * @class SummaryPlot
273 * @class SummaryPlot
270 * @param {from} initial from for detailed graph
274 * @param {from} initial from for detailed graph
271 * @param {to} initial to for detailed graph
275 * @param {to} initial to for detailed graph
272 * @param {dataset}
276 * @param {dataset}
273 * @param {overview_dataset}
277 * @param {overview_dataset}
274 */
278 */
275 function SummaryPlot(from,to,dataset,overview_dataset) {
279 function SummaryPlot(from,to,dataset,overview_dataset) {
276 var initial_ranges = {
280 var initial_ranges = {
277 "xaxis":{
281 "xaxis":{
278 "from":from,
282 "from":from,
279 "to":to,
283 "to":to,
280 },
284 },
281 };
285 };
282 var dataset = dataset;
286 var dataset = dataset;
283 var overview_dataset = [overview_dataset];
287 var overview_dataset = [overview_dataset];
284 var choiceContainer = YUD.get("legend_choices");
288 var choiceContainer = YUD.get("legend_choices");
285 var choiceContainerTable = YUD.get("legend_choices_tables");
289 var choiceContainerTable = YUD.get("legend_choices_tables");
286 var plotContainer = YUD.get('commit_history');
290 var plotContainer = YUD.get('commit_history');
287 var overviewContainer = YUD.get('overview');
291 var overviewContainer = YUD.get('overview');
288
292
289 var plot_options = {
293 var plot_options = {
290 bars: {show:true,align:'center',lineWidth:4},
294 bars: {show:true,align:'center',lineWidth:4},
291 legend: {show:true, container:"legend_container"},
295 legend: {show:true, container:"legend_container"},
292 points: {show:true,radius:0,fill:false},
296 points: {show:true,radius:0,fill:false},
293 yaxis: {tickDecimals:0,},
297 yaxis: {tickDecimals:0,},
294 xaxis: {
298 xaxis: {
295 mode: "time",
299 mode: "time",
296 timeformat: "%d/%m",
300 timeformat: "%d/%m",
297 min:from,
301 min:from,
298 max:to,
302 max:to,
299 },
303 },
300 grid: {
304 grid: {
301 hoverable: true,
305 hoverable: true,
302 clickable: true,
306 clickable: true,
303 autoHighlight:true,
307 autoHighlight:true,
304 color: "#999"
308 color: "#999"
305 },
309 },
306 //selection: {mode: "x"}
310 //selection: {mode: "x"}
307 };
311 };
308 var overview_options = {
312 var overview_options = {
309 legend:{show:false},
313 legend:{show:false},
310 bars: {show:true,barWidth: 2,},
314 bars: {show:true,barWidth: 2,},
311 shadowSize: 0,
315 shadowSize: 0,
312 xaxis: {mode: "time", timeformat: "%d/%m/%y",},
316 xaxis: {mode: "time", timeformat: "%d/%m/%y",},
313 yaxis: {ticks: 3, min: 0,tickDecimals:0,},
317 yaxis: {ticks: 3, min: 0,tickDecimals:0,},
314 grid: {color: "#999",},
318 grid: {color: "#999",},
315 selection: {mode: "x"}
319 selection: {mode: "x"}
316 };
320 };
317
321
318 /**
322 /**
319 *get dummy data needed in few places
323 *get dummy data needed in few places
320 */
324 */
321 function getDummyData(label){
325 function getDummyData(label){
322 return {"label":label,
326 return {"label":label,
323 "data":[{"time":0,
327 "data":[{"time":0,
324 "commits":0,
328 "commits":0,
325 "added":0,
329 "added":0,
326 "changed":0,
330 "changed":0,
327 "removed":0,
331 "removed":0,
328 }],
332 }],
329 "schema":["commits"],
333 "schema":["commits"],
330 "color":'#ffffff',
334 "color":'#ffffff',
331 }
335 }
332 }
336 }
333
337
334 /**
338 /**
335 * generate checkboxes accordindly to data
339 * generate checkboxes accordindly to data
336 * @param keys
340 * @param keys
337 * @returns
341 * @returns
338 */
342 */
339 function generateCheckboxes(data) {
343 function generateCheckboxes(data) {
340 //append checkboxes
344 //append checkboxes
341 var i = 0;
345 var i = 0;
342 choiceContainerTable.innerHTML = '';
346 choiceContainerTable.innerHTML = '';
343 for(var pos in data) {
347 for(var pos in data) {
344
348
345 data[pos].color = i;
349 data[pos].color = i;
346 i++;
350 i++;
347 if(data[pos].label != ''){
351 if(data[pos].label != ''){
348 choiceContainerTable.innerHTML += '<tr><td>'+
352 choiceContainerTable.innerHTML += '<tr><td>'+
349 '<input type="checkbox" name="' + data[pos].label +'" checked="checked" />'
353 '<input type="checkbox" name="' + data[pos].label +'" checked="checked" />'
350 +data[pos].label+
354 +data[pos].label+
351 '</td></tr>';
355 '</td></tr>';
352 }
356 }
353 }
357 }
354 }
358 }
355
359
356 /**
360 /**
357 * ToolTip show
361 * ToolTip show
358 */
362 */
359 function showTooltip(x, y, contents) {
363 function showTooltip(x, y, contents) {
360 var div=document.getElementById('tooltip');
364 var div=document.getElementById('tooltip');
361 if(!div) {
365 if(!div) {
362 div = document.createElement('div');
366 div = document.createElement('div');
363 div.id="tooltip";
367 div.id="tooltip";
364 div.style.position="absolute";
368 div.style.position="absolute";
365 div.style.border='1px solid #fdd';
369 div.style.border='1px solid #fdd';
366 div.style.padding='2px';
370 div.style.padding='2px';
367 div.style.backgroundColor='#fee';
371 div.style.backgroundColor='#fee';
368 document.body.appendChild(div);
372 document.body.appendChild(div);
369 }
373 }
370 YUD.setStyle(div, 'opacity', 0);
374 YUD.setStyle(div, 'opacity', 0);
371 div.innerHTML = contents;
375 div.innerHTML = contents;
372 div.style.top=(y + 5) + "px";
376 div.style.top=(y + 5) + "px";
373 div.style.left=(x + 5) + "px";
377 div.style.left=(x + 5) + "px";
374
378
375 var anim = new YAHOO.util.Anim(div, {opacity: {to: 0.8}}, 0.2);
379 var anim = new YAHOO.util.Anim(div, {opacity: {to: 0.8}}, 0.2);
376 anim.animate();
380 anim.animate();
377 }
381 }
378
382
379 /**
383 /**
380 * This function will detect if selected period has some changesets
384 * This function will detect if selected period has some changesets
381 for this user if it does this data is then pushed for displaying
385 for this user if it does this data is then pushed for displaying
382 Additionally it will only display users that are selected by the checkbox
386 Additionally it will only display users that are selected by the checkbox
383 */
387 */
384 function getDataAccordingToRanges(ranges) {
388 function getDataAccordingToRanges(ranges) {
385
389
386 var data = [];
390 var data = [];
387 var keys = [];
391 var keys = [];
388 for(var key in dataset){
392 for(var key in dataset){
389 var push = false;
393 var push = false;
390
394
391 //method1 slow !!
395 //method1 slow !!
392 //*
396 //*
393 for(var ds in dataset[key].data){
397 for(var ds in dataset[key].data){
394 commit_data = dataset[key].data[ds];
398 commit_data = dataset[key].data[ds];
395 if (commit_data.time >= ranges.xaxis.from && commit_data.time <= ranges.xaxis.to){
399 if (commit_data.time >= ranges.xaxis.from && commit_data.time <= ranges.xaxis.to){
396 push = true;
400 push = true;
397 break;
401 break;
398 }
402 }
399 }
403 }
400 //*/
404 //*/
401
405
402 /*//method2 sorted commit data !!!
406 /*//method2 sorted commit data !!!
403
407
404 var first_commit = dataset[key].data[0].time;
408 var first_commit = dataset[key].data[0].time;
405 var last_commit = dataset[key].data[dataset[key].data.length-1].time;
409 var last_commit = dataset[key].data[dataset[key].data.length-1].time;
406
410
407 if (first_commit >= ranges.xaxis.from && last_commit <= ranges.xaxis.to){
411 if (first_commit >= ranges.xaxis.from && last_commit <= ranges.xaxis.to){
408 push = true;
412 push = true;
409 }
413 }
410 //*/
414 //*/
411
415
412 if(push){
416 if(push){
413 data.push(dataset[key]);
417 data.push(dataset[key]);
414 }
418 }
415 }
419 }
416 if(data.length >= 1){
420 if(data.length >= 1){
417 return data;
421 return data;
418 }
422 }
419 else{
423 else{
420 //just return dummy data for graph to plot itself
424 //just return dummy data for graph to plot itself
421 return [getDummyData('')];
425 return [getDummyData('')];
422 }
426 }
423
427
424 }
428 }
425
429
426 /**
430 /**
427 * redraw using new checkbox data
431 * redraw using new checkbox data
428 */
432 */
429 function plotchoiced(e,args){
433 function plotchoiced(e,args){
430 var cur_data = args[0];
434 var cur_data = args[0];
431 var cur_ranges = args[1];
435 var cur_ranges = args[1];
432
436
433 var new_data = [];
437 var new_data = [];
434 var inputs = choiceContainer.getElementsByTagName("input");
438 var inputs = choiceContainer.getElementsByTagName("input");
435
439
436 //show only checked labels
440 //show only checked labels
437 for(var i=0; i<inputs.length; i++) {
441 for(var i=0; i<inputs.length; i++) {
438 var checkbox_key = inputs[i].name;
442 var checkbox_key = inputs[i].name;
439
443
440 if(inputs[i].checked){
444 if(inputs[i].checked){
441 for(var d in cur_data){
445 for(var d in cur_data){
442 if(cur_data[d].label == checkbox_key){
446 if(cur_data[d].label == checkbox_key){
443 new_data.push(cur_data[d]);
447 new_data.push(cur_data[d]);
444 }
448 }
445 }
449 }
446 }
450 }
447 else{
451 else{
448 //push dummy data to not hide the label
452 //push dummy data to not hide the label
449 new_data.push(getDummyData(checkbox_key));
453 new_data.push(getDummyData(checkbox_key));
450 }
454 }
451 }
455 }
452
456
453 var new_options = YAHOO.lang.merge(plot_options, {
457 var new_options = YAHOO.lang.merge(plot_options, {
454 xaxis: {
458 xaxis: {
455 min: cur_ranges.xaxis.from,
459 min: cur_ranges.xaxis.from,
456 max: cur_ranges.xaxis.to,
460 max: cur_ranges.xaxis.to,
457 mode:"time",
461 mode:"time",
458 timeformat: "%d/%m",
462 timeformat: "%d/%m",
459 },
463 },
460 });
464 });
461 if (!new_data){
465 if (!new_data){
462 new_data = [[0,1]];
466 new_data = [[0,1]];
463 }
467 }
464 // do the zooming
468 // do the zooming
465 plot = YAHOO.widget.Flot(plotContainer, new_data, new_options);
469 plot = YAHOO.widget.Flot(plotContainer, new_data, new_options);
466
470
467 plot.subscribe("plotselected", plotselected);
471 plot.subscribe("plotselected", plotselected);
468
472
469 //resubscribe plothover
473 //resubscribe plothover
470 plot.subscribe("plothover", plothover);
474 plot.subscribe("plothover", plothover);
471
475
472 // don't fire event on the overview to prevent eternal loop
476 // don't fire event on the overview to prevent eternal loop
473 overview.setSelection(cur_ranges, true);
477 overview.setSelection(cur_ranges, true);
474
478
475 }
479 }
476
480
477 /**
481 /**
478 * plot only selected items from overview
482 * plot only selected items from overview
479 * @param ranges
483 * @param ranges
480 * @returns
484 * @returns
481 */
485 */
482 function plotselected(ranges,cur_data) {
486 function plotselected(ranges,cur_data) {
483 //updates the data for new plot
487 //updates the data for new plot
484 data = getDataAccordingToRanges(ranges);
488 data = getDataAccordingToRanges(ranges);
485 generateCheckboxes(data);
489 generateCheckboxes(data);
486
490
487 var new_options = YAHOO.lang.merge(plot_options, {
491 var new_options = YAHOO.lang.merge(plot_options, {
488 xaxis: {
492 xaxis: {
489 min: ranges.xaxis.from,
493 min: ranges.xaxis.from,
490 max: ranges.xaxis.to,
494 max: ranges.xaxis.to,
491 mode:"time",
495 mode:"time",
492 timeformat: "%d/%m",
496 timeformat: "%d/%m",
493 },
497 },
494 yaxis: {
498 yaxis: {
495 min: ranges.yaxis.from,
499 min: ranges.yaxis.from,
496 max: ranges.yaxis.to,
500 max: ranges.yaxis.to,
497 },
501 },
498
502
499 });
503 });
500 // do the zooming
504 // do the zooming
501 plot = YAHOO.widget.Flot(plotContainer, data, new_options);
505 plot = YAHOO.widget.Flot(plotContainer, data, new_options);
502
506
503 plot.subscribe("plotselected", plotselected);
507 plot.subscribe("plotselected", plotselected);
504
508
505 //resubscribe plothover
509 //resubscribe plothover
506 plot.subscribe("plothover", plothover);
510 plot.subscribe("plothover", plothover);
507
511
508 // don't fire event on the overview to prevent eternal loop
512 // don't fire event on the overview to prevent eternal loop
509 overview.setSelection(ranges, true);
513 overview.setSelection(ranges, true);
510
514
511 //resubscribe choiced
515 //resubscribe choiced
512 YUE.on(choiceContainer.getElementsByTagName("input"), "click", plotchoiced, [data, ranges]);
516 YUE.on(choiceContainer.getElementsByTagName("input"), "click", plotchoiced, [data, ranges]);
513 }
517 }
514
518
515 var previousPoint = null;
519 var previousPoint = null;
516
520
517 function plothover(o) {
521 function plothover(o) {
518 var pos = o.pos;
522 var pos = o.pos;
519 var item = o.item;
523 var item = o.item;
520
524
521 //YUD.get("x").innerHTML = pos.x.toFixed(2);
525 //YUD.get("x").innerHTML = pos.x.toFixed(2);
522 //YUD.get("y").innerHTML = pos.y.toFixed(2);
526 //YUD.get("y").innerHTML = pos.y.toFixed(2);
523 if (item) {
527 if (item) {
524 if (previousPoint != item.datapoint) {
528 if (previousPoint != item.datapoint) {
525 previousPoint = item.datapoint;
529 previousPoint = item.datapoint;
526
530
527 var tooltip = YUD.get("tooltip");
531 var tooltip = YUD.get("tooltip");
528 if(tooltip) {
532 if(tooltip) {
529 tooltip.parentNode.removeChild(tooltip);
533 tooltip.parentNode.removeChild(tooltip);
530 }
534 }
531 var x = item.datapoint.x.toFixed(2);
535 var x = item.datapoint.x.toFixed(2);
532 var y = item.datapoint.y.toFixed(2);
536 var y = item.datapoint.y.toFixed(2);
533
537
534 if (!item.series.label){
538 if (!item.series.label){
535 item.series.label = 'commits';
539 item.series.label = 'commits';
536 }
540 }
537 var d = new Date(x*1000);
541 var d = new Date(x*1000);
538 var fd = d.toDateString()
542 var fd = d.toDateString()
539 var nr_commits = parseInt(y);
543 var nr_commits = parseInt(y);
540
544
541 var cur_data = dataset[item.series.label].data[item.dataIndex];
545 var cur_data = dataset[item.series.label].data[item.dataIndex];
542 var added = cur_data.added;
546 var added = cur_data.added;
543 var changed = cur_data.changed;
547 var changed = cur_data.changed;
544 var removed = cur_data.removed;
548 var removed = cur_data.removed;
545
549
546 var nr_commits_suffix = " ${_('commits')} ";
550 var nr_commits_suffix = " ${_('commits')} ";
547 var added_suffix = " ${_('files added')} ";
551 var added_suffix = " ${_('files added')} ";
548 var changed_suffix = " ${_('files changed')} ";
552 var changed_suffix = " ${_('files changed')} ";
549 var removed_suffix = " ${_('files removed')} ";
553 var removed_suffix = " ${_('files removed')} ";
550
554
551
555
552 if(nr_commits == 1){nr_commits_suffix = " ${_('commit')} ";}
556 if(nr_commits == 1){nr_commits_suffix = " ${_('commit')} ";}
553 if(added==1){added_suffix=" ${_('file added')} ";}
557 if(added==1){added_suffix=" ${_('file added')} ";}
554 if(changed==1){changed_suffix=" ${_('file changed')} ";}
558 if(changed==1){changed_suffix=" ${_('file changed')} ";}
555 if(removed==1){removed_suffix=" ${_('file removed')} ";}
559 if(removed==1){removed_suffix=" ${_('file removed')} ";}
556
560
557 showTooltip(item.pageX, item.pageY, item.series.label + " on " + fd
561 showTooltip(item.pageX, item.pageY, item.series.label + " on " + fd
558 +'<br/>'+
562 +'<br/>'+
559 nr_commits + nr_commits_suffix+'<br/>'+
563 nr_commits + nr_commits_suffix+'<br/>'+
560 added + added_suffix +'<br/>'+
564 added + added_suffix +'<br/>'+
561 changed + changed_suffix + '<br/>'+
565 changed + changed_suffix + '<br/>'+
562 removed + removed_suffix + '<br/>');
566 removed + removed_suffix + '<br/>');
563 }
567 }
564 }
568 }
565 else {
569 else {
566 var tooltip = YUD.get("tooltip");
570 var tooltip = YUD.get("tooltip");
567
571
568 if(tooltip) {
572 if(tooltip) {
569 tooltip.parentNode.removeChild(tooltip);
573 tooltip.parentNode.removeChild(tooltip);
570 }
574 }
571 previousPoint = null;
575 previousPoint = null;
572 }
576 }
573 }
577 }
574
578
575 /**
579 /**
576 * MAIN EXECUTION
580 * MAIN EXECUTION
577 */
581 */
578
582
579 var data = getDataAccordingToRanges(initial_ranges);
583 var data = getDataAccordingToRanges(initial_ranges);
580 generateCheckboxes(data);
584 generateCheckboxes(data);
581
585
582 //main plot
586 //main plot
583 var plot = YAHOO.widget.Flot(plotContainer,data,plot_options);
587 var plot = YAHOO.widget.Flot(plotContainer,data,plot_options);
584
588
585 //overview
589 //overview
586 var overview = YAHOO.widget.Flot(overviewContainer, overview_dataset, overview_options);
590 var overview = YAHOO.widget.Flot(overviewContainer, overview_dataset, overview_options);
587
591
588 //show initial selection on overview
592 //show initial selection on overview
589 overview.setSelection(initial_ranges);
593 overview.setSelection(initial_ranges);
590
594
591 plot.subscribe("plotselected", plotselected);
595 plot.subscribe("plotselected", plotselected);
592
596
593 overview.subscribe("plotselected", function (ranges) {
597 overview.subscribe("plotselected", function (ranges) {
594 plot.setSelection(ranges);
598 plot.setSelection(ranges);
595 });
599 });
596
600
597 plot.subscribe("plothover", plothover);
601 plot.subscribe("plothover", plothover);
598
602
599 YUE.on(choiceContainer.getElementsByTagName("input"), "click", plotchoiced, [data, initial_ranges]);
603 YUE.on(choiceContainer.getElementsByTagName("input"), "click", plotchoiced, [data, initial_ranges]);
600 }
604 }
601 SummaryPlot(${c.ts_min},${c.ts_max},${c.commit_data|n},${c.overview_data|n});
605 SummaryPlot(${c.ts_min},${c.ts_max},${c.commit_data|n},${c.overview_data|n});
602 </script>
606 </script>
603
607
604 </div>
608 </div>
605 </div>
609 </div>
606
610
607 <div class="box">
611 <div class="box">
608 <div class="title">
612 <div class="title">
609 <div class="breadcrumbs">${h.link_to(_('Shortlog'),h.url('shortlog_home',repo_name=c.repo_name))}</div>
613 <div class="breadcrumbs">${h.link_to(_('Shortlog'),h.url('shortlog_home',repo_name=c.repo_name))}</div>
610 </div>
614 </div>
611 <div class="table">
615 <div class="table">
612 <div id="shortlog_data">
616 <div id="shortlog_data">
613 <%include file='../shortlog/shortlog_data.html'/>
617 <%include file='../shortlog/shortlog_data.html'/>
614 </div>
618 </div>
615 ##%if c.repo_changesets:
619 ##%if c.repo_changesets:
616 ## ${h.link_to(_('show more'),h.url('changelog_home',repo_name=c.repo_name))}
620 ## ${h.link_to(_('show more'),h.url('changelog_home',repo_name=c.repo_name))}
617 ##%endif
621 ##%endif
618 </div>
622 </div>
619 </div>
623 </div>
620 <div class="box">
624 <div class="box">
621 <div class="title">
625 <div class="title">
622 <div class="breadcrumbs">${h.link_to(_('Tags'),h.url('tags_home',repo_name=c.repo_name))}</div>
626 <div class="breadcrumbs">${h.link_to(_('Tags'),h.url('tags_home',repo_name=c.repo_name))}</div>
623 </div>
627 </div>
624 <div class="table">
628 <div class="table">
625 <%include file='../tags/tags_data.html'/>
629 <%include file='../tags/tags_data.html'/>
626 %if c.repo_changesets:
630 %if c.repo_changesets:
627 ${h.link_to(_('show more'),h.url('tags_home',repo_name=c.repo_name))}
631 ${h.link_to(_('show more'),h.url('tags_home',repo_name=c.repo_name))}
628 %endif
632 %endif
629 </div>
633 </div>
630 </div>
634 </div>
631 <div class="box">
635 <div class="box">
632 <div class="title">
636 <div class="title">
633 <div class="breadcrumbs">${h.link_to(_('Branches'),h.url('branches_home',repo_name=c.repo_name))}</div>
637 <div class="breadcrumbs">${h.link_to(_('Branches'),h.url('branches_home',repo_name=c.repo_name))}</div>
634 </div>
638 </div>
635 <div class="table">
639 <div class="table">
636 <%include file='../branches/branches_data.html'/>
640 <%include file='../branches/branches_data.html'/>
637 %if c.repo_changesets:
641 %if c.repo_changesets:
638 ${h.link_to(_('show more'),h.url('branches_home',repo_name=c.repo_name))}
642 ${h.link_to(_('show more'),h.url('branches_home',repo_name=c.repo_name))}
639 %endif
643 %endif
640 </div>
644 </div>
641 </div>
645 </div>
642
646
643 </%def> No newline at end of file
647 </%def>
General Comments 0
You need to be logged in to leave comments. Login now