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