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