Skip to content

Commit

Permalink
Create Central Style Folder (openemr#3792) (openemr#3793)
Browse files Browse the repository at this point in the history
  • Loading branch information
tywrenn committed Aug 1, 2020
1 parent eebd844 commit 5dee0ca
Show file tree
Hide file tree
Showing 15 changed files with 460 additions and 413 deletions.
34 changes: 31 additions & 3 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,16 @@ let config = {
style_tabs: 'interface/themes/tabs_style_*.scss',
style_uni: 'interface/themes/oe-styles/style_*.scss',
style_color: 'interface/themes/colors/*.scss',
directional: 'interface/themes/directional.scss'
directional: 'interface/themes/directional.scss',
misc: 'interface/themes/misc/**/*.scss'
}
},
dist: {
assets: 'public/assets/'
},
dest: {
themes: 'public/themes'
themes: 'public/themes',
misc_themes: 'public/themes/misc'
}
};

Expand Down Expand Up @@ -119,6 +121,18 @@ function styles_style_tabs() {
.pipe(gulp.dest(config.dest.themes));
}

// For anything else that needs to be moved, use misc themes
function styles_style_misc() {
return gulp.src(config.src.styles.misc)
.pipe(sourcemaps.init())
.pipe(sass().on('error', sass.logError))
.pipe(postcss([ prefix() ]))
.pipe(gap.prependText(autoGeneratedHeader))
.pipe(gulpif(!config.dev, csso()))
.pipe(gulpif(!config.dev, sourcemaps.write()))
.pipe(gulp.dest(config.dest.misc_themes));
}

// rtl standard themes css compilation
function rtl_style_portal() {
return gulp.src(config.src.styles.style_portal)
Expand Down Expand Up @@ -181,8 +195,22 @@ function rtl_style_tabs() {
.pipe(gulp.dest(config.dest.themes));
}

// For anything else that needs to be moved, use misc themes
function rtl_style_misc() {
return gulp.src(config.src.styles.misc)
.pipe(gap.prependText('$dir: rtl;\n')) // Simply a flag here due to a hierarchy possibly being created
.pipe(sourcemaps.init())
.pipe(sass().on('error', sass.logError))
.pipe(postcss([ prefix() ]))
.pipe(gap.prependText(autoGeneratedHeader))
.pipe(gulpif(!config.dev, csso()))
.pipe(gulpif(!config.dev, sourcemaps.write()))
.pipe(rename({ prefix: "rtl_" }))
.pipe(gulp.dest(config.dest.misc_themes));
}

// compile themes
const styles = gulp.parallel(styles_style_color, styles_style_uni, styles_style_portal, styles_style_tabs, rtl_style_color, rtl_style_uni, rtl_style_portal, rtl_style_tabs);
const styles = gulp.parallel(styles_style_color, styles_style_uni, styles_style_portal, styles_style_tabs, styles_style_misc, rtl_style_color, rtl_style_uni, rtl_style_portal, rtl_style_tabs, rtl_style_misc);

// Copies (and distills, if possible) assets from node_modules to public/assets
function install(done) {
Expand Down
14 changes: 7 additions & 7 deletions interface/billing/edih_view.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@

?>
<!DOCTYPE html>
<html lang="en">
<html>

<head>
<title><?php echo xlt("EDI History"); ?></title>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />

<?php Header::setupHeader(['datetime-picker', 'datatables', 'datatables-dt', 'datatables-bs', 'datatables-scroller']); ?>

<link rel="stylesheet" href="<?php echo $web_root?>/library/css/edi_history_v2.css">

<?php if ($_SESSION['language_direction'] == "rtl") { ?>
<link rel="stylesheet" href="<?php echo $GLOBALS['themes_static_relative']; ?>/misc/rtl_edi_history_v2.css" />
<?php } else { ?>
<link rel="stylesheet" href="<?php echo $GLOBALS['themes_static_relative']; ?>/misc/edi_history_v2.css" />
<?php } ?>
</head>
<!-- style for OpenEMR color -->
<body class='body_top'>
Expand Down Expand Up @@ -250,7 +250,7 @@
<input type="hidden" name="csrf_token_form" value="<?php echo attr(CsrfUtils::collectCsrfToken()); ?>" />
<h4><?php echo xlt("Inspect the log"); ?></h4>
<label for="logfile"><?php echo xlt("View Log"); ?></label>
<select class="custom-select id="logselect" name="log_select"></select>
<select class="custom-select" id="logselect" name="log_select"></select>
<input type="hidden" name="logshowfile" value="getlog">
<input class="btn btn-primary" id="logshow" type="submit" form="formlog" value="<?php echo xla("Submit"); ?>" />
<input class="btn btn-secondary" id="logclose" type="button" form="formlog" value="<?php echo xla("Close"); ?>" />
Expand Down
3 changes: 3 additions & 0 deletions interface/globals.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,9 @@ function GetCallingScriptName()
// (it is very likely that this path will be changed in the future))
$GLOBALS['assets_static_relative'] = "$web_root/public/assets";

// Relative themes directory, relative to the webserver root.
$GLOBALS['themes_static_relative'] = "$web_root/public/themes";

// Relative images directory, relative to the webserver root.
$GLOBALS['images_static_relative'] = "$web_root/public/images";

Expand Down
6 changes: 5 additions & 1 deletion interface/patient_file/history/encounters.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,11 @@ function generatePageElement($start, $pagesize, $billing, $issue, $text)
<html>
<head>
<!-- Main style sheet comes after the page-specific stylesheet to facilitate overrides. -->
<link rel="stylesheet" href="<?php echo $GLOBALS['webroot'] ?>/library/css/encounters.css">
<?php if ($_SESSION['language_direction'] == "rtl") { ?>
<link rel="stylesheet" href="<?php echo $GLOBALS['themes_static_relative']; ?>/misc/rtl_encounters.css" />
<?php } else { ?>
<link rel="stylesheet" href="<?php echo $GLOBALS['themes_static_relative']; ?>/misc/encounters.css" />
<?php } ?>
<!-- Not sure why we don't want this ui to be B.S responsive. -->
<?php Header::setupHeader(['no_textformat']); ?>

Expand Down
6 changes: 5 additions & 1 deletion interface/patient_file/summary/labdata.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,11 @@

<?php Header::setupHeader('dygraphs'); ?>

<link rel="stylesheet" href="<?php echo $web_root; ?>/interface/themes/labdata.css">
<?php if ($_SESSION['language_direction'] == "rtl") { ?>
<link rel="stylesheet" href="<?php echo $GLOBALS['themes_static_relative']; ?>/misc/rtl_labdata.css" />
<?php } else { ?>
<link rel="stylesheet" href="<?php echo $GLOBALS['themes_static_relative']; ?>/misc/labdata.css" />
<?php } ?>

<script>
function checkAll(bx) {
Expand Down
9 changes: 7 additions & 2 deletions interface/patient_tracker/patient_tracker.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,14 +165,19 @@
?>
<html>
<head>
<meta name="author" content="OpenEMR: MedExBank">
<meta name="author" content="OpenEMR: MedExBank" />
<?php Header::setupHeader(['datetime-picker', 'opener']); ?>
<title><?php echo xlt('Flow Board'); ?></title>
<script>
<?php require_once "$srcdir/restoreSession.php"; ?>
</script>

<link rel="stylesheet" href="<?php echo $GLOBALS['web_root']; ?>/library/css/bootstrap_navbar.css?v=<?php echo $v_js_includes; ?>">
<?php if ($_SESSION['language_direction'] == "rtl") { ?>
<link rel="stylesheet" href="<?php echo $GLOBALS['themes_static_relative']; ?>/misc/rtl_bootstrap_navbar.css?v=<?php echo $v_js_includes; ?>" />
<?php } else { ?>
<link rel="stylesheet" href="<?php echo $GLOBALS['themes_static_relative']; ?>/misc/bootstrap_navbar.css?v=<?php echo $v_js_includes; ?>" />
<?php } ?>

<script src="<?php echo $GLOBALS['web_root']; ?>/interface/main/messages/js/reminder_appts.js?v=<?php echo $v_js_includes; ?>"></script>

<link rel="shortcut icon" href="<?php echo $webroot; ?>/sites/default/favicon.ico" />
Expand Down
6 changes: 5 additions & 1 deletion interface/super/rules/base/template/basic.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@
<!-- TODO: FIX No Bootstrap header !-->
<?php Header::setupHeader(['no_bootstrap', 'no_fontawesome', 'no_textformat', 'no_dialog']); ?>

<link rel="stylesheet" href="<?php css_src('rules.css') ?>">
<?php if ($_SESSION['language_direction'] == "rtl") { ?>
<link rel="stylesheet" href="<?php echo $GLOBALS['themes_static_relative']; ?>/misc/rtl_rules.css" />
<?php } else { ?>
<link rel="stylesheet" href="<?php echo $GLOBALS['themes_static_relative']; ?>/misc/rules.css" />
<?php } ?>
</head>

<body class='body_top'>
Expand Down
46 changes: 0 additions & 46 deletions interface/super/rules/www/css/jQuery.autocomplete.css

This file was deleted.

159 changes: 0 additions & 159 deletions interface/super/rules/www/css/rules.css

This file was deleted.

Loading

0 comments on commit 5dee0ca

Please sign in to comment.