/news updates:

- Updated presentation of news status & view/hide news text at the bottom of
  the homepage news section, so it behaves sensibly when wrapping (for German,
  Russian etc)
- <span>s for news title dates and author names
- Iconified author name for news entries
This commit is contained in:
str4d
2017-05-14 05:38:31 +00:00
parent e453ea48e1
commit ac31a1319b
10 changed files with 249 additions and 23 deletions

View File

@ -78,9 +78,9 @@ public class NewsFeedHelper extends HelperBase {
buf.append("<div class=\"newsentry\"><h3>");
if (entry.updated > 0) {
Date date = new Date(entry.updated);
buf.append("<font size=\"-1\">")
buf.append("<span class=\"newsDate\">")
.append(fmt.format(date))
.append(":</font> ");
.append("</span> ");
}
if (entry.link != null)
buf.append("<a href=\"").append(DataHelper.escapeHTML(entry.link)).append("\">");
@ -88,9 +88,9 @@ public class NewsFeedHelper extends HelperBase {
if (entry.link != null)
buf.append("</a>");
if (entry.authorName != null) {
buf.append(" <font size=\"-2\">(<i>")
.append(Messages.getString("by {0}", DataHelper.escapeHTML(entry.authorName), ctx))
.append("</i>)</font>\n");
buf.append(" <span class=\"newsAuthor\" title=\"Post author\"><i>")
.append(Messages.getString("{0}", DataHelper.escapeHTML(entry.authorName), ctx))
.append("</i></span>\n");
}
buf.append("</h3>\n<div class=\"newscontent\">\n")
.append(entry.content)

View File

@ -286,7 +286,7 @@ public class NewsHelper extends ContentHelper {
public static String status(RouterContext ctx) {
StringBuilder buf = new StringBuilder(128);
long now = ctx.clock().now();
buf.append("<i>");
buf.append("<span id=\"newsStatus\"><i>");
long lastUpdated = lastUpdated(ctx);
long lastFetch = lastChecked(ctx);
if (lastUpdated > 0) {
@ -300,7 +300,7 @@ public class NewsHelper extends ContentHelper {
DataHelper.formatDuration2(now - lastFetch),
ctx));
}
buf.append("</i>");
buf.append("</i></span><span id=\"newsDisplay\">");
String consoleNonce = CSSHelper.getNonce();
if (lastUpdated > 0 && consoleNonce != null) {
if (shouldShowNews(ctx)) {
@ -311,9 +311,9 @@ public class NewsHelper extends ContentHelper {
.append(Messages.getString("Show news", ctx));
}
buf.append("</a>" +
" - <a href=\"/news\">")
" | <a href=\"/news\">")
.append(Messages.getString("Show all news", ctx))
.append("</a>");
.append("</a></span>");
}
return buf.toString();
}