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

View File

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

View File

@ -1465,6 +1465,52 @@ div.news hr:last-child {
margin-bottom: 10px !important; margin-bottom: 10px !important;
} }
.newsentry + hr {
margin-bottom: 5px !important;
}
.newsAuthor {
padding-left: 14px;
float: right;
background: url(/themes/console/images/info/author.png) left 2px bottom 3px no-repeat;
background-size: 10px 10px;
font-size: 8.5pt;
padding: 2px 4px 0 14px;
display: inline-block;
opacity: 0.8;
}
.newsDate {
font-size: 10pt !important;
}
#newsStatus {
float: left;
text-align: justify;
}
#newsDisplay {
white-space: nowrap;
margin-left: 10px;
color: #663;
font-weight: bold;
}
#news #newsDisplay, #news #newsStatus {
margin-top: 3px !important;
margin-bottom: 3px !important;
display: inline-block;
}
.messages #newsStatus, .messages #newsDisplay {
float: none;
color: #005;
}
.messages #newsDisplay {
margin-left: 5px;
}
/* top navigation */ /* top navigation */
div.confignav { div.confignav {

View File

@ -760,27 +760,46 @@ div.news h4 {
} }
div.news p, div.newscontent p { div.news p, div.newscontent p {
margin-top: -5px;
font-size: 9pt; font-size: 9pt;
color: #EE9; color: #EE9;
margin-bottom: 0; margin: 0 !important;
/* padding: 0 15px;*/
} }
.newscontent b { div.news p:nth-child(n+2), div.newscontent p:nth-child(n+2) {
/* text-transform: uppercase; margin-top: 8px !important;
letter-spacing: 0.1em; */
}
div.news p:nth-child(n+1), div.newscontent p:nth-child(n+1) {
margin-top: 5px;
} }
div.news hr { div.news hr {
margin: 8px 0 3px 0; margin: 8px 0 3px 0;
} }
div.fixme { #newsStatus {
float: left;
}
#newsDisplay {
white-space: nowrap;
margin-left: 10px;
}
.newsAuthor {
float: right;
background: url(/themes/console/images/info/author_dark.png) left 2px center no-repeat;
background-size: 14px 14px;
font-size: 8pt !important;
padding: 1px 0 0 18px;
display: inline-block;
opacity: 0.9;
text-transform: none;
}
.newsDate {
opacity: 0.9;
font-style: italic;
margin-right: 3px;
}
#newspage {
margin: 18px 5px; /* positional parity with homepage news */ margin: 18px 5px; /* positional parity with homepage news */
} }

View File

@ -26,6 +26,15 @@ div.news {
direction: ltr; direction: ltr;
} }
.news h3, #newspage h3 {
direction: ltr;
}
.news hr + i {
float: left;
direction: rtl;
}
div.main { div.main {
margin: -1px 205px 5px 5px; margin: -1px 205px 5px 5px;
background: url("images/scarface.jpg") no-repeat scroll left bottom #000000 !important; background: url("images/scarface.jpg") no-repeat scroll left bottom #000000 !important;

View File

@ -168,7 +168,13 @@ td.optionsave {
border-top: 1px solid #494; border-top: 1px solid #494;
} }
/* responsive layout */ .newsentry + hr {
margin-bottom: 5px !important;
}
#newsDisplay, #newsDisplay a, #newsStatus, td.infohelp, td.infowarn, p.infohelp, p.infowarn {
font-size: 11pt !important;
}
@media screen and (min-width: 0) { @media screen and (min-width: 0) {
p, .main { p, .main {

Binary file not shown.

After

Width:  |  Height:  |  Size: 490 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 596 B

View File

@ -907,6 +907,43 @@ div.newscontent p {
margin-right: 8px; margin-right: 8px;
} }
#newsStatus, #newsDisplay {
display: inline-block;
}
.newsentry + hr + #newsStatus, .newsentry + hr + #newsStatus + #newsDisplay {
margin-top: -6px !important;
}
#newsStatus {
float: left;
text-align: justify;
margin-bottom: 6px !important;
}
#newsDisplay {
white-space: nowrap;
margin-left: 10px;
color: #337;
}
.newsAuthor {
padding: 0 0 0 15px !important;
float: right;
background: url(/themes/console/images/info/author.png) left 2px center no-repeat;
background-size: 10px 10px;
font-size: 8pt !important;
display: inline-block;
opacity: 0.8;
letter-spacing: 0.1em !important;
text-transform: none;
}
.newsDate {
opacity: 0.8;
margin-right: 1px;
}
.main#news { .main#news {
padding: 3px 15px 5px; padding: 3px 15px 5px;
background: #fff url(/themes/snark/ubergine/images/hat.png) no-repeat scroll right bottom; background: #fff url(/themes/snark/ubergine/images/hat.png) no-repeat scroll right bottom;
@ -5005,6 +5042,21 @@ div.routersummary img[src$="i2plogo.png"] {
height: 6px; height: 6px;
width: 6px; width: 6px;
} }
button.control {
padding: 14px !important;
}
#configstats td::before {
min-height: 24px;
}
.newsAuthor {
font-size: 9pt;
background-size: 11px 11px;
padding: 0 0 0 14px;
background-position: left center !important;
}
} }
@media screen and (-webkit-min-device-pixel-ratio:0) and (min-width: 1500px) { @media screen and (-webkit-min-device-pixel-ratio:0) and (min-width: 1500px) {

View File

@ -1535,11 +1535,47 @@ div.sorry hr {
color: #c9ceff; color: #c9ceff;
} }
/*
.newsentry font[size="-2"] { .newsentry font[size="-2"] {
letter-spacing: 0.15em; letter-spacing: 0.15em;
font-style: italic; font-style: italic;
text-transform: capitalize; text-transform: capitalize;
} }
*/
.main#news .newscontent {
border: 1px solid #443da0;
margin: -11px 0 10px;
padding: 0 10px 5px;
border-radius: 0 0 2px 2px;
background: rgba(0,0,0,0.6);
box-shadow: inset 0 0 0 1px #000;
}
.main#news .newsentry h3 {
border: 1px solid #443da0;
border-radius: 2px 2px 0 0;
}
.main#news .newsentry {
margin-bottom: 14px !important;
}
.main#news .newsentry:first-child {
margin-top: -3px !important;
}
.main#news .newsentry:last-child {
margin-bottom: -3px !important;
}
.news .newsentry {
margin-top: -3px !important;
}
.news .newsentry:first-child {
margin-top: -7px !important;
}
.news h4 { .news h4 {
border-bottom: 1px; border-bottom: 1px;
@ -1564,13 +1600,52 @@ div.sorry hr {
} }
.news hr { .news hr {
margin: 8px -20px 3px; margin: 8px -20px 5px;
} }
.fixme { #newspage {
margin: 18px 5px; /* positional parity with homepage news */ margin: 18px 5px; /* positional parity with homepage news */
} }
#newsStatus {
float: left;
color: #c9ceff;
}
#newsDisplay {
white-space: nowrap;
margin-left: 10px;
}
.newsAuthor {
float: right;
background: url(/themes/console/images/info/author_dark.png) left 2px top no-repeat;
background-size: 14px 14px;
font-size: 8pt !important;
padding: 0 0 0 18px;
display: inline-block;
opacity: 0.7;
text-transform: none;
}
.newsDate {
opacity: 0.7;
font-style: italic;
margin-right: 2px;
}
.messages i {
text-align: left;
float: none;
display: inline-block;
}
.messages #newsDisplay {
display: inline-block;
white-space: normal;
margin-left: 45px;
}
.main#jobs .joblog { .main#jobs .joblog {
margin-top: 10px !important; margin-top: 10px !important;
} }
@ -2213,6 +2288,25 @@ h2, h3, h4, .confignav {
box-shadow: inset 0 0 0 1px #000; box-shadow: inset 0 0 0 1px #000;
} }
.news h3, #newspage h3 {
padding-left: 30px !important;
text-align: left !important;
font-size: 9.5pt !important;
letter-spacing: 0.08em;
color: #c9ceff;
padding: 6px 10px 6px 30px;
background: url(/themes/console/images/info/newspaper.png) left 8px center no-repeat, linear-gradient(to bottom, #191729 0%, #201f33 7%, #1f1e32 9%, #161525 21%, #090812 49%, #05050e 50%, #020206 51%, #010103 53%, #000000 56%, #000000 100%) !important;
background-size: 16px 16px, 100% 100% !important;
}
.news h3 {
background: url(/themes/console/images/info/newspaper.png) left 8px center no-repeat !important;
background-size: 16px 16px !important;
border: none !important;
border-bottom: 1px solid #443da0 !important;
}
.underline { .underline {
border-bottom: 1px solid #efeeff; border-bottom: 1px solid #efeeff;
padding: 5px 0 5px 0; padding: 5px 0 5px 0;