##// END OF EJS Templates
routing: avoide espacing the %N in special route for CodeMirror
marcink -
r469:a8c08e03 default
parent child Browse files
Show More
@@ -1,136 +1,137 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
14
15 c.template_context['visual']['default_renderer'] = h.get_visual_attr(c, 'default_renderer')
15 c.template_context['visual']['default_renderer'] = h.get_visual_attr(c, 'default_renderer')
16 %>
16 %>
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 src="${h.asset('js/rhodecode/i18n/%s.js' % c.language, ver=c.rhodecode_version_hash)}"></script>
45 <script src="${h.asset('js/rhodecode/i18n/%s.js' % c.language, ver=c.rhodecode_version_hash)}"></script>
46 <script type="text/javascript">
46 <script type="text/javascript">
47 // register templateContext to pass template variables to JS
47 // register templateContext to pass template variables to JS
48 var templateContext = ${h.json.dumps(c.template_context)|n};
48 var templateContext = ${h.json.dumps(c.template_context)|n};
49
49
50 var REPO_NAME = "${getattr(c, 'repo_name', '')}";
50 var REPO_NAME = "${getattr(c, 'repo_name', '')}";
51 %if hasattr(c, 'rhodecode_db_repo'):
51 %if hasattr(c, 'rhodecode_db_repo'):
52 var REPO_LANDING_REV = '${c.rhodecode_db_repo.landing_rev[1]}';
52 var REPO_LANDING_REV = '${c.rhodecode_db_repo.landing_rev[1]}';
53 var REPO_TYPE = '${c.rhodecode_db_repo.repo_type}';
53 var REPO_TYPE = '${c.rhodecode_db_repo.repo_type}';
54 %else:
54 %else:
55 var REPO_LANDING_REV = '';
55 var REPO_LANDING_REV = '';
56 var REPO_TYPE = '';
56 var REPO_TYPE = '';
57 %endif
57 %endif
58 var APPLICATION_URL = "${h.url('home').rstrip('/')}";
58 var APPLICATION_URL = "${h.url('home').rstrip('/')}";
59 var ASSET_URL = "${h.asset('')}";
59 var ASSET_URL = "${h.asset('')}";
60 var DEFAULT_RENDERER = "${h.get_visual_attr(c, 'default_renderer')}";
60 var DEFAULT_RENDERER = "${h.get_visual_attr(c, 'default_renderer')}";
61 var CSRF_TOKEN = "${getattr(c, 'csrf_token', '')}";
61 var CSRF_TOKEN = "${getattr(c, 'csrf_token', '')}";
62 % if getattr(c, 'rhodecode_user', None):
62 % if getattr(c, 'rhodecode_user', None):
63 var USER = {name:'${c.rhodecode_user.username}'};
63 var USER = {name:'${c.rhodecode_user.username}'};
64 % else:
64 % else:
65 var USER = {name:null};
65 var USER = {name:null};
66 % endif
66 % endif
67
67
68 var APPENLIGHT = {
68 var APPENLIGHT = {
69 enabled: ${'true' if getattr(c, 'appenlight_enabled', False) else 'false'},
69 enabled: ${'true' if getattr(c, 'appenlight_enabled', False) else 'false'},
70 key: '${getattr(c, "appenlight_api_public_key", "")}',
70 key: '${getattr(c, "appenlight_api_public_key", "")}',
71 serverUrl: '${getattr(c, "appenlight_server_url", "")}',
71 serverUrl: '${getattr(c, "appenlight_server_url", "")}',
72 requestInfo: {
72 requestInfo: {
73 % if getattr(c, 'rhodecode_user', None):
73 % if getattr(c, 'rhodecode_user', None):
74 ip: '${c.rhodecode_user.ip_addr}',
74 ip: '${c.rhodecode_user.ip_addr}',
75 username: '${c.rhodecode_user.username}'
75 username: '${c.rhodecode_user.username}'
76 % endif
76 % endif
77 }
77 }
78 };
78 };
79 </script>
79 </script>
80
80
81 <!--[if lt IE 9]>
81 <!--[if lt IE 9]>
82 <script language="javascript" type="text/javascript" src="${h.asset('js/excanvas.min.js')}"></script>
82 <script language="javascript" type="text/javascript" src="${h.asset('js/excanvas.min.js')}"></script>
83 <![endif]-->
83 <![endif]-->
84 <script language="javascript" type="text/javascript" src="${h.asset('js/rhodecode/routes.js', ver=c.rhodecode_version_hash)}"></script>
84 <script language="javascript" type="text/javascript" src="${h.asset('js/rhodecode/routes.js', ver=c.rhodecode_version_hash)}"></script>
85 <script language="javascript" type="text/javascript" src="${h.asset('js/scripts.js', ver=c.rhodecode_version_hash)}"></script>
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 ## JAVASCRIPT EXTRA - optionally inject some extra JS for specificed templates
89 ## JAVASCRIPT EXTRA - optionally inject some extra JS for specificed templates
89 ${self.js_extra()}
90 ${self.js_extra()}
90
91
91 <script type="text/javascript">
92 <script type="text/javascript">
92 $(document).ready(function(){
93 $(document).ready(function(){
93 show_more_event();
94 show_more_event();
94 timeagoActivate();
95 timeagoActivate();
95 })
96 })
96 </script>
97 </script>
97
98
98 </%def>
99 </%def>
99
100
100 ## JAVASCRIPT EXTRA - optionally inject some extra JS for specificed templates
101 ## JAVASCRIPT EXTRA - optionally inject some extra JS for specificed templates
101 <%def name="js_extra()"></%def>
102 <%def name="js_extra()"></%def>
102 ${self.js()}
103 ${self.js()}
103
104
104 <%def name="head_extra()"></%def>
105 <%def name="head_extra()"></%def>
105 ${self.head_extra()}
106 ${self.head_extra()}
106
107
107 <%include file="/base/plugins_base.html"/>
108 <%include file="/base/plugins_base.html"/>
108
109
109 ## extra stuff
110 ## extra stuff
110 %if c.pre_code:
111 %if c.pre_code:
111 ${c.pre_code|n}
112 ${c.pre_code|n}
112 %endif
113 %endif
113 </head>
114 </head>
114 <body id="body">
115 <body id="body">
115 <noscript>
116 <noscript>
116 <div class="noscript-error">
117 <div class="noscript-error">
117 ${_('Please enable JavaScript to use RhodeCode Enterprise')}
118 ${_('Please enable JavaScript to use RhodeCode Enterprise')}
118 </div>
119 </div>
119 </noscript>
120 </noscript>
120 ## IE hacks
121 ## IE hacks
121 <!--[if IE 7]>
122 <!--[if IE 7]>
122 <script>$(document.body).addClass('ie7')</script>
123 <script>$(document.body).addClass('ie7')</script>
123 <![endif]-->
124 <![endif]-->
124 <!--[if IE 8]>
125 <!--[if IE 8]>
125 <script>$(document.body).addClass('ie8')</script>
126 <script>$(document.body).addClass('ie8')</script>
126 <![endif]-->
127 <![endif]-->
127 <!--[if IE 9]>
128 <!--[if IE 9]>
128 <script>$(document.body).addClass('ie9')</script>
129 <script>$(document.body).addClass('ie9')</script>
129 <![endif]-->
130 <![endif]-->
130
131
131 ${next.body()}
132 ${next.body()}
132 %if c.post_code:
133 %if c.post_code:
133 ${c.post_code|n}
134 ${c.post_code|n}
134 %endif
135 %endif
135 </body>
136 </body>
136 </html>
137 </html>
General Comments 0
You need to be logged in to leave comments. Login now