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