From edb3ffcf4500e9d9a4bd325b8761f73ae556f59b Mon Sep 17 00:00:00 2001 From: str4d Date: Sun, 1 May 2016 04:06:28 +0000 Subject: [PATCH] Rework /configui forms for theming --- .../net/i2p/router/web/ConfigUIHelper.java | 33 +++++++++++-------- apps/routerconsole/jsp/configui.jsp | 11 +++++-- 2 files changed, 29 insertions(+), 15 deletions(-) diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigUIHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigUIHelper.java index 9286072ae..f9ef17ec6 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigUIHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigUIHelper.java @@ -13,10 +13,16 @@ public class ConfigUIHelper extends HelperBase { String current = _context.getProperty(CSSHelper.PROP_THEME_NAME, CSSHelper.DEFAULT_THEME); Set themes = themeSet(); for (String theme : themes) { - buf.append("") + .append("").append(_t(theme)).append("
\n"); + buf.append("value=\"").append(theme).append("\">") + .append("") + .append("\"\"") + .append("
") + .append("
").append(_t(theme)).append("
") + .append("\n"); } boolean universalTheming = _context.getBooleanProperty(CSSHelper.PROP_UNIVERSAL_THEMING); buf.append("
"); @@ -142,11 +148,12 @@ public class ConfigUIHelper extends HelperBase { if (lang.equals("xx") && !isAdvanced()) continue; // we use "lang" so it is set automagically in CSSHelper - buf.append("") - .append("\"\" "); + .append("\"\"") + .append("
"); int under = lang.indexOf('_'); String slang = (under > 0) ? lang.substring(0, under) : lang; buf.append(Messages.getDisplayLanguage(slang, langs[i][2], _context)); @@ -156,7 +163,7 @@ public class ConfigUIHelper extends HelperBase { .append(Messages.getString(name, _context, Messages.COUNTRY_BUNDLE_NAME)) .append(')'); } - buf.append("
\n"); + buf.append("
\n"); } return buf.toString(); } @@ -175,7 +182,7 @@ public class ConfigUIHelper extends HelperBase { buf.append("") .append(_t("Remove")) .append("") - .append(_t("User Name")) + .append(_t("Username")) .append(" \n"); for (String name : userpw.keySet()) { buf.append("\n"); } } - buf.append("") - .append(_t("Add")).append(":" + - "" + - ""); - buf.append(_t("Password")).append(": " + - "" + - "\n"); + buf.append("") + .append("").append(_t("Username")).append(": ") + .append("") + .append("").append(_t("Password")).append(": ") + .append("") + .append("") + .append("\n"); return buf.toString(); } } diff --git a/apps/routerconsole/jsp/configui.jsp b/apps/routerconsole/jsp/configui.jsp index 7f993c5c2..bd7ac0a34 100644 --- a/apps/routerconsole/jsp/configui.jsp +++ b/apps/routerconsole/jsp/configui.jsp @@ -31,10 +31,10 @@ input.default { <%@include file="formhandler.jsi" %>

<%=uihelper._t("Router Console Theme")%>

-
+
<% String userAgent = request.getHeader("User-Agent"); if (userAgent == null || userAgent.contains("Trident/6") || !userAgent.contains("MSIE")) { @@ -46,8 +46,15 @@ input.default { <%=uihelper._t("If you're not using IE, it's likely that your browser is pretending to be IE; please configure your browser (or proxy) to use a different User Agent string if you'd like to access the console themes.")%> <% } %> -
+
+" > +" > +

<%=uihelper._t("Router Console Language")%>

+
+ + +

<%=uihelper._t("Please contribute to the router console translation project! Contact the developers in #i2p-dev on IRC to help.")%>