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