##// END OF EJS Templates
js: use minimized version by default
marcink -
r4020:6c8101bc default
parent child Browse files
Show More
@@ -1,164 +1,164 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 go_import_header = ''
6 go_import_header = ''
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 c.template_context['repo_id'] = c.rhodecode_db_repo.repo_id
10 c.template_context['repo_id'] = c.rhodecode_db_repo.repo_id
11 c.template_context['repo_view_type'] = h.get_repo_view_type(request)
11 c.template_context['repo_view_type'] = h.get_repo_view_type(request)
12
12
13 if getattr(c, 'repo_group', None):
13 if getattr(c, 'repo_group', None):
14 c.template_context['repo_group_id'] = c.repo_group.group_id
14 c.template_context['repo_group_id'] = c.repo_group.group_id
15 c.template_context['repo_group_name'] = c.repo_group.group_name
15 c.template_context['repo_group_name'] = c.repo_group.group_name
16
16
17 if getattr(c, 'rhodecode_user', None) and c.rhodecode_user.user_id:
17 if getattr(c, 'rhodecode_user', None) and c.rhodecode_user.user_id:
18 c.template_context['rhodecode_user']['username'] = c.rhodecode_user.username
18 c.template_context['rhodecode_user']['username'] = c.rhodecode_user.username
19 c.template_context['rhodecode_user']['email'] = c.rhodecode_user.email
19 c.template_context['rhodecode_user']['email'] = c.rhodecode_user.email
20 c.template_context['rhodecode_user']['notification_status'] = c.rhodecode_user.get_instance().user_data.get('notification_status', True)
20 c.template_context['rhodecode_user']['notification_status'] = c.rhodecode_user.get_instance().user_data.get('notification_status', True)
21 c.template_context['rhodecode_user']['first_name'] = c.rhodecode_user.first_name
21 c.template_context['rhodecode_user']['first_name'] = c.rhodecode_user.first_name
22 c.template_context['rhodecode_user']['last_name'] = c.rhodecode_user.last_name
22 c.template_context['rhodecode_user']['last_name'] = c.rhodecode_user.last_name
23
23
24 c.template_context['visual']['default_renderer'] = h.get_visual_attr(c, 'default_renderer')
24 c.template_context['visual']['default_renderer'] = h.get_visual_attr(c, 'default_renderer')
25 c.template_context['default_user'] = {
25 c.template_context['default_user'] = {
26 'username': h.DEFAULT_USER,
26 'username': h.DEFAULT_USER,
27 'user_id': 1
27 'user_id': 1
28 }
28 }
29 c.template_context['search_context'] = {
29 c.template_context['search_context'] = {
30 'repo_group_id': c.template_context.get('repo_group_id'),
30 'repo_group_id': c.template_context.get('repo_group_id'),
31 'repo_group_name': c.template_context.get('repo_group_name'),
31 'repo_group_name': c.template_context.get('repo_group_name'),
32 'repo_id': c.template_context.get('repo_id'),
32 'repo_id': c.template_context.get('repo_id'),
33 'repo_name': c.template_context.get('repo_name'),
33 'repo_name': c.template_context.get('repo_name'),
34 'repo_view_type': c.template_context.get('repo_view_type'),
34 'repo_view_type': c.template_context.get('repo_view_type'),
35 }
35 }
36
36
37 c.template_context['attachment_store'] = {
37 c.template_context['attachment_store'] = {
38 'max_file_size_mb': 10,
38 'max_file_size_mb': 10,
39 'image_ext': ["png", "jpg", "gif", "jpeg"]
39 'image_ext': ["png", "jpg", "gif", "jpeg"]
40 }
40 }
41
41
42 %>
42 %>
43 <html xmlns="http://www.w3.org/1999/xhtml">
43 <html xmlns="http://www.w3.org/1999/xhtml">
44 <head>
44 <head>
45 <title>${self.title()}</title>
45 <title>${self.title()}</title>
46 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
46 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
47
47
48 ${h.go_import_header(request, getattr(c, 'rhodecode_db_repo', None))}
48 ${h.go_import_header(request, getattr(c, 'rhodecode_db_repo', None))}
49
49
50 % if 'safari' in (request.user_agent or '').lower():
50 % if 'safari' in (request.user_agent or '').lower():
51 <meta name="referrer" content="origin">
51 <meta name="referrer" content="origin">
52 % else:
52 % else:
53 <meta name="referrer" content="origin-when-cross-origin">
53 <meta name="referrer" content="origin-when-cross-origin">
54 % endif
54 % endif
55
55
56 <%def name="robots()">
56 <%def name="robots()">
57 <meta name="robots" content="index, nofollow"/>
57 <meta name="robots" content="index, nofollow"/>
58 </%def>
58 </%def>
59 ${self.robots()}
59 ${self.robots()}
60 <link rel="icon" href="${h.asset('images/favicon.ico', ver=c.rhodecode_version_hash)}" sizes="16x16 32x32" type="image/png" />
60 <link rel="icon" href="${h.asset('images/favicon.ico', ver=c.rhodecode_version_hash)}" sizes="16x16 32x32" type="image/png" />
61 <script src="${h.asset('js/vendors/webcomponentsjs/custom-elements-es5-adapter.js', ver=c.rhodecode_version_hash)}"></script>
61 <script src="${h.asset('js/vendors/webcomponentsjs/custom-elements-es5-adapter.js', ver=c.rhodecode_version_hash)}"></script>
62 <script src="${h.asset('js/vendors/webcomponentsjs/webcomponents-bundle.js', ver=c.rhodecode_version_hash)}"></script>
62 <script src="${h.asset('js/vendors/webcomponentsjs/webcomponents-bundle.js', ver=c.rhodecode_version_hash)}"></script>
63
63
64 ## CSS definitions
64 ## CSS definitions
65 <%def name="css()">
65 <%def name="css()">
66 <link rel="stylesheet" type="text/css" href="${h.asset('css/style.css', ver=c.rhodecode_version_hash)}" media="screen"/>
66 <link rel="stylesheet" type="text/css" href="${h.asset('css/style.css', ver=c.rhodecode_version_hash)}" media="screen"/>
67 ## EXTRA FOR CSS
67 ## EXTRA FOR CSS
68 ${self.css_extra()}
68 ${self.css_extra()}
69 </%def>
69 </%def>
70 ## CSS EXTRA - optionally inject some extra CSS stuff needed for specific websites
70 ## CSS EXTRA - optionally inject some extra CSS stuff needed for specific websites
71 <%def name="css_extra()">
71 <%def name="css_extra()">
72 </%def>
72 </%def>
73
73
74 ${self.css()}
74 ${self.css()}
75
75
76 ## JAVASCRIPT
76 ## JAVASCRIPT
77 <%def name="js()">
77 <%def name="js()">
78
78
79 <script src="${h.asset('js/rhodecode/i18n/%s.js' % c.language, ver=c.rhodecode_version_hash)}"></script>
79 <script src="${h.asset('js/rhodecode/i18n/%s.js' % c.language, ver=c.rhodecode_version_hash)}"></script>
80 <script type="text/javascript">
80 <script type="text/javascript">
81 // register templateContext to pass template variables to JS
81 // register templateContext to pass template variables to JS
82 var templateContext = ${h.json.dumps(c.template_context)|n};
82 var templateContext = ${h.json.dumps(c.template_context)|n};
83
83
84 var APPLICATION_URL = "${h.route_path('home').rstrip('/')}";
84 var APPLICATION_URL = "${h.route_path('home').rstrip('/')}";
85 var APPLICATION_PLUGINS = [];
85 var APPLICATION_PLUGINS = [];
86 var ASSET_URL = "${h.asset('')}";
86 var ASSET_URL = "${h.asset('')}";
87 var DEFAULT_RENDERER = "${h.get_visual_attr(c, 'default_renderer')}";
87 var DEFAULT_RENDERER = "${h.get_visual_attr(c, 'default_renderer')}";
88 var CSRF_TOKEN = "${getattr(c, 'csrf_token', '')}";
88 var CSRF_TOKEN = "${getattr(c, 'csrf_token', '')}";
89
89
90 var APPENLIGHT = {
90 var APPENLIGHT = {
91 enabled: ${'true' if getattr(c, 'appenlight_enabled', False) else 'false'},
91 enabled: ${'true' if getattr(c, 'appenlight_enabled', False) else 'false'},
92 key: '${getattr(c, "appenlight_api_public_key", "")}',
92 key: '${getattr(c, "appenlight_api_public_key", "")}',
93 % if getattr(c, 'appenlight_server_url', None):
93 % if getattr(c, 'appenlight_server_url', None):
94 serverUrl: '${getattr(c, "appenlight_server_url", "")}',
94 serverUrl: '${getattr(c, "appenlight_server_url", "")}',
95 % endif
95 % endif
96 requestInfo: {
96 requestInfo: {
97 % if getattr(c, 'rhodecode_user', None):
97 % if getattr(c, 'rhodecode_user', None):
98 ip: '${c.rhodecode_user.ip_addr}',
98 ip: '${c.rhodecode_user.ip_addr}',
99 username: '${c.rhodecode_user.username}'
99 username: '${c.rhodecode_user.username}'
100 % endif
100 % endif
101 },
101 },
102 tags: {
102 tags: {
103 rhodecode_version: '${c.rhodecode_version}',
103 rhodecode_version: '${c.rhodecode_version}',
104 rhodecode_edition: '${c.rhodecode_edition}'
104 rhodecode_edition: '${c.rhodecode_edition}'
105 }
105 }
106 };
106 };
107
107
108 </script>
108 </script>
109 <%include file="/base/plugins_base.mako"/>
109 <%include file="/base/plugins_base.mako"/>
110 <!--[if lt IE 9]>
110 <!--[if lt IE 9]>
111 <script language="javascript" type="text/javascript" src="${h.asset('js/src/excanvas.min.js')}"></script>
111 <script language="javascript" type="text/javascript" src="${h.asset('js/src/excanvas.min.js')}"></script>
112 <![endif]-->
112 <![endif]-->
113 <script language="javascript" type="text/javascript" src="${h.asset('js/rhodecode/routes.js', ver=c.rhodecode_version_hash)}"></script>
113 <script language="javascript" type="text/javascript" src="${h.asset('js/rhodecode/routes.js', ver=c.rhodecode_version_hash)}"></script>
114 <script> var alertMessagePayloads = ${h.flash.json_alerts(request=request)|n}; </script>
114 <script> var alertMessagePayloads = ${h.flash.json_alerts(request=request)|n}; </script>
115 ## avoide escaping the %N
115 ## avoide escaping the %N
116 <script language="javascript" type="text/javascript" src="${h.asset('js/scripts.js', ver=c.rhodecode_version_hash)}"></script>
116 <script language="javascript" type="text/javascript" src="${h.asset('js/scripts.min.js', ver=c.rhodecode_version_hash)}"></script>
117 <script>CodeMirror.modeURL = "${h.asset('') + 'js/mode/%N/%N.js?ver='+c.rhodecode_version_hash}";</script>
117 <script>CodeMirror.modeURL = "${h.asset('') + 'js/mode/%N/%N.js?ver='+c.rhodecode_version_hash}";</script>
118
118
119
119
120 ## JAVASCRIPT EXTRA - optionally inject some extra JS for specificed templates
120 ## JAVASCRIPT EXTRA - optionally inject some extra JS for specificed templates
121 ${self.js_extra()}
121 ${self.js_extra()}
122
122
123 <script type="text/javascript">
123 <script type="text/javascript">
124 Rhodecode = (function() {
124 Rhodecode = (function() {
125 function _Rhodecode() {
125 function _Rhodecode() {
126 this.comments = new CommentsController();
126 this.comments = new CommentsController();
127 }
127 }
128 return new _Rhodecode();
128 return new _Rhodecode();
129 })();
129 })();
130
130
131 $(document).ready(function(){
131 $(document).ready(function(){
132 show_more_event();
132 show_more_event();
133 timeagoActivate();
133 timeagoActivate();
134 clipboardActivate();
134 clipboardActivate();
135 })
135 })
136 </script>
136 </script>
137
137
138 </%def>
138 </%def>
139
139
140 ## JAVASCRIPT EXTRA - optionally inject some extra JS for specificed templates
140 ## JAVASCRIPT EXTRA - optionally inject some extra JS for specificed templates
141 <%def name="js_extra()"></%def>
141 <%def name="js_extra()"></%def>
142 ${self.js()}
142 ${self.js()}
143
143
144 <%def name="head_extra()"></%def>
144 <%def name="head_extra()"></%def>
145 ${self.head_extra()}
145 ${self.head_extra()}
146 ## extra stuff
146 ## extra stuff
147 %if c.pre_code:
147 %if c.pre_code:
148 ${c.pre_code|n}
148 ${c.pre_code|n}
149 %endif
149 %endif
150 </head>
150 </head>
151 <body id="body">
151 <body id="body">
152 <noscript>
152 <noscript>
153 <div class="noscript-error">
153 <div class="noscript-error">
154 ${_('Please enable JavaScript to use RhodeCode Enterprise')}
154 ${_('Please enable JavaScript to use RhodeCode Enterprise')}
155 </div>
155 </div>
156 </noscript>
156 </noscript>
157
157
158 ${next.body()}
158 ${next.body()}
159 %if c.post_code:
159 %if c.post_code:
160 ${c.post_code|n}
160 ${c.post_code|n}
161 %endif
161 %endif
162 <rhodecode-app></rhodecode-app>
162 <rhodecode-app></rhodecode-app>
163 </body>
163 </body>
164 </html>
164 </html>
General Comments 0
You need to be logged in to leave comments. Login now