From: <udi...@us...> - 2022-02-13 12:41:19
|
Revision: 1434 http://sourceforge.net/p/j-trac/code/1434 Author: udittmer Date: 2022-02-13 12:41:17 +0000 (Sun, 13 Feb 2022) Log Message: ----------- more color customizations Modified Paths: -------------- trunk/jtrac/src/main/java/info/jtrac/domain/Config.java trunk/jtrac/src/main/java/info/jtrac/util/ItemUtils.java trunk/jtrac/src/main/java/info/jtrac/wicket/BasePage.html trunk/jtrac/src/main/java/info/jtrac/wicket/BasePage.java trunk/jtrac/src/main/java/info/jtrac/wicket/IndividualHeadPanel.html trunk/jtrac/src/main/java/info/jtrac/wicket/LoginPage.html trunk/jtrac/src/main/java/info/jtrac/wicket/LoginPage.java trunk/jtrac/src/main/java/info/jtrac/wicket/LogoutPage.html trunk/jtrac/src/main/java/info/jtrac/wicket/LogoutPage.java trunk/jtrac/src/main/resources/messages.properties trunk/jtrac/src/main/resources/messages_de.properties trunk/jtrac/src/main/resources/messages_en.properties trunk/jtrac/src/main/webapp/resources/jtrac.css Modified: trunk/jtrac/src/main/java/info/jtrac/domain/Config.java =================================================================== --- trunk/jtrac/src/main/java/info/jtrac/domain/Config.java 2022-02-11 09:16:05 UTC (rev 1433) +++ trunk/jtrac/src/main/java/info/jtrac/domain/Config.java 2022-02-13 12:41:17 UTC (rev 1434) @@ -55,6 +55,7 @@ PARAMS.add("jtrac.header.picture"); PARAMS.add("jtrac.header.text"); PARAMS.add("jtrac.color.gray"); + PARAMS.add("jtrac.color.header"); PARAMS.add("jtrac.color.lightblue"); PARAMS.add("jtrac.color.mediumblue"); PARAMS.add("jtrac.color.darkblue"); Modified: trunk/jtrac/src/main/java/info/jtrac/util/ItemUtils.java =================================================================== --- trunk/jtrac/src/main/java/info/jtrac/util/ItemUtils.java 2022-02-11 09:16:05 UTC (rev 1433) +++ trunk/jtrac/src/main/java/info/jtrac/util/ItemUtils.java 2022-02-13 12:41:17 UTC (rev 1434) @@ -142,7 +142,13 @@ return null; } else { Node document = parser.parse(text); - return renderer.render(document); + String html = renderer.render(document).trim(); + // strip out opening/closing <p> and closing linefeed + if (html.startsWith("<p>")) + html = html.substring(3); + if (html.endsWith("</p>")) + html = html.substring(0, html.length()-4); + return html; } } Modified: trunk/jtrac/src/main/java/info/jtrac/wicket/BasePage.html =================================================================== --- trunk/jtrac/src/main/java/info/jtrac/wicket/BasePage.html 2022-02-11 09:16:05 UTC (rev 1433) +++ trunk/jtrac/src/main/java/info/jtrac/wicket/BasePage.html 2022-02-13 12:41:17 UTC (rev 1434) @@ -5,8 +5,8 @@ <link rel="stylesheet" type="text/css" href="resources/jtrac.css"/> <link rel="shortcut icon" type="image/x-icon" href="favicon.ico"/> <link rel="icon" type="image/x-icon" href="favicon.ico"/> - </head> - <body> + </head> + <body> <span wicket:id="individuel"></span><br/> <span wicket:id="header"></span><br/> <div style="clear:both"><br/></div> @@ -13,11 +13,11 @@ <wicket:child/> <div><br/></div> <table width="100%" class="jtrac"> - <tr class="alt"> + <tr class="header"> <td align="right"> <i>powered by <a href="http://j-trac.sourceforge.net/" target="_blank">JTrac</a> <span wicket:id="version"></span></i> </td> </tr> - </table> + </table> </body> </html> Modified: trunk/jtrac/src/main/java/info/jtrac/wicket/BasePage.java =================================================================== --- trunk/jtrac/src/main/java/info/jtrac/wicket/BasePage.java 2022-02-11 09:16:05 UTC (rev 1433) +++ trunk/jtrac/src/main/java/info/jtrac/wicket/BasePage.java 2022-02-13 12:41:17 UTC (rev 1434) @@ -82,6 +82,7 @@ public BasePage() { String colorGray = JtracApplication.get().getJtrac().loadConfig("jtrac.color.gray", "#CCCCCC"); + String colorHeader = JtracApplication.get().getJtrac().loadConfig("jtrac.color.header", "#E1ECFE"); String colorLightBlue = JtracApplication.get().getJtrac().loadConfig("jtrac.color.lightblue", "#E1ECFE"); String colorMediumBlue = JtracApplication.get().getJtrac().loadConfig("jtrac.color.mediumblue", "#C3D9FF"); String colorDarkBlue = JtracApplication.get().getJtrac().loadConfig("jtrac.color.darkblue", "#0000D9"); @@ -95,6 +96,7 @@ add(new HeaderContributor(new IHeaderContributor() { public void renderHead(IHeaderResponse response) { String js = "var r = document.querySelector(':root');\n" + + "r.style.setProperty('--header', '"+colorHeader+"');\n" + "r.style.setProperty('--lightblue', '"+colorLightBlue+"');\n" + "r.style.setProperty('--mediumblue', '"+colorMediumBlue+"');\n" + "r.style.setProperty('--darkblue', '"+colorDarkBlue+"');\n" Modified: trunk/jtrac/src/main/java/info/jtrac/wicket/IndividualHeadPanel.html =================================================================== --- trunk/jtrac/src/main/java/info/jtrac/wicket/IndividualHeadPanel.html 2022-02-11 09:16:05 UTC (rev 1433) +++ trunk/jtrac/src/main/java/info/jtrac/wicket/IndividualHeadPanel.html 2022-02-13 12:41:17 UTC (rev 1434) @@ -1,8 +1,8 @@ <wicket:panel> - <table width="100%" class="jtrac alt" padding="4"> + <table width="100%" class="jtrac header" padding="4"> <tr> <td width="20%" align="left"><img height="55px" wicket:id="icon"/></td> <td align="left"><b><div wicket:id="message">[text goes here]</div></b></td> </tr> </table> -</wicket:panel> \ No newline at end of file +</wicket:panel> Modified: trunk/jtrac/src/main/java/info/jtrac/wicket/LoginPage.html =================================================================== --- trunk/jtrac/src/main/java/info/jtrac/wicket/LoginPage.html 2022-02-11 09:16:05 UTC (rev 1433) +++ trunk/jtrac/src/main/java/info/jtrac/wicket/LoginPage.html 2022-02-13 12:41:17 UTC (rev 1434) @@ -39,7 +39,7 @@ </form> <div><br/></div> <table width="100%" class="jtrac"> - <tr class="alt"> + <tr class="header"> <td align="right"> <i>powered by <a href="http://j-trac.sourceforge.net/" target="_blank">JTrac</a> <span wicket:id="version"></span></i> </td> Modified: trunk/jtrac/src/main/java/info/jtrac/wicket/LoginPage.java =================================================================== --- trunk/jtrac/src/main/java/info/jtrac/wicket/LoginPage.java 2022-02-11 09:16:05 UTC (rev 1433) +++ trunk/jtrac/src/main/java/info/jtrac/wicket/LoginPage.java 2022-02-13 12:41:17 UTC (rev 1434) @@ -1,232 +1,253 @@ -/* - * Copyright 2002-2005 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package info.jtrac.wicket; - -import info.jtrac.domain.User; -import info.jtrac.util.WebUtils; -import javax.servlet.http.Cookie; -import org.apache.wicket.behavior.HeaderContributor; -import org.apache.wicket.markup.html.IHeaderContributor; -import org.apache.wicket.markup.html.IHeaderResponse; -import org.apache.wicket.markup.html.WebMarkupContainer; -import org.apache.wicket.markup.html.WebPage; -import org.apache.wicket.markup.html.basic.Label; -import org.apache.wicket.markup.html.form.CheckBox; -import org.apache.wicket.markup.html.form.PasswordTextField; -import org.apache.wicket.markup.html.form.StatelessForm; -import org.apache.wicket.markup.html.form.TextField; -import org.apache.wicket.markup.html.panel.FeedbackPanel; -import org.apache.wicket.model.BoundCompoundPropertyModel; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * The JTrac login page. - */ -public class LoginPage extends WebPage { - /** - * Logger object - */ - private static final Logger logger = LoggerFactory.getLogger(LoginPage.class); - - /** - * Default constructor - */ - public LoginPage() { - setVersioned(false); - add(new IndividualHeadPanel().setRenderBodyOnly(true)); - add(new Label("title", getLocalizer().getString("login.title", null))); - add(new LoginForm("form")); - String jtracVersion = JtracApplication.get().getJtrac().getReleaseVersion(); - add(new Label("version", jtracVersion)); - } - - /** - * Wicket form for the login (inner class) - */ - private class LoginForm extends StatelessForm { - /** - * The login name of the user. - */ - private String loginName; - - /** - * The password of the user. - */ - private String password; - - /** - * The flag indicating if the user wants to be remembered or not. - */ - private boolean rememberMe; - - /** - * This method will return the login name of the user. - * - * @return The login name of the user. - */ - public String getLoginName() { - return loginName; - } - - /** - * This method allows to set the login name entered in the form. - * - * @param loginName The login name to set. - */ - public void setLoginName(String loginName) { - this.loginName = loginName; - } - - /** - * This method will return the password of the user. - * - * @return The password of the user. - */ - public String getPassword() { - return password; - } - - /** - * This method allows to set the password entered in the form. - * - * @param password The password to set. - */ - public void setPassword(String password) { - this.password = password; - } - - /** - * This method will return the flag indicating if the user - * want's to be remembered as chosen on the form. - * - * @return The flag indicating if the user wants to be remembered - * (<code>true</code>) or not (<code>false</code>). - */ - public boolean isRememberMe() { - return rememberMe; - } - - /** - * This method allows to set the boolean flag to be remembered as - * checked on the form. - * - * @param rememberMe The boolean flag to set. - */ - public void setRememberMe(boolean rememberMe) { - this.rememberMe = rememberMe; - } - - /** - * Constructor for the login form. - * - * @param id - */ - public LoginForm(String id) { - super(id); - add(new WebMarkupContainer("hide") { - @Override - public boolean isVisible() { - return !LoginForm.this.hasError(); - } - }); - add(new FeedbackPanel("feedback")); - setModel(new BoundCompoundPropertyModel(this)); - final TextField loginNameField = new TextField("loginName"); - loginNameField.setOutputMarkupId(true); - add(loginNameField); - final PasswordTextField passwordField = new PasswordTextField("password"); - passwordField.setRequired(false); - passwordField.setOutputMarkupId(true); - add(passwordField); - - /* - * Intelligently set focus on the appropriate textbox. - */ - add(new HeaderContributor(new IHeaderContributor() { - public void renderHead(IHeaderResponse response) { - String markupId; - if(loginNameField.getConvertedInput() == null) { - markupId = loginNameField.getMarkupId(); - } else { - markupId = passwordField.getMarkupId(); - } - response.renderOnLoadJavascript("document.getElementById('" + markupId + "').focus()"); - } - })); - add(new CheckBox("rememberMe")); - } // end LoginForm(String) - - /** - * This method will process the login after the user hits the submit - * button to login. - */ - @Override - protected void onSubmit() { - if(loginName == null || password == null) { - logger.error("login failed - login name " + - (loginName!=null ? "is set (trimmed length=" + - loginName.trim().length()+")" : "is null") + - " and password " + - (password!=null ? "is set" : "is null") + "."); - error(getLocalizer().getString("login.error", null)); - return; - } - - User user = JtracApplication.get().authenticate(loginName, password); - if (user == null) { - /* - * ================================ - * Login failed! - * ================================ - */ - logger.error("login failed - Authentication for login name '"+ - loginName + "' not successful"); - error(getLocalizer().getString("login.error", null)); - } else { - /* - * ================================ - * Login success! - * ================================ - */ - - /* - * Set Remember me cookie if checkbox is checked on page. - */ - if(rememberMe) { - Cookie cookie = new Cookie("jtrac", loginName + ":" + JtracApplication.get().getJtrac().encodeClearText(password)); - cookie.setMaxAge(30 * 24 * 60 * 60); // 30 days in seconds - String path = getWebRequestCycle().getWebRequest().getHttpServletRequest().getContextPath(); - cookie.setPath(path); - getWebRequestCycle().getWebResponse().addCookie(cookie); - logger.debug("remember me requested, cookie added, " + WebUtils.getDebugStringForCookie(cookie)); - } - - /* - * Setup session with principal - */ - JtracSession.get().setUser(user); - /* - * Proceed to bookmarkable page or default dashboard - */ - if (!continueToOriginalDestination()) { - setResponsePage(DashboardPage.class); - } - } - } // end onSubmit() - } // end inner class LoginForm -} +/* + * Copyright 2002-2005 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package info.jtrac.wicket; + +import info.jtrac.domain.User; +import info.jtrac.util.WebUtils; +import javax.servlet.http.Cookie; +import org.apache.wicket.behavior.HeaderContributor; +import org.apache.wicket.markup.html.IHeaderContributor; +import org.apache.wicket.markup.html.IHeaderResponse; +import org.apache.wicket.markup.html.WebMarkupContainer; +import org.apache.wicket.markup.html.WebPage; +import org.apache.wicket.markup.html.basic.Label; +import org.apache.wicket.markup.html.form.CheckBox; +import org.apache.wicket.markup.html.form.PasswordTextField; +import org.apache.wicket.markup.html.form.StatelessForm; +import org.apache.wicket.markup.html.form.TextField; +import org.apache.wicket.markup.html.panel.FeedbackPanel; +import org.apache.wicket.model.BoundCompoundPropertyModel; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * The JTrac login page. + */ +public class LoginPage extends WebPage { + /** + * Logger object + */ + private static final Logger logger = LoggerFactory.getLogger(LoginPage.class); + + /** + * Default constructor + */ + public LoginPage() { + setVersioned(false); + add(new IndividualHeadPanel().setRenderBodyOnly(true)); + add(new Label("title", getLocalizer().getString("login.title", null))); + add(new LoginForm("form")); + String jtracVersion = JtracApplication.get().getJtrac().getReleaseVersion(); + add(new Label("version", jtracVersion)); + + String colorGray = JtracApplication.get().getJtrac().loadConfig("jtrac.color.gray", "#CCCCCC"); + String colorHeader = JtracApplication.get().getJtrac().loadConfig("jtrac.color.header", "#E1ECFE"); + String colorLightBlue = JtracApplication.get().getJtrac().loadConfig("jtrac.color.lightblue", "#E1ECFE"); + String colorMediumBlue = JtracApplication.get().getJtrac().loadConfig("jtrac.color.mediumblue", "#C3D9FF"); + String colorDarkBlue = JtracApplication.get().getJtrac().loadConfig("jtrac.color.darkblue", "#0000D9"); + String colorError = JtracApplication.get().getJtrac().loadConfig("jtrac.color.error", "#CC2200"); + String colorErrorBg = JtracApplication.get().getJtrac().loadConfig("jtrac.color.errorbg", "#FFB6C1"); + add(new HeaderContributor(new IHeaderContributor() { + public void renderHead(IHeaderResponse response) { + String js = "var r = document.querySelector(':root');\n" + + "r.style.setProperty('--header', '"+colorHeader+"');\n" + + "r.style.setProperty('--lightblue', '"+colorLightBlue+"');\n" + + "r.style.setProperty('--mediumblue', '"+colorMediumBlue+"');\n" + + "r.style.setProperty('--darkblue', '"+colorDarkBlue+"');\n" + + "r.style.setProperty('--error', '"+colorError+"');\n" + + "r.style.setProperty('--errorbg', '"+colorErrorBg+"');\n" + + "r.style.setProperty('--gray', '"+colorGray+"');\n"; + response.renderOnDomReadyJavascript(js); + } + })); + } + + /** + * Wicket form for the login (inner class) + */ + private class LoginForm extends StatelessForm { + /** + * The login name of the user. + */ + private String loginName; + + /** + * The password of the user. + */ + private String password; + + /** + * The flag indicating if the user wants to be remembered or not. + */ + private boolean rememberMe; + + /** + * This method will return the login name of the user. + * + * @return The login name of the user. + */ + public String getLoginName() { + return loginName; + } + + /** + * This method allows to set the login name entered in the form. + * + * @param loginName The login name to set. + */ + public void setLoginName(String loginName) { + this.loginName = loginName; + } + + /** + * This method will return the password of the user. + * + * @return The password of the user. + */ + public String getPassword() { + return password; + } + + /** + * This method allows to set the password entered in the form. + * + * @param password The password to set. + */ + public void setPassword(String password) { + this.password = password; + } + + /** + * This method will return the flag indicating if the user + * want's to be remembered as chosen on the form. + * + * @return The flag indicating if the user wants to be remembered + * (<code>true</code>) or not (<code>false</code>). + */ + public boolean isRememberMe() { + return rememberMe; + } + + /** + * This method allows to set the boolean flag to be remembered as + * checked on the form. + * + * @param rememberMe The boolean flag to set. + */ + public void setRememberMe(boolean rememberMe) { + this.rememberMe = rememberMe; + } + + /** + * Constructor for the login form. + * + * @param id + */ + public LoginForm(String id) { + super(id); + add(new WebMarkupContainer("hide") { + @Override + public boolean isVisible() { + return !LoginForm.this.hasError(); + } + }); + add(new FeedbackPanel("feedback")); + setModel(new BoundCompoundPropertyModel(this)); + final TextField loginNameField = new TextField("loginName"); + loginNameField.setOutputMarkupId(true); + add(loginNameField); + final PasswordTextField passwordField = new PasswordTextField("password"); + passwordField.setRequired(false); + passwordField.setOutputMarkupId(true); + add(passwordField); + + /* + * Intelligently set focus on the appropriate textbox. + */ + add(new HeaderContributor(new IHeaderContributor() { + public void renderHead(IHeaderResponse response) { + String markupId; + if(loginNameField.getConvertedInput() == null) { + markupId = loginNameField.getMarkupId(); + } else { + markupId = passwordField.getMarkupId(); + } + response.renderOnLoadJavascript("document.getElementById('" + markupId + "').focus()"); + } + })); + add(new CheckBox("rememberMe")); + } // end LoginForm(String) + + /** + * This method will process the login after the user hits the submit + * button to login. + */ + @Override + protected void onSubmit() { + if(loginName == null || password == null) { + logger.error("login failed - login name " + + (loginName!=null ? "is set (trimmed length=" + + loginName.trim().length()+")" : "is null") + + " and password " + + (password!=null ? "is set" : "is null") + "."); + error(getLocalizer().getString("login.error", null)); + return; + } + + User user = JtracApplication.get().authenticate(loginName, password); + if (user == null) { + /* + * ================================ + * Login failed! + * ================================ + */ + logger.error("login failed - Authentication for login name '"+ + loginName + "' not successful"); + error(getLocalizer().getString("login.error", null)); + } else { + /* + * ================================ + * Login success! + * ================================ + */ + + /* + * Set Remember me cookie if checkbox is checked on page. + */ + if(rememberMe) { + Cookie cookie = new Cookie("jtrac", loginName + ":" + JtracApplication.get().getJtrac().encodeClearText(password)); + cookie.setMaxAge(30 * 24 * 60 * 60); // 30 days in seconds + String path = getWebRequestCycle().getWebRequest().getHttpServletRequest().getContextPath(); + cookie.setPath(path); + getWebRequestCycle().getWebResponse().addCookie(cookie); + logger.debug("remember me requested, cookie added, " + WebUtils.getDebugStringForCookie(cookie)); + } + + /* + * Setup session with principal + */ + JtracSession.get().setUser(user); + /* + * Proceed to bookmarkable page or default dashboard + */ + if (!continueToOriginalDestination()) { + setResponsePage(DashboardPage.class); + } + } + } // end onSubmit() + } // end inner class LoginForm +} Modified: trunk/jtrac/src/main/java/info/jtrac/wicket/LogoutPage.html =================================================================== --- trunk/jtrac/src/main/java/info/jtrac/wicket/LogoutPage.html 2022-02-11 09:16:05 UTC (rev 1433) +++ trunk/jtrac/src/main/java/info/jtrac/wicket/LogoutPage.html 2022-02-13 12:41:17 UTC (rev 1434) @@ -28,7 +28,7 @@ </table> <div style="padding-bottom:2em"></div> <table width="100%" class="jtrac"> - <tr class="alt"> + <tr class="header"> <td align="right"> <i>powered by <a href="http://j-trac.sourceforge.net/" target="_blank">JTrac</a> <span wicket:id="version"></span></i> </td> Modified: trunk/jtrac/src/main/java/info/jtrac/wicket/LogoutPage.java =================================================================== --- trunk/jtrac/src/main/java/info/jtrac/wicket/LogoutPage.java 2022-02-11 09:16:05 UTC (rev 1433) +++ trunk/jtrac/src/main/java/info/jtrac/wicket/LogoutPage.java 2022-02-13 12:41:17 UTC (rev 1434) @@ -1,45 +1,68 @@ -/* - * Copyright 2002-2005 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package info.jtrac.wicket; - -import org.apache.wicket.PageParameters; -import org.apache.wicket.markup.html.WebPage; -import org.apache.wicket.markup.html.basic.Label; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.util.StringUtils; - -/** - * logout page. the session invalidation code is in HeaderPanel - */ -public class LogoutPage extends WebPage { - - private static final Logger logger = LoggerFactory.getLogger(LogoutPage.class); - - public LogoutPage(PageParameters params) { - String locale = params.getString("locale"); - if(locale != null) { - getRequestCycle().getSession().setLocale(StringUtils.parseLocaleString(locale)); - } - setVersioned(false); - add(new IndividualHeadPanel().setRenderBodyOnly(true)); - add(new Label("title", getLocalizer().getString("logout.title", null))); - String jtracVersion = JtracApplication.get().getJtrac().getReleaseVersion(); - add(new Label("version", jtracVersion)); - } - -} +/* + * Copyright 2002-2005 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package info.jtrac.wicket; + +import org.apache.wicket.PageParameters; +import org.apache.wicket.behavior.HeaderContributor; +import org.apache.wicket.markup.html.IHeaderContributor; +import org.apache.wicket.markup.html.IHeaderResponse; +import org.apache.wicket.markup.html.WebPage; +import org.apache.wicket.markup.html.basic.Label; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.util.StringUtils; + +/** + * logout page. the session invalidation code is in HeaderPanel + */ +public class LogoutPage extends WebPage { + + private static final Logger logger = LoggerFactory.getLogger(LogoutPage.class); + + public LogoutPage(PageParameters params) { + String locale = params.getString("locale"); + if(locale != null) { + getRequestCycle().getSession().setLocale(StringUtils.parseLocaleString(locale)); + } + setVersioned(false); + add(new IndividualHeadPanel().setRenderBodyOnly(true)); + add(new Label("title", getLocalizer().getString("logout.title", null))); + String jtracVersion = JtracApplication.get().getJtrac().getReleaseVersion(); + add(new Label("version", jtracVersion)); + + String colorGray = JtracApplication.get().getJtrac().loadConfig("jtrac.color.gray", "#CCCCCC"); + String colorHeader = JtracApplication.get().getJtrac().loadConfig("jtrac.color.header", "#E1ECFE"); + String colorLightBlue = JtracApplication.get().getJtrac().loadConfig("jtrac.color.lightblue", "#E1ECFE"); + String colorMediumBlue = JtracApplication.get().getJtrac().loadConfig("jtrac.color.mediumblue", "#C3D9FF"); + String colorDarkBlue = JtracApplication.get().getJtrac().loadConfig("jtrac.color.darkblue", "#0000D9"); + String colorError = JtracApplication.get().getJtrac().loadConfig("jtrac.color.error", "#CC2200"); + String colorErrorBg = JtracApplication.get().getJtrac().loadConfig("jtrac.color.errorbg", "#FFB6C1"); + add(new HeaderContributor(new IHeaderContributor() { + public void renderHead(IHeaderResponse response) { + String js = "var r = document.querySelector(':root');\n" + + "r.style.setProperty('--header', '"+colorHeader+"');\n" + + "r.style.setProperty('--lightblue', '"+colorLightBlue+"');\n" + + "r.style.setProperty('--mediumblue', '"+colorMediumBlue+"');\n" + + "r.style.setProperty('--darkblue', '"+colorDarkBlue+"');\n" + + "r.style.setProperty('--error', '"+colorError+"');\n" + + "r.style.setProperty('--errorbg', '"+colorErrorBg+"');\n" + + "r.style.setProperty('--gray', '"+colorGray+"');\n"; + response.renderOnDomReadyJavascript(js); + } + })); + } +} Modified: trunk/jtrac/src/main/resources/messages.properties =================================================================== --- trunk/jtrac/src/main/resources/messages.properties 2022-02-11 09:16:05 UTC (rev 1433) +++ trunk/jtrac/src/main/resources/messages.properties 2022-02-13 12:41:17 UTC (rev 1434) @@ -201,7 +201,8 @@ config.jtrac.header.picture = Individual header picture config.jtrac.header.text = Individual header text config.jtrac.color.gray = Background color for labels (Default ist #CCCCCC) -config.jtrac.color.lightblue = Background color for header (Default ist #E1ECFE) +config.jtrac.color.header = Background color for header (Default ist #E1ECFE) +config.jtrac.color.lightblue = Background color (Default ist #E1ECFE) config.jtrac.color.mediumblue = Color for highlighting (Default ist #C3D9FF) config.jtrac.color.darkblue = Color for highlighting (Default ist #0000D9) config.jtrac.color.error = Color for error messages (Default ist #CC2200) Modified: trunk/jtrac/src/main/resources/messages_de.properties =================================================================== --- trunk/jtrac/src/main/resources/messages_de.properties 2022-02-11 09:16:05 UTC (rev 1433) +++ trunk/jtrac/src/main/resources/messages_de.properties 2022-02-13 12:41:17 UTC (rev 1434) @@ -201,7 +201,8 @@ config.jtrac.header.picture = Individuelles Bild im Header config.jtrac.header.text = Individueller Text im Header config.jtrac.color.gray = Farbe f\u00fcr \u00dcberschriften (Default ist #CCCCCC) -config.jtrac.color.lightblue = Farbe f\u00fcr Header (Default ist #E1ECFE) +config.jtrac.color.header = Hintergrundfarbe f\u00fcr Header (Default ist #E1ECFE) +config.jtrac.color.lightblue = HIntergrundfarbe (Default ist #E1ECFE) config.jtrac.color.mediumblue = Farbe zum Hervorheben (Default ist #C3D9FF) config.jtrac.color.darkblue = Farbe zum Hervorheben (Default ist #0000D9) config.jtrac.color.error = Farbe f\u00fcr Fehlermeldungen (Default ist #CC2200) Modified: trunk/jtrac/src/main/resources/messages_en.properties =================================================================== --- trunk/jtrac/src/main/resources/messages_en.properties 2022-02-11 09:16:05 UTC (rev 1433) +++ trunk/jtrac/src/main/resources/messages_en.properties 2022-02-13 12:41:17 UTC (rev 1434) @@ -201,7 +201,8 @@ config.jtrac.header.picture = Individual header picture config.jtrac.header.text = Individual header text config.jtrac.color.gray = Background color for labels (Default ist #CCCCCC) -config.jtrac.color.lightblue = Background color for header (Default ist #E1ECFE) +config.jtrac.color.header = Background color for header (Default ist #E1ECFE) +config.jtrac.color.lightblue = Background color (Default ist #E1ECFE) config.jtrac.color.mediumblue = Color for highlighting (Default ist #C3D9FF) config.jtrac.color.darkblue = Color for highlighting (Default ist #0000D9) config.jtrac.color.error = Color for error messages (Default ist #CC2200) Modified: trunk/jtrac/src/main/webapp/resources/jtrac.css =================================================================== --- trunk/jtrac/src/main/webapp/resources/jtrac.css 2022-02-11 09:16:05 UTC (rev 1433) +++ trunk/jtrac/src/main/webapp/resources/jtrac.css 2022-02-13 12:41:17 UTC (rev 1434) @@ -1,4 +1,5 @@ :root { + --header: #E1ECFE; --lightblue: #E1ECFE; --mediumblue: #C3D9FF; --darkblue: #0000D9; @@ -23,6 +24,7 @@ .info { color: var(--darkblue); font-weight: bold; } .heading { color: var(--darkblue); font-weight: bold; margin-bottom: 1em; } .alt { background: var(--lightblue); } +.header { background: var(--header); } .selected, table.jtrac .selected { background: var(--mediumblue); } .bdr-bottom, tr.bdr-bottom td { border-bottom: 1px solid var(--gray); } .nav-header { background: var(--gray); padding: 0.1em; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |