Skip to content

Commit c61d445

Browse files
committed
enh: run DCOR theme patches during inspect
1 parent 64af5d6 commit c61d445

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

CHANGELOG

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
1.17.1
2+
- enh: run DCOR theme patches during inspect
3+
- setup: bump ckanext-dcor_theme to 1.1.0
14
1.17.0
25
- BREAKING: remove DCOR-colab branding recipe (migrated to ansible)
36
- BREAKING: remove DCOR-med branding recipe (migrated to ansible)

dcor_control/cli/inspect.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def inspect(assume_yes=False, dcor_site_config_dir=None):
7171
click.secho("Checking i18n hack...", bold=True)
7272
cn += inspect_mod.check_dcor_theme_i18n_hack(autocorrect=assume_yes)
7373

74-
click.secho("Checking DCOR theme css branding...", bold=True)
74+
click.secho("Checking DCOR theme css branding and patches...", bold=True)
7575
cn += inspect_mod.check_dcor_theme_main_css(autocorrect=assume_yes)
7676

7777
if cn:

dcor_control/inspect/config_ckan.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def check_dcor_theme_i18n_hack(autocorrect):
8888

8989

9090
def check_dcor_theme_main_css(autocorrect):
91-
"""Generate dcor_main.css
91+
"""Generate dcor_main.css and patch a few template files
9292
9393
This will run the command::
9494
@@ -100,10 +100,10 @@ def check_dcor_theme_main_css(autocorrect):
100100
# TODO: Check whether the paths created by this script are set up correctly
101101
if opt != "dcor_theme_main/dcor_theme_main":
102102
if autocorrect:
103-
print("Applying DCOR theme main css")
103+
print("Applying DCOR theme main css and templating patches")
104104
replace_main = True
105105
else:
106-
replace_main = common.ask("DCOR theme dcor_main.css is not setup")
106+
replace_main = common.ask("DCOR theme CSS and patches not set-up")
107107
if replace_main:
108108
# apply hack
109109
ckan_cmd = f"ckan -c {ckan_ini} dcor-theme-main-css-branding"
@@ -113,6 +113,10 @@ def check_dcor_theme_main_css(autocorrect):
113113
key="ckan.theme",
114114
value="dcor_theme_main/dcor_theme_main",
115115
autocorrect=True)
116+
# apply patches
117+
ckan_cmd_2 = f"ckan -c {ckan_ini} dcor-patch-ckan-templates"
118+
sp.check_output(ckan_cmd_2, shell=True)
119+
116120
return did_something
117121

118122

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ dependencies = [
3636
"ckanext-dc_view>=0.12.0",
3737
"ckanext-dcor_depot>=0.17.0",
3838
"ckanext-dcor_schemas>=0.22.0",
39-
"ckanext-dcor_theme>=0.12.0",
39+
"ckanext-dcor_theme>=1.1.0",
4040
"dcor_shared>=1.0.2",
4141
"importlib_resources",
4242
"numpy>=1.21", # CVE-2021-33430

0 commit comments

Comments
 (0)