##// END OF EJS Templates
root template: got rid of shared styles
ergo -
r763:dcfdd6aa default
parent child Browse files
Show More
@@ -1,178 +1,177 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 c.template_context['rhodecode_user']['notification_status'] = c.rhodecode_user.get_instance().user_data.get('notification_status', True)
15 15
16 16 c.template_context['visual']['default_renderer'] = h.get_visual_attr(c, 'default_renderer')
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>
46 46 // setup Polymer options
47 47 window.Polymer = {lazyRegister: true, dom: 'shadow'};
48 48
49 49 // Load webcomponentsjs polyfill if browser does not support native Web Components
50 50 (function() {
51 51 'use strict';
52 52 var onload = function() {
53 53 // For native Imports, manually fire WebComponentsReady so user code
54 54 // can use the same code path for native and polyfill'd imports.
55 55 if (!window.HTMLImports) {
56 56 document.dispatchEvent(
57 57 new CustomEvent('WebComponentsReady', {bubbles: true})
58 58 );
59 59 }
60 60 };
61 61 var webComponentsSupported = (
62 62 'registerElement' in document
63 63 && 'import' in document.createElement('link')
64 64 && 'content' in document.createElement('template')
65 65 );
66 66 if (!webComponentsSupported) {
67 67 var e = document.createElement('script');
68 68 e.async = true;
69 69 e.src = '${h.asset('js/vendors/webcomponentsjs/webcomponents-lite.min.js', ver=c.rhodecode_version_hash)}';
70 70 document.head.appendChild(e);
71 71 } else {
72 72 onload();
73 73 }
74 74 })();
75 75 </script>
76 76
77 77 <script src="${h.asset('js/rhodecode/i18n/%s.js' % c.language, ver=c.rhodecode_version_hash)}"></script>
78 78 <script type="text/javascript">
79 79 // register templateContext to pass template variables to JS
80 80 var templateContext = ${h.json.dumps(c.template_context)|n};
81 81
82 82 var REPO_NAME = "${getattr(c, 'repo_name', '')}";
83 83 %if hasattr(c, 'rhodecode_db_repo'):
84 84 var REPO_LANDING_REV = '${c.rhodecode_db_repo.landing_rev[1]}';
85 85 var REPO_TYPE = '${c.rhodecode_db_repo.repo_type}';
86 86 %else:
87 87 var REPO_LANDING_REV = '';
88 88 var REPO_TYPE = '';
89 89 %endif
90 90 var APPLICATION_URL = "${h.url('home').rstrip('/')}";
91 91 var ASSET_URL = "${h.asset('')}";
92 92 var DEFAULT_RENDERER = "${h.get_visual_attr(c, 'default_renderer')}";
93 93 var CSRF_TOKEN = "${getattr(c, 'csrf_token', '')}";
94 94 % if getattr(c, 'rhodecode_user', None):
95 95 var USER = {name:'${c.rhodecode_user.username}'};
96 96 % else:
97 97 var USER = {name:null};
98 98 % endif
99 99
100 100 var APPENLIGHT = {
101 101 enabled: ${'true' if getattr(c, 'appenlight_enabled', False) else 'false'},
102 102 key: '${getattr(c, "appenlight_api_public_key", "")}',
103 103 % if getattr(c, 'appenlight_server_url', None):
104 104 serverUrl: '${getattr(c, "appenlight_server_url", "")}',
105 105 % endif
106 106 requestInfo: {
107 107 % if getattr(c, 'rhodecode_user', None):
108 108 ip: '${c.rhodecode_user.ip_addr}',
109 109 username: '${c.rhodecode_user.username}'
110 110 % endif
111 111 }
112 112 };
113 113 </script>
114 114 <!--[if lt IE 9]>
115 115 <script language="javascript" type="text/javascript" src="${h.asset('js/excanvas.min.js')}"></script>
116 116 <![endif]-->
117 117 <script language="javascript" type="text/javascript" src="${h.asset('js/rhodecode/routes.js', ver=c.rhodecode_version_hash)}"></script>
118 118 <script language="javascript" type="text/javascript" src="${h.asset('js/scripts.js', ver=c.rhodecode_version_hash)}"></script>
119 119 <script>
120 120 var e = document.createElement('script');
121 121 e.src = '${h.asset('js/rhodecode-components.js', ver=c.rhodecode_version_hash)}';
122 122 document.head.appendChild(e);
123 123 </script>
124 124 <link rel="import" href="${h.asset('js/rhodecode-components.html', ver=c.rhodecode_version_hash)}">
125 <style include="shared-styles" is="custom-style"></style>
126 125 ## avoide escaping the %N
127 126 <script>CodeMirror.modeURL = "${h.asset('') + 'js/mode/%N/%N.js?ver='+c.rhodecode_version_hash}";</script>
128 127
129 128
130 129 ## JAVASCRIPT EXTRA - optionally inject some extra JS for specificed templates
131 130 ${self.js_extra()}
132 131
133 132 <script type="text/javascript">
134 133 $(document).ready(function(){
135 134 show_more_event();
136 135 timeagoActivate();
137 136 })
138 137 </script>
139 138
140 139 </%def>
141 140
142 141 ## JAVASCRIPT EXTRA - optionally inject some extra JS for specificed templates
143 142 <%def name="js_extra()"></%def>
144 143 ${self.js()}
145 144
146 145 <%def name="head_extra()"></%def>
147 146 ${self.head_extra()}
148 147 <%include file="/base/plugins_base.html"/>
149 148
150 149 ## extra stuff
151 150 %if c.pre_code:
152 151 ${c.pre_code|n}
153 152 %endif
154 153 </head>
155 154 <body id="body">
156 155 <noscript>
157 156 <div class="noscript-error">
158 157 ${_('Please enable JavaScript to use RhodeCode Enterprise')}
159 158 </div>
160 159 </noscript>
161 160 ## IE hacks
162 161 <!--[if IE 7]>
163 162 <script>$(document.body).addClass('ie7')</script>
164 163 <![endif]-->
165 164 <!--[if IE 8]>
166 165 <script>$(document.body).addClass('ie8')</script>
167 166 <![endif]-->
168 167 <!--[if IE 9]>
169 168 <script>$(document.body).addClass('ie9')</script>
170 169 <![endif]-->
171 170
172 171 ${next.body()}
173 172 %if c.post_code:
174 173 ${c.post_code|n}
175 174 %endif
176 175 <rhodecode-toast id="notifications"></rhodecode-toast>
177 176 </body>
178 177 </html>
General Comments 0
You need to be logged in to leave comments. Login now