Show More
@@ -1,323 +1,323 b'' | |||
|
1 | 1 | ${h.secure_form(h.route_path('admin_settings_global_update'), request=request)} |
|
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 | |
|
34 | 34 | <div class="panel panel-default"> |
|
35 | 35 | <div class="panel-heading" id="personal-group-options"> |
|
36 | 36 | <h3 class="panel-title">${_('Personal Repository Group')} <a class="permalink" href="#personal-group-options"> ΒΆ</a></h3> |
|
37 | 37 | </div> |
|
38 | 38 | <div class="panel-body"> |
|
39 | 39 | <div class="checkbox"> |
|
40 | 40 | ${h.checkbox('rhodecode_create_personal_repo_group','True')} |
|
41 | 41 | <label for="rhodecode_create_personal_repo_group">${_('Create Personal Repository Group')}</label> |
|
42 | 42 | </div> |
|
43 | 43 | <span class="help-block"> |
|
44 | 44 | ${_('Always create Personal Repository Groups for new users.')} <br/> |
|
45 | 45 | ${_('When creating new users from add user form or API you can still turn this off via a checkbox or flag')} |
|
46 | 46 | </span> |
|
47 | 47 | |
|
48 | 48 | <div class="label"> |
|
49 | 49 | <label for="rhodecode_personal_repo_group_pattern">${_('Personal Repo Group Pattern')}</label> |
|
50 | 50 | </div> |
|
51 | 51 | <div class="field input"> |
|
52 | 52 | ${h.text('rhodecode_personal_repo_group_pattern',size=60, placeholder=c.personal_repo_group_default_pattern)} |
|
53 | 53 | </div> |
|
54 | 54 | <span class="help-block"> |
|
55 | 55 | ${_('Pattern used to create Personal Repository Groups. Prefix can be other existing repository group path[s], eg. /u/${username}')} <br/> |
|
56 | 56 | ${_('Available variables are currently ${username} and ${user_id}')} |
|
57 | 57 | </span> |
|
58 | 58 | </div> |
|
59 | 59 | </div> |
|
60 | 60 | |
|
61 | 61 | |
|
62 | 62 | <div class="panel panel-default"> |
|
63 | 63 | <div class="panel-heading" id="captcha-options"> |
|
64 | 64 | <h3 class="panel-title">${_('Registration Captcha')} <a class="permalink" href="#captcha-options"> ΒΆ</a></h3> |
|
65 | 65 | </div> |
|
66 | 66 | <div class="panel-body"> |
|
67 | 67 | <div class="label"> |
|
68 | 68 | <label for="rhodecode_captcha_public_key">${_('Google reCaptcha v2 site key.')}</label> |
|
69 | 69 | </div> |
|
70 | 70 | <div class="field input"> |
|
71 | 71 | ${h.text('rhodecode_captcha_public_key',size=60)} |
|
72 | 72 | </div> |
|
73 | 73 | <div class="field"> |
|
74 | 74 | <span class="help-block"> |
|
75 | 75 | ${_('Site key for reCaptcha v2 system.')} |
|
76 | 76 | </span> |
|
77 | 77 | </div> |
|
78 | 78 | |
|
79 | 79 | <div class="label"> |
|
80 | 80 | <label for="rhodecode_captcha_private_key">${_('Google reCaptcha v2 secret key.')}</label> |
|
81 | 81 | </div> |
|
82 | 82 | <div class="field input"> |
|
83 | 83 | ${h.text('rhodecode_captcha_private_key',size=60)} |
|
84 | 84 | </div> |
|
85 | 85 | <div class="field"> |
|
86 | 86 | <span class="help-block"> |
|
87 | 87 | ${_('Secret key for reCaptcha v2 system. Setting this value will enable captcha on registration and password reset forms.')} |
|
88 | 88 | </span> |
|
89 | 89 | </div> |
|
90 | 90 | </div> |
|
91 | 91 | </div> |
|
92 | 92 | |
|
93 | 93 | <div class="panel panel-default"> |
|
94 | 94 | <div class="panel-heading" id="header-code-options"> |
|
95 | 95 | <h3 class="panel-title">${_('Custom Header Code')} <a class="permalink" href="#header-code-options"> ΒΆ</a></h3> |
|
96 | 96 | </div> |
|
97 | 97 | <div class="panel-body"> |
|
98 | 98 | <div class="select"> |
|
99 | 99 | <select id="pre_template" > |
|
100 | 100 | <option value="#">${_('Templates...')}</option> |
|
101 | 101 | <option value="ga">Google Analytics</option> |
|
102 | 102 | <option value="clicky">Clicky</option> |
|
103 | 103 | <option value="server_announce">${_('Server Announcement')}</option> |
|
104 | 104 | <option value="flash_filtering">${_('Flash message filtering')}</option> |
|
105 | 105 | <option value="custom_logo">${_('Custom logos')}</option> |
|
106 | 106 | </select> |
|
107 | 107 | </div> |
|
108 | 108 | <div style="padding: 10px 0px"></div> |
|
109 | 109 | <div class="textarea text-area"> |
|
110 | 110 | ${h.textarea('rhodecode_pre_code',cols=23,rows=5,class_="medium")} |
|
111 |
<span class="help-block">${_('Custom js/css code added at the end of the <head |
|
|
112 |
${_('Use <script/> or < |
|
|
111 | <span class="help-block">${_('Custom js/css code added at the end of the <head/> tag.')} | |
|
112 | ${_('Use <script/> or <style/> tags to define custom scripting or styling.')}</span> | |
|
113 | 113 | </div> |
|
114 | 114 | </div> |
|
115 | 115 | </div> |
|
116 | 116 | |
|
117 | 117 | <div class="panel panel-default"> |
|
118 | 118 | <div class="panel-heading" id="footer-code-options"> |
|
119 | 119 | <h3 class="panel-title">${_('Custom Footer Code')} <a class="permalink" href="#footer-code-options"> ΒΆ</a></h3> |
|
120 | 120 | </div> |
|
121 | 121 | <div class="panel-body"> |
|
122 | 122 | <div class="select"> |
|
123 | 123 | <select id="post_template" > |
|
124 | 124 | <option value="#">${_('Templates...')}</option> |
|
125 | 125 | <option value="ga">Google Analytics</option> |
|
126 | 126 | <option value="clicky">Clicky</option> |
|
127 | 127 | <option value="server_announce">${_('Server Announcement')}</option> |
|
128 | 128 | </select> |
|
129 | 129 | </div> |
|
130 | 130 | <div style="padding: 10px 0px"></div> |
|
131 | 131 | <div class="textarea text-area"> |
|
132 | 132 | ${h.textarea('rhodecode_post_code',cols=23,rows=5, class_="medium")} |
|
133 | 133 | <span class="help-block">${_('Custom js/css code added at the end of the <body> tag.')} |
|
134 |
${_('Use <script> or < |
|
|
134 | ${_('Use <script> or <style> tags to define custom scripting or styling.')}</span> | |
|
135 | 135 | </div> |
|
136 | 136 | </div> |
|
137 | 137 | </div> |
|
138 | 138 | |
|
139 | 139 | <div class="buttons"> |
|
140 | 140 | ${h.submit('save',_('Save settings'),class_="btn")} |
|
141 | 141 | ${h.reset('reset',_('Reset'),class_="btn")} |
|
142 | 142 | </div> |
|
143 | 143 | ${h.end_form()} |
|
144 | 144 | |
|
145 | 145 | |
|
146 | 146 | |
|
147 | 147 | ## TEMPLATES ## |
|
148 | 148 | ############### |
|
149 | 149 | |
|
150 | 150 | <script id="ga_tmpl" type="text/x-template"> |
|
151 | 151 | <%text filter="h"> |
|
152 | 152 | <script> |
|
153 | 153 | // Google Analytics |
|
154 | 154 | // Put your Google Analytics code instead of _GACODE_ |
|
155 | 155 | var _gaq_code = '_GACODE_'; |
|
156 | 156 | var _gaq = _gaq || []; |
|
157 | 157 | _gaq.push(['_setAccount', _gaq_code]); |
|
158 | 158 | _gaq.push(['_trackPageview']); |
|
159 | 159 | |
|
160 | 160 | (function() { |
|
161 | 161 | var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; |
|
162 | 162 | ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; |
|
163 | 163 | var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); |
|
164 | 164 | })(); |
|
165 | 165 | |
|
166 | 166 | rhodecode_statechange_callback = function(url, data){ |
|
167 | 167 | // ANALYTICS callback on html5 history state changed |
|
168 | 168 | // triggered by file browser, url is the new url, |
|
169 | 169 | // data is extra info passed from the State object |
|
170 | 170 | if (typeof window._gaq !== 'undefined') { |
|
171 | 171 | _gaq.push(['_trackPageview', url]); |
|
172 | 172 | } |
|
173 | 173 | }; |
|
174 | 174 | </script> |
|
175 | 175 | </%text> |
|
176 | 176 | </script> |
|
177 | 177 | |
|
178 | 178 | |
|
179 | 179 | |
|
180 | 180 | <script id="clicky_tmpl" type="text/x-template"> |
|
181 | 181 | <%text filter="h"> |
|
182 | 182 | <script src="//static.getclicky.com/js" type="text/javascript"></script> |
|
183 | 183 | <script type="text/javascript"> |
|
184 | 184 | // Clicky Analytics - should be used in the footer code section. |
|
185 | 185 | // Put your Clicky code instead of _CLICKYCODE_ here, |
|
186 | 186 | // and below in the <img> tag. |
|
187 | 187 | var _cl_code = _CLICKYCODE_; |
|
188 | 188 | try{clicky.init(_cl_code);}catch(e){} |
|
189 | 189 | |
|
190 | 190 | rhodecode_statechange_callback = function(url, data){ |
|
191 | 191 | // ANALYTICS callback on html5 history state changed |
|
192 | 192 | // triggered by file browser, url is the new url, |
|
193 | 193 | // data is extra info passed from the State object |
|
194 | 194 | if (typeof window.clicky !== 'undefined') { |
|
195 | 195 | clicky.log(url); |
|
196 | 196 | } |
|
197 | 197 | } |
|
198 | 198 | </script> |
|
199 | 199 | <noscript> |
|
200 | 200 | // Put your clicky code in the src file. |
|
201 | 201 | <p><img alt="Clicky" width="1" height="1" |
|
202 | 202 | src="//in.getclicky.com/_CLICKYCODE_ns.gif" /></p> |
|
203 | 203 | </noscript> |
|
204 | 204 | </%text> |
|
205 | 205 | </script> |
|
206 | 206 | |
|
207 | 207 | |
|
208 | 208 | |
|
209 | 209 | <script id="server_announce_tmpl" type='text/x-template'> |
|
210 | 210 | <%text filter="h"> |
|
211 | 211 | <script> |
|
212 | 212 | // Server announcement displayed on the top of the page. |
|
213 | 213 | // This can be used to send a global maintenance messages or other |
|
214 | 214 | // important messages to all users of the RhodeCode Enterprise system. |
|
215 | 215 | |
|
216 | 216 | $(document).ready(function(e) { |
|
217 | 217 | |
|
218 | 218 | // EDIT - put your message below |
|
219 | 219 | var message = "TYPE YOUR MESSAGE HERE"; |
|
220 | 220 | |
|
221 | 221 | // EDIT - choose "info"/"warning"/"error"/"success"/"neutral" as appropriate |
|
222 | 222 | var alert_level = "info"; |
|
223 | 223 | |
|
224 | 224 | $("#body").prepend( |
|
225 | 225 | ("<div id='server-announcement' class='"+alert_level+"'>_MSG_"+"</div>").replace("_MSG_", message) |
|
226 | 226 | ) |
|
227 | 227 | }) |
|
228 | 228 | </script> |
|
229 | 229 | </%text> |
|
230 | 230 | </script> |
|
231 | 231 | |
|
232 | 232 | <script id="flash_filtering_tmpl" type='text/x-template'> |
|
233 | 233 | <%text filter="h"> |
|
234 | 234 | <script> |
|
235 | 235 | // This filters out some flash messages before they are presented to user |
|
236 | 236 | // based on their contents. Could be used to filter out warnings/errors |
|
237 | 237 | // of license messages |
|
238 | 238 | |
|
239 | 239 | var filteredMessages = []; |
|
240 | 240 | for(var i =0; i< alertMessagePayloads.length; i++){ |
|
241 | 241 | if (typeof alertMessagePayloads[i].message.subdata.subtype !== 'undefined' && |
|
242 | 242 | alertMessagePayloads[i].message.subdata.subtype.indexOf('rc_license') !== -1){ |
|
243 | 243 | continue |
|
244 | 244 | } |
|
245 | 245 | filteredMessages.push(alertMessagePayloads[i]); |
|
246 | 246 | } |
|
247 | 247 | alertMessagePayloads = filteredMessages; |
|
248 | 248 | </script> |
|
249 | 249 | </%text> |
|
250 | 250 | </script> |
|
251 | 251 | |
|
252 | 252 | |
|
253 | 253 | <script id="custom_logo_tmpl" type='text/x-template'> |
|
254 | 254 | <%text filter="h"> |
|
255 | 255 | <script> |
|
256 | 256 | |
|
257 | 257 | $(document).ready(function(e) { |
|
258 | 258 | // 1) Set custom logo on login/register pages. |
|
259 | 259 | |
|
260 | 260 | // external URL, custom company logo |
|
261 | 261 | //$('.sign-in-image').attr("src", "http://server.com/logo_path/custom_logo.png"); |
|
262 | 262 | |
|
263 | 263 | // Alternative logo from static folder |
|
264 | 264 | $('.sign-in-image').attr("src", "/_static/rhodecode/images/RhodeCode_Logo_Black.png"); |
|
265 | 265 | |
|
266 | 266 | // option to set width/height, adjust if required to make your image look good. |
|
267 | 267 | $('.sign-in-image').css({"width": "300px", "height": "345px"}); |
|
268 | 268 | |
|
269 | 269 | // 2) Header logo on top bar |
|
270 | 270 | $('.logo-wrapper').find('img').attr('src', 'http://server.com/logo_path/custom_header_logo.png') |
|
271 | 271 | |
|
272 | 272 | }); |
|
273 | 273 | </script> |
|
274 | 274 | </%text> |
|
275 | 275 | </script> |
|
276 | 276 | |
|
277 | 277 | |
|
278 | 278 | <script> |
|
279 | 279 | var pre_cm = initCodeMirror('rhodecode_pre_code', '', false); |
|
280 | 280 | var pre_old = pre_cm.getValue(); |
|
281 | 281 | |
|
282 | 282 | var post_cm = initCodeMirror('rhodecode_post_code', '', false); |
|
283 | 283 | var post_old = post_cm.getValue(); |
|
284 | 284 | |
|
285 | 285 | var get_data = function(type, old) { |
|
286 | 286 | var get_tmpl = function(tmpl_name){ |
|
287 | 287 | // unescape some stuff |
|
288 | 288 | return htmlEnDeCode.htmlDecode($('#'+tmpl_name+'_tmpl').html()); |
|
289 | 289 | }; |
|
290 | 290 | return { |
|
291 | 291 | '#': old, |
|
292 | 292 | 'ga': get_tmpl('ga'), |
|
293 | 293 | 'clicky': get_tmpl('clicky'), |
|
294 | 294 | 'server_announce': get_tmpl('server_announce'), |
|
295 | 295 | 'flash_filtering': get_tmpl('flash_filtering'), |
|
296 | 296 | 'custom_logo': get_tmpl('custom_logo') |
|
297 | 297 | }[type] |
|
298 | 298 | }; |
|
299 | 299 | |
|
300 | 300 | $('#pre_template').select2({ |
|
301 | 301 | containerCssClass: 'drop-menu', |
|
302 | 302 | dropdownCssClass: 'drop-menu-dropdown', |
|
303 | 303 | dropdownAutoWidth: true, |
|
304 | 304 | minimumResultsForSearch: -1 |
|
305 | 305 | }); |
|
306 | 306 | |
|
307 | 307 | $('#post_template').select2({ |
|
308 | 308 | containerCssClass: 'drop-menu', |
|
309 | 309 | dropdownCssClass: 'drop-menu-dropdown', |
|
310 | 310 | dropdownAutoWidth: true, |
|
311 | 311 | minimumResultsForSearch: -1 |
|
312 | 312 | }); |
|
313 | 313 | |
|
314 | 314 | $('#post_template').on('change', function(e){ |
|
315 | 315 | var sel = this.value; |
|
316 | 316 | post_cm.setValue(get_data(sel, post_old)) |
|
317 | 317 | }); |
|
318 | 318 | |
|
319 | 319 | $('#pre_template').on('change', function(e){ |
|
320 | 320 | var sel = this.value; |
|
321 | 321 | pre_cm.setValue(get_data(sel, pre_old)) |
|
322 | 322 | }) |
|
323 | 323 | </script> |
General Comments 0
You need to be logged in to leave comments.
Login now