From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 2EEFE92702 for ; Tue, 14 Mar 2023 15:02:25 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 1761921FA8 for ; Tue, 14 Mar 2023 15:02:25 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Tue, 14 Mar 2023 15:02:24 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 23A09461BE for ; Tue, 14 Mar 2023 15:02:24 +0100 (CET) From: Stefan Sterz To: pve-devel@lists.proxmox.com Date: Tue, 14 Mar 2023 15:01:59 +0100 Message-Id: <20230314140203.1107068-4-s.sterz@proxmox.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230314140203.1107068-1-s.sterz@proxmox.com> References: <20230314140203.1107068-1-s.sterz@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.067 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [pveproxy.pm] Subject: [pve-devel] [PATCH manager] pveproxy/template: switch to using the "auto" theme per default X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Mar 2023 14:02:25 -0000 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 --- PVE/Service/pveproxy.pm | 5 ++++- www/index.html.tpl | 8 ++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/PVE/Service/pveproxy.pm b/PVE/Service/pveproxy.pm index 3fd76128..7b305f76 100755 --- a/PVE/Service/pveproxy.pm +++ b/PVE/Service/pveproxy.pm @@ -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 diff --git a/www/index.html.tpl b/www/index.html.tpl index be31dd40..b07ce5f1 100644 --- a/www/index.html.tpl +++ b/www/index.html.tpl @@ -12,11 +12,11 @@ - [%- IF theme %] - [%- IF theme == 'auto' %] - - [%- ELSE %] + [%- IF theme != 'crisp' %] + [%- IF theme != 'auto' %] + [%- ELSE %] + [%- END -%] [%- END -%] -- 2.30.2