##// END OF EJS Templates
html: small fix to make i18n extraction not break on <script> tags.
marcink -
r539:fb031ee8 default
parent child Browse files
Show More
@@ -1,245 +1,245 b''
1 ${h.secure_form(url('admin_settings_global'), method='post')}
1 ${h.secure_form(url('admin_settings_global'), method='post')}
2
2
3 <div class="panel panel-default">
3 <div class="panel panel-default">
4 <div class="panel-heading" id="branding-options">
4 <div class="panel-heading" id="branding-options">
5 <h3 class="panel-title">${_('Branding')} <a class="permalink" href="#branding-options"> ΒΆ</a></h3>
5 <h3 class="panel-title">${_('Branding')} <a class="permalink" href="#branding-options"> ΒΆ</a></h3>
6 </div>
6 </div>
7 <div class="panel-body">
7 <div class="panel-body">
8 <div class="label">
8 <div class="label">
9 <label for="rhodecode_title">${_('Title')}</label>
9 <label for="rhodecode_title">${_('Title')}</label>
10 </div>
10 </div>
11 <div class="field input">
11 <div class="field input">
12 ${h.text('rhodecode_title',size=60)}
12 ${h.text('rhodecode_title',size=60)}
13 </div>
13 </div>
14 <div class="field">
14 <div class="field">
15 <span class="help-block">
15 <span class="help-block">
16 ${_('Set a custom title for your RhodeCode instance (limited to 40 characters).')}
16 ${_('Set a custom title for your RhodeCode instance (limited to 40 characters).')}
17 </span>
17 </span>
18 </div>
18 </div>
19 <div class="label">
19 <div class="label">
20 <label for="rhodecode_realm">${_('HTTP[S] authentication realm')}</label>
20 <label for="rhodecode_realm">${_('HTTP[S] authentication realm')}</label>
21 </div>
21 </div>
22 <div class="field input">
22 <div class="field input">
23 ${h.text('rhodecode_realm',size=60)}
23 ${h.text('rhodecode_realm',size=60)}
24 </div>
24 </div>
25 <div class="field">
25 <div class="field">
26 <span class="help-block">
26 <span class="help-block">
27 ${_('Set a custom text that is shown as authentication message to clients trying to connect.')}
27 ${_('Set a custom text that is shown as authentication message to clients trying to connect.')}
28 </span>
28 </span>
29 </div>
29 </div>
30 </div>
30 </div>
31 </div>
31 </div>
32
32
33 <div class="panel panel-default">
33 <div class="panel panel-default">
34 <div class="panel-heading" id="captcha-options">
34 <div class="panel-heading" id="captcha-options">
35 <h3 class="panel-title">${_('Registration Captcha')} <a class="permalink" href="#captcha-options"> ΒΆ</a></h3>
35 <h3 class="panel-title">${_('Registration Captcha')} <a class="permalink" href="#captcha-options"> ΒΆ</a></h3>
36 </div>
36 </div>
37 <div class="panel-body">
37 <div class="panel-body">
38 <div class="label">
38 <div class="label">
39 <label for="rhodecode_captcha_public_key">${_('Google ReCaptcha public key')}</label>
39 <label for="rhodecode_captcha_public_key">${_('Google ReCaptcha public key')}</label>
40 </div>
40 </div>
41 <div class="field input">
41 <div class="field input">
42 ${h.text('rhodecode_captcha_public_key',size=60)}
42 ${h.text('rhodecode_captcha_public_key',size=60)}
43 </div>
43 </div>
44 <div class="field">
44 <div class="field">
45 <span class="help-block">
45 <span class="help-block">
46 ${_('Public key for reCaptcha system.')}
46 ${_('Public key for reCaptcha system.')}
47 </span>
47 </span>
48 </div>
48 </div>
49
49
50 <div class="label">
50 <div class="label">
51 <label for="rhodecode_captcha_private_key">${_('Google ReCaptcha private key')}</label>
51 <label for="rhodecode_captcha_private_key">${_('Google ReCaptcha private key')}</label>
52 </div>
52 </div>
53 <div class="field input">
53 <div class="field input">
54 ${h.text('rhodecode_captcha_private_key',size=60)}
54 ${h.text('rhodecode_captcha_private_key',size=60)}
55 </div>
55 </div>
56 <div class="field">
56 <div class="field">
57 <span class="help-block">
57 <span class="help-block">
58 ${_('Private key for reCaptcha system. Setting this value will enable captcha on registration')}
58 ${_('Private key for reCaptcha system. Setting this value will enable captcha on registration')}
59 </span>
59 </span>
60 </div>
60 </div>
61 </div>
61 </div>
62 </div>
62 </div>
63
63
64 <div class="panel panel-default">
64 <div class="panel panel-default">
65 <div class="panel-heading" id="header-code-options">
65 <div class="panel-heading" id="header-code-options">
66 <h3 class="panel-title">${_('Custom Header Code')} <a class="permalink" href="#header-code-options"> ΒΆ</a></h3>
66 <h3 class="panel-title">${_('Custom Header Code')} <a class="permalink" href="#header-code-options"> ΒΆ</a></h3>
67 </div>
67 </div>
68 <div class="panel-body">
68 <div class="panel-body">
69 <div class="select">
69 <div class="select">
70 <select id="pre_template" >
70 <select id="pre_template" >
71 <option value="#">${_('Templates...')}</option>
71 <option value="#">${_('Templates...')}</option>
72 <option value="ga">Google Analytics</option>
72 <option value="ga">Google Analytics</option>
73 <option value="clicky">Clicky</option>
73 <option value="clicky">Clicky</option>
74 <option value="server_announce">${_('Server Announcement')}</option>
74 <option value="server_announce">${_('Server Announcement')}</option>
75 </select>
75 </select>
76 </div>
76 </div>
77 <div style="padding: 10px 0px"></div>
77 <div style="padding: 10px 0px"></div>
78 <div class="textarea text-area">
78 <div class="textarea text-area">
79 ${h.textarea('rhodecode_pre_code',cols=23,rows=5,class_="medium")}
79 ${h.textarea('rhodecode_pre_code',cols=23,rows=5,class_="medium")}
80 <span class="help-block">${_('Custom js/css code added at the end of the <header> tag.')}
80 <span class="help-block">${_('Custom js/css code added at the end of the <header/> tag.')}
81 ${_('Use <script> or <css> tags to define custom styling or scripting')}</span>
81 ${_('Use <script/> or <css/> tags to define custom styling or scripting')}</span>
82 </div>
82 </div>
83 </div>
83 </div>
84 </div>
84 </div>
85
85
86 <div class="panel panel-default">
86 <div class="panel panel-default">
87 <div class="panel-heading" id="footer-code-options">
87 <div class="panel-heading" id="footer-code-options">
88 <h3 class="panel-title">${_('Custom Footer Code')} <a class="permalink" href="#footer-code-options"> ΒΆ</a></h3>
88 <h3 class="panel-title">${_('Custom Footer Code')} <a class="permalink" href="#footer-code-options"> ΒΆ</a></h3>
89 </div>
89 </div>
90 <div class="panel-body">
90 <div class="panel-body">
91 <div class="select">
91 <div class="select">
92 <select id="post_template" >
92 <select id="post_template" >
93 <option value="#">${_('Templates...')}</option>
93 <option value="#">${_('Templates...')}</option>
94 <option value="ga">Google Analytics</option>
94 <option value="ga">Google Analytics</option>
95 <option value="clicky">Clicky</option>
95 <option value="clicky">Clicky</option>
96 <option value="server_announce">${_('Server Announcement')}</option>
96 <option value="server_announce">${_('Server Announcement')}</option>
97 </select>
97 </select>
98 </div>
98 </div>
99 <div style="padding: 10px 0px"></div>
99 <div style="padding: 10px 0px"></div>
100 <div class="textarea text-area">
100 <div class="textarea text-area">
101 ${h.textarea('rhodecode_post_code',cols=23,rows=5, class_="medium")}
101 ${h.textarea('rhodecode_post_code',cols=23,rows=5, class_="medium")}
102 <span class="help-block">${_('Custom js/css code added at the end of the <body> tag.')}
102 <span class="help-block">${_('Custom js/css code added at the end of the <body> tag.')}
103 ${_('Use <script> or <css> tags to define custom styling or scripting')}</span>
103 ${_('Use <script> or <css> tags to define custom styling or scripting')}</span>
104 </div>
104 </div>
105 </div>
105 </div>
106 </div>
106 </div>
107
107
108 <div class="buttons">
108 <div class="buttons">
109 ${h.submit('save',_('Save settings'),class_="btn")}
109 ${h.submit('save',_('Save settings'),class_="btn")}
110 ${h.reset('reset',_('Reset'),class_="btn")}
110 ${h.reset('reset',_('Reset'),class_="btn")}
111 </div>
111 </div>
112 ${h.end_form()}
112 ${h.end_form()}
113
113
114
114
115
115
116 ## TEMPLATES ##
116 ## TEMPLATES ##
117 ###############
117 ###############
118
118
119 <script id="ga_tmpl" type="text/x-template">
119 <script id="ga_tmpl" type="text/x-template">
120 <%text filter="h">
120 <%text filter="h">
121 <script>
121 <script>
122 // Google Analytics
122 // Google Analytics
123 // Put your Google Analytics code instead of _GACODE_
123 // Put your Google Analytics code instead of _GACODE_
124 var _gaq_code = '_GACODE_';
124 var _gaq_code = '_GACODE_';
125 var _gaq = _gaq || [];
125 var _gaq = _gaq || [];
126 _gaq.push(['_setAccount', _gaq_code]);
126 _gaq.push(['_setAccount', _gaq_code]);
127 _gaq.push(['_trackPageview']);
127 _gaq.push(['_trackPageview']);
128
128
129 (function() {
129 (function() {
130 var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
130 var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
131 ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
131 ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
132 var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
132 var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
133 })();
133 })();
134
134
135 rhodecode_statechange_callback = function(url, data){
135 rhodecode_statechange_callback = function(url, data){
136 // ANALYTICS callback on html5 history state changed
136 // ANALYTICS callback on html5 history state changed
137 // triggered by file browser, url is the new url,
137 // triggered by file browser, url is the new url,
138 // data is extra info passed from the State object
138 // data is extra info passed from the State object
139 if (typeof window._gaq !== 'undefined') {
139 if (typeof window._gaq !== 'undefined') {
140 _gaq.push(['_trackPageview', url]);
140 _gaq.push(['_trackPageview', url]);
141 }
141 }
142 };
142 };
143 </script>
143 </script>
144 </%text>
144 </%text>
145 </script>
145 </script>
146
146
147
147
148
148
149 <script id="clicky_tmpl" type="text/x-template">
149 <script id="clicky_tmpl" type="text/x-template">
150 <%text filter="h">
150 <%text filter="h">
151 <script src="//static.getclicky.com/js" type="text/javascript"></script>
151 <script src="//static.getclicky.com/js" type="text/javascript"></script>
152 <script type="text/javascript">
152 <script type="text/javascript">
153 // Clicky Analytics - should be used in the footer code section.
153 // Clicky Analytics - should be used in the footer code section.
154 // Put your Clicky code instead of _CLICKYCODE_ here,
154 // Put your Clicky code instead of _CLICKYCODE_ here,
155 // and below in the <img> tag.
155 // and below in the <img> tag.
156 var _cl_code = _CLICKYCODE_;
156 var _cl_code = _CLICKYCODE_;
157 try{clicky.init(_cl_code);}catch(e){}
157 try{clicky.init(_cl_code);}catch(e){}
158
158
159 rhodecode_statechange_callback = function(url, data){
159 rhodecode_statechange_callback = function(url, data){
160 // ANALYTICS callback on html5 history state changed
160 // ANALYTICS callback on html5 history state changed
161 // triggered by file browser, url is the new url,
161 // triggered by file browser, url is the new url,
162 // data is extra info passed from the State object
162 // data is extra info passed from the State object
163 if (typeof window.clicky !== 'undefined') {
163 if (typeof window.clicky !== 'undefined') {
164 clicky.log(url);
164 clicky.log(url);
165 }
165 }
166 }
166 }
167 </script>
167 </script>
168 <noscript>
168 <noscript>
169 // Put your clicky code in the src file.
169 // Put your clicky code in the src file.
170 <p><img alt="Clicky" width="1" height="1"
170 <p><img alt="Clicky" width="1" height="1"
171 src="//in.getclicky.com/_CLICKYCODE_ns.gif" /></p>
171 src="//in.getclicky.com/_CLICKYCODE_ns.gif" /></p>
172 </noscript>
172 </noscript>
173 </%text>
173 </%text>
174 </script>
174 </script>
175
175
176
176
177
177
178 <script id="server_announce_tmpl" type='text/x-template'>
178 <script id="server_announce_tmpl" type='text/x-template'>
179 <%text filter="h">
179 <%text filter="h">
180 <script>
180 <script>
181 // Server announcement displayed on the top of the page.
181 // Server announcement displayed on the top of the page.
182 // This can be used to send a global maintainance messages or other
182 // This can be used to send a global maintainance messages or other
183 // important messages to all users of the RhodeCode Enterprise system.
183 // important messages to all users of the RhodeCode Enterprise system.
184
184
185 $(document).ready(function(e){
185 $(document).ready(function(e){
186 // put your message below
186 // put your message below
187 var message = "TYPE YOUR MESSAGE HERE";
187 var message = "TYPE YOUR MESSAGE HERE";
188
188
189 $('#body').prepend(
189 $('#body').prepend(
190 ('<div class="flash_msg">'+
190 ('<div class="flash_msg">'+
191 '<div class="alert alert-info">_MSG_'+
191 '<div class="alert alert-info">_MSG_'+
192 '</div></div>').replace('_MSG_', message)
192 '</div></div>').replace('_MSG_', message)
193 )
193 )
194 })
194 })
195 </script>
195 </script>
196 </%text>
196 </%text>
197 </script>
197 </script>
198
198
199
199
200
200
201 <script>
201 <script>
202 var pre_cm = initCodeMirror('rhodecode_pre_code', '', false);
202 var pre_cm = initCodeMirror('rhodecode_pre_code', '', false);
203 var pre_old = pre_cm.getValue();
203 var pre_old = pre_cm.getValue();
204
204
205 var post_cm = initCodeMirror('rhodecode_post_code', '', false);
205 var post_cm = initCodeMirror('rhodecode_post_code', '', false);
206 var post_old = post_cm.getValue();
206 var post_old = post_cm.getValue();
207
207
208 var get_data = function(type, old){
208 var get_data = function(type, old){
209 var get_tmpl = function(tmpl_name){
209 var get_tmpl = function(tmpl_name){
210 // unescape some stuff
210 // unescape some stuff
211 var html = htmlEnDeCode.htmlDecode($('#'+tmpl_name+'_tmpl').html());
211 var html = htmlEnDeCode.htmlDecode($('#'+tmpl_name+'_tmpl').html());
212 return html;
212 return html;
213 };
213 };
214 return {
214 return {
215 '#': old,
215 '#': old,
216 'ga': get_tmpl('ga'),
216 'ga': get_tmpl('ga'),
217 'clicky': get_tmpl('clicky'),
217 'clicky': get_tmpl('clicky'),
218 'server_announce': get_tmpl('server_announce')
218 'server_announce': get_tmpl('server_announce')
219 }[type]
219 }[type]
220 };
220 };
221
221
222 $('#pre_template').select2({
222 $('#pre_template').select2({
223 containerCssClass: 'drop-menu',
223 containerCssClass: 'drop-menu',
224 dropdownCssClass: 'drop-menu-dropdown',
224 dropdownCssClass: 'drop-menu-dropdown',
225 dropdownAutoWidth: true,
225 dropdownAutoWidth: true,
226 minimumResultsForSearch: -1
226 minimumResultsForSearch: -1
227 });
227 });
228
228
229 $('#post_template').select2({
229 $('#post_template').select2({
230 containerCssClass: 'drop-menu',
230 containerCssClass: 'drop-menu',
231 dropdownCssClass: 'drop-menu-dropdown',
231 dropdownCssClass: 'drop-menu-dropdown',
232 dropdownAutoWidth: true,
232 dropdownAutoWidth: true,
233 minimumResultsForSearch: -1
233 minimumResultsForSearch: -1
234 });
234 });
235
235
236 $('#post_template').on('change', function(e){
236 $('#post_template').on('change', function(e){
237 var sel = this.value;
237 var sel = this.value;
238 post_cm.setValue(get_data(sel, post_old))
238 post_cm.setValue(get_data(sel, post_old))
239 });
239 });
240
240
241 $('#pre_template').on('change', function(e){
241 $('#pre_template').on('change', function(e){
242 var sel = this.value;
242 var sel = this.value;
243 pre_cm.setValue(get_data(sel, pre_old))
243 pre_cm.setValue(get_data(sel, pre_old))
244 })
244 })
245 </script>
245 </script>
General Comments 0
You need to be logged in to leave comments. Login now