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