Commit 96a74223 authored by michael.simon's avatar michael.simon
Browse files

embed burger icon svg, to get javascript switch to work

parent 96298ec3
......@@ -61,6 +61,14 @@ public class HeadBarBean {
return getOrDefault(request.getServerName() + "_app_base", "");
}
public String getBurgerIcon() {
return "<button class=\"burger\"><svg class=\"burger-icon\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\" viewBox=\"0 0 300 274.5\" width=\"300px\" height=\"274.5px\">\n"
+ " <rect class=\"burger-top\" y=\"214.4\" width=\"300\" height=\"60.1\"/>\n"
+ " <rect class=\"burger-middle\" y=\"107.2\" width=\"300\" height=\"60.1\"/>\n"
+ " <rect class=\"burger-bottom\" y=\"0\" width=\"300\" height=\"60.1\"/>\n"
+ "</svg></button>";
}
private String getOrDefault(String key, String defaultString) {
if (appConfig.getConfigValue(key) != null) {
return appConfig.getConfigValue(key);
......
<svg class="burger-icon" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 300 274.5" width="300px" height="274.5px">
<rect class="burger-top" y="214.4" width="300" height="60.1"/>
<rect class="burger-middle" y="107.2" width="300" height="60.1"/>
<rect class="burger-bottom" y="0" width="300" height="60.1"/>
</svg>
\ No newline at end of file
......@@ -3,7 +3,9 @@
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui">
xmlns:p="http://primefaces.org/ui"
>
<head>
<title>Head bar</title>
</head>
......@@ -20,7 +22,8 @@
</div>
<div class="navigation">
<button class="burger"><img src="#{resource['img/burger-icon.svg']}" class="burger-icon" /></button>
<h:outputText value="#{headBarBean.burgerIcon}" escape="false" />
<!-- <button class="burger"><img src="#{resource['img/burger-icon.svg']}" class="burger-icon" /></button> -->
<div class="navigation-meta">
<ul class="navigation-meta-links">
......
......@@ -53,7 +53,7 @@
<i class="fa fa-fw fa-key"></i>
<b><h:outputText value="#{token.serial}" /></b>
</f:facet>
<p:panelGrid columns="2">
<h:panelGrid columns="2">
<p:outputPanel>
<h:graphicImage width="60px" value="#{resource['img/smartphone.svg']}" alt="Smartphone" rendered="#{token.tokenType == 'TOTP' and token.serial.startsWith('TOTP')}"/>
<h:graphicImage width="60px" value="#{resource['img/kittoken_small.png']}" alt="Hardware Token" rendered="#{token.tokenType == 'TOTP' and not token.serial.startsWith('TOTP')}"/>
......@@ -67,7 +67,7 @@
<h:outputText value="#{messages.twofa_tokentype_tanlist}" rendered="#{token.tokenType == 'HOTP'}"/>
<h:outputText value="#{messages.twofa_tokentype_yubikey}" rendered="#{token.tokenType == 'yubico'}"/>
</h:panelGroup>
</p:panelGrid>
</h:panelGrid>
</p:panel>
</p:dataGrid>
......
......@@ -46,7 +46,7 @@
<i class="fa fa-fw fa-key"></i>
<b><h:outputText value="#{token.serial}" /></b>
</f:facet>
<p:panelGrid columns="2">
<h:panelGrid columns="2">
<p:outputPanel>
<h:graphicImage width="60px" value="#{resource['img/smartphone.svg']}" alt="Smartphone" rendered="#{token.tokenType == 'TOTP' and token.serial.startsWith('TOTP')}"/>
<h:graphicImage width="60px" value="#{resource['img/kittoken_small.png']}" alt="Hardware Token" rendered="#{token.tokenType == 'TOTP' and not token.serial.startsWith('TOTP')}"/>
......@@ -72,7 +72,7 @@
<h:outputText value="#{messages.twofa_token_not_init}" style="color:red;"/>
</p:panel>
</p:outputPanel>
</p:panelGrid>
</h:panelGrid>
</p:panel>
</p:dataGrid>
</p:outputPanel>
......@@ -80,12 +80,12 @@
<p:dataGrid var="token" value="#{twoFaUserBean.tokenList}" columns="2" styleClass="whitefoot"
layout="grid" style="margin-bottom: 16px;" rendered="#{! twoFaUserBean.readOnly}">
<f:facet name="header">#{messages.twofa_list}</f:facet>
<p:panel styleClass="grayback" style="margin-bottom: 0px;">
<p:panel style="margin-bottom: 0px;">
<f:facet name="header">
<i class="fa fa-fw fa-key"></i>
<b><h:outputText value="#{token.serial}" /></b>
</f:facet>
<p:panelGrid columns="2">
<h:panelGrid columns="2">
<p:outputPanel>
<h:graphicImage width="60px" value="#{resource['img/smartphone.svg']}" alt="Smartphone" rendered="#{token.tokenType == 'TOTP' and token.serial.startsWith('TOTP')}"/>
<h:graphicImage width="60px" value="#{resource['img/kittoken_small.png']}" alt="Hardware Token" rendered="#{token.tokenType == 'TOTP' and not token.serial.startsWith('TOTP')}"/>
......@@ -121,7 +121,7 @@
update="@form" rendered="#{token.isactive and token.tokenType == 'HMAC'}"
oncomplete="PF('showBackupTanDlg').show();"/>
</p:outputPanel>
</p:panelGrid>
</h:panelGrid>
</p:panel>
</p:dataGrid>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment