##// END OF EJS Templates
flash-filters: changed texts
marcink -
r987:d56114c0 default
parent child Browse files
Show More
@@ -1,266 +1,267 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 <option value="flash_filtering">${_('Example flash message filtering')}</option>
75 <option value="flash_filtering">${_('Flash message filtering')}</option>
76 </select>
76 </select>
77 </div>
77 </div>
78 <div style="padding: 10px 0px"></div>
78 <div style="padding: 10px 0px"></div>
79 <div class="textarea text-area">
79 <div class="textarea text-area">
80 ${h.textarea('rhodecode_pre_code',cols=23,rows=5,class_="medium")}
80 ${h.textarea('rhodecode_pre_code',cols=23,rows=5,class_="medium")}
81 <span class="help-block">${_('Custom js/css code added at the end of the <header/> tag.')}
81 <span class="help-block">${_('Custom js/css code added at the end of the <header/> tag.')}
82 ${_('Use <script/> or <css/> tags to define custom styling or scripting')}</span>
82 ${_('Use <script/> or <css/> tags to define custom styling or scripting')}</span>
83 </div>
83 </div>
84 </div>
84 </div>
85 </div>
85 </div>
86
86
87 <div class="panel panel-default">
87 <div class="panel panel-default">
88 <div class="panel-heading" id="footer-code-options">
88 <div class="panel-heading" id="footer-code-options">
89 <h3 class="panel-title">${_('Custom Footer Code')} <a class="permalink" href="#footer-code-options"> ΒΆ</a></h3>
89 <h3 class="panel-title">${_('Custom Footer Code')} <a class="permalink" href="#footer-code-options"> ΒΆ</a></h3>
90 </div>
90 </div>
91 <div class="panel-body">
91 <div class="panel-body">
92 <div class="select">
92 <div class="select">
93 <select id="post_template" >
93 <select id="post_template" >
94 <option value="#">${_('Templates...')}</option>
94 <option value="#">${_('Templates...')}</option>
95 <option value="ga">Google Analytics</option>
95 <option value="ga">Google Analytics</option>
96 <option value="clicky">Clicky</option>
96 <option value="clicky">Clicky</option>
97 <option value="server_announce">${_('Server Announcement')}</option>
97 <option value="server_announce">${_('Server Announcement')}</option>
98 </select>
98 </select>
99 </div>
99 </div>
100 <div style="padding: 10px 0px"></div>
100 <div style="padding: 10px 0px"></div>
101 <div class="textarea text-area">
101 <div class="textarea text-area">
102 ${h.textarea('rhodecode_post_code',cols=23,rows=5, class_="medium")}
102 ${h.textarea('rhodecode_post_code',cols=23,rows=5, class_="medium")}
103 <span class="help-block">${_('Custom js/css code added at the end of the <body> tag.')}
103 <span class="help-block">${_('Custom js/css code added at the end of the <body> tag.')}
104 ${_('Use <script> or <css> tags to define custom styling or scripting')}</span>
104 ${_('Use <script> or <css> tags to define custom styling or scripting')}</span>
105 </div>
105 </div>
106 </div>
106 </div>
107 </div>
107 </div>
108
108
109 <div class="buttons">
109 <div class="buttons">
110 ${h.submit('save',_('Save settings'),class_="btn")}
110 ${h.submit('save',_('Save settings'),class_="btn")}
111 ${h.reset('reset',_('Reset'),class_="btn")}
111 ${h.reset('reset',_('Reset'),class_="btn")}
112 </div>
112 </div>
113 ${h.end_form()}
113 ${h.end_form()}
114
114
115
115
116
116
117 ## TEMPLATES ##
117 ## TEMPLATES ##
118 ###############
118 ###############
119
119
120 <script id="ga_tmpl" type="text/x-template">
120 <script id="ga_tmpl" type="text/x-template">
121 <%text filter="h">
121 <%text filter="h">
122 <script>
122 <script>
123 // Google Analytics
123 // Google Analytics
124 // Put your Google Analytics code instead of _GACODE_
124 // Put your Google Analytics code instead of _GACODE_
125 var _gaq_code = '_GACODE_';
125 var _gaq_code = '_GACODE_';
126 var _gaq = _gaq || [];
126 var _gaq = _gaq || [];
127 _gaq.push(['_setAccount', _gaq_code]);
127 _gaq.push(['_setAccount', _gaq_code]);
128 _gaq.push(['_trackPageview']);
128 _gaq.push(['_trackPageview']);
129
129
130 (function() {
130 (function() {
131 var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
131 var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
132 ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
132 ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
133 var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
133 var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
134 })();
134 })();
135
135
136 rhodecode_statechange_callback = function(url, data){
136 rhodecode_statechange_callback = function(url, data){
137 // ANALYTICS callback on html5 history state changed
137 // ANALYTICS callback on html5 history state changed
138 // triggered by file browser, url is the new url,
138 // triggered by file browser, url is the new url,
139 // data is extra info passed from the State object
139 // data is extra info passed from the State object
140 if (typeof window._gaq !== 'undefined') {
140 if (typeof window._gaq !== 'undefined') {
141 _gaq.push(['_trackPageview', url]);
141 _gaq.push(['_trackPageview', url]);
142 }
142 }
143 };
143 };
144 </script>
144 </script>
145 </%text>
145 </%text>
146 </script>
146 </script>
147
147
148
148
149
149
150 <script id="clicky_tmpl" type="text/x-template">
150 <script id="clicky_tmpl" type="text/x-template">
151 <%text filter="h">
151 <%text filter="h">
152 <script src="//static.getclicky.com/js" type="text/javascript"></script>
152 <script src="//static.getclicky.com/js" type="text/javascript"></script>
153 <script type="text/javascript">
153 <script type="text/javascript">
154 // Clicky Analytics - should be used in the footer code section.
154 // Clicky Analytics - should be used in the footer code section.
155 // Put your Clicky code instead of _CLICKYCODE_ here,
155 // Put your Clicky code instead of _CLICKYCODE_ here,
156 // and below in the <img> tag.
156 // and below in the <img> tag.
157 var _cl_code = _CLICKYCODE_;
157 var _cl_code = _CLICKYCODE_;
158 try{clicky.init(_cl_code);}catch(e){}
158 try{clicky.init(_cl_code);}catch(e){}
159
159
160 rhodecode_statechange_callback = function(url, data){
160 rhodecode_statechange_callback = function(url, data){
161 // ANALYTICS callback on html5 history state changed
161 // ANALYTICS callback on html5 history state changed
162 // triggered by file browser, url is the new url,
162 // triggered by file browser, url is the new url,
163 // data is extra info passed from the State object
163 // data is extra info passed from the State object
164 if (typeof window.clicky !== 'undefined') {
164 if (typeof window.clicky !== 'undefined') {
165 clicky.log(url);
165 clicky.log(url);
166 }
166 }
167 }
167 }
168 </script>
168 </script>
169 <noscript>
169 <noscript>
170 // Put your clicky code in the src file.
170 // Put your clicky code in the src file.
171 <p><img alt="Clicky" width="1" height="1"
171 <p><img alt="Clicky" width="1" height="1"
172 src="//in.getclicky.com/_CLICKYCODE_ns.gif" /></p>
172 src="//in.getclicky.com/_CLICKYCODE_ns.gif" /></p>
173 </noscript>
173 </noscript>
174 </%text>
174 </%text>
175 </script>
175 </script>
176
176
177
177
178
178
179 <script id="server_announce_tmpl" type='text/x-template'>
179 <script id="server_announce_tmpl" type='text/x-template'>
180 <%text filter="h">
180 <%text filter="h">
181 <script>
181 <script>
182 // Server announcement displayed on the top of the page.
182 // Server announcement displayed on the top of the page.
183 // This can be used to send a global maintainance messages or other
183 // This can be used to send a global maintainance messages or other
184 // important messages to all users of the RhodeCode Enterprise system.
184 // important messages to all users of the RhodeCode Enterprise system.
185
185
186 $(document).ready(function(e){
186 $(document).ready(function(e){
187
187
188 // EDIT - put your message below
188 // EDIT - put your message below
189 var message = "TYPE YOUR MESSAGE HERE";
189 var message = "TYPE YOUR MESSAGE HERE";
190
190
191 // EDIT - choose "info"/"warning"/"error"/"success"/"neutral" as appropriate
191 // EDIT - choose "info"/"warning"/"error"/"success"/"neutral" as appropriate
192 var alert_level = "info";
192 var alert_level = "info";
193
193
194 $("#body").prepend(
194 $("#body").prepend(
195 ("<div id='server-announcement' class='"+alert_level+"'>_MSG_"+"</div>").replace("_MSG_", message)
195 ("<div id='server-announcement' class='"+alert_level+"'>_MSG_"+"</div>").replace("_MSG_", message)
196 )
196 )
197 })
197 })
198 </script>
198 </script>
199 </%text>
199 </%text>
200 </script>
200 </script>
201
201
202 <script id="flash_filtering_tmpl" type='text/x-template'>
202 <script id="flash_filtering_tmpl" type='text/x-template'>
203 <%text filter="h">
203 <%text filter="h">
204 <script>
204 <script>
205 // This filters out some flash messages before they are presented to user
205 // This filters out some flash messages before they are presented to user
206 // based on their contents
206 // based on their contents. Could be used to filter out warnings/errors
207 // of license messages
207
208
208 var filteredMessages = [];
209 var filteredMessages = [];
209 for(var i =0; i< alertMessagePayloads.length; i++){
210 for(var i =0; i< alertMessagePayloads.length; i++){
210 if (typeof alertMessagePayloads[i].message.subdata.subtype !== 'undefined' &&
211 if (typeof alertMessagePayloads[i].message.subdata.subtype !== 'undefined' &&
211 alertMessagePayloads[i].message.subdata.subtype.indexOf('rc_license') !== -1){
212 alertMessagePayloads[i].message.subdata.subtype.indexOf('rc_license') !== -1){
212 continue
213 continue
213 }
214 }
214 filteredMessages.push(alertMessagePayloads[i]);
215 filteredMessages.push(alertMessagePayloads[i]);
215 }
216 }
216 alertMessagePayloads = filteredMessages;
217 alertMessagePayloads = filteredMessages;
217 </script>
218 </script>
218 </%text>
219 </%text>
219 </script>
220 </script>
220
221
221 <script>
222 <script>
222 var pre_cm = initCodeMirror('rhodecode_pre_code', '', false);
223 var pre_cm = initCodeMirror('rhodecode_pre_code', '', false);
223 var pre_old = pre_cm.getValue();
224 var pre_old = pre_cm.getValue();
224
225
225 var post_cm = initCodeMirror('rhodecode_post_code', '', false);
226 var post_cm = initCodeMirror('rhodecode_post_code', '', false);
226 var post_old = post_cm.getValue();
227 var post_old = post_cm.getValue();
227
228
228 var get_data = function(type, old){
229 var get_data = function(type, old){
229 var get_tmpl = function(tmpl_name){
230 var get_tmpl = function(tmpl_name){
230 // unescape some stuff
231 // unescape some stuff
231 var html = htmlEnDeCode.htmlDecode($('#'+tmpl_name+'_tmpl').html());
232 var html = htmlEnDeCode.htmlDecode($('#'+tmpl_name+'_tmpl').html());
232 return html;
233 return html;
233 };
234 };
234 return {
235 return {
235 '#': old,
236 '#': old,
236 'ga': get_tmpl('ga'),
237 'ga': get_tmpl('ga'),
237 'clicky': get_tmpl('clicky'),
238 'clicky': get_tmpl('clicky'),
238 'server_announce': get_tmpl('server_announce'),
239 'server_announce': get_tmpl('server_announce'),
239 'flash_filtering': get_tmpl('flash_filtering')
240 'flash_filtering': get_tmpl('flash_filtering')
240 }[type]
241 }[type]
241 };
242 };
242
243
243 $('#pre_template').select2({
244 $('#pre_template').select2({
244 containerCssClass: 'drop-menu',
245 containerCssClass: 'drop-menu',
245 dropdownCssClass: 'drop-menu-dropdown',
246 dropdownCssClass: 'drop-menu-dropdown',
246 dropdownAutoWidth: true,
247 dropdownAutoWidth: true,
247 minimumResultsForSearch: -1
248 minimumResultsForSearch: -1
248 });
249 });
249
250
250 $('#post_template').select2({
251 $('#post_template').select2({
251 containerCssClass: 'drop-menu',
252 containerCssClass: 'drop-menu',
252 dropdownCssClass: 'drop-menu-dropdown',
253 dropdownCssClass: 'drop-menu-dropdown',
253 dropdownAutoWidth: true,
254 dropdownAutoWidth: true,
254 minimumResultsForSearch: -1
255 minimumResultsForSearch: -1
255 });
256 });
256
257
257 $('#post_template').on('change', function(e){
258 $('#post_template').on('change', function(e){
258 var sel = this.value;
259 var sel = this.value;
259 post_cm.setValue(get_data(sel, post_old))
260 post_cm.setValue(get_data(sel, post_old))
260 });
261 });
261
262
262 $('#pre_template').on('change', function(e){
263 $('#pre_template').on('change', function(e){
263 var sel = this.value;
264 var sel = this.value;
264 pre_cm.setValue(get_data(sel, pre_old))
265 pre_cm.setValue(get_data(sel, pre_old))
265 })
266 })
266 </script>
267 </script>
General Comments 0
You need to be logged in to leave comments. Login now