Add community icons, add icons and descriptions to post-save screen

This commit is contained in:
Bryan Housel
2018-04-07 14:51:04 -04:00
parent 89798ad865
commit 8ea2c7ff9a
4 changed files with 47 additions and 9 deletions

View File

@@ -3611,6 +3611,9 @@ img.tile-debug {
vertical-align: top;
padding: 0 10px 5px 10px;
}
.save-success td.cell-icon {
width: 50px;
}
.save-success .details {
margin: 0px 5px;
white-space: nowrap;

View File

@@ -134,6 +134,7 @@ export function svgDefs(context) {
// symbol spritesheets
defs
.call(SVGSpriteDefinition('iD-sprite', context.imagePath('iD-sprite.svg')))
.call(SVGSpriteDefinition('maki-sprite', context.imagePath('maki-sprite.svg')));
.call(SVGSpriteDefinition('maki-sprite', context.imagePath('maki-sprite.svg')))
.call(SVGSpriteDefinition('community-sprite', context.imagePath('community-sprite.svg')));
};
}

View File

@@ -72,7 +72,7 @@ export function uiSuccess(context) {
row
.append('td')
.attr('class', 'summary-icon')
.attr('class', 'cell-icon summary-icon')
.append('a')
.attr('target', '_blank')
.attr('href', changesetURL)
@@ -83,7 +83,7 @@ export function uiSuccess(context) {
var summaryDetail = row
.append('td')
.attr('class', 'summary-detail');
.attr('class', 'cell-detail summary-detail');
summaryDetail
.append('a')
@@ -168,13 +168,46 @@ export function uiSuccess(context) {
rowEnter
.append('td')
.attr('class', 'community-icon')
.text(function(d) { return d.type; });
.attr('class', 'cell-icon community-icon')
.append('a')
.attr('target', '_blank')
.attr('href', function(d) { return d.url; })
.append('svg')
.attr('class', 'logo-small')
.append('use')
.attr('xlink:href', function(d) { return '#community-' + d.type; });
rowEnter
var communityDetail = rowEnter
.append('td')
.attr('class', 'community-detail')
.text(function(d) { return d.name; });
.attr('class', 'cell-detail community-detail');
communityDetail.each(function(d) {
var selection = d3_select(this);
var replacements = {
url: d.url,
signupUrl: d.signupUrl || d.url
};
selection
.append('div')
.attr('class', 'community-detail-name')
.append('a')
.attr('target', '_blank')
.attr('href', d.url)
.text(t('community.' + d.id + '.name'));
selection
.append('div')
.attr('class', 'community-detail-description')
.text(t('community.' + d.id + '.description', replacements));
if (d.extendedDescription) {
selection
.append('div')
.attr('class', 'community-detail-extendedDescription')
.text(t('community.' + d.id + '.extendedDescription', replacements));
}
});
}

View File

@@ -16,8 +16,9 @@
"dist": "npm-run-all -p dist:**",
"dist:mapillary": "shx mkdir -p dist/mapillary-js && shx cp -R node_modules/mapillary-js/dist/* dist/mapillary-js/",
"dist:min": "uglifyjs dist/iD.js -c warnings=false -m -o dist/iD.min.js",
"dist:svg:maki": "svg-sprite --symbol --symbol-dest . --symbol-sprite dist/img/maki-sprite.svg node_modules/@mapbox/maki/icons/*.svg",
"dist:svg:id": "node svg/spriteify.js --svg svg/iD-sprite.src.svg --json svg/iD-sprite.json > dist/img/iD-sprite.svg",
"dist:svg:community": "svg-sprite --symbol --symbol-dest . --shape-id-generator \"community-%s\" --symbol-sprite dist/img/community-sprite.svg node_modules/osm-community-index/dist/img/*.svg",
"dist:svg:maki": "svg-sprite --symbol --symbol-dest . --symbol-sprite dist/img/maki-sprite.svg node_modules/@mapbox/maki/icons/*.svg",
"imagery": "node data/update_imagery",
"lint": "eslint *.js js/id test/spec modules",
"start": "node development_server.js develop",