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