global settings: add a new template for flash filtering
This commit is contained in:
parent
73c93af3e7
commit
108430ae23
1 changed files with 20 additions and 1 deletions
|
|
@ -72,6 +72,7 @@ ${h.secure_form(url('admin_settings_global'), method='post')}
|
|||
<option value="ga">Google Analytics</option>
|
||||
<option value="clicky">Clicky</option>
|
||||
<option value="server_announce">${_('Server Announcement')}</option>
|
||||
<option value="flash_filtering">${_('Example flash message filtering')}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div style="padding: 10px 0px"></div>
|
||||
|
|
@ -198,7 +199,24 @@ $(document).ready(function(e){
|
|||
</%text>
|
||||
</script>
|
||||
|
||||
<script id="flash_filtering_tmpl" type='text/x-template'>
|
||||
<%text filter="h">
|
||||
<script>
|
||||
// This filters out some flash messages before they are presented to user
|
||||
// based on their contents
|
||||
|
||||
var filteredMessages = [];
|
||||
for(var i =0; i< alertMessagePayloads.length; i++){
|
||||
if (typeof alertMessagePayloads[i].message.subdata.subtype !== 'undefined' &&
|
||||
alertMessagePayloads[i].message.subdata.subtype.indexOf('rc_license') !== -1){
|
||||
continue
|
||||
}
|
||||
filteredMessages.push(alertMessagePayloads[i]);
|
||||
}
|
||||
alertMessagePayloads = filteredMessages;
|
||||
</script>
|
||||
</%text>
|
||||
</script>
|
||||
|
||||
<script>
|
||||
var pre_cm = initCodeMirror('rhodecode_pre_code', '', false);
|
||||
|
|
@ -217,7 +235,8 @@ var get_data = function(type, old){
|
|||
'#': old,
|
||||
'ga': get_tmpl('ga'),
|
||||
'clicky': get_tmpl('clicky'),
|
||||
'server_announce': get_tmpl('server_announce')
|
||||
'server_announce': get_tmpl('server_announce'),
|
||||
'flash_filtering': get_tmpl('flash_filtering')
|
||||
}[type]
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue