[f79788]: / Allura / allura / templates / repo / file.html  Maximize  Restore  History

Download this file

100 lines (92 with data), 4.0 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
{#-
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-#}
{% extends 'allura:templates/repo/repo_master.html' %}
{% import 'allura:templates/jinja_master/lib.html' as lib with context %}
{% do g.register_forge_css('css/forge/hilite.css') %}
{% block title %}
{{c.project.name}} / {{c.app.config.options.mount_label}} /
{{blob.commit.shorthand_id()}}
{{h.really_unicode(blob.path())}}
{% endblock %}
{% block header %}
<a href="{{blob.commit.url()}}" rel="nofollow">{{blob.commit.shorthand_id()}}</a>:
{{lib.path_links(blob.path().split('/')[1:-1])}} {{h.really_unicode(blob.name)}}
{% endblock %}
{% block actions %}
{{ lib.maximize_content_button() }}
{{ g.icons['history'].render(href='%slog/?path=%s' % (blob.commit.url(), blob.path()), show_title=True, rel='nofollow') }}
{% endblock %}
{% block extra_js %}
{{ super() }}
<script type="text/javascript">(function() {
$(window).on('hashchange', function(e) {
var hash = window.location.hash.substring(1);
if ('originalEvent' in e && 'oldURL' in e.originalEvent) {
$('#' + e.originalEvent.oldURL.split('#')[1]).css('background-color', 'transparent');
}
if (hash !== '' && hash.substring(0, 1) === 'l' && !isNaN(hash.substring(1))) {
$('#' + hash).css('background-color', '#ffff99');
}
}).trigger('hashchange');
var clicks = 0;
$('.code_block').each(function(index, element) {
$(element).on('click', function() {
// Trick to ignore double and triple clicks
clicks++;
if (clicks === 1) {
setTimeout(function() {
if (clicks === 1) {
var hash = window.location.hash.substring(1);
if (hash !== '' && hash.substring(0, 1) === 'l' && !isNaN(hash.substring(1))) {
$('#' + hash).css('background-color', 'transparent');
}
$(element).css('background-color', '#ffff99');
window.history.pushState({}, document.title, window.location.pathname + window.location.search + '#' + $(element).attr('id'));
}
clicks = 0;
}, 500);
}
});
});
}());
</script>
{% endblock %}
{% block content %}
{% if large_size %}
<p><em>File is {{ large_size|filesizeformat}}. Too large to display.</em></p>
<p><a rel="nofollow" href="?format=raw">Download this file</a></p>
{% elif blob.has_image_view %}
<p><a rel="nofollow" href="?format=raw">Download this file</a></p>
<img src="?format=raw" alt=""/>
{% elif blob.has_html_view or blob.has_pypeline_view or force_display %}
<p><a rel="nofollow" href="?format=raw">Download this file</a></p>
<div class="clip grid-19 codebrowser">
<h3>
{{ stats.line_count }} lines ({{ stats.data_line_count }} with data), {{ stats.code_size|filesizeformat }}
</h3>
{% if blob.has_pypeline_view %}
{{h.render_any_markup(blob.name, blob.text, code_mode=True)}}
{% else %}
{{g.highlight(blob.text, filename=blob.name)}}
{% endif %}
</div>
{% else %}
<p>{{h.really_unicode(blob.name)}} is not known to be viewable in your browser.
Try to <a rel="nofollow" href="?force=True">display it</a> anyway or
<a rel="nofollow" href="?format=raw">download it</a> instead.</p>
{% endif %}
{% endblock %}