From cab78c2c6b54cbc408d2561dc4d90ad4a03d255c Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Sun, 8 Apr 2018 21:55:36 -0400 Subject: [PATCH] Add notification badge for events, default disclosures to closed --- css/80_app.css | 34 +++++++++++++++++++++++++++++++++- modules/ui/success.js | 10 +++++++++- 2 files changed, 42 insertions(+), 2 deletions(-) diff --git a/css/80_app.css b/css/80_app.css index 216f2aee2..5b6567435 100644 --- a/css/80_app.css +++ b/css/80_app.css @@ -3460,6 +3460,9 @@ img.tile-debug { color: #ccf; } +/* Notification Badges */ + +/* For an icon (e.g. new version) */ .badge { display: inline-block; background: #d32232; @@ -3486,6 +3489,24 @@ img.tile-debug { fill: white; } +/* For text (e.g. upcoming events) */ +.badge-text { + display: inline-block; + color: white; + text-align: center; + width: 16px; + height: 16px; + font-size: 10px; + font-weight: bold; + margin-left: 5px; + background: #f00; + border-radius: 9px; +} +[dir='rtl'] .badge-text { + margin-left: 0; + margin-right: 5px; +} + /* Modals ------------------------------------------------------- */ @@ -3647,8 +3668,12 @@ img.tile-debug { font-weight: bold; } .community-languages { + margin-top: 5px; font-style: italic; } +.community-languages:only-child { + margin-top: 0; +} .save-summary .details { margin: 0px 5px; white-space: nowrap; @@ -3665,6 +3690,10 @@ img.tile-debug { height: 15px; } +.community-events { + margin-top: 5px; +} + .community-event, .community-more { background-color: #efefef; @@ -3673,7 +3702,10 @@ img.tile-debug { margin-bottom: 5px; } -.community-event-name, +.community-event-name { + font-size: 14px; + font-weight: bold; +} .community-event-when { font-weight: bold; } diff --git a/modules/ui/success.js b/modules/ui/success.js index 01d1a992d..52581aead 100644 --- a/modules/ui/success.js +++ b/modules/ui/success.js @@ -191,6 +191,8 @@ export function uiSuccess(context) { selection .append('div') .call(uiDisclosure(context, 'community-more-' + d.id, false) + .expanded(false) + .updatePreference(false) .title(t('success.more')) .content(showMore) ); @@ -215,9 +217,15 @@ export function uiSuccess(context) { selection .append('div') .call(uiDisclosure(context, 'community-events-' + d.id, false) + .expanded(false) + .updatePreference(false) .title(t('success.events')) .content(showNextEvents) - ); + ) + .select('.hide-toggle') + .append('span') + .attr('class', 'badge-text') + .text(nextEvents.length); }