Show More
@@ -1,136 +1,137 b'' | |||
|
1 | 1 | ## -*- coding: utf-8 -*- |
|
2 | 2 | <!DOCTYPE html> |
|
3 | 3 | |
|
4 | 4 | <% |
|
5 | 5 | c.template_context['repo_name'] = getattr(c, 'repo_name', '') |
|
6 | 6 | |
|
7 | 7 | if hasattr(c, 'rhodecode_db_repo'): |
|
8 | 8 | c.template_context['repo_type'] = c.rhodecode_db_repo.repo_type |
|
9 | 9 | c.template_context['repo_landing_commit'] = c.rhodecode_db_repo.landing_rev[1] |
|
10 | 10 | |
|
11 | 11 | if getattr(c, 'rhodecode_user', None) and c.rhodecode_user.user_id: |
|
12 | 12 | c.template_context['rhodecode_user']['username'] = c.rhodecode_user.username |
|
13 | 13 | c.template_context['rhodecode_user']['email'] = c.rhodecode_user.email |
|
14 | 14 | |
|
15 | 15 | c.template_context['visual']['default_renderer'] = h.get_visual_attr(c, 'default_renderer') |
|
16 | 16 | %> |
|
17 | 17 | |
|
18 | 18 | <html xmlns="http://www.w3.org/1999/xhtml"> |
|
19 | 19 | <head> |
|
20 | 20 | <title>${self.title()}</title> |
|
21 | 21 | <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> |
|
22 | 22 | <%def name="robots()"> |
|
23 | 23 | <meta name="robots" content="index, nofollow"/> |
|
24 | 24 | </%def> |
|
25 | 25 | ${self.robots()} |
|
26 | 26 | <link rel="icon" href="${h.asset('images/favicon.ico', ver=c.rhodecode_version_hash)}" sizes="16x16 32x32" type="image/png" /> |
|
27 | 27 | |
|
28 | 28 | ## CSS definitions |
|
29 | 29 | <%def name="css()"> |
|
30 | 30 | <link rel="stylesheet" type="text/css" href="${h.asset('css/style.css', ver=c.rhodecode_version_hash)}" media="screen"/> |
|
31 | 31 | <!--[if lt IE 9]> |
|
32 | 32 | <link rel="stylesheet" type="text/css" href="${h.asset('css/ie.css', ver=c.rhodecode_version_hash)}" media="screen"/> |
|
33 | 33 | <![endif]--> |
|
34 | 34 | ## EXTRA FOR CSS |
|
35 | 35 | ${self.css_extra()} |
|
36 | 36 | </%def> |
|
37 | 37 | ## CSS EXTRA - optionally inject some extra CSS stuff needed for specific websites |
|
38 | 38 | <%def name="css_extra()"> |
|
39 | 39 | </%def> |
|
40 | 40 | |
|
41 | 41 | ${self.css()} |
|
42 | 42 | |
|
43 | 43 | ## JAVASCRIPT |
|
44 | 44 | <%def name="js()"> |
|
45 | 45 | <script src="${h.asset('js/rhodecode/i18n/%s.js' % c.language, ver=c.rhodecode_version_hash)}"></script> |
|
46 | 46 | <script type="text/javascript"> |
|
47 | 47 | // register templateContext to pass template variables to JS |
|
48 | 48 | var templateContext = ${h.json.dumps(c.template_context)|n}; |
|
49 | 49 | |
|
50 | 50 | var REPO_NAME = "${getattr(c, 'repo_name', '')}"; |
|
51 | 51 | %if hasattr(c, 'rhodecode_db_repo'): |
|
52 | 52 | var REPO_LANDING_REV = '${c.rhodecode_db_repo.landing_rev[1]}'; |
|
53 | 53 | var REPO_TYPE = '${c.rhodecode_db_repo.repo_type}'; |
|
54 | 54 | %else: |
|
55 | 55 | var REPO_LANDING_REV = ''; |
|
56 | 56 | var REPO_TYPE = ''; |
|
57 | 57 | %endif |
|
58 | 58 | var APPLICATION_URL = "${h.url('home').rstrip('/')}"; |
|
59 | 59 | var ASSET_URL = "${h.asset('')}"; |
|
60 | 60 | var DEFAULT_RENDERER = "${h.get_visual_attr(c, 'default_renderer')}"; |
|
61 | 61 | var CSRF_TOKEN = "${getattr(c, 'csrf_token', '')}"; |
|
62 | 62 | % if getattr(c, 'rhodecode_user', None): |
|
63 | 63 | var USER = {name:'${c.rhodecode_user.username}'}; |
|
64 | 64 | % else: |
|
65 | 65 | var USER = {name:null}; |
|
66 | 66 | % endif |
|
67 | 67 | |
|
68 | 68 | var APPENLIGHT = { |
|
69 | 69 | enabled: ${'true' if getattr(c, 'appenlight_enabled', False) else 'false'}, |
|
70 | 70 | key: '${getattr(c, "appenlight_api_public_key", "")}', |
|
71 | 71 | serverUrl: '${getattr(c, "appenlight_server_url", "")}', |
|
72 | 72 | requestInfo: { |
|
73 | 73 | % if getattr(c, 'rhodecode_user', None): |
|
74 | 74 | ip: '${c.rhodecode_user.ip_addr}', |
|
75 | 75 | username: '${c.rhodecode_user.username}' |
|
76 | 76 | % endif |
|
77 | 77 | } |
|
78 | 78 | }; |
|
79 | 79 | </script> |
|
80 | 80 | |
|
81 | 81 | <!--[if lt IE 9]> |
|
82 | 82 | <script language="javascript" type="text/javascript" src="${h.asset('js/excanvas.min.js')}"></script> |
|
83 | 83 | <![endif]--> |
|
84 | 84 | <script language="javascript" type="text/javascript" src="${h.asset('js/rhodecode/routes.js', ver=c.rhodecode_version_hash)}"></script> |
|
85 | 85 | <script language="javascript" type="text/javascript" src="${h.asset('js/scripts.js', ver=c.rhodecode_version_hash)}"></script> |
|
86 | <script>CodeMirror.modeURL = "${h.asset('js/mode/%N/%N.js')}";</script> | |
|
86 | ## avoide esaping the %N | |
|
87 | <script>CodeMirror.modeURL = "${h.asset('') + 'js/mode/%N/%N.js'}";</script> | |
|
87 | 88 | |
|
88 | 89 | ## JAVASCRIPT EXTRA - optionally inject some extra JS for specificed templates |
|
89 | 90 | ${self.js_extra()} |
|
90 | 91 | |
|
91 | 92 | <script type="text/javascript"> |
|
92 | 93 | $(document).ready(function(){ |
|
93 | 94 | show_more_event(); |
|
94 | 95 | timeagoActivate(); |
|
95 | 96 | }) |
|
96 | 97 | </script> |
|
97 | 98 | |
|
98 | 99 | </%def> |
|
99 | 100 | |
|
100 | 101 | ## JAVASCRIPT EXTRA - optionally inject some extra JS for specificed templates |
|
101 | 102 | <%def name="js_extra()"></%def> |
|
102 | 103 | ${self.js()} |
|
103 | 104 | |
|
104 | 105 | <%def name="head_extra()"></%def> |
|
105 | 106 | ${self.head_extra()} |
|
106 | 107 | |
|
107 | 108 | <%include file="/base/plugins_base.html"/> |
|
108 | 109 | |
|
109 | 110 | ## extra stuff |
|
110 | 111 | %if c.pre_code: |
|
111 | 112 | ${c.pre_code|n} |
|
112 | 113 | %endif |
|
113 | 114 | </head> |
|
114 | 115 | <body id="body"> |
|
115 | 116 | <noscript> |
|
116 | 117 | <div class="noscript-error"> |
|
117 | 118 | ${_('Please enable JavaScript to use RhodeCode Enterprise')} |
|
118 | 119 | </div> |
|
119 | 120 | </noscript> |
|
120 | 121 | ## IE hacks |
|
121 | 122 | <!--[if IE 7]> |
|
122 | 123 | <script>$(document.body).addClass('ie7')</script> |
|
123 | 124 | <![endif]--> |
|
124 | 125 | <!--[if IE 8]> |
|
125 | 126 | <script>$(document.body).addClass('ie8')</script> |
|
126 | 127 | <![endif]--> |
|
127 | 128 | <!--[if IE 9]> |
|
128 | 129 | <script>$(document.body).addClass('ie9')</script> |
|
129 | 130 | <![endif]--> |
|
130 | 131 | |
|
131 | 132 | ${next.body()} |
|
132 | 133 | %if c.post_code: |
|
133 | 134 | ${c.post_code|n} |
|
134 | 135 | %endif |
|
135 | 136 | </body> |
|
136 | 137 | </html> |
General Comments 0
You need to be logged in to leave comments.
Login now