From 6a399b3996d7ed98df301e6520373c45863816dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andre=CC=81s=20Gonza=CC=81lez?= Date: Fri, 9 Oct 2020 17:30:33 -0300 Subject: [PATCH 1/2] Added lms/static/certificates/sass to the list of directories where paver update_assets looks for sass files in themes. This allows compiling sass for certificates with comprehensive theming in place. --- pavelib/assets.py | 11 +++++++++++ pavelib/paver_tests/test_assets.py | 1 + 2 files changed, 12 insertions(+) diff --git a/pavelib/assets.py b/pavelib/assets.py index 52c6cfdbce..3ec86a84d0 100644 --- a/pavelib/assets.py +++ b/pavelib/assets.py @@ -194,6 +194,17 @@ def get_theme_sass_dirs(system, theme_dir): ], }) + # now compile theme sass files for certificate + if system == 'lms': + dirs.append({ + "sass_source_dir": theme_dir / system / "static" / "certificates" / "sass", + "css_destination_dir": theme_dir / system / "static" / "certificates" / "css", + "lookup_paths": [ + sass_dir / "partials", + sass_dir + ], + }) + return dirs diff --git a/pavelib/paver_tests/test_assets.py b/pavelib/paver_tests/test_assets.py index 16eed479fe..92cd202ac9 100644 --- a/pavelib/paver_tests/test_assets.py +++ b/pavelib/paver_tests/test_assets.py @@ -252,6 +252,7 @@ class TestPaverWatchAssetTasks(TestCase): self.expected_sass_directories.extend([ path(TEST_THEME_DIR) / 'lms/static/sass', path(TEST_THEME_DIR) / 'lms/static/sass/partials', + path(TEST_THEME_DIR) / 'lms/static/certificates/sass', path(TEST_THEME_DIR) / 'cms/static/sass', path(TEST_THEME_DIR) / 'cms/static/sass/partials', ]) From e45a88a9400def0eeffd63d72ac3d90714c054b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andre=CC=81s=20Gonza=CC=81lez?= Date: Tue, 13 Oct 2020 16:43:39 -0300 Subject: [PATCH 2/2] Use variables for certificate sass dir --- pavelib/assets.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pavelib/assets.py b/pavelib/assets.py index 3ec86a84d0..4014c4f2a2 100644 --- a/pavelib/assets.py +++ b/pavelib/assets.py @@ -167,6 +167,8 @@ def get_theme_sass_dirs(system, theme_dir): system_sass_dir = path(system) / "static" / "sass" sass_dir = theme_dir / system / "static" / "sass" css_dir = theme_dir / system / "static" / "css" + certs_sass_dir = theme_dir / system / "static" / "certificates" / "sass" + certs_css_dir = theme_dir / system / "static" / "certificates" / "css" dependencies = SASS_LOOKUP_DEPENDENCIES.get(system, []) if sass_dir.isdir(): @@ -197,8 +199,8 @@ def get_theme_sass_dirs(system, theme_dir): # now compile theme sass files for certificate if system == 'lms': dirs.append({ - "sass_source_dir": theme_dir / system / "static" / "certificates" / "sass", - "css_destination_dir": theme_dir / system / "static" / "certificates" / "css", + "sass_source_dir": certs_sass_dir, + "css_destination_dir": certs_css_dir, "lookup_paths": [ sass_dir / "partials", sass_dir