Skip to content

Commit

Permalink
[#4779] Remove Boostrap 2 templates option
Browse files Browse the repository at this point in the history
Leave the config option and mechanism to switch templates in place in
case we re-use in the future, but only accepting the current values.
  • Loading branch information
amercader committed May 10, 2019
1 parent 32080c1 commit 97093dc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 26 deletions.
4 changes: 0 additions & 4 deletions ckan/config/deployment.ini_tmpl
Expand Up @@ -119,10 +119,6 @@ ckan.views.default_views = image_view text_view recline_view

## Front-End Settings

# Uncomment following configuration to enable using of Bootstrap 2
#ckan.base_public_folder = public-bs2
#ckan.base_templates_folder = templates-bs2

ckan.site_title = CKAN
ckan.site_logo = /base/images/ckan-logo.png
ckan.site_description =
Expand Down
8 changes: 4 additions & 4 deletions ckan/config/environment.py
Expand Up @@ -76,14 +76,14 @@ def find_controller(self, controller):
# Pylons paths
root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

valid_base_public_folder_names = ['public', 'public-bs2']
valid_base_public_folder_names = ['public']
static_files = app_conf.get('ckan.base_public_folder', 'public')
app_conf['ckan.base_public_folder'] = static_files

if static_files not in valid_base_public_folder_names:
raise CkanConfigurationException(
'You provided an invalid value for ckan.base_public_folder. '
'Possible values are: "public" and "public-bs2".'
'Possible values are: "public".'
)

log.info('Loading static files from %s' % static_files)
Expand Down Expand Up @@ -248,14 +248,14 @@ def update_config():
config['pylons.h'] = helpers.helper_functions

# Templates and CSS loading from configuration
valid_base_templates_folder_names = ['templates', 'templates-bs2']
valid_base_templates_folder_names = ['templates']
templates = config.get('ckan.base_templates_folder', 'templates')
config['ckan.base_templates_folder'] = templates

if templates not in valid_base_templates_folder_names:
raise CkanConfigurationException(
'You provided an invalid value for ckan.base_templates_folder. '
'Possible values are: "templates" and "templates-bs2".'
'Possible values are: "templates".'
)

jinja2_templates_path = os.path.join(root, templates)
Expand Down
22 changes: 4 additions & 18 deletions doc/maintaining/configuration.rst
Expand Up @@ -1430,15 +1430,8 @@ Example::
Default value: ``public``

This config option is used to configure the base folder for static files used
by CKAN core. It's used to determine which version of Bootstrap to be used.
It accepts two values: ``public`` (Bootstrap 3, the default value from CKAN
2.8 onwards) and ``public-bs2`` (Bootstrap 2, used until CKAN 2.7).

It must be used in conjunction with :ref:`ckan.base_templates_folder` in order
for it to properly function. Also, you can't use for example Bootstrap 3 for
static files and Bootstrap 2 for templates or vice versa.

.. note:: Starting with CKAN 2.8, Bootstrap 3 will be used as a default.
by CKAN core. It is currently unused and it only accepts one value: ``public``
(Bootstrap 3, the default value from CKAN 2.8 onwards).

.. _ckan.base_templates_folder:

Expand All @@ -1452,15 +1445,8 @@ Example::
Default value: ``templates``

This config option is used to configure the base folder for templates used
by CKAN core. It's used to determine which version of Bootstrap to be used.
It accepts two values: ``templates`` (Bootstrap 3, the default value from CKAN
2.8 onwards) and ``templates-bs2`` (Bootstrap 2, used until CKAN 2.7).

It must be used in conjunction with :ref:`ckan.base_public_folder` in order
for it to properly function. Also, you can't use for example Bootstrap 3 for
templates and Bootstrap 2 for static files or vice versa.

.. note:: Starting with CKAN 2.8, Bootstrap 3 will be used as a default.
by CKAN core. It is currently unused and it only accepts one vaue: ``templates``
(Bootstrap 3, the default value from CKAN 2.8 onwards).

.. end_config-theming
Expand Down

0 comments on commit 97093dc

Please sign in to comment.