##// 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 ## -*- coding: utf-8 -*-
1 ## -*- coding: utf-8 -*-
2 <!DOCTYPE html>
2 <!DOCTYPE html>
3
3
4 <%
4 <%
5 c.template_context['repo_name'] = getattr(c, 'repo_name', '')
5 c.template_context['repo_name'] = getattr(c, 'repo_name', '')
6
6
7 if hasattr(c, 'rhodecode_db_repo'):
7 if hasattr(c, 'rhodecode_db_repo'):
8 c.template_context['repo_type'] = c.rhodecode_db_repo.repo_type
8 c.template_context['repo_type'] = c.rhodecode_db_repo.repo_type
9 c.template_context['repo_landing_commit'] = c.rhodecode_db_repo.landing_rev[1]
9 c.template_context['repo_landing_commit'] = c.rhodecode_db_repo.landing_rev[1]
10
10
11 if getattr(c, 'rhodecode_user', None) and c.rhodecode_user.user_id:
11 if getattr(c, 'rhodecode_user', None) and c.rhodecode_user.user_id:
12 c.template_context['rhodecode_user']['username'] = c.rhodecode_user.username
12 c.template_context['rhodecode_user']['username'] = c.rhodecode_user.username
13 c.template_context['rhodecode_user']['email'] = c.rhodecode_user.email
13 c.template_context['rhodecode_user']['email'] = c.rhodecode_user.email
14 c.template_context['rhodecode_user']['notification_status'] = c.rhodecode_user.get_instance().user_data.get('notification_status', True)
14 c.template_context['rhodecode_user']['notification_status'] = c.rhodecode_user.get_instance().user_data.get('notification_status', True)
15
15
16 c.template_context['visual']['default_renderer'] = h.get_visual_attr(c, 'default_renderer')
16 c.template_context['visual']['default_renderer'] = h.get_visual_attr(c, 'default_renderer')
17 %>
17 %>
18 <html xmlns="http://www.w3.org/1999/xhtml">
18 <html xmlns="http://www.w3.org/1999/xhtml">
19 <head>
19 <head>
20 <title>${self.title()}</title>
20 <title>${self.title()}</title>
21 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
21 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
22 <%def name="robots()">
22 <%def name="robots()">
23 <meta name="robots" content="index, nofollow"/>
23 <meta name="robots" content="index, nofollow"/>
24 </%def>
24 </%def>
25 ${self.robots()}
25 ${self.robots()}
26 <link rel="icon" href="${h.asset('images/favicon.ico', ver=c.rhodecode_version_hash)}" sizes="16x16 32x32" type="image/png" />
26 <link rel="icon" href="${h.asset('images/favicon.ico', ver=c.rhodecode_version_hash)}" sizes="16x16 32x32" type="image/png" />
27
27
28 ## CSS definitions
28 ## CSS definitions
29 <%def name="css()">
29 <%def name="css()">
30 <link rel="stylesheet" type="text/css" href="${h.asset('css/style.css', ver=c.rhodecode_version_hash)}" media="screen"/>
30 <link rel="stylesheet" type="text/css" href="${h.asset('css/style.css', ver=c.rhodecode_version_hash)}" media="screen"/>
31 <!--[if lt IE 9]>
31 <!--[if lt IE 9]>
32 <link rel="stylesheet" type="text/css" href="${h.asset('css/ie.css', ver=c.rhodecode_version_hash)}" media="screen"/>
32 <link rel="stylesheet" type="text/css" href="${h.asset('css/ie.css', ver=c.rhodecode_version_hash)}" media="screen"/>
33 <![endif]-->
33 <![endif]-->
34 ## EXTRA FOR CSS
34 ## EXTRA FOR CSS
35 ${self.css_extra()}
35 ${self.css_extra()}
36 </%def>
36 </%def>
37 ## CSS EXTRA - optionally inject some extra CSS stuff needed for specific websites
37 ## CSS EXTRA - optionally inject some extra CSS stuff needed for specific websites
38 <%def name="css_extra()">
38 <%def name="css_extra()">
39 </%def>
39 </%def>
40
40
41 ${self.css()}
41 ${self.css()}
42
42
43 ## JAVASCRIPT
43 ## JAVASCRIPT
44 <%def name="js()">
44 <%def name="js()">
45 <script>
45 <script>
46 // setup Polymer options
46 // setup Polymer options
47 window.Polymer = {lazyRegister: true, dom: 'shadow'};
47 window.Polymer = {lazyRegister: true, dom: 'shadow'};
48
48
49 // Load webcomponentsjs polyfill if browser does not support native Web Components
49 // Load webcomponentsjs polyfill if browser does not support native Web Components
50 (function() {
50 (function() {
51 'use strict';
51 'use strict';
52 var onload = function() {
52 var onload = function() {
53 // For native Imports, manually fire WebComponentsReady so user code
53 // For native Imports, manually fire WebComponentsReady so user code
54 // can use the same code path for native and polyfill'd imports.
54 // can use the same code path for native and polyfill'd imports.
55 if (!window.HTMLImports) {
55 if (!window.HTMLImports) {
56 document.dispatchEvent(
56 document.dispatchEvent(
57 new CustomEvent('WebComponentsReady', {bubbles: true})
57 new CustomEvent('WebComponentsReady', {bubbles: true})
58 );
58 );
59 }
59 }
60 };
60 };
61 var webComponentsSupported = (
61 var webComponentsSupported = (
62 'registerElement' in document
62 'registerElement' in document
63 && 'import' in document.createElement('link')
63 && 'import' in document.createElement('link')
64 && 'content' in document.createElement('template')
64 && 'content' in document.createElement('template')
65 );
65 );
66 if (!webComponentsSupported) {
66 if (!webComponentsSupported) {
67 var e = document.createElement('script');
67 var e = document.createElement('script');
68 e.async = true;
68 e.async = true;
69 e.src = '${h.asset('js/vendors/webcomponentsjs/webcomponents-lite.min.js', ver=c.rhodecode_version_hash)}';
69 e.src = '${h.asset('js/vendors/webcomponentsjs/webcomponents-lite.min.js', ver=c.rhodecode_version_hash)}';
70 document.head.appendChild(e);
70 document.head.appendChild(e);
71 } else {
71 } else {
72 onload();
72 onload();
73 }
73 }
74 })();
74 })();
75 </script>
75 </script>
76
76
77 <script src="${h.asset('js/rhodecode/i18n/%s.js' % c.language, ver=c.rhodecode_version_hash)}"></script>
77 <script src="${h.asset('js/rhodecode/i18n/%s.js' % c.language, ver=c.rhodecode_version_hash)}"></script>
78 <script type="text/javascript">
78 <script type="text/javascript">
79 // register templateContext to pass template variables to JS
79 // register templateContext to pass template variables to JS
80 var templateContext = ${h.json.dumps(c.template_context)|n};
80 var templateContext = ${h.json.dumps(c.template_context)|n};
81
81
82 var REPO_NAME = "${getattr(c, 'repo_name', '')}";
82 var REPO_NAME = "${getattr(c, 'repo_name', '')}";
83 %if hasattr(c, 'rhodecode_db_repo'):
83 %if hasattr(c, 'rhodecode_db_repo'):
84 var REPO_LANDING_REV = '${c.rhodecode_db_repo.landing_rev[1]}';
84 var REPO_LANDING_REV = '${c.rhodecode_db_repo.landing_rev[1]}';
85 var REPO_TYPE = '${c.rhodecode_db_repo.repo_type}';
85 var REPO_TYPE = '${c.rhodecode_db_repo.repo_type}';
86 %else:
86 %else:
87 var REPO_LANDING_REV = '';
87 var REPO_LANDING_REV = '';
88 var REPO_TYPE = '';
88 var REPO_TYPE = '';
89 %endif
89 %endif
90 var APPLICATION_URL = "${h.url('home').rstrip('/')}";
90 var APPLICATION_URL = "${h.url('home').rstrip('/')}";
91 var ASSET_URL = "${h.asset('')}";
91 var ASSET_URL = "${h.asset('')}";
92 var DEFAULT_RENDERER = "${h.get_visual_attr(c, 'default_renderer')}";
92 var DEFAULT_RENDERER = "${h.get_visual_attr(c, 'default_renderer')}";
93 var CSRF_TOKEN = "${getattr(c, 'csrf_token', '')}";
93 var CSRF_TOKEN = "${getattr(c, 'csrf_token', '')}";
94 % if getattr(c, 'rhodecode_user', None):
94 % if getattr(c, 'rhodecode_user', None):
95 var USER = {name:'${c.rhodecode_user.username}'};
95 var USER = {name:'${c.rhodecode_user.username}'};
96 % else:
96 % else:
97 var USER = {name:null};
97 var USER = {name:null};
98 % endif
98 % endif
99
99
100 var APPENLIGHT = {
100 var APPENLIGHT = {
101 enabled: ${'true' if getattr(c, 'appenlight_enabled', False) else 'false'},
101 enabled: ${'true' if getattr(c, 'appenlight_enabled', False) else 'false'},
102 key: '${getattr(c, "appenlight_api_public_key", "")}',
102 key: '${getattr(c, "appenlight_api_public_key", "")}',
103 % if getattr(c, 'appenlight_server_url', None):
103 % if getattr(c, 'appenlight_server_url', None):
104 serverUrl: '${getattr(c, "appenlight_server_url", "")}',
104 serverUrl: '${getattr(c, "appenlight_server_url", "")}',
105 % endif
105 % endif
106 requestInfo: {
106 requestInfo: {
107 % if getattr(c, 'rhodecode_user', None):
107 % if getattr(c, 'rhodecode_user', None):
108 ip: '${c.rhodecode_user.ip_addr}',
108 ip: '${c.rhodecode_user.ip_addr}',
109 username: '${c.rhodecode_user.username}'
109 username: '${c.rhodecode_user.username}'
110 % endif
110 % endif
111 }
111 }
112 };
112 };
113 </script>
113 </script>
114 <!--[if lt IE 9]>
114 <!--[if lt IE 9]>
115 <script language="javascript" type="text/javascript" src="${h.asset('js/excanvas.min.js')}"></script>
115 <script language="javascript" type="text/javascript" src="${h.asset('js/excanvas.min.js')}"></script>
116 <![endif]-->
116 <![endif]-->
117 <script language="javascript" type="text/javascript" src="${h.asset('js/rhodecode/routes.js', ver=c.rhodecode_version_hash)}"></script>
117 <script language="javascript" type="text/javascript" src="${h.asset('js/rhodecode/routes.js', ver=c.rhodecode_version_hash)}"></script>
118 <script language="javascript" type="text/javascript" src="${h.asset('js/scripts.js', ver=c.rhodecode_version_hash)}"></script>
118 <script language="javascript" type="text/javascript" src="${h.asset('js/scripts.js', ver=c.rhodecode_version_hash)}"></script>
119 <script>
119 <script>
120 var e = document.createElement('script');
120 var e = document.createElement('script');
121 e.src = '${h.asset('js/rhodecode-components.js', ver=c.rhodecode_version_hash)}';
121 e.src = '${h.asset('js/rhodecode-components.js', ver=c.rhodecode_version_hash)}';
122 document.head.appendChild(e);
122 document.head.appendChild(e);
123 </script>
123 </script>
124 <link rel="import" href="${h.asset('js/rhodecode-components.html', ver=c.rhodecode_version_hash)}">
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 ## avoide escaping the %N
125 ## avoide escaping the %N
127 <script>CodeMirror.modeURL = "${h.asset('') + 'js/mode/%N/%N.js?ver='+c.rhodecode_version_hash}";</script>
126 <script>CodeMirror.modeURL = "${h.asset('') + 'js/mode/%N/%N.js?ver='+c.rhodecode_version_hash}";</script>
128
127
129
128
130 ## JAVASCRIPT EXTRA - optionally inject some extra JS for specificed templates
129 ## JAVASCRIPT EXTRA - optionally inject some extra JS for specificed templates
131 ${self.js_extra()}
130 ${self.js_extra()}
132
131
133 <script type="text/javascript">
132 <script type="text/javascript">
134 $(document).ready(function(){
133 $(document).ready(function(){
135 show_more_event();
134 show_more_event();
136 timeagoActivate();
135 timeagoActivate();
137 })
136 })
138 </script>
137 </script>
139
138
140 </%def>
139 </%def>
141
140
142 ## JAVASCRIPT EXTRA - optionally inject some extra JS for specificed templates
141 ## JAVASCRIPT EXTRA - optionally inject some extra JS for specificed templates
143 <%def name="js_extra()"></%def>
142 <%def name="js_extra()"></%def>
144 ${self.js()}
143 ${self.js()}
145
144
146 <%def name="head_extra()"></%def>
145 <%def name="head_extra()"></%def>
147 ${self.head_extra()}
146 ${self.head_extra()}
148 <%include file="/base/plugins_base.html"/>
147 <%include file="/base/plugins_base.html"/>
149
148
150 ## extra stuff
149 ## extra stuff
151 %if c.pre_code:
150 %if c.pre_code:
152 ${c.pre_code|n}
151 ${c.pre_code|n}
153 %endif
152 %endif
154 </head>
153 </head>
155 <body id="body">
154 <body id="body">
156 <noscript>
155 <noscript>
157 <div class="noscript-error">
156 <div class="noscript-error">
158 ${_('Please enable JavaScript to use RhodeCode Enterprise')}
157 ${_('Please enable JavaScript to use RhodeCode Enterprise')}
159 </div>
158 </div>
160 </noscript>
159 </noscript>
161 ## IE hacks
160 ## IE hacks
162 <!--[if IE 7]>
161 <!--[if IE 7]>
163 <script>$(document.body).addClass('ie7')</script>
162 <script>$(document.body).addClass('ie7')</script>
164 <![endif]-->
163 <![endif]-->
165 <!--[if IE 8]>
164 <!--[if IE 8]>
166 <script>$(document.body).addClass('ie8')</script>
165 <script>$(document.body).addClass('ie8')</script>
167 <![endif]-->
166 <![endif]-->
168 <!--[if IE 9]>
167 <!--[if IE 9]>
169 <script>$(document.body).addClass('ie9')</script>
168 <script>$(document.body).addClass('ie9')</script>
170 <![endif]-->
169 <![endif]-->
171
170
172 ${next.body()}
171 ${next.body()}
173 %if c.post_code:
172 %if c.post_code:
174 ${c.post_code|n}
173 ${c.post_code|n}
175 %endif
174 %endif
176 <rhodecode-toast id="notifications"></rhodecode-toast>
175 <rhodecode-toast id="notifications"></rhodecode-toast>
177 </body>
176 </body>
178 </html>
177 </html>
General Comments 0
You need to be logged in to leave comments. Login now