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