diff --git a/CHANGES.rst b/CHANGES.rst index 3c7b5b806c51deaca5ac9cbb4bfc9278ec50abb8..22adaa79cdbd90c97c2fcd0ee7be5c896cb34521 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,6 +1,11 @@ Kvalikirstu2 Changelog ====================== +1.0.12 - 2024/04/17 +------------------- +- Fixed css file name to be consistent with template +- Fixed study data folder name case issues by checking the actual name on filesystem + 1.0.11 - 2023/11/29 ------------------- - Added Jenkins CI configuration diff --git a/VERSION b/VERSION index 86844988ea931074d16236a3f323bde73e2f1906..492b167a6de7ea23f06015ad6e5da1a7c49e21e5 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.0.11 \ No newline at end of file +1.0.12 \ No newline at end of file diff --git a/kvalikirstu2/kvali_interface.py b/kvalikirstu2/kvali_interface.py index e20025eddbf7cef2f0f47b4e876841c7efaa70e7..0ac2ebe0e67e679c56349aca34f85152bb040163 100644 --- a/kvalikirstu2/kvali_interface.py +++ b/kvalikirstu2/kvali_interface.py @@ -137,6 +137,21 @@ def _try_load_header_info(): _DATA['header_info'] = header_scanner.get_header_info_for_study(_DATA['data_path']) +def update_study_data_folder(data_folder, study_path): + """Returns study data folder name as it is on filesystem if possible, otherwise returns the parsed value unchanged. + + :param data_folder: Parsed study data folder arg. + :param path: The study path. + + """ + # Check for a case-insensitive match from the list of folders in the study_path + matching_folder = next((folder for folder in os.listdir(study_path) if folder.lower() == data_folder.lower()), None) + + # If there's a case-insensitive match, return the matching folder name with the original casing + # If no case-insensitive match, return the provided folder name + return matching_folder if matching_folder else data_folder + + def set_study_path(path: str): """Sets the path for the study @@ -147,6 +162,7 @@ def set_study_path(path: str): path = os.getcwd() args = argument_parser.get_args() + args.study_data_folder = update_study_data_folder(args.study_data_folder, path) logger.debug('setting study_path %s', path) _DATA['data_path'] = os.path.join(path, args.study_data_folder) _DATA['study_path'] = path diff --git a/kvalikirstu2/templates/index_template.xml b/kvalikirstu2/templates/index_template.xml index f89629c4df6fc15014c6f82ae9df354ed144625d..fc67aa15b4b5090ac2533fe50c3e2a5ff2c6538e 100644 --- a/kvalikirstu2/templates/index_template.xml +++ b/kvalikirstu2/templates/index_template.xml @@ -3,7 +3,7 @@ <head> <meta charset="utf-8"/> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/> - <link rel="stylesheet" type="text/css" href="{{file_mapping.get_html_link('data')}}/css/dataTables.min.css"/> + <link rel="stylesheet" type="text/css" href="{{file_mapping.get_html_link('data')}}/css/datatables.min.css"/> <link rel="stylesheet" href="{{file_mapping.get_html_link('data')}}/css/foundation.min.css"/> <title>{{metadata.study_id}} - {{metadata.title}} - {{_("Index")}}</title> <style> .nojscell { display: none }