From abeef29ed0039785c6c9770701c8a36d379fdb21 Mon Sep 17 00:00:00 2001 From: Saman Bemel-Benrud Date: Thu, 23 May 2013 17:01:09 -0400 Subject: [PATCH] first pass at basic relations UI for members --- css/app.css | 48 ++- js/id/ui/preset.js | 2 +- js/id/ui/preset/localized.js | 2 +- js/id/ui/raw_membership_editor.js | 38 +- svg/ui-mockups.svg | 586 ++++++++++-------------------- 5 files changed, 263 insertions(+), 413 deletions(-) diff --git a/css/app.css b/css/app.css index 6940ad0f7..d3a83ee69 100644 --- a/css/app.css +++ b/css/app.css @@ -893,6 +893,9 @@ a:hover .icon.out-link { background-position: -500px -14px;} padding-left: 20px; padding-right: 20px; } +.inspector-preset .form-field:first-child { + margin-top: 10px; +} .form-label { position: relative; @@ -935,6 +938,10 @@ a:hover .icon.out-link { background-position: -500px -14px;} height: 65px; } +.form-field button.remove { + border-radius: 0 0 4px 0; +} + /* adding additional preset fields */ .more-buttons { @@ -1262,10 +1269,6 @@ input[type=number] { border-radius: 0 0 4px 4px; } -.form-field .localized-wrap .entry .localized-remove { - border-radius: 0 0 4px 0; -} - /* Preset form address */ .form-field .addr-housename { @@ -1344,10 +1347,15 @@ div.combobox { border-right: 5px solid transparent; } -/* tag editor */ +/* Raw Tag Editor */ .raw-tag-editor { border-top: 1px solid #ccc; + padding-bottom: 0; +} + +.tag-list { + padding-top: 10px; } .tag-row { @@ -1367,6 +1375,7 @@ div.combobox { .tag-row .input-wrap-position { width: 40%; float: left; + height: 29px; } .tag-row input.key { @@ -1452,12 +1461,11 @@ div.combobox { .tag-reference-body p, .tag-reference-body img { - padding-top: 10px; + padding-top: 20px; } .tag-reference-body a { margin-top: 5px; - margin-bottom: 5px; display: block; } @@ -1472,6 +1480,10 @@ div.combobox { width: 100%; } +.raw-tag-editor .tag-reference-body * { + padding-bottom: 10px; +} + img.wiki-image { float: right; width: 33.3333%; @@ -1483,6 +1495,22 @@ img.wiki-image { max-height: 200px; } +/* Raw relation membership editor */ + +.raw-membership-editor:nth-last-child(2) { + padding-bottom: 0; +} + +.raw-membership-editor .member-row { + position: relative; + padding-top: 10px; +} + +.raw-membership-editor .member-row .member-entity-name { + font-weight: normal; + padding-left: 10px; +} + /* Map Controls */ .map-controls { @@ -1543,9 +1571,13 @@ img.wiki-image { border: 0; } +.background-control .hide-toggle { + padding-bottom: 10px; +} + .hide-toggle { display: block; - padding: 0 0 10px 12px; + padding-left:12px; position: relative; } diff --git a/js/id/ui/preset.js b/js/id/ui/preset.js index b585cffcd..b00ed2d21 100644 --- a/js/id/ui/preset.js +++ b/js/id/ui/preset.js @@ -98,7 +98,7 @@ iD.ui.preset = function(context, entity, preset) { .style('opacity', '0') .transition() .duration(200) - .style('padding-top', '20px') + .style('padding-top', '10px') .style('max-height', '240px') .style('opacity', '1') .each('end', function(d) { diff --git a/js/id/ui/preset/localized.js b/js/id/ui/preset/localized.js index 224254f75..22d6eeeea 100644 --- a/js/id/ui/preset/localized.js +++ b/js/id/ui/preset/localized.js @@ -120,7 +120,7 @@ iD.ui.preset.localized = function(field, context) { .attr('class', 'localized-value'); wrap.append('button') - .attr('class', 'minor button-input-action localized-remove') + .attr('class', 'minor button-input-action remove') .on('click', function(d) { var t = {}; t[key(d.lang)] = ''; diff --git a/js/id/ui/raw_membership_editor.js b/js/id/ui/raw_membership_editor.js index 8d7c2dd2c..559f62a80 100644 --- a/js/id/ui/raw_membership_editor.js +++ b/js/id/ui/raw_membership_editor.js @@ -62,33 +62,35 @@ iD.ui.RawMembershipEditor = function(context, entity) { .data(memberships, function(d) { return iD.Entity.key(d.relation) + ',' + d.index; }); var row = li.enter().append('li') - .attr('class', 'member-row'); + .attr('class', 'member-row form-field'); - var relation = row.append('a') + // var relation = row.append('div') + // .attr('class', 'member-entity cf'); + + // relation.append('span') + // .attr('class', 'member-entity-icon') + // .each(function(d) { + // return d3.select(this) + // .call(iD.ui.PresetIcon(context.geometry(d.relation.id))); + // }); + + relationLabel = row.append('label') + .attr('class', 'form-label') + .append('a') .attr('href', '#') - .attr('class', 'member-entity') .on('click', selectRelation); - relation.append('span') - .attr('class', 'member-entity-icon') - .each(function(d) { - return d3.select(this) - .call(iD.ui.PresetIcon(context.geometry(d.relation.id))); - }); + relationLabel.append('span') + .attr('class','member-entity-type') + .text(function(d) { return context.presets().match(d.relation, context.graph()).name(); }); - relation.append('span') + relationLabel.append('span') .attr('class', 'member-entity-name') .text(function(d) { return iD.util.localeName(d.relation); }); - relation.append('span') - .attr('class', 'member-entity-type') - .text(function(d) { return context.presets().match(d.relation, context.graph()).name(); }); - - row.append('span') + row.append('input') .attr('class', 'member-role') - .append('input') .property('type', 'text') - .attr('class', 'member-role-input') .attr('maxlength', 255) .attr('placeholder', t('inspector.role')) .property('value', function(d) { return d.member.role; }) @@ -96,7 +98,7 @@ iD.ui.RawMembershipEditor = function(context, entity) { row.append('button') .attr('tabindex', -1) - .attr('class', 'member-delete') + .attr('class', 'remove button-input-action member-delete minor') .on('click', deleteMembership) .append('span') .attr('class', 'icon delete'); diff --git a/svg/ui-mockups.svg b/svg/ui-mockups.svg index e590ae9f2..3a3a99baa 100644 --- a/svg/ui-mockups.svg +++ b/svg/ui-mockups.svg @@ -125,9 +125,9 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="0.5" - inkscape:cx="-5474.0215" - inkscape:cy="6.49335" + inkscape:zoom="1" + inkscape:cx="-5486.5385" + inkscape:cy="-17.330415" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="false" @@ -2085,7 +2085,7 @@ Route + style="font-size:12px;font-weight:bold;text-align:start;text-anchor:start;fill:#7092ff;fill-opacity:1;-inkscape-font-specification:Helvetica Neue Bold">Route Role + y="1292.2062">Role forward @@ -2168,7 +2168,7 @@ width="360" height="1" x="-6000" - y="1122.3622" + y="1302.3622" inkscape:export-filename="/Users/saman/Desktop/hover-state.png" inkscape:export-xdpi="90" inkscape:export-ydpi="90" /> @@ -2187,10 +2187,10 @@ @@ -3405,7 +3405,7 @@ width="400" height="50" x="-5060" - y="1512.3622" + y="1202.3622" rx="0" ry="0" inkscape:export-filename="/Users/saman/Desktop/default-state.png" @@ -3427,7 +3427,7 @@ sodipodi:linespacing="100%" id="text17569" y="1029.6592" - x="-5019.7178" + x="-5219.7178" style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:100%;letter-spacing:0px;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#000000;fill:#a9a9a9;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Helvetica Neue;-inkscape-font-specification:Helvetica Neue" xml:space="preserve" inkscape:export-filename="/Users/saman/Desktop/default-state.png" @@ -3435,7 +3435,7 @@ inkscape:export-ydpi="90">Route membership - - - Road - Role - forward - - - - - + View on openstreetmap.org All tags @@ -3939,7 +3859,7 @@ sodipodi:nodetypes="cccc" inkscape:connector-curvature="0" id="path17707" - d="m -5040,1537.3622 0,-8 8,4 z" + d="m -5040,1227.3622 0,-8 8,4 z" style="color:#000000;fill:#7092ff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" /> Editing Primary Road - - - Multipolygon membership - - - - - - Name of multipolygon - - - Type - - - - Other relations - - Name of relation - - - Type - - - - - - - - - - - - - + Relations + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +