From 8a0a5e309e03bedf6a044f80a2e5e71562eb40b7 Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Sun, 8 Apr 2018 08:59:49 -0400 Subject: [PATCH] Show languages --- css/80_app.css | 11 ++++++++++- data/core.yaml | 1 + dist/locales/en.json | 3 ++- modules/ui/success.js | 25 +++++++++++++++++++------ 4 files changed, 32 insertions(+), 8 deletions(-) diff --git a/css/80_app.css b/css/80_app.css index 7919cd081..c75209c00 100644 --- a/css/80_app.css +++ b/css/80_app.css @@ -3604,6 +3604,11 @@ img.tile-debug { /* Success Modal ------------------------------------------------------- */ +.save-success.body { + overflow-y: scroll; + overflow-x: hidden; +} + .save-summary, .save-communityLinks { padding: 0px 20px 15px 20px; @@ -3641,6 +3646,9 @@ img.tile-debug { font-size: 14px; font-weight: bold; } +.community-languages { + font-style: italic; +} .save-summary .details { margin: 0px 5px; white-space: nowrap; @@ -3655,12 +3663,13 @@ img.tile-debug { width: 12px; height: 15px; } -.community-detail .disclosure-wrap .community-extended-description { +.community-detail .community-more { background-color: #efefef; padding: 8px; border-radius: 4px; } + /* Splash Modal ------------------------------------------------------- */ .modal-actions .logo-walkthrough, diff --git a/data/core.yaml b/data/core.yaml index 75adffa6e..bac0beb6c 100644 --- a/data/core.yaml +++ b/data/core.yaml @@ -537,6 +537,7 @@ en: changeset_id: "Changeset #: {changeset_id}" like_osm: "Like OpenStreetMap? Connect with others:" more: More + languages: "Languages: {languages}" confirm: okay: "OK" cancel: "Cancel" diff --git a/dist/locales/en.json b/dist/locales/en.json index 197f127f1..f5bcac69c 100644 --- a/dist/locales/en.json +++ b/dist/locales/en.json @@ -653,7 +653,8 @@ "view_on_osm": "View Changes on OSM", "changeset_id": "Changeset #: {changeset_id}", "like_osm": "Like OpenStreetMap? Connect with others:", - "more": "More" + "more": "More", + "languages": "Languages: {languages}" }, "confirm": { "okay": "OK", diff --git a/modules/ui/success.js b/modules/ui/success.js index 37e2425d6..1de9a6a79 100644 --- a/modules/ui/success.js +++ b/modules/ui/success.js @@ -179,20 +179,33 @@ export function uiSuccess(context) { .attr('class', 'community-description') .html(t('community.' + d.id + '.description', replacements)); - if (d.extendedDescription) { + if (d.extendedDescription || (d.languageCodes && d.languageCodes.length)) { selection .append('div') .call(uiDisclosure(context, 'community-ext-' + d.id, false) .title(t('success.more')) - .content(extendedDescription) + .content(showMore) ); } - function extendedDescription(selection) { - selection + function showMore(selection) { + var more = selection .append('div') - .attr('class', 'community-extended-description') - .html(t('community.' + d.id + '.extendedDescription', replacements)); + .attr('class', 'community-more'); + + if (d.extendedDescription) { + more + .append('div') + .attr('class', 'community-extended-description') + .html(t('community.' + d.id + '.extendedDescription', replacements)); + } + + if (d.languageCodes && d.languageCodes.length) { + more + .append('div') + .attr('class', 'community-languages') + .text(t('success.languages', { languages: d.languageCodes.join(', ') })); + } } function linkify(url) {