Skip to content

Commit

Permalink
Rename themes
Browse files Browse the repository at this point in the history
  • Loading branch information
Etheryte committed Feb 24, 2025
1 parent 4f22a64 commit ddacb7c
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1145,7 +1145,7 @@ public List<String> getWebThemesList() {
* @return the name of the theme for the webUI
*/
public String getDefaultWebTheme() {
return Config.get().getString(WEB_THEME, "susemanager-light");
return Config.get().getString(WEB_THEME, "suse-light");
}

/**
Expand Down
4 changes: 2 additions & 2 deletions web/conf/rhn_web.conf
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ web.locale = en_US
web.docs_locale = en

# Set the list of possible webUI style themes name in a comma separated name list
# susemanager-light,susemanager-dark,uyuni
web.themes = susemanager-light,susemanager-dark,uyuni
# suse-light,suse-dark,uyuni
web.themes = suse-light,suse-dark,uyuni

# Set the default webUI style theme name
web.theme_default = uyuni
Expand Down
4 changes: 2 additions & 2 deletions web/html/src/branding/css/base/mixins.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
@mixin onSuma {
@if $theme == "susemanager-light" {
@if $theme == "suse-light" {
@content;
}
@if $theme == "susemanager-dark" {
@if $theme == "suse-dark" {
@content;
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "./susemanager-light-variables.scss";
@import "./suse-light-variables.scss";

$aside-background: $eos-bc-pine-500;
$aside-menu-text: $eos-bc-white;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$theme: "susemanager-dark";
$theme: "suse-dark";

@import "./base/body.scss";

Expand All @@ -9,7 +9,7 @@ $theme: "susemanager-dark";
@import "bootstrap/scss/bootstrap";

@import "./variables.scss";
@import "./susemanager-dark-variables.scss";
@import "./suse-dark-variables.scss";

display: flex;
flex-direction: column;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$theme: "susemanager-light";
$theme: "suse-light";

@import "./base/body.scss";

Expand All @@ -9,7 +9,7 @@ $theme: "susemanager-light";
@import "bootstrap/scss/bootstrap";

@import "./variables.scss";
@import "./susemanager-light-variables.scss";
@import "./suse-light-variables.scss";

display: flex;
flex-direction: column;
Expand Down
4 changes: 2 additions & 2 deletions web/html/src/build/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ module.exports = (env, argv) => {
return {
entry: {
"javascript/manager/main": "./manager/index.ts",
"css/updated-susemanager-light": path.resolve(__dirname, "../branding/css/susemanager-light.scss"),
"css/updated-susemanager-dark": path.resolve(__dirname, "../branding/css/susemanager-dark.scss"),
"css/updated-suse-light": path.resolve(__dirname, "../branding/css/suse-light.scss"),
"css/updated-suse-dark": path.resolve(__dirname, "../branding/css/suse-dark.scss"),
"css/updated-uyuni": path.resolve(__dirname, "../branding/css/uyuni.scss"),
},
output: {
Expand Down
24 changes: 9 additions & 15 deletions web/html/src/core/debugUtils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { showErrorToastr, showSuccessToastr, showWarningToastr } from "component
const debugUtils = {
logTheme() {
const theme = document.querySelector<HTMLLinkElement>(
'link[href^="/css/updated-susemanager-light"],link[href^="/css/updated-susemanager-dark"],link[href^="/css/updated-uyuni"]'
'link[href^="/css/updated-suse-light"],link[href^="/css/updated-suse-dark"],link[href^="/css/updated-uyuni"]'
);
if (!theme) {
throw new TypeError("Unable to identify theme");
Expand All @@ -13,35 +13,29 @@ const debugUtils = {
},
toggleTheme() {
if (document.body.className.includes("theme-susemanager-")) {
document.body.className = document.body.className.replace("theme-susemanager-light", "theme-uyuni");
document.body.className = document.body.className.replace("theme-susemanager-dark", "theme-uyuni");
document.body.className = document.body.className.replace("theme-suse-light", "theme-uyuni");
document.body.className = document.body.className.replace("theme-suse-dark", "theme-uyuni");
} else if (document.body.className.includes("theme-uyuni")) {
document.body.className = document.body.className.replace("theme-uyuni", "theme-susemanager-light");
document.body.className = document.body.className.replace("theme-uyuni", "theme-suse-light");
}

const sumaLight = document.querySelector('link[href^="/css/updated-susemanager-light"]');
const sumaLight = document.querySelector('link[href^="/css/updated-suse-light"]');
if (sumaLight) {
sumaLight.setAttribute(
"href",
sumaLight.getAttribute("href")!.replace("updated-susemanager-light", "updated-uyuni")
);
sumaLight.setAttribute("href", sumaLight.getAttribute("href")!.replace("updated-suse-light", "updated-uyuni"));
this.logTheme();
return;
}

const sumaDark = document.querySelector('link[href^="/css/updated-susemanager-dark"]');
const sumaDark = document.querySelector('link[href^="/css/updated-suse-dark"]');
if (sumaDark) {
sumaDark.setAttribute(
"href",
sumaDark.getAttribute("href")!.replace("updated-susemanager-dark", "updated-uyuni")
);
sumaDark.setAttribute("href", sumaDark.getAttribute("href")!.replace("updated-suse-dark", "updated-uyuni"));
this.logTheme();
return;
}

const uyuni = document.querySelector('link[href^="/css/updated-uyuni"]');
if (uyuni) {
uyuni.setAttribute("href", uyuni.getAttribute("href")!.replace("updated-uyuni", "updated-susemanager-light"));
uyuni.setAttribute("href", uyuni.getAttribute("href")!.replace("updated-uyuni", "updated-suse-light"));
this.logTheme();
return;
}
Expand Down
2 changes: 1 addition & 1 deletion web/html/src/manager/login/login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import withPageWrapper from "components/general/with-page-wrapper";
import SusemanagerThemeLogin from "./susemanager/login";
import UyuniThemeLogin from "./uyuni/login";

type Theme = "uyuni" | "susemanager-light" | "susemanager-dark";
type Theme = "uyuni" | "suse-light" | "suse-dark";

const products = {
suma: {
Expand Down
2 changes: 1 addition & 1 deletion web/html/src/styleguide/template.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = {
head: {
// Some of these will currently fail due to CORS, but will be obsolete once we move branding into web
links: [
`/css/susemanager-light.css?cb=${noCache}`,
`/css/suse-light.css?cb=${noCache}`,
`/fonts/font-awesome/css/font-awesome.css?cb=${noCache}`,
`/fonts/font-spacewalk/css/spacewalk-font.css?cb=${noCache}`,
`/css/jquery.timepicker.css?cb=${noCache}`,
Expand Down
2 changes: 1 addition & 1 deletion web/spacewalk-web.spec
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ popd

# Adjust default theme for SUSE Manager
%if 0%{?sle_version} && ! (0%{?is_opensuse} || 0%{?rhel} || 0%{?fedora})
sed -i -e 's/^web.theme_default =.*$/web.theme_default = susemanager-light/' %{buildroot}%{_datadir}/rhn/config-defaults/rhn_web.conf
sed -i -e 's/^web.theme_default =.*$/web.theme_default = suse-light/' %{buildroot}%{_datadir}/rhn/config-defaults/rhn_web.conf
%endif

%find_lang spacewalk-web
Expand Down

0 comments on commit ddacb7c

Please sign in to comment.