##// END OF EJS Templates
settings: re-use attached request global config for performance...
settings: re-use attached request global config for performance - since we *always* generate a global config and register it into request make use of it, and not rely on the get_all_settings heavy logic that makes it slow to fetch because of cache checks. Within single request we're fine to re-use it when ever request attribute is available

File last commit:

r2351:59272121 default
r4200:007322e6 stable
Show More
plugin_init.mako
19 lines | 620 B | application/x-mako | MakoHtmlLexer
<%page args="config"/>
<script>
var CHANNELSTREAM_URLS = ${config['url_gen'](request)|n};
%if request.registry.rhodecode_plugins['channelstream']['enabled'] and c.rhodecode_user.username != h.DEFAULT_USER:
var CHANNELSTREAM_SETTINGS = {
'enabled': true,
'ws_location': '${request.registry.settings.get('channelstream.ws_url')}',
'webapp_location': '${h.route_url('home').rstrip('/')}'
};
%else:
var CHANNELSTREAM_SETTINGS = {
'enabled':false,
'ws_location': '',
'webapp_location': '${h.route_url('home').rstrip('/')}'
};
%endif
</script>