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
+2 -1
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')));
};
}
+40 -7
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));
}
});
}