diff --git a/apps/routerconsole/java/src/net/i2p/router/web/NewsHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/NewsHelper.java index 709c4505ff..3e4bfc19f7 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/NewsHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/NewsHelper.java @@ -16,7 +16,46 @@ public class NewsHelper extends ContentHelper { if (!news.exists()) _page = (new File(_context.getBaseDir(), "docs/initialNews/initialNews.xml")).getAbsolutePath(); return super.getContent(); - } + } + + /** @since 0.9.1 */ + public String getNewsHeadings() { + StringBuilder buf = new StringBuilder(512); + String consoleNonce = System.getProperty("router.consoleNonce"); + if (consoleNonce != null) { + // Set up string containing to show news. + String newsUrl = ""; + // Set up title and pre-headings stuff. + buf.append("

").append(_("News & Updates")) + .append("


\n"); + // Get news content. + String newsContent = getContent(); + if (newsContent != "") { + buf.append("\n"); + buf.append(newsUrl).append(Messages.getString("Show news", _context)).append("\n"); + } else { + buf.append("
").append(_("none")).append("
"); + } + // Add post-headings stuff. + buf.append("
\n"); + } + return buf.toString(); + } /** @since 0.8.12 */ public boolean shouldShowNews() { diff --git a/apps/routerconsole/jsp/home.jsp b/apps/routerconsole/jsp/home.jsp index 21b4f6d3cc..f4088cc031 100644 --- a/apps/routerconsole/jsp/home.jsp +++ b/apps/routerconsole/jsp/home.jsp @@ -20,6 +20,11 @@ %> " /> +<% + java.io.File fpath = new java.io.File(net.i2p.I2PAppContext.getGlobalContext().getRouterDir(), "docs/news.xml"); +%> + + " /> @@ -33,14 +38,6 @@ <%@include file="xhr1.jsi" %> -<% - if (!newshelper.shouldShowNews()) { -%> -

<%=intl._("News")%>


- -<% - } // !shouldShowNews() -%> @@ -48,11 +45,8 @@ <% if (newshelper.shouldShowNews()) { - java.io.File fpath = new java.io.File(net.i2p.I2PAppContext.getGlobalContext().getRouterDir(), "docs/news.xml"); %>
- -

diff --git a/apps/routerconsole/jsp/xhr1.jsi b/apps/routerconsole/jsp/xhr1.jsi index a171d0c852..c75ec3eace 100644 --- a/apps/routerconsole/jsp/xhr1.jsi +++ b/apps/routerconsole/jsp/xhr1.jsi @@ -17,6 +17,13 @@

"><%=intl._("Network")%>:


+<% + if (!newshelper.shouldShowNews()) { +%> +
+<% + } // !shouldShowNews() +%>
diff --git a/apps/routerconsole/jsp/xhr1.jsp b/apps/routerconsole/jsp/xhr1.jsp index 95c27683b7..b48e824421 100644 --- a/apps/routerconsole/jsp/xhr1.jsp +++ b/apps/routerconsole/jsp/xhr1.jsp @@ -11,4 +11,11 @@ %> " /> + +" /> +<% + java.io.File fpath = new java.io.File(net.i2p.I2PAppContext.getGlobalContext().getRouterDir(), "docs/news.xml"); +%> + + <%@include file="xhr1.jsi" %> diff --git a/installer/resources/themes/console/dark/console.css b/installer/resources/themes/console/dark/console.css index acc5d6b9b5..2c32a68f34 100644 --- a/installer/resources/themes/console/dark/console.css +++ b/installer/resources/themes/console/dark/console.css @@ -170,6 +170,10 @@ div.routersummary h4 { line-height: 100%; } +div.routersummary ul { + text-align: left !important; +} + div.routersummary table { border: 0; text-align: center !important; @@ -227,6 +231,11 @@ div routersummary hr:last-child { margin-bottom: -5px !important; } +div.newsheadings { + text-align: right; + margin: 0 0 0 10px; +} + div.tunnels { padding-top: 3px !important; margin-left: -4px;