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