##// END OF EJS Templates
UI: percentage of stats gathered doesn't seem like important enough to need a large font
Aras Pranckevicius -
r1981:518f8791 beta
parent child Browse files
Show More
@@ -1,224 +1,224 b''
1 ## -*- coding: utf-8 -*-
1 ## -*- coding: utf-8 -*-
2 <%inherit file="/base/base.html"/>
2 <%inherit file="/base/base.html"/>
3
3
4 <%def name="title()">
4 <%def name="title()">
5 ${_('Edit repository')} ${c.repo_info.repo_name} - ${c.rhodecode_name}
5 ${_('Edit repository')} ${c.repo_info.repo_name} - ${c.rhodecode_name}
6 </%def>
6 </%def>
7
7
8 <%def name="breadcrumbs_links()">
8 <%def name="breadcrumbs_links()">
9 ${h.link_to(_('Admin'),h.url('admin_home'))}
9 ${h.link_to(_('Admin'),h.url('admin_home'))}
10 &raquo;
10 &raquo;
11 ${h.link_to(_('Repositories'),h.url('repos'))}
11 ${h.link_to(_('Repositories'),h.url('repos'))}
12 &raquo;
12 &raquo;
13 ${_('edit')} &raquo; ${h.link_to(c.repo_info.just_name,h.url('summary_home',repo_name=c.repo_name))}
13 ${_('edit')} &raquo; ${h.link_to(c.repo_info.just_name,h.url('summary_home',repo_name=c.repo_name))}
14 </%def>
14 </%def>
15
15
16 <%def name="page_nav()">
16 <%def name="page_nav()">
17 ${self.menu('admin')}
17 ${self.menu('admin')}
18 </%def>
18 </%def>
19
19
20 <%def name="main()">
20 <%def name="main()">
21 <div class="box box-left">
21 <div class="box box-left">
22 <!-- box / title -->
22 <!-- box / title -->
23 <div class="title">
23 <div class="title">
24 ${self.breadcrumbs()}
24 ${self.breadcrumbs()}
25 </div>
25 </div>
26 ${h.form(url('repo', repo_name=c.repo_info.repo_name),method='put')}
26 ${h.form(url('repo', repo_name=c.repo_info.repo_name),method='put')}
27 <div class="form">
27 <div class="form">
28 <!-- fields -->
28 <!-- fields -->
29 <div class="fields">
29 <div class="fields">
30 <div class="field">
30 <div class="field">
31 <div class="label">
31 <div class="label">
32 <label for="repo_name">${_('Name')}:</label>
32 <label for="repo_name">${_('Name')}:</label>
33 </div>
33 </div>
34 <div class="input">
34 <div class="input">
35 ${h.text('repo_name',class_="medium")}
35 ${h.text('repo_name',class_="medium")}
36 </div>
36 </div>
37 </div>
37 </div>
38 <div class="field">
38 <div class="field">
39 <div class="label">
39 <div class="label">
40 <label for="clone_uri">${_('Clone uri')}:</label>
40 <label for="clone_uri">${_('Clone uri')}:</label>
41 </div>
41 </div>
42 <div class="input">
42 <div class="input">
43 ${h.text('clone_uri',class_="medium")}
43 ${h.text('clone_uri',class_="medium")}
44 </div>
44 </div>
45 </div>
45 </div>
46 <div class="field">
46 <div class="field">
47 <div class="label">
47 <div class="label">
48 <label for="repo_group">${_('Repository group')}:</label>
48 <label for="repo_group">${_('Repository group')}:</label>
49 </div>
49 </div>
50 <div class="input">
50 <div class="input">
51 ${h.select('repo_group','',c.repo_groups,class_="medium")}
51 ${h.select('repo_group','',c.repo_groups,class_="medium")}
52 </div>
52 </div>
53 </div>
53 </div>
54 <div class="field">
54 <div class="field">
55 <div class="label">
55 <div class="label">
56 <label for="repo_type">${_('Type')}:</label>
56 <label for="repo_type">${_('Type')}:</label>
57 </div>
57 </div>
58 <div class="input">
58 <div class="input">
59 ${h.select('repo_type','hg',c.backends,class_="medium")}
59 ${h.select('repo_type','hg',c.backends,class_="medium")}
60 </div>
60 </div>
61 </div>
61 </div>
62 <div class="field">
62 <div class="field">
63 <div class="label label-textarea">
63 <div class="label label-textarea">
64 <label for="description">${_('Description')}:</label>
64 <label for="description">${_('Description')}:</label>
65 </div>
65 </div>
66 <div class="textarea text-area editor">
66 <div class="textarea text-area editor">
67 ${h.textarea('description',cols=23,rows=5)}
67 ${h.textarea('description',cols=23,rows=5)}
68 </div>
68 </div>
69 </div>
69 </div>
70
70
71 <div class="field">
71 <div class="field">
72 <div class="label label-checkbox">
72 <div class="label label-checkbox">
73 <label for="private">${_('Private')}:</label>
73 <label for="private">${_('Private')}:</label>
74 </div>
74 </div>
75 <div class="checkboxes">
75 <div class="checkboxes">
76 ${h.checkbox('private',value="True")}
76 ${h.checkbox('private',value="True")}
77 </div>
77 </div>
78 </div>
78 </div>
79 <div class="field">
79 <div class="field">
80 <div class="label label-checkbox">
80 <div class="label label-checkbox">
81 <label for="enable_statistics">${_('Enable statistics')}:</label>
81 <label for="enable_statistics">${_('Enable statistics')}:</label>
82 </div>
82 </div>
83 <div class="checkboxes">
83 <div class="checkboxes">
84 ${h.checkbox('enable_statistics',value="True")}
84 ${h.checkbox('enable_statistics',value="True")}
85 </div>
85 </div>
86 </div>
86 </div>
87 <div class="field">
87 <div class="field">
88 <div class="label label-checkbox">
88 <div class="label label-checkbox">
89 <label for="enable_downloads">${_('Enable downloads')}:</label>
89 <label for="enable_downloads">${_('Enable downloads')}:</label>
90 </div>
90 </div>
91 <div class="checkboxes">
91 <div class="checkboxes">
92 ${h.checkbox('enable_downloads',value="True")}
92 ${h.checkbox('enable_downloads',value="True")}
93 </div>
93 </div>
94 </div>
94 </div>
95 <div class="field">
95 <div class="field">
96 <div class="label">
96 <div class="label">
97 <label for="user">${_('Owner')}:</label>
97 <label for="user">${_('Owner')}:</label>
98 </div>
98 </div>
99 <div class="input input-small ac">
99 <div class="input input-small ac">
100 <div class="perm_ac">
100 <div class="perm_ac">
101 ${h.text('user',class_='yui-ac-input')}
101 ${h.text('user',class_='yui-ac-input')}
102 <div id="owner_container"></div>
102 <div id="owner_container"></div>
103 </div>
103 </div>
104 </div>
104 </div>
105 </div>
105 </div>
106
106
107 <div class="field">
107 <div class="field">
108 <div class="label">
108 <div class="label">
109 <label for="input">${_('Permissions')}:</label>
109 <label for="input">${_('Permissions')}:</label>
110 </div>
110 </div>
111 <div class="input">
111 <div class="input">
112 <%include file="repo_edit_perms.html"/>
112 <%include file="repo_edit_perms.html"/>
113 </div>
113 </div>
114
114
115 <div class="buttons">
115 <div class="buttons">
116 ${h.submit('save','Save',class_="ui-button")}
116 ${h.submit('save','Save',class_="ui-button")}
117 ${h.reset('reset','Reset',class_="ui-button")}
117 ${h.reset('reset','Reset',class_="ui-button")}
118 </div>
118 </div>
119 </div>
119 </div>
120 </div>
120 </div>
121 </div>
121 </div>
122 ${h.end_form()}
122 ${h.end_form()}
123 </div>
123 </div>
124
124
125 <div class="box box-right">
125 <div class="box box-right">
126 <div class="title">
126 <div class="title">
127 <h5>${_('Administration')}</h5>
127 <h5>${_('Administration')}</h5>
128 </div>
128 </div>
129
129
130 <h3>${_('Statistics')}</h3>
130 <h3>${_('Statistics')}</h3>
131 ${h.form(url('repo_stats', repo_name=c.repo_info.repo_name),method='delete')}
131 ${h.form(url('repo_stats', repo_name=c.repo_info.repo_name),method='delete')}
132 <div class="form">
132 <div class="form">
133 <div class="fields">
133 <div class="fields">
134 ${h.submit('reset_stats_%s' % c.repo_info.repo_name,_('Reset current statistics'),class_="ui-btn",onclick="return confirm('"+_('Confirm to remove current statistics')+"');")}
134 ${h.submit('reset_stats_%s' % c.repo_info.repo_name,_('Reset current statistics'),class_="ui-btn",onclick="return confirm('"+_('Confirm to remove current statistics')+"');")}
135 <div class="field" style="border:none;color:#888">
135 <div class="field" style="border:none;color:#888">
136 <ul>
136 <ul>
137 <li>${_('Fetched to rev')}: ${c.stats_revision}/${c.repo_last_rev}</li>
137 <li>${_('Fetched to rev')}: ${c.stats_revision}/${c.repo_last_rev}</li>
138 <li>${_('Percentage of stats gathered')}: ${c.stats_percentage} %</li>
138 <li>${_('Stats gathered')}: ${c.stats_percentage}%</li>
139 </ul>
139 </ul>
140 </div>
140 </div>
141 </div>
141 </div>
142 </div>
142 </div>
143 ${h.end_form()}
143 ${h.end_form()}
144
144
145 %if c.repo_info.clone_uri:
145 %if c.repo_info.clone_uri:
146 <h3>${_('Remote')}</h3>
146 <h3>${_('Remote')}</h3>
147 ${h.form(url('repo_pull', repo_name=c.repo_info.repo_name),method='put')}
147 ${h.form(url('repo_pull', repo_name=c.repo_info.repo_name),method='put')}
148 <div class="form">
148 <div class="form">
149 <div class="fields">
149 <div class="fields">
150 ${h.submit('remote_pull_%s' % c.repo_info.repo_name,_('Pull changes from remote location'),class_="ui-btn",onclick="return confirm('"+_('Confirm to pull changes from remote side')+"');")}
150 ${h.submit('remote_pull_%s' % c.repo_info.repo_name,_('Pull changes from remote location'),class_="ui-btn",onclick="return confirm('"+_('Confirm to pull changes from remote side')+"');")}
151 <div class="field" style="border:none">
151 <div class="field" style="border:none">
152 <ul>
152 <ul>
153 <li><a href="${c.repo_info.clone_uri}">${c.repo_info.clone_uri}</a></li>
153 <li><a href="${c.repo_info.clone_uri}">${c.repo_info.clone_uri}</a></li>
154 </ul>
154 </ul>
155 </div>
155 </div>
156 </div>
156 </div>
157 </div>
157 </div>
158 ${h.end_form()}
158 ${h.end_form()}
159 %endif
159 %endif
160
160
161 <h3>${_('Cache')}</h3>
161 <h3>${_('Cache')}</h3>
162 ${h.form(url('repo_cache', repo_name=c.repo_info.repo_name),method='delete')}
162 ${h.form(url('repo_cache', repo_name=c.repo_info.repo_name),method='delete')}
163 <div class="form">
163 <div class="form">
164 <div class="fields">
164 <div class="fields">
165 ${h.submit('reset_cache_%s' % c.repo_info.repo_name,_('Invalidate repository cache'),class_="ui-btn",onclick="return confirm('"+_('Confirm to invalidate repository cache')+"');")}
165 ${h.submit('reset_cache_%s' % c.repo_info.repo_name,_('Invalidate repository cache'),class_="ui-btn",onclick="return confirm('"+_('Confirm to invalidate repository cache')+"');")}
166 </div>
166 </div>
167 </div>
167 </div>
168 ${h.end_form()}
168 ${h.end_form()}
169
169
170 <h3>${_('Public journal')}</h3>
170 <h3>${_('Public journal')}</h3>
171 ${h.form(url('repo_public_journal', repo_name=c.repo_info.repo_name),method='put')}
171 ${h.form(url('repo_public_journal', repo_name=c.repo_info.repo_name),method='put')}
172 <div class="form">
172 <div class="form">
173 ${h.hidden('auth_token',str(h.get_token()))}
173 ${h.hidden('auth_token',str(h.get_token()))}
174 <div class="field">
174 <div class="field">
175 %if c.in_public_journal:
175 %if c.in_public_journal:
176 ${h.submit('set_public_%s' % c.repo_info.repo_name,_('Remove from public journal'),class_="ui-btn")}
176 ${h.submit('set_public_%s' % c.repo_info.repo_name,_('Remove from public journal'),class_="ui-btn")}
177 %else:
177 %else:
178 ${h.submit('set_public_%s' % c.repo_info.repo_name,_('Add to public journal'),class_="ui-btn")}
178 ${h.submit('set_public_%s' % c.repo_info.repo_name,_('Add to public journal'),class_="ui-btn")}
179 %endif
179 %endif
180 </div>
180 </div>
181 <div class="field" style="border:none;color:#888">
181 <div class="field" style="border:none;color:#888">
182 <ul>
182 <ul>
183 <li>${_('''All actions made on this repository will be accessible to everyone in public journal''')}
183 <li>${_('''All actions made on this repository will be accessible to everyone in public journal''')}
184 </li>
184 </li>
185 </ul>
185 </ul>
186 </div>
186 </div>
187 </div>
187 </div>
188 ${h.end_form()}
188 ${h.end_form()}
189
189
190 <h3>${_('Delete')}</h3>
190 <h3>${_('Delete')}</h3>
191 ${h.form(url('repo', repo_name=c.repo_info.repo_name),method='delete')}
191 ${h.form(url('repo', repo_name=c.repo_info.repo_name),method='delete')}
192 <div class="form">
192 <div class="form">
193 <div class="fields">
193 <div class="fields">
194 ${h.submit('remove_%s' % c.repo_info.repo_name,_('Remove this repository'),class_="ui-btn red",onclick="return confirm('"+_('Confirm to delete this repository')+"');")}
194 ${h.submit('remove_%s' % c.repo_info.repo_name,_('Remove this repository'),class_="ui-btn red",onclick="return confirm('"+_('Confirm to delete this repository')+"');")}
195 </div>
195 </div>
196 <div class="field" style="border:none;color:#888">
196 <div class="field" style="border:none;color:#888">
197 <ul>
197 <ul>
198 <li>${_('''This repository will be renamed in a special way in order to be unaccesible for RhodeCode and VCS systems.
198 <li>${_('''This repository will be renamed in a special way in order to be unaccesible for RhodeCode and VCS systems.
199 If you need fully delete it from filesystem please do it manually''')}
199 If you need fully delete it from filesystem please do it manually''')}
200 </li>
200 </li>
201 </ul>
201 </ul>
202 </div>
202 </div>
203 </div>
203 </div>
204 ${h.end_form()}
204 ${h.end_form()}
205
205
206 <h3>${_('Set as fork')}</h3>
206 <h3>${_('Set as fork')}</h3>
207 ${h.form(url('repo_as_fork', repo_name=c.repo_info.repo_name),method='put')}
207 ${h.form(url('repo_as_fork', repo_name=c.repo_info.repo_name),method='put')}
208 <div class="form">
208 <div class="form">
209 <div class="fields">
209 <div class="fields">
210 ${h.select('id_fork_of','',c.repos_list,class_="medium")}
210 ${h.select('id_fork_of','',c.repos_list,class_="medium")}
211 ${h.submit('set_as_fork_%s' % c.repo_info.repo_name,_('set'),class_="ui-btn",)}
211 ${h.submit('set_as_fork_%s' % c.repo_info.repo_name,_('set'),class_="ui-btn",)}
212 </div>
212 </div>
213 <div class="field" style="border:none;color:#888">
213 <div class="field" style="border:none;color:#888">
214 <ul>
214 <ul>
215 <li>${_('''Manually set this repository as a fork of another''')}</li>
215 <li>${_('''Manually set this repository as a fork of another''')}</li>
216 </ul>
216 </ul>
217 </div>
217 </div>
218 </div>
218 </div>
219 ${h.end_form()}
219 ${h.end_form()}
220
220
221 </div>
221 </div>
222
222
223
223
224 </%def>
224 </%def>
@@ -1,698 +1,698 b''
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.dbrepo.just_name,h.url('summary_home',repo_name=c.repo_name))}
10 ${h.link_to(c.dbrepo.just_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 <%
20 <%
21 summary = lambda n:{False:'summary-short'}.get(n)
21 summary = lambda n:{False:'summary-short'}.get(n)
22 %>
22 %>
23 %if c.show_stats:
23 %if c.show_stats:
24 <div class="box box-left">
24 <div class="box box-left">
25 %else:
25 %else:
26 <div class="box">
26 <div class="box">
27 %endif
27 %endif
28 <!-- box / title -->
28 <!-- box / title -->
29 <div class="title">
29 <div class="title">
30 ${self.breadcrumbs()}
30 ${self.breadcrumbs()}
31 </div>
31 </div>
32 <!-- end box / title -->
32 <!-- end box / title -->
33 <div class="form">
33 <div class="form">
34 <div id="summary" class="fields">
34 <div id="summary" class="fields">
35
35
36 <div class="field">
36 <div class="field">
37 <div class="label-summary">
37 <div class="label-summary">
38 <label>${_('Name')}:</label>
38 <label>${_('Name')}:</label>
39 </div>
39 </div>
40 <div class="input ${summary(c.show_stats)}">
40 <div class="input ${summary(c.show_stats)}">
41 <div style="float:right;padding:5px 0px 0px 5px">
41 <div style="float:right;padding:5px 0px 0px 5px">
42 %if c.rhodecode_user.username != 'default':
42 %if c.rhodecode_user.username != 'default':
43 ${h.link_to(_('RSS'),h.url('rss_feed_home',repo_name=c.dbrepo.repo_name,api_key=c.rhodecode_user.api_key),class_='rss_icon')}
43 ${h.link_to(_('RSS'),h.url('rss_feed_home',repo_name=c.dbrepo.repo_name,api_key=c.rhodecode_user.api_key),class_='rss_icon')}
44 ${h.link_to(_('ATOM'),h.url('atom_feed_home',repo_name=c.dbrepo.repo_name,api_key=c.rhodecode_user.api_key),class_='atom_icon')}
44 ${h.link_to(_('ATOM'),h.url('atom_feed_home',repo_name=c.dbrepo.repo_name,api_key=c.rhodecode_user.api_key),class_='atom_icon')}
45 %else:
45 %else:
46 ${h.link_to(_('RSS'),h.url('rss_feed_home',repo_name=c.dbrepo.repo_name),class_='rss_icon')}
46 ${h.link_to(_('RSS'),h.url('rss_feed_home',repo_name=c.dbrepo.repo_name),class_='rss_icon')}
47 ${h.link_to(_('ATOM'),h.url('atom_feed_home',repo_name=c.dbrepo.repo_name),class_='atom_icon')}
47 ${h.link_to(_('ATOM'),h.url('atom_feed_home',repo_name=c.dbrepo.repo_name),class_='atom_icon')}
48 %endif
48 %endif
49 </div>
49 </div>
50 %if c.rhodecode_user.username != 'default':
50 %if c.rhodecode_user.username != 'default':
51 %if c.following:
51 %if c.following:
52 <span id="follow_toggle" class="following" title="${_('Stop following this repository')}"
52 <span id="follow_toggle" class="following" title="${_('Stop following this repository')}"
53 onclick="javascript:toggleFollowingRepo(this,${c.dbrepo.repo_id},'${str(h.get_token())}')">
53 onclick="javascript:toggleFollowingRepo(this,${c.dbrepo.repo_id},'${str(h.get_token())}')">
54 </span>
54 </span>
55 %else:
55 %else:
56 <span id="follow_toggle" class="follow" title="${_('Start following this repository')}"
56 <span id="follow_toggle" class="follow" title="${_('Start following this repository')}"
57 onclick="javascript:toggleFollowingRepo(this,${c.dbrepo.repo_id},'${str(h.get_token())}')">
57 onclick="javascript:toggleFollowingRepo(this,${c.dbrepo.repo_id},'${str(h.get_token())}')">
58 </span>
58 </span>
59 %endif
59 %endif
60 %endif:
60 %endif:
61 ##REPO TYPE
61 ##REPO TYPE
62 %if h.is_hg(c.dbrepo):
62 %if h.is_hg(c.dbrepo):
63 <img style="margin-bottom:2px" class="icon" title="${_('Mercurial repository')}" alt="${_('Mercurial repository')}" src="${h.url('/images/icons/hgicon.png')}"/>
63 <img style="margin-bottom:2px" class="icon" title="${_('Mercurial repository')}" alt="${_('Mercurial repository')}" src="${h.url('/images/icons/hgicon.png')}"/>
64 %endif
64 %endif
65 %if h.is_git(c.dbrepo):
65 %if h.is_git(c.dbrepo):
66 <img style="margin-bottom:2px" class="icon" title="${_('Git repository')}" alt="${_('Git repository')}" src="${h.url('/images/icons/giticon.png')}"/>
66 <img style="margin-bottom:2px" class="icon" title="${_('Git repository')}" alt="${_('Git repository')}" src="${h.url('/images/icons/giticon.png')}"/>
67 %endif
67 %endif
68
68
69 ##PUBLIC/PRIVATE
69 ##PUBLIC/PRIVATE
70 %if c.dbrepo.private:
70 %if c.dbrepo.private:
71 <img style="margin-bottom:2px" class="icon" title="${_('private repository')}" alt="${_('private repository')}" src="${h.url('/images/icons/lock.png')}"/>
71 <img style="margin-bottom:2px" class="icon" title="${_('private repository')}" alt="${_('private repository')}" src="${h.url('/images/icons/lock.png')}"/>
72 %else:
72 %else:
73 <img style="margin-bottom:2px" class="icon" title="${_('public repository')}" alt="${_('public repository')}" src="${h.url('/images/icons/lock_open.png')}"/>
73 <img style="margin-bottom:2px" class="icon" title="${_('public repository')}" alt="${_('public repository')}" src="${h.url('/images/icons/lock_open.png')}"/>
74 %endif
74 %endif
75
75
76 ##REPO NAME
76 ##REPO NAME
77 <span class="repo_name" title="${_('Non changable ID %s') % c.dbrepo.repo_id}">${h.repo_link(c.dbrepo.groups_and_repo)}</span>
77 <span class="repo_name" title="${_('Non changable ID %s') % c.dbrepo.repo_id}">${h.repo_link(c.dbrepo.groups_and_repo)}</span>
78
78
79 ##FORK
79 ##FORK
80 %if c.dbrepo.fork:
80 %if c.dbrepo.fork:
81 <div style="margin-top:5px;clear:both"">
81 <div style="margin-top:5px;clear:both"">
82 <a href="${h.url('summary_home',repo_name=c.dbrepo.fork.repo_name)}"><img class="icon" alt="${_('public')}" title="${_('Fork of')} ${c.dbrepo.fork.repo_name}" src="${h.url('/images/icons/arrow_divide.png')}"/>
82 <a href="${h.url('summary_home',repo_name=c.dbrepo.fork.repo_name)}"><img class="icon" alt="${_('public')}" title="${_('Fork of')} ${c.dbrepo.fork.repo_name}" src="${h.url('/images/icons/arrow_divide.png')}"/>
83 ${_('Fork of')} ${c.dbrepo.fork.repo_name}
83 ${_('Fork of')} ${c.dbrepo.fork.repo_name}
84 </a>
84 </a>
85 </div>
85 </div>
86 %endif
86 %endif
87 ##REMOTE
87 ##REMOTE
88 %if c.dbrepo.clone_uri:
88 %if c.dbrepo.clone_uri:
89 <div style="margin-top:5px;clear:both">
89 <div style="margin-top:5px;clear:both">
90 <a href="${h.url(str(h.hide_credentials(c.dbrepo.clone_uri)))}"><img class="icon" alt="${_('remote clone')}" title="${_('Clone from')} ${h.hide_credentials(c.dbrepo.clone_uri)}" src="${h.url('/images/icons/connect.png')}"/>
90 <a href="${h.url(str(h.hide_credentials(c.dbrepo.clone_uri)))}"><img class="icon" alt="${_('remote clone')}" title="${_('Clone from')} ${h.hide_credentials(c.dbrepo.clone_uri)}" src="${h.url('/images/icons/connect.png')}"/>
91 ${_('Clone from')} ${h.hide_credentials(c.dbrepo.clone_uri)}
91 ${_('Clone from')} ${h.hide_credentials(c.dbrepo.clone_uri)}
92 </a>
92 </a>
93 </div>
93 </div>
94 %endif
94 %endif
95 </div>
95 </div>
96 </div>
96 </div>
97
97
98 <div class="field">
98 <div class="field">
99 <div class="label-summary">
99 <div class="label-summary">
100 <label>${_('Description')}:</label>
100 <label>${_('Description')}:</label>
101 </div>
101 </div>
102 <div class="input ${summary(c.show_stats)} desc">${h.urlify_text(c.dbrepo.description)}</div>
102 <div class="input ${summary(c.show_stats)} desc">${h.urlify_text(c.dbrepo.description)}</div>
103 </div>
103 </div>
104
104
105 <div class="field">
105 <div class="field">
106 <div class="label-summary">
106 <div class="label-summary">
107 <label>${_('Contact')}:</label>
107 <label>${_('Contact')}:</label>
108 </div>
108 </div>
109 <div class="input ${summary(c.show_stats)}">
109 <div class="input ${summary(c.show_stats)}">
110 <div class="gravatar">
110 <div class="gravatar">
111 <img alt="gravatar" src="${h.gravatar_url(c.dbrepo.user.email)}"/>
111 <img alt="gravatar" src="${h.gravatar_url(c.dbrepo.user.email)}"/>
112 </div>
112 </div>
113 ${_('Username')}: ${c.dbrepo.user.username}<br/>
113 ${_('Username')}: ${c.dbrepo.user.username}<br/>
114 ${_('Name')}: ${c.dbrepo.user.name} ${c.dbrepo.user.lastname}<br/>
114 ${_('Name')}: ${c.dbrepo.user.name} ${c.dbrepo.user.lastname}<br/>
115 ${_('Email')}: <a href="mailto:${c.dbrepo.user.email}">${c.dbrepo.user.email}</a>
115 ${_('Email')}: <a href="mailto:${c.dbrepo.user.email}">${c.dbrepo.user.email}</a>
116 </div>
116 </div>
117 </div>
117 </div>
118
118
119 <div class="field">
119 <div class="field">
120 <div class="label-summary">
120 <div class="label-summary">
121 <label>${_('Clone url')}:</label>
121 <label>${_('Clone url')}:</label>
122 </div>
122 </div>
123 <div class="input ${summary(c.show_stats)}">
123 <div class="input ${summary(c.show_stats)}">
124 <div style="display:none" id="clone_by_name" class="ui-btn clone">${_('Show by Name')}</div>
124 <div style="display:none" id="clone_by_name" class="ui-btn clone">${_('Show by Name')}</div>
125 <div id="clone_by_id" class="ui-btn clone">${_('Show by ID')}</div>
125 <div id="clone_by_id" class="ui-btn clone">${_('Show by ID')}</div>
126 <input style="width:80%;margin-left:105px" type="text" id="clone_url" readonly="readonly" value="${c.clone_repo_url}"/>
126 <input style="width:80%;margin-left:105px" type="text" id="clone_url" readonly="readonly" value="${c.clone_repo_url}"/>
127 <input style="display:none;width:80%;margin-left:105px" type="text" id="clone_url_id" readonly="readonly" value="${c.clone_repo_url_id}"/>
127 <input style="display:none;width:80%;margin-left:105px" type="text" id="clone_url_id" readonly="readonly" value="${c.clone_repo_url_id}"/>
128 </div>
128 </div>
129 </div>
129 </div>
130
130
131 <div class="field">
131 <div class="field">
132 <div class="label-summary">
132 <div class="label-summary">
133 <label>${_('Trending files')}:</label>
133 <label>${_('Trending files')}:</label>
134 </div>
134 </div>
135 <div class="input ${summary(c.show_stats)}">
135 <div class="input ${summary(c.show_stats)}">
136 %if c.show_stats:
136 %if c.show_stats:
137 <div id="lang_stats"></div>
137 <div id="lang_stats"></div>
138 %else:
138 %else:
139 ${_('Statistics are disabled for this repository')}
139 ${_('Statistics are disabled for this repository')}
140 %if h.HasPermissionAll('hg.admin')('enable stats on from summary'):
140 %if h.HasPermissionAll('hg.admin')('enable stats on from summary'):
141 ${h.link_to(_('enable'),h.url('edit_repo',repo_name=c.repo_name),class_="ui-btn")}
141 ${h.link_to(_('enable'),h.url('edit_repo',repo_name=c.repo_name),class_="ui-btn")}
142 %endif
142 %endif
143 %endif
143 %endif
144 </div>
144 </div>
145 </div>
145 </div>
146
146
147 <div class="field">
147 <div class="field">
148 <div class="label-summary">
148 <div class="label-summary">
149 <label>${_('Download')}:</label>
149 <label>${_('Download')}:</label>
150 </div>
150 </div>
151 <div class="input ${summary(c.show_stats)}">
151 <div class="input ${summary(c.show_stats)}">
152 %if len(c.rhodecode_repo.revisions) == 0:
152 %if len(c.rhodecode_repo.revisions) == 0:
153 ${_('There are no downloads yet')}
153 ${_('There are no downloads yet')}
154 %elif c.enable_downloads is False:
154 %elif c.enable_downloads is False:
155 ${_('Downloads are disabled for this repository')}
155 ${_('Downloads are disabled for this repository')}
156 %if h.HasPermissionAll('hg.admin')('enable downloads on from summary'):
156 %if h.HasPermissionAll('hg.admin')('enable downloads on from summary'):
157 ${h.link_to(_('enable'),h.url('edit_repo',repo_name=c.repo_name),class_="ui-btn")}
157 ${h.link_to(_('enable'),h.url('edit_repo',repo_name=c.repo_name),class_="ui-btn")}
158 %endif
158 %endif
159 %else:
159 %else:
160 ${h.select('download_options',c.rhodecode_repo.get_changeset().raw_id,c.download_options)}
160 ${h.select('download_options',c.rhodecode_repo.get_changeset().raw_id,c.download_options)}
161 <span id="${'zip_link'}">${h.link_to('Download as zip',h.url('files_archive_home',repo_name=c.dbrepo.repo_name,fname='tip.zip'),class_="archive_icon ui-btn")}</span>
161 <span id="${'zip_link'}">${h.link_to('Download as zip',h.url('files_archive_home',repo_name=c.dbrepo.repo_name,fname='tip.zip'),class_="archive_icon ui-btn")}</span>
162 <span style="vertical-align: bottom">
162 <span style="vertical-align: bottom">
163 <input id="archive_subrepos" type="checkbox" name="subrepos" />
163 <input id="archive_subrepos" type="checkbox" name="subrepos" />
164 <label for="archive_subrepos" class="tooltip" title="${_('Check this to download archive with subrepos')}" >${_('with subrepos')}</label>
164 <label for="archive_subrepos" class="tooltip" title="${_('Check this to download archive with subrepos')}" >${_('with subrepos')}</label>
165 </span>
165 </span>
166 %endif
166 %endif
167 </div>
167 </div>
168 </div>
168 </div>
169 </div>
169 </div>
170 </div>
170 </div>
171 </div>
171 </div>
172
172
173 %if c.show_stats:
173 %if c.show_stats:
174 <div class="box box-right" style="min-height:455px">
174 <div class="box box-right" style="min-height:455px">
175 <!-- box / title -->
175 <!-- box / title -->
176 <div class="title">
176 <div class="title">
177 <h5>${_('Commit activity by day / author')}</h5>
177 <h5>${_('Commit activity by day / author')}</h5>
178 </div>
178 </div>
179
179
180 <div class="graph">
180 <div class="graph">
181 <div style="padding:0 10px 10px 15px;font-size: 1.2em;">
181 <div style="padding:0 10px 10px 17px;">
182 %if c.no_data:
182 %if c.no_data:
183 ${c.no_data_msg}
183 ${c.no_data_msg}
184 %if h.HasPermissionAll('hg.admin')('enable stats on from summary'):
184 %if h.HasPermissionAll('hg.admin')('enable stats on from summary'):
185 ${h.link_to(_('enable'),h.url('edit_repo',repo_name=c.repo_name),class_="ui-btn")}
185 ${h.link_to(_('enable'),h.url('edit_repo',repo_name=c.repo_name),class_="ui-btn")}
186 %endif
186 %endif
187 %else:
187 %else:
188 ${_('Loaded in')} ${c.stats_percentage} %
188 ${_('Stats gathered: ')} ${c.stats_percentage}%
189 %endif
189 %endif
190 </div>
190 </div>
191 <div id="commit_history" style="width:450px;height:300px;float:left"></div>
191 <div id="commit_history" style="width:450px;height:300px;float:left"></div>
192 <div style="clear: both;height: 10px"></div>
192 <div style="clear: both;height: 10px"></div>
193 <div id="overview" style="width:450px;height:100px;float:left"></div>
193 <div id="overview" style="width:450px;height:100px;float:left"></div>
194
194
195 <div id="legend_data" style="clear:both;margin-top:10px;">
195 <div id="legend_data" style="clear:both;margin-top:10px;">
196 <div id="legend_container"></div>
196 <div id="legend_container"></div>
197 <div id="legend_choices">
197 <div id="legend_choices">
198 <table id="legend_choices_tables" class="noborder" style="font-size:smaller;color:#545454"></table>
198 <table id="legend_choices_tables" class="noborder" style="font-size:smaller;color:#545454"></table>
199 </div>
199 </div>
200 </div>
200 </div>
201 </div>
201 </div>
202 </div>
202 </div>
203 %endif
203 %endif
204
204
205 <div class="box">
205 <div class="box">
206 <div class="title">
206 <div class="title">
207 <div class="breadcrumbs">
207 <div class="breadcrumbs">
208 %if c.repo_changesets:
208 %if c.repo_changesets:
209 ${h.link_to(_('Shortlog'),h.url('shortlog_home',repo_name=c.repo_name))}
209 ${h.link_to(_('Shortlog'),h.url('shortlog_home',repo_name=c.repo_name))}
210 %else:
210 %else:
211 ${_('Quick start')}
211 ${_('Quick start')}
212 %endif
212 %endif
213 </div>
213 </div>
214 </div>
214 </div>
215 <div class="table">
215 <div class="table">
216 <div id="shortlog_data">
216 <div id="shortlog_data">
217 <%include file='../shortlog/shortlog_data.html'/>
217 <%include file='../shortlog/shortlog_data.html'/>
218 </div>
218 </div>
219 </div>
219 </div>
220 </div>
220 </div>
221
221
222 %if c.readme_data:
222 %if c.readme_data:
223 <div class="box" style="background-color: #FAFAFA">
223 <div class="box" style="background-color: #FAFAFA">
224 <div class="title">
224 <div class="title">
225 <div class="breadcrumbs"><a href="${h.url('files_home',repo_name=c.repo_name,revision='tip',f_path=c.readme_file)}">${c.readme_file}</a></div>
225 <div class="breadcrumbs"><a href="${h.url('files_home',repo_name=c.repo_name,revision='tip',f_path=c.readme_file)}">${c.readme_file}</a></div>
226 </div>
226 </div>
227 <div class="readme">
227 <div class="readme">
228 <div class="readme_box">
228 <div class="readme_box">
229 ${c.readme_data|n}
229 ${c.readme_data|n}
230 </div>
230 </div>
231 </div>
231 </div>
232 </div>
232 </div>
233 %endif
233 %endif
234
234
235 <script type="text/javascript">
235 <script type="text/javascript">
236 var clone_url = 'clone_url';
236 var clone_url = 'clone_url';
237 YUE.on(clone_url,'click',function(e){
237 YUE.on(clone_url,'click',function(e){
238 if(YUD.hasClass(clone_url,'selected')){
238 if(YUD.hasClass(clone_url,'selected')){
239 return
239 return
240 }
240 }
241 else{
241 else{
242 YUD.addClass(clone_url,'selected');
242 YUD.addClass(clone_url,'selected');
243 YUD.get(clone_url).select();
243 YUD.get(clone_url).select();
244 }
244 }
245 })
245 })
246
246
247 YUE.on('clone_by_name','click',function(e){
247 YUE.on('clone_by_name','click',function(e){
248 // show url by name and hide name button
248 // show url by name and hide name button
249 YUD.setStyle('clone_url','display','');
249 YUD.setStyle('clone_url','display','');
250 YUD.setStyle('clone_by_name','display','none');
250 YUD.setStyle('clone_by_name','display','none');
251
251
252 // hide url by id and show name button
252 // hide url by id and show name button
253 YUD.setStyle('clone_by_id','display','');
253 YUD.setStyle('clone_by_id','display','');
254 YUD.setStyle('clone_url_id','display','none');
254 YUD.setStyle('clone_url_id','display','none');
255
255
256 })
256 })
257 YUE.on('clone_by_id','click',function(e){
257 YUE.on('clone_by_id','click',function(e){
258
258
259 // show url by id and hide id button
259 // show url by id and hide id button
260 YUD.setStyle('clone_by_id','display','none');
260 YUD.setStyle('clone_by_id','display','none');
261 YUD.setStyle('clone_url_id','display','');
261 YUD.setStyle('clone_url_id','display','');
262
262
263 // hide url by name and show id button
263 // hide url by name and show id button
264 YUD.setStyle('clone_by_name','display','');
264 YUD.setStyle('clone_by_name','display','');
265 YUD.setStyle('clone_url','display','none');
265 YUD.setStyle('clone_url','display','none');
266 })
266 })
267
267
268
268
269 var tmpl_links = {};
269 var tmpl_links = {};
270 %for cnt,archive in enumerate(c.rhodecode_repo._get_archives()):
270 %for cnt,archive in enumerate(c.rhodecode_repo._get_archives()):
271 tmpl_links["${archive['type']}"] = '${h.link_to('__NAME__', h.url('files_archive_home',repo_name=c.dbrepo.repo_name, fname='__CS__'+archive['extension'],subrepos='__SUB__'),class_='archive_icon ui-btn')}';
271 tmpl_links["${archive['type']}"] = '${h.link_to('__NAME__', h.url('files_archive_home',repo_name=c.dbrepo.repo_name, fname='__CS__'+archive['extension'],subrepos='__SUB__'),class_='archive_icon ui-btn')}';
272 %endfor
272 %endfor
273
273
274 YUE.on(['download_options','archive_subrepos'],'change',function(e){
274 YUE.on(['download_options','archive_subrepos'],'change',function(e){
275 var sm = YUD.get('download_options');
275 var sm = YUD.get('download_options');
276 var new_cs = sm.options[sm.selectedIndex];
276 var new_cs = sm.options[sm.selectedIndex];
277
277
278 for(k in tmpl_links){
278 for(k in tmpl_links){
279 var s = YUD.get(k+'_link');
279 var s = YUD.get(k+'_link');
280 if(s){
280 if(s){
281 var title_tmpl = "${_('Download %s as %s') % ('__CS_NAME__','__CS_EXT__')}";
281 var title_tmpl = "${_('Download %s as %s') % ('__CS_NAME__','__CS_EXT__')}";
282 title_tmpl= title_tmpl.replace('__CS_NAME__',new_cs.text);
282 title_tmpl= title_tmpl.replace('__CS_NAME__',new_cs.text);
283 title_tmpl = title_tmpl.replace('__CS_EXT__',k);
283 title_tmpl = title_tmpl.replace('__CS_EXT__',k);
284
284
285 var url = tmpl_links[k].replace('__CS__',new_cs.value);
285 var url = tmpl_links[k].replace('__CS__',new_cs.value);
286 var subrepos = YUD.get('archive_subrepos').checked;
286 var subrepos = YUD.get('archive_subrepos').checked;
287 url = url.replace('__SUB__',subrepos);
287 url = url.replace('__SUB__',subrepos);
288 url = url.replace('__NAME__',title_tmpl);
288 url = url.replace('__NAME__',title_tmpl);
289 s.innerHTML = url
289 s.innerHTML = url
290 }
290 }
291 }
291 }
292 });
292 });
293 </script>
293 </script>
294 %if c.show_stats:
294 %if c.show_stats:
295 <script type="text/javascript">
295 <script type="text/javascript">
296 var data = ${c.trending_languages|n};
296 var data = ${c.trending_languages|n};
297 var total = 0;
297 var total = 0;
298 var no_data = true;
298 var no_data = true;
299 var tbl = document.createElement('table');
299 var tbl = document.createElement('table');
300 tbl.setAttribute('class','trending_language_tbl');
300 tbl.setAttribute('class','trending_language_tbl');
301 var cnt = 0;
301 var cnt = 0;
302 for (var i=0;i<data.length;i++){
302 for (var i=0;i<data.length;i++){
303 total+= data[i][1].count;
303 total+= data[i][1].count;
304 }
304 }
305 for (var i=0;i<data.length;i++){
305 for (var i=0;i<data.length;i++){
306 cnt += 1;
306 cnt += 1;
307 no_data = false;
307 no_data = false;
308
308
309 var hide = cnt>2;
309 var hide = cnt>2;
310 var tr = document.createElement('tr');
310 var tr = document.createElement('tr');
311 if (hide){
311 if (hide){
312 tr.setAttribute('style','display:none');
312 tr.setAttribute('style','display:none');
313 tr.setAttribute('class','stats_hidden');
313 tr.setAttribute('class','stats_hidden');
314 }
314 }
315 var k = data[i][0];
315 var k = data[i][0];
316 var obj = data[i][1];
316 var obj = data[i][1];
317 var percentage = Math.round((obj.count/total*100),2);
317 var percentage = Math.round((obj.count/total*100),2);
318
318
319 var td1 = document.createElement('td');
319 var td1 = document.createElement('td');
320 td1.width = 150;
320 td1.width = 150;
321 var trending_language_label = document.createElement('div');
321 var trending_language_label = document.createElement('div');
322 trending_language_label.innerHTML = obj.desc+" ("+k+")";
322 trending_language_label.innerHTML = obj.desc+" ("+k+")";
323 td1.appendChild(trending_language_label);
323 td1.appendChild(trending_language_label);
324
324
325 var td2 = document.createElement('td');
325 var td2 = document.createElement('td');
326 td2.setAttribute('style','padding-right:14px !important');
326 td2.setAttribute('style','padding-right:14px !important');
327 var trending_language = document.createElement('div');
327 var trending_language = document.createElement('div');
328 var nr_files = obj.count+" ${_('files')}";
328 var nr_files = obj.count+" ${_('files')}";
329
329
330 trending_language.title = k+" "+nr_files;
330 trending_language.title = k+" "+nr_files;
331
331
332 if (percentage>22){
332 if (percentage>22){
333 trending_language.innerHTML = "<b style='font-size:0.8em'>"+percentage+"% "+nr_files+ "</b>";
333 trending_language.innerHTML = "<b style='font-size:0.8em'>"+percentage+"% "+nr_files+ "</b>";
334 }
334 }
335 else{
335 else{
336 trending_language.innerHTML = "<b style='font-size:0.8em'>"+percentage+"%</b>";
336 trending_language.innerHTML = "<b style='font-size:0.8em'>"+percentage+"%</b>";
337 }
337 }
338
338
339 trending_language.setAttribute("class", 'trending_language top-right-rounded-corner bottom-right-rounded-corner');
339 trending_language.setAttribute("class", 'trending_language top-right-rounded-corner bottom-right-rounded-corner');
340 trending_language.style.width=percentage+"%";
340 trending_language.style.width=percentage+"%";
341 td2.appendChild(trending_language);
341 td2.appendChild(trending_language);
342
342
343 tr.appendChild(td1);
343 tr.appendChild(td1);
344 tr.appendChild(td2);
344 tr.appendChild(td2);
345 tbl.appendChild(tr);
345 tbl.appendChild(tr);
346 if(cnt == 3){
346 if(cnt == 3){
347 var show_more = document.createElement('tr');
347 var show_more = document.createElement('tr');
348 var td = document.createElement('td');
348 var td = document.createElement('td');
349 lnk = document.createElement('a');
349 lnk = document.createElement('a');
350
350
351 lnk.href='#';
351 lnk.href='#';
352 lnk.innerHTML = "${_('show more')}";
352 lnk.innerHTML = "${_('show more')}";
353 lnk.id='code_stats_show_more';
353 lnk.id='code_stats_show_more';
354 td.appendChild(lnk);
354 td.appendChild(lnk);
355
355
356 show_more.appendChild(td);
356 show_more.appendChild(td);
357 show_more.appendChild(document.createElement('td'));
357 show_more.appendChild(document.createElement('td'));
358 tbl.appendChild(show_more);
358 tbl.appendChild(show_more);
359 }
359 }
360
360
361 }
361 }
362
362
363 YUD.get('lang_stats').appendChild(tbl);
363 YUD.get('lang_stats').appendChild(tbl);
364 YUE.on('code_stats_show_more','click',function(){
364 YUE.on('code_stats_show_more','click',function(){
365 l = YUD.getElementsByClassName('stats_hidden')
365 l = YUD.getElementsByClassName('stats_hidden')
366 for (e in l){
366 for (e in l){
367 YUD.setStyle(l[e],'display','');
367 YUD.setStyle(l[e],'display','');
368 };
368 };
369 YUD.setStyle(YUD.get('code_stats_show_more'),
369 YUD.setStyle(YUD.get('code_stats_show_more'),
370 'display','none');
370 'display','none');
371 });
371 });
372 </script>
372 </script>
373 <script type="text/javascript">
373 <script type="text/javascript">
374 /**
374 /**
375 * Plots summary graph
375 * Plots summary graph
376 *
376 *
377 * @class SummaryPlot
377 * @class SummaryPlot
378 * @param {from} initial from for detailed graph
378 * @param {from} initial from for detailed graph
379 * @param {to} initial to for detailed graph
379 * @param {to} initial to for detailed graph
380 * @param {dataset}
380 * @param {dataset}
381 * @param {overview_dataset}
381 * @param {overview_dataset}
382 */
382 */
383 function SummaryPlot(from,to,dataset,overview_dataset) {
383 function SummaryPlot(from,to,dataset,overview_dataset) {
384 var initial_ranges = {
384 var initial_ranges = {
385 "xaxis":{
385 "xaxis":{
386 "from":from,
386 "from":from,
387 "to":to,
387 "to":to,
388 },
388 },
389 };
389 };
390 var dataset = dataset;
390 var dataset = dataset;
391 var overview_dataset = [overview_dataset];
391 var overview_dataset = [overview_dataset];
392 var choiceContainer = YUD.get("legend_choices");
392 var choiceContainer = YUD.get("legend_choices");
393 var choiceContainerTable = YUD.get("legend_choices_tables");
393 var choiceContainerTable = YUD.get("legend_choices_tables");
394 var plotContainer = YUD.get('commit_history');
394 var plotContainer = YUD.get('commit_history');
395 var overviewContainer = YUD.get('overview');
395 var overviewContainer = YUD.get('overview');
396
396
397 var plot_options = {
397 var plot_options = {
398 bars: {show:true,align:'center',lineWidth:4},
398 bars: {show:true,align:'center',lineWidth:4},
399 legend: {show:true, container:"legend_container"},
399 legend: {show:true, container:"legend_container"},
400 points: {show:true,radius:0,fill:false},
400 points: {show:true,radius:0,fill:false},
401 yaxis: {tickDecimals:0,},
401 yaxis: {tickDecimals:0,},
402 xaxis: {
402 xaxis: {
403 mode: "time",
403 mode: "time",
404 timeformat: "%d/%m",
404 timeformat: "%d/%m",
405 min:from,
405 min:from,
406 max:to,
406 max:to,
407 },
407 },
408 grid: {
408 grid: {
409 hoverable: true,
409 hoverable: true,
410 clickable: true,
410 clickable: true,
411 autoHighlight:true,
411 autoHighlight:true,
412 color: "#999"
412 color: "#999"
413 },
413 },
414 //selection: {mode: "x"}
414 //selection: {mode: "x"}
415 };
415 };
416 var overview_options = {
416 var overview_options = {
417 legend:{show:false},
417 legend:{show:false},
418 bars: {show:true,barWidth: 2,},
418 bars: {show:true,barWidth: 2,},
419 shadowSize: 0,
419 shadowSize: 0,
420 xaxis: {mode: "time", timeformat: "%d/%m/%y",},
420 xaxis: {mode: "time", timeformat: "%d/%m/%y",},
421 yaxis: {ticks: 3, min: 0,tickDecimals:0,},
421 yaxis: {ticks: 3, min: 0,tickDecimals:0,},
422 grid: {color: "#999",},
422 grid: {color: "#999",},
423 selection: {mode: "x"}
423 selection: {mode: "x"}
424 };
424 };
425
425
426 /**
426 /**
427 *get dummy data needed in few places
427 *get dummy data needed in few places
428 */
428 */
429 function getDummyData(label){
429 function getDummyData(label){
430 return {"label":label,
430 return {"label":label,
431 "data":[{"time":0,
431 "data":[{"time":0,
432 "commits":0,
432 "commits":0,
433 "added":0,
433 "added":0,
434 "changed":0,
434 "changed":0,
435 "removed":0,
435 "removed":0,
436 }],
436 }],
437 "schema":["commits"],
437 "schema":["commits"],
438 "color":'#ffffff',
438 "color":'#ffffff',
439 }
439 }
440 }
440 }
441
441
442 /**
442 /**
443 * generate checkboxes accordindly to data
443 * generate checkboxes accordindly to data
444 * @param keys
444 * @param keys
445 * @returns
445 * @returns
446 */
446 */
447 function generateCheckboxes(data) {
447 function generateCheckboxes(data) {
448 //append checkboxes
448 //append checkboxes
449 var i = 0;
449 var i = 0;
450 choiceContainerTable.innerHTML = '';
450 choiceContainerTable.innerHTML = '';
451 for(var pos in data) {
451 for(var pos in data) {
452
452
453 data[pos].color = i;
453 data[pos].color = i;
454 i++;
454 i++;
455 if(data[pos].label != ''){
455 if(data[pos].label != ''){
456 choiceContainerTable.innerHTML +=
456 choiceContainerTable.innerHTML +=
457 '<tr><td><input type="checkbox" id="id_user_{0}" name="{0}" checked="checked" /> \
457 '<tr><td><input type="checkbox" id="id_user_{0}" name="{0}" checked="checked" /> \
458 <label for="id_user_{0}">{0}</label></td></tr>'.format(data[pos].label);
458 <label for="id_user_{0}">{0}</label></td></tr>'.format(data[pos].label);
459 }
459 }
460 }
460 }
461 }
461 }
462
462
463 /**
463 /**
464 * ToolTip show
464 * ToolTip show
465 */
465 */
466 function showTooltip(x, y, contents) {
466 function showTooltip(x, y, contents) {
467 var div=document.getElementById('tooltip');
467 var div=document.getElementById('tooltip');
468 if(!div) {
468 if(!div) {
469 div = document.createElement('div');
469 div = document.createElement('div');
470 div.id="tooltip";
470 div.id="tooltip";
471 div.style.position="absolute";
471 div.style.position="absolute";
472 div.style.border='1px solid #fdd';
472 div.style.border='1px solid #fdd';
473 div.style.padding='2px';
473 div.style.padding='2px';
474 div.style.backgroundColor='#fee';
474 div.style.backgroundColor='#fee';
475 document.body.appendChild(div);
475 document.body.appendChild(div);
476 }
476 }
477 YUD.setStyle(div, 'opacity', 0);
477 YUD.setStyle(div, 'opacity', 0);
478 div.innerHTML = contents;
478 div.innerHTML = contents;
479 div.style.top=(y + 5) + "px";
479 div.style.top=(y + 5) + "px";
480 div.style.left=(x + 5) + "px";
480 div.style.left=(x + 5) + "px";
481
481
482 var anim = new YAHOO.util.Anim(div, {opacity: {to: 0.8}}, 0.2);
482 var anim = new YAHOO.util.Anim(div, {opacity: {to: 0.8}}, 0.2);
483 anim.animate();
483 anim.animate();
484 }
484 }
485
485
486 /**
486 /**
487 * This function will detect if selected period has some changesets
487 * This function will detect if selected period has some changesets
488 for this user if it does this data is then pushed for displaying
488 for this user if it does this data is then pushed for displaying
489 Additionally it will only display users that are selected by the checkbox
489 Additionally it will only display users that are selected by the checkbox
490 */
490 */
491 function getDataAccordingToRanges(ranges) {
491 function getDataAccordingToRanges(ranges) {
492
492
493 var data = [];
493 var data = [];
494 var new_dataset = {};
494 var new_dataset = {};
495 var keys = [];
495 var keys = [];
496 var max_commits = 0;
496 var max_commits = 0;
497 for(var key in dataset){
497 for(var key in dataset){
498
498
499 for(var ds in dataset[key].data){
499 for(var ds in dataset[key].data){
500 commit_data = dataset[key].data[ds];
500 commit_data = dataset[key].data[ds];
501 if (commit_data.time >= ranges.xaxis.from && commit_data.time <= ranges.xaxis.to){
501 if (commit_data.time >= ranges.xaxis.from && commit_data.time <= ranges.xaxis.to){
502
502
503 if(new_dataset[key] === undefined){
503 if(new_dataset[key] === undefined){
504 new_dataset[key] = {data:[],schema:["commits"],label:key};
504 new_dataset[key] = {data:[],schema:["commits"],label:key};
505 }
505 }
506 new_dataset[key].data.push(commit_data);
506 new_dataset[key].data.push(commit_data);
507 }
507 }
508 }
508 }
509 if (new_dataset[key] !== undefined){
509 if (new_dataset[key] !== undefined){
510 data.push(new_dataset[key]);
510 data.push(new_dataset[key]);
511 }
511 }
512 }
512 }
513
513
514 if (data.length > 0){
514 if (data.length > 0){
515 return data;
515 return data;
516 }
516 }
517 else{
517 else{
518 //just return dummy data for graph to plot itself
518 //just return dummy data for graph to plot itself
519 return [getDummyData('')];
519 return [getDummyData('')];
520 }
520 }
521 }
521 }
522
522
523 /**
523 /**
524 * redraw using new checkbox data
524 * redraw using new checkbox data
525 */
525 */
526 function plotchoiced(e,args){
526 function plotchoiced(e,args){
527 var cur_data = args[0];
527 var cur_data = args[0];
528 var cur_ranges = args[1];
528 var cur_ranges = args[1];
529
529
530 var new_data = [];
530 var new_data = [];
531 var inputs = choiceContainer.getElementsByTagName("input");
531 var inputs = choiceContainer.getElementsByTagName("input");
532
532
533 //show only checked labels
533 //show only checked labels
534 for(var i=0; i<inputs.length; i++) {
534 for(var i=0; i<inputs.length; i++) {
535 var checkbox_key = inputs[i].name;
535 var checkbox_key = inputs[i].name;
536
536
537 if(inputs[i].checked){
537 if(inputs[i].checked){
538 for(var d in cur_data){
538 for(var d in cur_data){
539 if(cur_data[d].label == checkbox_key){
539 if(cur_data[d].label == checkbox_key){
540 new_data.push(cur_data[d]);
540 new_data.push(cur_data[d]);
541 }
541 }
542 }
542 }
543 }
543 }
544 else{
544 else{
545 //push dummy data to not hide the label
545 //push dummy data to not hide the label
546 new_data.push(getDummyData(checkbox_key));
546 new_data.push(getDummyData(checkbox_key));
547 }
547 }
548 }
548 }
549
549
550 var new_options = YAHOO.lang.merge(plot_options, {
550 var new_options = YAHOO.lang.merge(plot_options, {
551 xaxis: {
551 xaxis: {
552 min: cur_ranges.xaxis.from,
552 min: cur_ranges.xaxis.from,
553 max: cur_ranges.xaxis.to,
553 max: cur_ranges.xaxis.to,
554 mode:"time",
554 mode:"time",
555 timeformat: "%d/%m",
555 timeformat: "%d/%m",
556 },
556 },
557 });
557 });
558 if (!new_data){
558 if (!new_data){
559 new_data = [[0,1]];
559 new_data = [[0,1]];
560 }
560 }
561 // do the zooming
561 // do the zooming
562 plot = YAHOO.widget.Flot(plotContainer, new_data, new_options);
562 plot = YAHOO.widget.Flot(plotContainer, new_data, new_options);
563
563
564 plot.subscribe("plotselected", plotselected);
564 plot.subscribe("plotselected", plotselected);
565
565
566 //resubscribe plothover
566 //resubscribe plothover
567 plot.subscribe("plothover", plothover);
567 plot.subscribe("plothover", plothover);
568
568
569 // don't fire event on the overview to prevent eternal loop
569 // don't fire event on the overview to prevent eternal loop
570 overview.setSelection(cur_ranges, true);
570 overview.setSelection(cur_ranges, true);
571
571
572 }
572 }
573
573
574 /**
574 /**
575 * plot only selected items from overview
575 * plot only selected items from overview
576 * @param ranges
576 * @param ranges
577 * @returns
577 * @returns
578 */
578 */
579 function plotselected(ranges,cur_data) {
579 function plotselected(ranges,cur_data) {
580 //updates the data for new plot
580 //updates the data for new plot
581 var data = getDataAccordingToRanges(ranges);
581 var data = getDataAccordingToRanges(ranges);
582 generateCheckboxes(data);
582 generateCheckboxes(data);
583
583
584 var new_options = YAHOO.lang.merge(plot_options, {
584 var new_options = YAHOO.lang.merge(plot_options, {
585 xaxis: {
585 xaxis: {
586 min: ranges.xaxis.from,
586 min: ranges.xaxis.from,
587 max: ranges.xaxis.to,
587 max: ranges.xaxis.to,
588 mode:"time",
588 mode:"time",
589 timeformat: "%d/%m",
589 timeformat: "%d/%m",
590 },
590 },
591 });
591 });
592 // do the zooming
592 // do the zooming
593 plot = YAHOO.widget.Flot(plotContainer, data, new_options);
593 plot = YAHOO.widget.Flot(plotContainer, data, new_options);
594
594
595 plot.subscribe("plotselected", plotselected);
595 plot.subscribe("plotselected", plotselected);
596
596
597 //resubscribe plothover
597 //resubscribe plothover
598 plot.subscribe("plothover", plothover);
598 plot.subscribe("plothover", plothover);
599
599
600 // don't fire event on the overview to prevent eternal loop
600 // don't fire event on the overview to prevent eternal loop
601 overview.setSelection(ranges, true);
601 overview.setSelection(ranges, true);
602
602
603 //resubscribe choiced
603 //resubscribe choiced
604 YUE.on(choiceContainer.getElementsByTagName("input"), "click", plotchoiced, [data, ranges]);
604 YUE.on(choiceContainer.getElementsByTagName("input"), "click", plotchoiced, [data, ranges]);
605 }
605 }
606
606
607 var previousPoint = null;
607 var previousPoint = null;
608
608
609 function plothover(o) {
609 function plothover(o) {
610 var pos = o.pos;
610 var pos = o.pos;
611 var item = o.item;
611 var item = o.item;
612
612
613 //YUD.get("x").innerHTML = pos.x.toFixed(2);
613 //YUD.get("x").innerHTML = pos.x.toFixed(2);
614 //YUD.get("y").innerHTML = pos.y.toFixed(2);
614 //YUD.get("y").innerHTML = pos.y.toFixed(2);
615 if (item) {
615 if (item) {
616 if (previousPoint != item.datapoint) {
616 if (previousPoint != item.datapoint) {
617 previousPoint = item.datapoint;
617 previousPoint = item.datapoint;
618
618
619 var tooltip = YUD.get("tooltip");
619 var tooltip = YUD.get("tooltip");
620 if(tooltip) {
620 if(tooltip) {
621 tooltip.parentNode.removeChild(tooltip);
621 tooltip.parentNode.removeChild(tooltip);
622 }
622 }
623 var x = item.datapoint.x.toFixed(2);
623 var x = item.datapoint.x.toFixed(2);
624 var y = item.datapoint.y.toFixed(2);
624 var y = item.datapoint.y.toFixed(2);
625
625
626 if (!item.series.label){
626 if (!item.series.label){
627 item.series.label = 'commits';
627 item.series.label = 'commits';
628 }
628 }
629 var d = new Date(x*1000);
629 var d = new Date(x*1000);
630 var fd = d.toDateString()
630 var fd = d.toDateString()
631 var nr_commits = parseInt(y);
631 var nr_commits = parseInt(y);
632
632
633 var cur_data = dataset[item.series.label].data[item.dataIndex];
633 var cur_data = dataset[item.series.label].data[item.dataIndex];
634 var added = cur_data.added;
634 var added = cur_data.added;
635 var changed = cur_data.changed;
635 var changed = cur_data.changed;
636 var removed = cur_data.removed;
636 var removed = cur_data.removed;
637
637
638 var nr_commits_suffix = " ${_('commits')} ";
638 var nr_commits_suffix = " ${_('commits')} ";
639 var added_suffix = " ${_('files added')} ";
639 var added_suffix = " ${_('files added')} ";
640 var changed_suffix = " ${_('files changed')} ";
640 var changed_suffix = " ${_('files changed')} ";
641 var removed_suffix = " ${_('files removed')} ";
641 var removed_suffix = " ${_('files removed')} ";
642
642
643
643
644 if(nr_commits == 1){nr_commits_suffix = " ${_('commit')} ";}
644 if(nr_commits == 1){nr_commits_suffix = " ${_('commit')} ";}
645 if(added==1){added_suffix=" ${_('file added')} ";}
645 if(added==1){added_suffix=" ${_('file added')} ";}
646 if(changed==1){changed_suffix=" ${_('file changed')} ";}
646 if(changed==1){changed_suffix=" ${_('file changed')} ";}
647 if(removed==1){removed_suffix=" ${_('file removed')} ";}
647 if(removed==1){removed_suffix=" ${_('file removed')} ";}
648
648
649 showTooltip(item.pageX, item.pageY, item.series.label + " on " + fd
649 showTooltip(item.pageX, item.pageY, item.series.label + " on " + fd
650 +'<br/>'+
650 +'<br/>'+
651 nr_commits + nr_commits_suffix+'<br/>'+
651 nr_commits + nr_commits_suffix+'<br/>'+
652 added + added_suffix +'<br/>'+
652 added + added_suffix +'<br/>'+
653 changed + changed_suffix + '<br/>'+
653 changed + changed_suffix + '<br/>'+
654 removed + removed_suffix + '<br/>');
654 removed + removed_suffix + '<br/>');
655 }
655 }
656 }
656 }
657 else {
657 else {
658 var tooltip = YUD.get("tooltip");
658 var tooltip = YUD.get("tooltip");
659
659
660 if(tooltip) {
660 if(tooltip) {
661 tooltip.parentNode.removeChild(tooltip);
661 tooltip.parentNode.removeChild(tooltip);
662 }
662 }
663 previousPoint = null;
663 previousPoint = null;
664 }
664 }
665 }
665 }
666
666
667 /**
667 /**
668 * MAIN EXECUTION
668 * MAIN EXECUTION
669 */
669 */
670
670
671 var data = getDataAccordingToRanges(initial_ranges);
671 var data = getDataAccordingToRanges(initial_ranges);
672 generateCheckboxes(data);
672 generateCheckboxes(data);
673
673
674 //main plot
674 //main plot
675 var plot = YAHOO.widget.Flot(plotContainer,data,plot_options);
675 var plot = YAHOO.widget.Flot(plotContainer,data,plot_options);
676
676
677 //overview
677 //overview
678 var overview = YAHOO.widget.Flot(overviewContainer,
678 var overview = YAHOO.widget.Flot(overviewContainer,
679 overview_dataset, overview_options);
679 overview_dataset, overview_options);
680
680
681 //show initial selection on overview
681 //show initial selection on overview
682 overview.setSelection(initial_ranges);
682 overview.setSelection(initial_ranges);
683
683
684 plot.subscribe("plotselected", plotselected);
684 plot.subscribe("plotselected", plotselected);
685 plot.subscribe("plothover", plothover)
685 plot.subscribe("plothover", plothover)
686
686
687 overview.subscribe("plotselected", function (ranges) {
687 overview.subscribe("plotselected", function (ranges) {
688 plot.setSelection(ranges);
688 plot.setSelection(ranges);
689 });
689 });
690
690
691 // user choices on overview
691 // user choices on overview
692 YUE.on(choiceContainer.getElementsByTagName("input"), "click", plotchoiced, [data, initial_ranges]);
692 YUE.on(choiceContainer.getElementsByTagName("input"), "click", plotchoiced, [data, initial_ranges]);
693 }
693 }
694 SummaryPlot(${c.ts_min},${c.ts_max},${c.commit_data|n},${c.overview_data|n});
694 SummaryPlot(${c.ts_min},${c.ts_max},${c.commit_data|n},${c.overview_data|n});
695 </script>
695 </script>
696 %endif
696 %endif
697
697
698 </%def>
698 </%def>
General Comments 0
You need to be logged in to leave comments. Login now