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