annotate rhodecode/templates/files/files_source.html @ 2031:82a88013a3fd

merge 1.3 into stable
author Marcin Kuzminski <marcin@python-works.com>
date Sun, 26 Feb 2012 17:25:09 +0200
parents bf263968da47 14d8cfb96c17
children ecd59c28f432
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
362
558eb7c5028f version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents: 278
diff changeset
1 <dl>
1737
61eda8bf70d0 new files views
Marcin Kuzminski <marcin@python-works.com>
parents: 1699
diff changeset
2 <dt style="padding-top:10px;font-size:16px">${_('History')}</dt>
128
9deb6f1d5b90 Implemented file history.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
3 <dd>
410
9a7ae16ff53e fixes translations, style updates.
Marcin Kuzminski <marcin@python-works.com>
parents: 387
diff changeset
4 <div>
9a7ae16ff53e fixes translations, style updates.
Marcin Kuzminski <marcin@python-works.com>
parents: 387
diff changeset
5 ${h.form(h.url('files_diff_home',repo_name=c.repo_name,f_path=c.f_path),method='get')}
1737
61eda8bf70d0 new files views
Marcin Kuzminski <marcin@python-works.com>
parents: 1699
diff changeset
6 ${h.hidden('diff2',c.file.last_changeset.raw_id)}
61eda8bf70d0 new files views
Marcin Kuzminski <marcin@python-works.com>
parents: 1699
diff changeset
7 ${h.select('diff1',c.file.last_changeset.raw_id,c.file_history)}
1756
Marcin Kuzminski <marcin@python-works.com>
parents: 1737
diff changeset
8 ${h.submit('diff','diff to revision',class_="ui-btn")}
Marcin Kuzminski <marcin@python-works.com>
parents: 1737
diff changeset
9 ${h.submit('show_rev','show at revision',class_="ui-btn")}
128
9deb6f1d5b90 Implemented file history.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
10 ${h.end_form()}
410
9a7ae16ff53e fixes translations, style updates.
Marcin Kuzminski <marcin@python-works.com>
parents: 387
diff changeset
11 </div>
128
9deb6f1d5b90 Implemented file history.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
12 </dd>
1737
61eda8bf70d0 new files views
Marcin Kuzminski <marcin@python-works.com>
parents: 1699
diff changeset
13 </dl>
1888
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1789
diff changeset
14
128
9deb6f1d5b90 Implemented file history.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
15 <div id="body" class="codeblock">
144
ea89ac73bef8 Update css +file browsing and diffs
Marcin Kuzminski <marcin@python-works.com>
parents: 129
diff changeset
16 <div class="code-header">
1737
61eda8bf70d0 new files views
Marcin Kuzminski <marcin@python-works.com>
parents: 1699
diff changeset
17 <div class="stats">
2029
14d8cfb96c17 urlify the commit message in file block + small css fixes
Marcin Kuzminski <marcin@python-works.com>
parents: 1983
diff changeset
18 <div class="left img"><img src="${h.url('/images/icons/file.png')}"/></div>
1888
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1789
diff changeset
19 <div class="left item"><pre>${h.link_to("r%s:%s" % (c.file.last_changeset.revision,h.short_id(c.file.last_changeset.raw_id)),h.url('changeset_home',repo_name=c.repo_name,revision=c.file.last_changeset.raw_id))}</pre></div>
2029
14d8cfb96c17 urlify the commit message in file block + small css fixes
Marcin Kuzminski <marcin@python-works.com>
parents: 1983
diff changeset
20 <div class="left item"><pre>${h.format_byte_size(c.file.size,binary=True)}</pre></div>
14d8cfb96c17 urlify the commit message in file block + small css fixes
Marcin Kuzminski <marcin@python-works.com>
parents: 1983
diff changeset
21 <div class="left item last"><pre>${c.file.mimetype}</pre></div>
1737
61eda8bf70d0 new files views
Marcin Kuzminski <marcin@python-works.com>
parents: 1699
diff changeset
22 <div class="buttons">
1983
8fa8d0d034e6 - added branch to history list for file
Marcin Kuzminski <marcin@python-works.com>
parents: 1888
diff changeset
23 ${h.link_to(_('show annotation'),h.url('files_annotate_home',repo_name=c.repo_name,revision=c.file.last_changeset.raw_id,f_path=c.f_path),class_="ui-btn")}
8fa8d0d034e6 - added branch to history list for file
Marcin Kuzminski <marcin@python-works.com>
parents: 1888
diff changeset
24 ${h.link_to(_('show as raw'),h.url('files_raw_home',repo_name=c.repo_name,revision=c.file.last_changeset.raw_id,f_path=c.f_path),class_="ui-btn")}
8fa8d0d034e6 - added branch to history list for file
Marcin Kuzminski <marcin@python-works.com>
parents: 1888
diff changeset
25 ${h.link_to(_('download as raw'),h.url('files_rawfile_home',repo_name=c.repo_name,revision=c.file.last_changeset.raw_id,f_path=c.f_path),class_="ui-btn")}
1888
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1789
diff changeset
26 % if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name):
1737
61eda8bf70d0 new files views
Marcin Kuzminski <marcin@python-works.com>
parents: 1699
diff changeset
27 % if not c.file.is_binary:
1983
8fa8d0d034e6 - added branch to history list for file
Marcin Kuzminski <marcin@python-works.com>
parents: 1888
diff changeset
28 ${h.link_to(_('edit'),h.url('files_edit_home',repo_name=c.repo_name,revision=c.file.last_changeset.raw_id,f_path=c.f_path),class_="ui-btn")}
1737
61eda8bf70d0 new files views
Marcin Kuzminski <marcin@python-works.com>
parents: 1699
diff changeset
29 % endif
1888
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1789
diff changeset
30 % endif
1737
61eda8bf70d0 new files views
Marcin Kuzminski <marcin@python-works.com>
parents: 1699
diff changeset
31 </div>
61eda8bf70d0 new files views
Marcin Kuzminski <marcin@python-works.com>
parents: 1699
diff changeset
32 </div>
61eda8bf70d0 new files views
Marcin Kuzminski <marcin@python-works.com>
parents: 1699
diff changeset
33 <div class="author">
61eda8bf70d0 new files views
Marcin Kuzminski <marcin@python-works.com>
parents: 1699
diff changeset
34 <div class="gravatar">
1983
8fa8d0d034e6 - added branch to history list for file
Marcin Kuzminski <marcin@python-works.com>
parents: 1888
diff changeset
35 <img alt="gravatar" src="${h.gravatar_url(h.email(c.file.last_changeset.author),16)}"/>
1737
61eda8bf70d0 new files views
Marcin Kuzminski <marcin@python-works.com>
parents: 1699
diff changeset
36 </div>
1983
8fa8d0d034e6 - added branch to history list for file
Marcin Kuzminski <marcin@python-works.com>
parents: 1888
diff changeset
37 <div title="${c.file.last_changeset.author}" class="user">${h.person(c.file.last_changeset.author)}</div>
1737
61eda8bf70d0 new files views
Marcin Kuzminski <marcin@python-works.com>
parents: 1699
diff changeset
38 </div>
2029
14d8cfb96c17 urlify the commit message in file block + small css fixes
Marcin Kuzminski <marcin@python-works.com>
parents: 1983
diff changeset
39 <div class="commit">${h.urlify_commit(c.file.last_changeset.message,c.repo_name)}</div>
144
ea89ac73bef8 Update css +file browsing and diffs
Marcin Kuzminski <marcin@python-works.com>
parents: 129
diff changeset
40 </div>
ea89ac73bef8 Update css +file browsing and diffs
Marcin Kuzminski <marcin@python-works.com>
parents: 129
diff changeset
41 <div class="code-body">
1737
61eda8bf70d0 new files views
Marcin Kuzminski <marcin@python-works.com>
parents: 1699
diff changeset
42 %if c.file.is_binary:
61eda8bf70d0 new files views
Marcin Kuzminski <marcin@python-works.com>
parents: 1699
diff changeset
43 ${_('Binary file (%s)') % c.file.mimetype}
1043
6ec53c16c744 fixed binary file issues
Marcin Kuzminski <marcin@python-works.com>
parents: 1035
diff changeset
44 %else:
1737
61eda8bf70d0 new files views
Marcin Kuzminski <marcin@python-works.com>
parents: 1699
diff changeset
45 % if c.file.size < c.cut_off_limit:
61eda8bf70d0 new files views
Marcin Kuzminski <marcin@python-works.com>
parents: 1699
diff changeset
46 ${h.pygmentize(c.file,linenos=True,anchorlinenos=True,lineanchors='L',cssclass="code-highlight")}
485
9836541b0509 added limit for showing pygemntized source codes larger than 250kb.
Marcin Kuzminski <marcin@python-works.com>
parents: 413
diff changeset
47 %else:
1472
aaec08ad9daf Added pt_BR localization, added i18n wrappers on some places missing, fixed css in settings screen for longer labels.
Augusto Herrmann <augusto.herrmann@planejamento.gov.br>
parents: 1322
diff changeset
48 ${_('File is too big to display')} ${h.link_to(_('show as raw'),
1983
8fa8d0d034e6 - added branch to history list for file
Marcin Kuzminski <marcin@python-works.com>
parents: 1888
diff changeset
49 h.url('files_raw_home',repo_name=c.repo_name,revision=c.file.last_changeset.raw_id,f_path=c.f_path))}
485
9836541b0509 added limit for showing pygemntized source codes larger than 250kb.
Marcin Kuzminski <marcin@python-works.com>
parents: 413
diff changeset
50 %endif
969
6e070138d173 implemented #107 variable lines can be now highlighted
Marcin Kuzminski <marcin@python-works.com>
parents: 965
diff changeset
51 <script type="text/javascript">
6e070138d173 implemented #107 variable lines can be now highlighted
Marcin Kuzminski <marcin@python-works.com>
parents: 965
diff changeset
52 function highlight_lines(lines){
6e070138d173 implemented #107 variable lines can be now highlighted
Marcin Kuzminski <marcin@python-works.com>
parents: 965
diff changeset
53 for(pos in lines){
1888
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1789
diff changeset
54 YUD.setStyle('L'+lines[pos],'background-color','#FFFFBE');
1320
09c3fb460fcb Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents: 1313
diff changeset
55 }
1888
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1789
diff changeset
56 }
969
6e070138d173 implemented #107 variable lines can be now highlighted
Marcin Kuzminski <marcin@python-works.com>
parents: 965
diff changeset
57 page_highlights = location.href.substring(location.href.indexOf('#')+1).split('L');
6e070138d173 implemented #107 variable lines can be now highlighted
Marcin Kuzminski <marcin@python-works.com>
parents: 965
diff changeset
58 if (page_highlights.length == 2){
6e070138d173 implemented #107 variable lines can be now highlighted
Marcin Kuzminski <marcin@python-works.com>
parents: 965
diff changeset
59 highlight_ranges = page_highlights[1].split(",");
6e070138d173 implemented #107 variable lines can be now highlighted
Marcin Kuzminski <marcin@python-works.com>
parents: 965
diff changeset
60
6e070138d173 implemented #107 variable lines can be now highlighted
Marcin Kuzminski <marcin@python-works.com>
parents: 965
diff changeset
61 var h_lines = [];
6e070138d173 implemented #107 variable lines can be now highlighted
Marcin Kuzminski <marcin@python-works.com>
parents: 965
diff changeset
62 for (pos in highlight_ranges){
6e070138d173 implemented #107 variable lines can be now highlighted
Marcin Kuzminski <marcin@python-works.com>
parents: 965
diff changeset
63 var _range = highlight_ranges[pos].split('-');
6e070138d173 implemented #107 variable lines can be now highlighted
Marcin Kuzminski <marcin@python-works.com>
parents: 965
diff changeset
64 if(_range.length == 2){
6e070138d173 implemented #107 variable lines can be now highlighted
Marcin Kuzminski <marcin@python-works.com>
parents: 965
diff changeset
65 var start = parseInt(_range[0]);
6e070138d173 implemented #107 variable lines can be now highlighted
Marcin Kuzminski <marcin@python-works.com>
parents: 965
diff changeset
66 var end = parseInt(_range[1]);
6e070138d173 implemented #107 variable lines can be now highlighted
Marcin Kuzminski <marcin@python-works.com>
parents: 965
diff changeset
67 if (start < end){
6e070138d173 implemented #107 variable lines can be now highlighted
Marcin Kuzminski <marcin@python-works.com>
parents: 965
diff changeset
68 for(var i=start;i<=end;i++){
6e070138d173 implemented #107 variable lines can be now highlighted
Marcin Kuzminski <marcin@python-works.com>
parents: 965
diff changeset
69 h_lines.push(i);
6e070138d173 implemented #107 variable lines can be now highlighted
Marcin Kuzminski <marcin@python-works.com>
parents: 965
diff changeset
70 }
1888
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1789
diff changeset
71 }
969
6e070138d173 implemented #107 variable lines can be now highlighted
Marcin Kuzminski <marcin@python-works.com>
parents: 965
diff changeset
72 }
6e070138d173 implemented #107 variable lines can be now highlighted
Marcin Kuzminski <marcin@python-works.com>
parents: 965
diff changeset
73 else{
6e070138d173 implemented #107 variable lines can be now highlighted
Marcin Kuzminski <marcin@python-works.com>
parents: 965
diff changeset
74 h_lines.push(parseInt(highlight_ranges[pos]));
6e070138d173 implemented #107 variable lines can be now highlighted
Marcin Kuzminski <marcin@python-works.com>
parents: 965
diff changeset
75 }
6e070138d173 implemented #107 variable lines can be now highlighted
Marcin Kuzminski <marcin@python-works.com>
parents: 965
diff changeset
76 }
1320
09c3fb460fcb Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents: 1313
diff changeset
77 highlight_lines(h_lines);
1888
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1789
diff changeset
78
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1789
diff changeset
79 //remember original location
1320
09c3fb460fcb Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents: 1313
diff changeset
80 var old_hash = location.href.substring(location.href.indexOf('#'));
1888
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1789
diff changeset
81
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1789
diff changeset
82 // this makes a jump to anchor moved by 3 posstions for padding
1320
09c3fb460fcb Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents: 1313
diff changeset
83 window.location.hash = '#L'+Math.max(parseInt(h_lines[0])-3,1);
1888
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1789
diff changeset
84
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1789
diff changeset
85 //sets old anchor
1320
09c3fb460fcb Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents: 1313
diff changeset
86 window.location.hash = old_hash;
1888
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1789
diff changeset
87
969
6e070138d173 implemented #107 variable lines can be now highlighted
Marcin Kuzminski <marcin@python-works.com>
parents: 965
diff changeset
88 }
1043
6ec53c16c744 fixed binary file issues
Marcin Kuzminski <marcin@python-works.com>
parents: 1035
diff changeset
89 </script>
1888
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1789
diff changeset
90 %endif
144
ea89ac73bef8 Update css +file browsing and diffs
Marcin Kuzminski <marcin@python-works.com>
parents: 129
diff changeset
91 </div>
413
0ebec9b88d13 added jump to revision from file history.
Marcin Kuzminski <marcin@python-works.com>
parents: 410
diff changeset
92 </div>
0ebec9b88d13 added jump to revision from file history.
Marcin Kuzminski <marcin@python-works.com>
parents: 410
diff changeset
93
0ebec9b88d13 added jump to revision from file history.
Marcin Kuzminski <marcin@python-works.com>
parents: 410
diff changeset
94 <script type="text/javascript">
1320
09c3fb460fcb Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents: 1313
diff changeset
95 YUE.onDOMReady(function(){
09c3fb460fcb Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents: 1313
diff changeset
96 YUE.on('show_rev','click',function(e){
09c3fb460fcb Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents: 1313
diff changeset
97 YUE.preventDefault(e);
1699
623b228cf325 cleaned up JS files in files templates.
Marcin Kuzminski <marcin@python-works.com>
parents: 1472
diff changeset
98 var cs = YUD.get('diff1').value;
413
0ebec9b88d13 added jump to revision from file history.
Marcin Kuzminski <marcin@python-works.com>
parents: 410
diff changeset
99 var url = "${h.url('files_home',repo_name=c.repo_name,revision='__CS__',f_path=c.f_path)}".replace('__CS__',cs);
0ebec9b88d13 added jump to revision from file history.
Marcin Kuzminski <marcin@python-works.com>
parents: 410
diff changeset
100 window.location = url;
1320
09c3fb460fcb Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents: 1313
diff changeset
101 });
1699
623b228cf325 cleaned up JS files in files templates.
Marcin Kuzminski <marcin@python-works.com>
parents: 1472
diff changeset
102 YUE.on('hlcode','mouseup',getSelectionLink("${_('Selection link')}"))
413
0ebec9b88d13 added jump to revision from file history.
Marcin Kuzminski <marcin@python-works.com>
parents: 410
diff changeset
103 });
1472
aaec08ad9daf Added pt_BR localization, added i18n wrappers on some places missing, fixed css in settings screen for longer labels.
Augusto Herrmann <augusto.herrmann@planejamento.gov.br>
parents: 1322
diff changeset
104 </script>