1212def change_css_selectors (file_paths , changes_to_make , reverse = False ):
1313 """
1414 Modifies custom stylesheets to update specific CSS selectors.
15-
16- Args:
17- file_paths: List of file paths to process
18- changes_to_make: List of tuples with (old_selector, new_selector)
19- reverse: If True, reverses the changes (new_selector -> old_selector)
15+ Reverse allows this to be used for undo a migration as well.5rf
2016 """
2117 for file_path in file_paths :
2218 try :
@@ -86,21 +82,21 @@ def get_custom_stylesheet_paths(apps, schema_editor):
8682 )
8783 except SettingValue .DoesNotExist :
8884 continue
89- if theme . value == 'material' :
90- stylesheet_paths .extend ([
91- os .path .join (
92- settings .BASE_DIR ,
93- 'static' ,
94- 'material' ,
95- 'css' ,
96- f'journal{ journal_id } _override.css' ,
97- ),
98- os .path .join (
99- plugin_settings .BASE_CSS_PATH ,
100- str (journal_id ),
101- 'custom.css' ,
102- )
103- ])
85+
86+ stylesheet_paths .extend ([
87+ os .path .join (
88+ settings .BASE_DIR ,
89+ 'static' ,
90+ theme . value ,
91+ 'css' ,
92+ f'journal{ journal_id } _override.css' ,
93+ ),
94+ os .path .join (
95+ plugin_settings .BASE_CSS_PATH ,
96+ str (journal_id ),
97+ 'custom.css' ,
98+ )
99+ ])
104100
105101 for sheet in CrossJournalStylesheet .objects .filter (journals = journal ):
106102 stylesheet_paths .append (
@@ -110,7 +106,8 @@ def get_custom_stylesheet_paths(apps, schema_editor):
110106 sheet .stylesheet_name ,
111107 )
112108 )
113-
109+ elif theme .value == 'clean' :
110+ pass
114111 # Get press stylesheets
115112 press = Press .objects .first ()
116113 if press and press .theme == 'material' :
@@ -139,7 +136,7 @@ def find_and_handle_custom_stylesheets(apps, schema_editor, changes_to_make, rev
139136 Args:
140137 apps: Django apps registry
141138 schema_editor: Django schema editor
142- changes_to_make: List of tuples with (old_selector, new_selector)
139+ changes_to_make: List of tuples with (theme, old_selector, new_selector)
143140 reverse: If True, reverses the changes
144141 """
145142 stylesheet_paths = get_custom_stylesheet_paths (apps , schema_editor )
0 commit comments