Browse Source

Show Glitter tips only once

pull/670/head
Safihre 9 years ago
parent
commit
4d34742f46
  1. 33
      interfaces/Glitter/templates/static/javascripts/glitter.main.js
  2. 2
      sabnzbd/cfg.py
  3. 2
      sabnzbd/interface.py

33
interfaces/Glitter/templates/static/javascripts/glitter.main.js

@ -1038,6 +1038,28 @@ function ViewModel() {
clear: function() { self.clearMessages('CacheMsg')}
});
}
// Message about tips and tricks, only once
if(response.config.misc.notified_new_skin < 2) {
self.allMessages.push({
index: 'TipsMsgV110',
type: glitterTranslate.status['INFO'],
text: glitterTranslate.glitterTips + ' <a class="queue-update-sab" href="https://sabnzbd.org/wiki/extra/glitter-tips-and-tricks" target="_blank">Glitter Tips and Tricks <span class="glyphicon glyphicon-new-window"></span></a>',
css: 'info',
clear: function() {
// Update the config to not show again
callAPI({
mode: 'set_config',
section: 'misc',
keyword: 'notified_new_skin',
value: 2
})
// Remove the actual message
self.clearMessages('TipsMsgV110')
}
});
}
})
// Orphaned folder check - Not for 5 days if user ignored it
@ -1083,17 +1105,6 @@ function ViewModel() {
});
}
// Message about tips and tricks, only once
if(!localStorageGetItem('TipsMsgV110')*1) {
self.allMessages.push({
index: 'TipsMsgV110',
type: glitterTranslate.status['INFO'],
text: glitterTranslate.glitterTips + ' <a class="queue-update-sab" href="https://sabnzbd.org/wiki/extra/glitter-tips-and-tricks" target="_blank">Glitter Tips and Tricks <span class="glyphicon glyphicon-new-window"></span></a>',
css: 'info',
clear: function() { self.clearMessages('TipsMsgV110')}
});
}
/***
Date-stuff
***/

2
sabnzbd/cfg.py

@ -224,7 +224,7 @@ web_color = OptionStr('misc', 'web_color', '')
web_color2 = OptionStr('misc', 'web_color2')
cleanup_list = OptionList('misc', 'cleanup_list')
warned_old_queue = OptionBool('misc', 'warned_old_queue9', False)
notified_new_skin = OptionBool('misc', 'notified_new_skin', False)
notified_new_skin = OptionNumber('misc', 'notified_new_skin', 0)
unwanted_extensions = OptionList('misc', 'unwanted_extensions')
action_on_unwanted_extensions = OptionNumber('misc', 'action_on_unwanted_extensions', 0)

2
sabnzbd/interface.py

@ -346,7 +346,7 @@ class MainPage(object):
if not cfg.notified_new_skin() and cfg.web_dir() != 'Glitter':
logging.warning(T('Try our new skin Glitter! Fresh new design that is optimized for desktop and mobile devices. Go to Config -> General to change your skin.'))
if not cfg.notified_new_skin():
cfg.notified_new_skin.set(True)
cfg.notified_new_skin.set(1)
config.save_config()
if kwargs.get('skip_wizard') or config.get_servers():

Loading…
Cancel
Save