Add config for "global" help URL

This commit is contained in:
Lance Edgar 2020-08-20 17:51:00 -05:00
parent cfa9c95814
commit 9620fc5a83
3 changed files with 13 additions and 1 deletions

View file

@ -53,9 +53,15 @@ class ConfigExtension(BaseExtension):
config.setdefault('tailbone', 'themes.expose_picker', 'true')
def global_help_url(config):
return config.get('tailbone', 'global_help_url')
def legacy_mobile_enabled(config):
return config.getbool('tailbone', 'legacy_mobile.enabled',
default=True)
def protected_usernames(config):
return config.getlist('tailbone', 'protected_usernames')

View file

@ -44,6 +44,7 @@ from tailbone.forms.common import Feedback
from tailbone.db import Session
from tailbone.views import View
from tailbone.util import set_app_theme
from tailbone.config import global_help_url
class CommonView(View):
@ -69,6 +70,7 @@ class CommonView(View):
context = {
'image_url': image_url,
'use_buefy': self.get_use_buefy(),
'help_url': global_help_url(self.rattail_config),
}
if self.expose_quickie_search:

View file

@ -58,6 +58,7 @@ from webhelpers2.html import HTML, tags
from tailbone import forms, grids, diffs
from tailbone.views import View
from tailbone.config import global_help_url
log = logging.getLogger(__name__)
@ -2318,7 +2319,10 @@ class MasterView(View):
so if you like you can return a different help URL depending on which
type of CRUD view is in effect, etc.
"""
return self.help_url
if self.help_url:
return self.help_url
return global_help_url(self.rattail_config)
def render_to_response(self, template, data, mobile=False):
"""