From ac31a1319b2c4a4ca84654d8791eaefff4062cdf Mon Sep 17 00:00:00 2001 From: str4d Date: Sun, 14 May 2017 05:38:31 +0000 Subject: [PATCH] /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) - s for news title dates and author names - Iconified author name for news entries --- .../net/i2p/router/web/NewsFeedHelper.java | 10 +- .../src/net/i2p/router/web/NewsHelper.java | 8 +- .../themes/console/classic/console.css | 46 ++++++++ .../resources/themes/console/dark/console.css | 41 ++++++-- .../themes/console/dark/console_ar.css | 9 ++ .../themes/console/dark/console_big.css | 8 +- .../themes/console/images/info/author.png | Bin 0 -> 490 bytes .../console/images/info/author_dark.png | Bin 0 -> 596 bytes .../themes/console/light/console.css | 52 ++++++++++ .../themes/console/midnight/console.css | 98 +++++++++++++++++- 10 files changed, 249 insertions(+), 23 deletions(-) create mode 100644 installer/resources/themes/console/images/info/author.png create mode 100644 installer/resources/themes/console/images/info/author_dark.png diff --git a/apps/routerconsole/java/src/net/i2p/router/web/NewsFeedHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/NewsFeedHelper.java index 5bbf5a071..f73bf64a4 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/NewsFeedHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/NewsFeedHelper.java @@ -78,9 +78,9 @@ public class NewsFeedHelper extends HelperBase { buf.append("

"); if (entry.updated > 0) { Date date = new Date(entry.updated); - buf.append("") + buf.append("") .append(fmt.format(date)) - .append(": "); + .append(" "); } if (entry.link != null) buf.append(""); @@ -88,9 +88,9 @@ public class NewsFeedHelper extends HelperBase { if (entry.link != null) buf.append(""); if (entry.authorName != null) { - buf.append(" (") - .append(Messages.getString("by {0}", DataHelper.escapeHTML(entry.authorName), ctx)) - .append(")\n"); + buf.append(" ") + .append(Messages.getString("{0}", DataHelper.escapeHTML(entry.authorName), ctx)) + .append("\n"); } buf.append("

\n
\n") .append(entry.content) 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 f8bd51e6f..3a75b7dcd 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/NewsHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/NewsHelper.java @@ -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(""); + buf.append(""); 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(""); + buf.append(""); 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("" + - " - ") + " | ") .append(Messages.getString("Show all news", ctx)) - .append(""); + .append(""); } return buf.toString(); } diff --git a/installer/resources/themes/console/classic/console.css b/installer/resources/themes/console/classic/console.css index 768116079..e3300ed81 100644 --- a/installer/resources/themes/console/classic/console.css +++ b/installer/resources/themes/console/classic/console.css @@ -1465,6 +1465,52 @@ div.news hr:last-child { 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 */ div.confignav { diff --git a/installer/resources/themes/console/dark/console.css b/installer/resources/themes/console/dark/console.css index af7b32e2b..c7029dc93 100644 --- a/installer/resources/themes/console/dark/console.css +++ b/installer/resources/themes/console/dark/console.css @@ -760,27 +760,46 @@ div.news h4 { } div.news p, div.newscontent p { - margin-top: -5px; font-size: 9pt; color: #EE9; - margin-bottom: 0; -/* padding: 0 15px;*/ + margin: 0 !important; } -.newscontent b { -/* text-transform: uppercase; - letter-spacing: 0.1em; */ -} - -div.news p:nth-child(n+1), div.newscontent p:nth-child(n+1) { - margin-top: 5px; +div.news p:nth-child(n+2), div.newscontent p:nth-child(n+2) { + margin-top: 8px !important; } div.news hr { 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 */ } diff --git a/installer/resources/themes/console/dark/console_ar.css b/installer/resources/themes/console/dark/console_ar.css index d6f06cfc4..091e989c7 100644 --- a/installer/resources/themes/console/dark/console_ar.css +++ b/installer/resources/themes/console/dark/console_ar.css @@ -26,6 +26,15 @@ div.news { direction: ltr; } +.news h3, #newspage h3 { + direction: ltr; +} + +.news hr + i { + float: left; + direction: rtl; +} + div.main { margin: -1px 205px 5px 5px; background: url("images/scarface.jpg") no-repeat scroll left bottom #000000 !important; diff --git a/installer/resources/themes/console/dark/console_big.css b/installer/resources/themes/console/dark/console_big.css index 72da9e1c4..74b893473 100644 --- a/installer/resources/themes/console/dark/console_big.css +++ b/installer/resources/themes/console/dark/console_big.css @@ -168,7 +168,13 @@ td.optionsave { 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) { p, .main { diff --git a/installer/resources/themes/console/images/info/author.png b/installer/resources/themes/console/images/info/author.png new file mode 100644 index 0000000000000000000000000000000000000000..fce8a9ea096f42cc2cb29793a6f2c5145cd3d3cd GIT binary patch literal 490 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbMf$pD`aS0MfW|9>D!IZ#qkQdU;x z;^IduY859&092^W(9~v4O9v&VM5fK>~85I>38yg!J7q{Gc(JG*R zgOVUWpyzm`OwEFVV~cASEZ?<-?2Qt<3PO&JY5_^DsIJ|VHRUfu>h$?A!N#-_LwodFuBhpY`{>jTlyo zN-PPsXD?X3LOSC>+ZNrV;KLd3Z%*4SA6np0a{JN)XI5?-)||ldHIla%UGKeg^7O`e zli7IAHGr0TD=JoEmVg_;Z&TP42p?h5Oj9h)FuVdi<{zxYGY2w8KtlwrZsGM5$ xvb`~V#U>V2gXb5%KizO!cD?+R+3FWOd5&-ipZ|IECoj;g44$rjF6*2UngEo!q?rH! literal 0 HcmV?d00001 diff --git a/installer/resources/themes/console/images/info/author_dark.png b/installer/resources/themes/console/images/info/author_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..76a816fa64d4f1622f515c7068e8038279b3d093 GIT binary patch literal 596 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GXl47`X#{LR=*n8KoE*!_^og)EU#$ z)0>-{+e?%CJs2lOt4*Ffd5SmFbRVV}K1@rOF8%-iKTzeWRjYt%7B60$l$6BA#s*Z` z-Q5k8b#!!;W@Kb$W@cew5fl`Zm6cUdQ870+x3IAA@bK{R@(KF9_tFl;O_y?_7y;!0lyKE8(!9~LJi zRi>vu*;4OgWfkG(7Vqbm9u@|4&zc33H`IEaTGnv+^5qBXsvmD|c>MVBlP6D}K7IOX zcgO43uiqZ%{qW(#$0HLzfByXC%a^aGXMFwo_1l@5zpgC&_3PK~-@pI;`v>%0<_X_8 zVCdMD1o;7j2L*8PNUCX>xOqp#C8Z%idRb$0*SvX~_wGG%?A*C4S8l#}|KZ!WZ$E#o z^*#ImsDGEIi(`m{BYdgI%sO9G*uZz?MEW&Sld z*FX6-qrs7}LVljjdEtgf4s~MvM;S#LCtTLvZ)qj4c~1ub;gs7wGUm%-V|svL4Sk Q7!C>rPgg&ebxsLQ0GqJ_>Hq)$ literal 0 HcmV?d00001 diff --git a/installer/resources/themes/console/light/console.css b/installer/resources/themes/console/light/console.css index 7a40977a8..1fc77c372 100644 --- a/installer/resources/themes/console/light/console.css +++ b/installer/resources/themes/console/light/console.css @@ -907,6 +907,43 @@ div.newscontent p { 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 { padding: 3px 15px 5px; 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; 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) { diff --git a/installer/resources/themes/console/midnight/console.css b/installer/resources/themes/console/midnight/console.css index 94d3fc3db..95ca32d10 100644 --- a/installer/resources/themes/console/midnight/console.css +++ b/installer/resources/themes/console/midnight/console.css @@ -1535,11 +1535,47 @@ div.sorry hr { color: #c9ceff; } +/* .newsentry font[size="-2"] { letter-spacing: 0.15em; font-style: italic; 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 { border-bottom: 1px; @@ -1564,13 +1600,52 @@ div.sorry hr { } .news hr { - margin: 8px -20px 3px; + margin: 8px -20px 5px; } -.fixme { +#newspage { 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 { margin-top: 10px !important; } @@ -2213,6 +2288,25 @@ h2, h3, h4, .confignav { 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 { border-bottom: 1px solid #efeeff; padding: 5px 0 5px 0;