]> git.proxmox.com Git - pve-manager.git/commitdiff
pveproxy/template: switch to using the "auto" theme per default
authorStefan Sterz <s.sterz@proxmox.com>
Tue, 14 Mar 2023 14:01:59 +0000 (15:01 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 14 Mar 2023 14:11:42 +0000 (15:11 +0100)
the auto theme uses media queries to detect a users preferred theme,
switch to using it per default instead of the light theme.

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
PVE/Service/pveproxy.pm
www/index.html.tpl

index 3fd76128b370835dd681dada3c4ce8ab4c1348c0..7b305f76026bb66b40df9a1d1a92d6da59647dab 100755 (executable)
@@ -215,6 +215,10 @@ sub get_index {
        }
     }
 
+    if ($theme eq "") {
+       $theme = "auto"
+    }
+
     if (!$lang) {
        my $dc_conf = PVE::Cluster::cfs_read_file('datacenter.cfg');
        $lang = $dc_conf->{language} // 'en';
@@ -264,7 +268,6 @@ sub get_index {
        version => "$version",
        wtversion => $wtversion,
        theme => $theme,
-       auto => $theme == "auto",
     };
 
     # by default, load the normal index
index be31dd40e0f9dfc9799f8bb620571824dd7fab53..b07ce5f175bb2067f9d78860346b2f9fff59cdfa 100644 (file)
     <link rel="stylesheet" type="text/css" href="/pve2/fa/css/font-awesome.css" />
     <link rel="stylesheet" type="text/css" href="/pve2/css/ext6-pve.css?ver=[% version %]" />
     <link rel="stylesheet" type="text/css" href="/pwt/css/ext6-pmx.css?ver=[% wtversion %]" />
-    [%- IF theme %]
-      [%- IF theme == 'auto' %]
-    <link rel="stylesheet" type="text/css" media="(prefers-color-scheme: dark)" href="/pwt/themes/theme-proxmox-dark.css?ver=[% wtversion %]" />
-      [%- ELSE %]
+    [%- IF theme != 'crisp' %]
+      [%- IF theme != 'auto' %]
     <link rel="stylesheet" type="text/css" href="/pwt/themes/theme-[% theme %].css?ver=[% wtversion %]" />
+      [%- ELSE %]
+    <link rel="stylesheet" type="text/css" media="(prefers-color-scheme: dark)" href="/pwt/themes/theme-proxmox-dark.css?ver=[% wtversion %]" />
       [%- END -%]
     [%- END -%]