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