Show More
@@ -1,114 +1,114 b'' | |||||
1 | <dl> |
|
1 | <dl> | |
2 | <dt style="padding-top:10px;font-size:16px">${_('History')}</dt> |
|
2 | <dt style="padding-top:10px;font-size:16px">${_('History')}</dt> | |
3 | <dd> |
|
3 | <dd> | |
4 | <div> |
|
4 | <div> | |
5 | ${h.form(h.url('files_diff_home',repo_name=c.repo_name,f_path=c.f_path),method='get')} |
|
5 | ${h.form(h.url('files_diff_home',repo_name=c.repo_name,f_path=c.f_path),method='get')} | |
6 | ${h.hidden('diff2',c.file.changeset.raw_id)} |
|
6 | ${h.hidden('diff2',c.file.changeset.raw_id)} | |
7 | ${h.select('diff1',c.file.changeset.raw_id,c.file_history)} |
|
7 | ${h.select('diff1',c.file.changeset.raw_id,c.file_history)} | |
8 | ${h.submit('diff','diff to revision',class_="ui-btn")} |
|
8 | ${h.submit('diff','diff to revision',class_="ui-btn")} | |
9 | ${h.submit('show_rev','show at revision',class_="ui-btn")} |
|
9 | ${h.submit('show_rev','show at revision',class_="ui-btn")} | |
10 | ${h.end_form()} |
|
10 | ${h.end_form()} | |
11 | </div> |
|
11 | </div> | |
12 | </dd> |
|
12 | </dd> | |
13 | </dl> |
|
13 | </dl> | |
14 |
|
14 | |||
15 | <div id="body" class="codeblock"> |
|
15 | <div id="body" class="codeblock"> | |
16 | <div class="code-header"> |
|
16 | <div class="code-header"> | |
17 | <div class="stats"> |
|
17 | <div class="stats"> | |
18 | <div class="left img"><img src="${h.url('/images/icons/file.png')}"/></div> |
|
18 | <div class="left img"><img src="${h.url('/images/icons/file.png')}"/></div> | |
19 | <div class="left item"><pre>${h.link_to("r%s:%s" % (c.file.changeset.revision,h.short_id(c.file.changeset.raw_id)),h.url('changeset_home',repo_name=c.repo_name,revision=c.file.changeset.raw_id))}</pre></div> |
|
19 | <div class="left item"><pre class="tooltip" title="${c.file.changeset.date}">${h.link_to("r%s:%s" % (c.file.changeset.revision,h.short_id(c.file.changeset.raw_id)),h.url('changeset_home',repo_name=c.repo_name,revision=c.file.changeset.raw_id))}</pre></div> | |
20 | <div class="left item"><pre>${h.format_byte_size(c.file.size,binary=True)}</pre></div> |
|
20 | <div class="left item"><pre>${h.format_byte_size(c.file.size,binary=True)}</pre></div> | |
21 | <div class="left item last"><pre>${c.file.mimetype}</pre></div> |
|
21 | <div class="left item last"><pre>${c.file.mimetype}</pre></div> | |
22 | <div class="buttons"> |
|
22 | <div class="buttons"> | |
23 | %if c.annotate: |
|
23 | %if c.annotate: | |
24 | ${h.link_to(_('show source'), h.url('files_home', repo_name=c.repo_name,revision=c.file.changeset.raw_id,f_path=c.f_path),class_="ui-btn")} |
|
24 | ${h.link_to(_('show source'), h.url('files_home', repo_name=c.repo_name,revision=c.file.changeset.raw_id,f_path=c.f_path),class_="ui-btn")} | |
25 | %else: |
|
25 | %else: | |
26 | ${h.link_to(_('show annotation'),h.url('files_annotate_home',repo_name=c.repo_name,revision=c.file.changeset.raw_id,f_path=c.f_path),class_="ui-btn")} |
|
26 | ${h.link_to(_('show annotation'),h.url('files_annotate_home',repo_name=c.repo_name,revision=c.file.changeset.raw_id,f_path=c.f_path),class_="ui-btn")} | |
27 | %endif |
|
27 | %endif | |
28 | ${h.link_to(_('show as raw'),h.url('files_raw_home',repo_name=c.repo_name,revision=c.file.changeset.raw_id,f_path=c.f_path),class_="ui-btn")} |
|
28 | ${h.link_to(_('show as raw'),h.url('files_raw_home',repo_name=c.repo_name,revision=c.file.changeset.raw_id,f_path=c.f_path),class_="ui-btn")} | |
29 | ${h.link_to(_('download as raw'),h.url('files_rawfile_home',repo_name=c.repo_name,revision=c.file.changeset.raw_id,f_path=c.f_path),class_="ui-btn")} |
|
29 | ${h.link_to(_('download as raw'),h.url('files_rawfile_home',repo_name=c.repo_name,revision=c.file.changeset.raw_id,f_path=c.f_path),class_="ui-btn")} | |
30 | % if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name): |
|
30 | % if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name): | |
31 | % if not c.file.is_binary: |
|
31 | % if not c.file.is_binary: | |
32 | ${h.link_to(_('edit'),h.url('files_edit_home',repo_name=c.repo_name,revision=c.file.changeset.raw_id,f_path=c.f_path),class_="ui-btn")} |
|
32 | ${h.link_to(_('edit'),h.url('files_edit_home',repo_name=c.repo_name,revision=c.file.changeset.raw_id,f_path=c.f_path),class_="ui-btn")} | |
33 | % endif |
|
33 | % endif | |
34 | % endif |
|
34 | % endif | |
35 | </div> |
|
35 | </div> | |
36 | </div> |
|
36 | </div> | |
37 | <div class="author"> |
|
37 | <div class="author"> | |
38 | <div class="gravatar"> |
|
38 | <div class="gravatar"> | |
39 | <img alt="gravatar" src="${h.gravatar_url(h.email(c.file.changeset.author),16)}"/> |
|
39 | <img alt="gravatar" src="${h.gravatar_url(h.email(c.file.changeset.author),16)}"/> | |
40 | </div> |
|
40 | </div> | |
41 | <div title="${c.file.changeset.author}" class="user">${h.person(c.file.changeset.author)}</div> |
|
41 | <div title="${c.file.changeset.author}" class="user">${h.person(c.file.changeset.author)}</div> | |
42 | </div> |
|
42 | </div> | |
43 | <div class="commit">${h.urlify_commit(c.file.changeset.message,c.repo_name)}</div> |
|
43 | <div class="commit">${h.urlify_commit(c.file.changeset.message,c.repo_name)}</div> | |
44 | </div> |
|
44 | </div> | |
45 | <div class="code-body"> |
|
45 | <div class="code-body"> | |
46 | %if c.file.is_binary: |
|
46 | %if c.file.is_binary: | |
47 | ${_('Binary file (%s)') % c.file.mimetype} |
|
47 | ${_('Binary file (%s)') % c.file.mimetype} | |
48 | %else: |
|
48 | %else: | |
49 | % if c.file.size < c.cut_off_limit: |
|
49 | % if c.file.size < c.cut_off_limit: | |
50 | %if c.annotate: |
|
50 | %if c.annotate: | |
51 | ${h.pygmentize_annotation(c.repo_name,c.file,linenos=True,anchorlinenos=True,lineanchors='L',cssclass="code-highlight")} |
|
51 | ${h.pygmentize_annotation(c.repo_name,c.file,linenos=True,anchorlinenos=True,lineanchors='L',cssclass="code-highlight")} | |
52 | %else: |
|
52 | %else: | |
53 | ${h.pygmentize(c.file,linenos=True,anchorlinenos=True,lineanchors='L',cssclass="code-highlight")} |
|
53 | ${h.pygmentize(c.file,linenos=True,anchorlinenos=True,lineanchors='L',cssclass="code-highlight")} | |
54 | %endif |
|
54 | %endif | |
55 | %else: |
|
55 | %else: | |
56 | ${_('File is too big to display')} ${h.link_to(_('show as raw'), |
|
56 | ${_('File is too big to display')} ${h.link_to(_('show as raw'), | |
57 | h.url('files_raw_home',repo_name=c.repo_name,revision=c.file.changeset.raw_id,f_path=c.f_path))} |
|
57 | h.url('files_raw_home',repo_name=c.repo_name,revision=c.file.changeset.raw_id,f_path=c.f_path))} | |
58 | %endif |
|
58 | %endif | |
59 | %endif |
|
59 | %endif | |
60 | </div> |
|
60 | </div> | |
61 | </div> |
|
61 | </div> | |
62 |
|
62 | |||
63 | <script type="text/javascript"> |
|
63 | <script type="text/javascript"> | |
64 | YUE.onDOMReady(function(){ |
|
64 | YUE.onDOMReady(function(){ | |
65 | function highlight_lines(lines){ |
|
65 | function highlight_lines(lines){ | |
66 | for(pos in lines){ |
|
66 | for(pos in lines){ | |
67 | YUD.setStyle('L'+lines[pos],'background-color','#FFFFBE'); |
|
67 | YUD.setStyle('L'+lines[pos],'background-color','#FFFFBE'); | |
68 | } |
|
68 | } | |
69 | } |
|
69 | } | |
70 | page_highlights = location.href.substring(location.href.indexOf('#')+1).split('L'); |
|
70 | page_highlights = location.href.substring(location.href.indexOf('#')+1).split('L'); | |
71 | if (page_highlights.length == 2){ |
|
71 | if (page_highlights.length == 2){ | |
72 | highlight_ranges = page_highlights[1].split(","); |
|
72 | highlight_ranges = page_highlights[1].split(","); | |
73 |
|
73 | |||
74 | var h_lines = []; |
|
74 | var h_lines = []; | |
75 | for (pos in highlight_ranges){ |
|
75 | for (pos in highlight_ranges){ | |
76 | var _range = highlight_ranges[pos].split('-'); |
|
76 | var _range = highlight_ranges[pos].split('-'); | |
77 | if(_range.length == 2){ |
|
77 | if(_range.length == 2){ | |
78 | var start = parseInt(_range[0]); |
|
78 | var start = parseInt(_range[0]); | |
79 | var end = parseInt(_range[1]); |
|
79 | var end = parseInt(_range[1]); | |
80 | if (start < end){ |
|
80 | if (start < end){ | |
81 | for(var i=start;i<=end;i++){ |
|
81 | for(var i=start;i<=end;i++){ | |
82 | h_lines.push(i); |
|
82 | h_lines.push(i); | |
83 | } |
|
83 | } | |
84 | } |
|
84 | } | |
85 | } |
|
85 | } | |
86 | else{ |
|
86 | else{ | |
87 | h_lines.push(parseInt(highlight_ranges[pos])); |
|
87 | h_lines.push(parseInt(highlight_ranges[pos])); | |
88 | } |
|
88 | } | |
89 | } |
|
89 | } | |
90 | highlight_lines(h_lines); |
|
90 | highlight_lines(h_lines); | |
91 |
|
91 | |||
92 | //remember original location |
|
92 | //remember original location | |
93 | var old_hash = location.href.substring(location.href.indexOf('#')); |
|
93 | var old_hash = location.href.substring(location.href.indexOf('#')); | |
94 |
|
94 | |||
95 | // this makes a jump to anchor moved by 3 posstions for padding |
|
95 | // this makes a jump to anchor moved by 3 posstions for padding | |
96 | window.location.hash = '#L'+Math.max(parseInt(h_lines[0])-3,1); |
|
96 | window.location.hash = '#L'+Math.max(parseInt(h_lines[0])-3,1); | |
97 |
|
97 | |||
98 | //sets old anchor |
|
98 | //sets old anchor | |
99 | window.location.hash = old_hash; |
|
99 | window.location.hash = old_hash; | |
100 |
|
100 | |||
101 | } |
|
101 | } | |
102 | YUE.on('show_rev','click',function(e){ |
|
102 | YUE.on('show_rev','click',function(e){ | |
103 | YUE.preventDefault(e); |
|
103 | YUE.preventDefault(e); | |
104 | var cs = YUD.get('diff1').value; |
|
104 | var cs = YUD.get('diff1').value; | |
105 | %if c.annotate: |
|
105 | %if c.annotate: | |
106 | var url = "${h.url('files_annotate_home',repo_name=c.repo_name,revision='__CS__',f_path=c.f_path)}".replace('__CS__',cs); |
|
106 | var url = "${h.url('files_annotate_home',repo_name=c.repo_name,revision='__CS__',f_path=c.f_path)}".replace('__CS__',cs); | |
107 | %else: |
|
107 | %else: | |
108 | var url = "${h.url('files_home',repo_name=c.repo_name,revision='__CS__',f_path=c.f_path)}".replace('__CS__',cs); |
|
108 | var url = "${h.url('files_home',repo_name=c.repo_name,revision='__CS__',f_path=c.f_path)}".replace('__CS__',cs); | |
109 | %endif |
|
109 | %endif | |
110 | window.location = url; |
|
110 | window.location = url; | |
111 | }); |
|
111 | }); | |
112 | YUE.on('hlcode','mouseup',getSelectionLink("${_('Selection link')}")) |
|
112 | YUE.on('hlcode','mouseup',getSelectionLink("${_('Selection link')}")) | |
113 | }); |
|
113 | }); | |
114 | </script> |
|
114 | </script> |
General Comments 0
You need to be logged in to leave comments.
Login now