add support for an override stylesheet which applies to all users

This commit is contained in:
Andrew Dolgov 2020-11-30 15:53:32 +03:00
parent 8089fcc762
commit 81c52b4b1e
5 changed files with 21 additions and 4 deletions

View File

@ -7,6 +7,10 @@
define('COOKIE_LIFETIME_LONG', 86400*365);
// this CSS file is included for everyone (if it exists in themes.local)
// on login, registration, and main (index and prefs) pages
define('LOCAL_OVERRIDE_STYLESHEET', '.local-overrides.css');
$fetch_last_error = false;
$fetch_last_error_code = false;
$fetch_last_content_type = false;

View File

@ -18,6 +18,10 @@
} ?>
<?php if (theme_exists(LOCAL_OVERRIDE_STYLESHEET)) {
echo stylesheet_tag(get_theme_path(LOCAL_OVERRIDE_STYLESHEET));
} ?>
<style type="text/css">
@media (prefers-color-scheme: dark) {
body {

View File

@ -44,8 +44,11 @@
if ($theme && theme_exists("$theme")) {
echo stylesheet_tag(get_theme_path($theme), 'theme_css');
}
}
?>
} ?>
<?php if (theme_exists(LOCAL_OVERRIDE_STYLESHEET)) {
echo stylesheet_tag(get_theme_path(LOCAL_OVERRIDE_STYLESHEET));
} ?>
<script type="text/javascript">
const __csrf_token = "<?php echo $_SESSION["csrf_token"]; ?>";

View File

@ -36,8 +36,11 @@
if ($theme && theme_exists("$theme")) {
echo stylesheet_tag(get_theme_path($theme), 'theme_css');
}
}
?>
} ?>
<?php if (theme_exists(LOCAL_OVERRIDE_STYLESHEET)) {
echo stylesheet_tag(get_theme_path(LOCAL_OVERRIDE_STYLESHEET));
} ?>
<script type="text/javascript">
const __csrf_token = "<?php echo $_SESSION["csrf_token"]; ?>";

View File

@ -98,6 +98,9 @@
<?php echo javascript_tag("js/common.js") ?>
<?php echo javascript_tag("lib/prototype.js") ?>
<?php echo javascript_tag("lib/scriptaculous/scriptaculous.js?load=effects,controls") ?>
<?php if (theme_exists(LOCAL_OVERRIDE_STYLESHEET)) {
echo stylesheet_tag(get_theme_path(LOCAL_OVERRIDE_STYLESHEET));
} ?>
</head>
<script type="text/javascript">