Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add preset subtitle property #6137

Closed
wants to merge 15 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions build_data.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ function generatePresets(tstrings, faIcons) {

tstrings.presets[id] = {
name: preset.name,
subtitle: preset.subtitle,
terms: (preset.terms || []).join(',')
};

Expand Down Expand Up @@ -344,6 +345,9 @@ function generateTranslations(fields, presets, tstrings) {
} else {
delete preset.terms;
}
if (!p.subtitle) {
preset.subtitle = '<translate with short summary or explanation of \'' + preset.name + '\', if needed>';
}
});

return translations;
Expand Down
4 changes: 4 additions & 0 deletions css/80_app.css
Original file line number Diff line number Diff line change
Expand Up @@ -1330,6 +1330,10 @@ a.hide-toggle {
text-overflow: ellipsis;
overflow: hidden;
}
.preset-list-button .label-inner .namepart:nth-child(2) {
font-weight: normal;
font-size: 11px;
}

.preset-list-button:hover .label,
.preset-list-button:focus .label,
Expand Down
1,150 changes: 1,139 additions & 11 deletions data/presets.yaml

Large diffs are not rendered by default.

34 changes: 33 additions & 1 deletion data/presets/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ Generally, these properties will be equivalent and should be supersets of `tags`

iD's validator will recommend that users add missing tags from `addTags` to matching features.

For example, the Bridge preset has these properties:
For example, the Bridge preset has these properties:

```
"tags": {
Expand Down Expand Up @@ -174,10 +174,42 @@ The default is `1.0`.

The primary name of the feature type in American English.

Names use [title case](https://en.wikipedia.org/wiki/Letter_case#Title_case), where most words are capitalized.

Upon merging with `master`, this is sent to Transifex for translating to other localizations. Changing the name of an existing preset will require it to be re-translated to all localizations.

This property is required. There is no default.

##### `subtitle`

An optional summary or explanation of the feature in American English. This is displayed alongside `name` in some parts of the UI. Its purpose is to help mappers accurately decide what preset to use.

Subtitles use [sentence case](https://en.wikipedia.org/wiki/Letter_case#Sentence_case), where just the first word is capitalized.

Subtitles can be noun phrases, where they further specify what the preset _is_.

```
"name": "Stream",
"subtitle": "Minor natural waterway"
```

```
"name": "Ford",
"subtitle": "Where water flows over a road"
```

Alternatively, subtitles can be verb phrases, where they specify what the preset _does_.

```
"name": "Bar",
"subtitle": "Serves alcoholic drinks"
```

```
"name": "Flat Coin Vending Machine",
"subtitle": "Presses coins into souvenirs"
```

##### `replacement`

The ID of a preset that is preferable to this one. iD's validator will flag features matching this preset and recommend that the user upgrade the tags.
Expand Down
124 changes: 62 additions & 62 deletions data/presets/presets.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion data/presets/presets/advertising/billboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@
"tags": {
"advertising": "billboard"
},
"name": "Billboard"
"name": "Billboard",
"subtitle": "Large, flat advertising structure"
}
3 changes: 2 additions & 1 deletion data/presets/presets/amenity/animal_boarding.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,6 @@
"tags": {
"amenity": "animal_boarding"
},
"name": "Animal Boarding Facility"
"name": "Animal Boarding Facility",
"subtitle": "Temporary housing and care for pets"
}
3 changes: 2 additions & 1 deletion data/presets/presets/amenity/atm.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@
"tags": {
"amenity": "atm"
},
"name": "ATM"
"name": "ATM",
"subtitle": "Machine allowing bank account access"
}
3 changes: 2 additions & 1 deletion data/presets/presets/amenity/bar.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@
"tags": {
"amenity": "bar"
},
"name": "Bar"
"name": "Bar",
"subtitle": "Establishment serving alcoholic drinks"
}
3 changes: 2 additions & 1 deletion data/presets/presets/amenity/bbq.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@
"tags": {
"amenity": "bbq"
},
"name": "Barbecue/Grill"
"name": "Barbecue Grill",
"subtitle": "Device for cooking over flames"
}
3 changes: 2 additions & 1 deletion data/presets/presets/amenity/biergarten.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@
"bier",
"booze"
],
"name": "Biergarten"
"name": "Biergarten",
"subtitle": "Establishment serving beer outside"
}
3 changes: 2 additions & 1 deletion data/presets/presets/amenity/cinema.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,6 @@
"tags": {
"amenity": "cinema"
},
"name": "Cinema"
"name": "Cinema",
"subtitle": "Venue for screening motion pictures"
}
3 changes: 2 additions & 1 deletion data/presets/presets/amenity/clock/sundial.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@
"key": "display",
"value": "sundial"
},
"name": "Sundial"
"name": "Sundial",
"subtitle": "Device using the sun to tell time"
}
3 changes: 2 additions & 1 deletion data/presets/presets/amenity/dojo.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@
"tags": {
"amenity": "dojo"
},
"name": "Dojo / Martial Arts Academy"
"name": "Dojo",
"subtitle": "Martial arts academy"
}
3 changes: 2 additions & 1 deletion data/presets/presets/amenity/post_box.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@
"letter",
"post"
],
"name": "Mailbox"
"name": "Mailbox",
"subtitle": "Drop box for outgoing post"
}
3 changes: 2 additions & 1 deletion data/presets/presets/amenity/pub.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,6 @@
"bier",
"booze"
],
"name": "Pub"
"name": "Pub",
"subtitle": "Establishment serving beer and food"
}
3 changes: 2 additions & 1 deletion data/presets/presets/amenity/pub/microbrewery.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@
"microbrewery",
"small batch brewery"
],
"name": "Brewpub"
"name": "Brewpub",
"subtitle": "Pub with a microbrewery"
}
3 changes: 2 additions & 1 deletion data/presets/presets/amenity/shelter/lean_to.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
"amenity": "shelter",
"shelter_type": "lean_to"
},
"name": "Lean-To"
"name": "Lean-To",
"subtitle": "Unenclosed wilderness shelter"
}
7 changes: 6 additions & 1 deletion data/presets/presets/amenity/theatre/type/amphi.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"lit"
],
"geometry": [
"point", "area"
"point",
"area"
],
"terms": [
"open air",
Expand All @@ -19,5 +20,9 @@
"amenity": "theatre",
"theatre:type": "amphi"
},
"reference": {
"key": "theatre:type",
"value": "amphi"
},
"name": "Amphitheatre"
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@
"key": "vending",
"value": "elongated_coin"
},
"name": "Flat Coin Vending Machine"
"name": "Flat Coin Vending Machine",
"subtitle": "Presses coins into souvenirs"
}
3 changes: 2 additions & 1 deletion data/presets/presets/building.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@
},
"matchScore": 0.6,
"terms": [],
"name": "Building"
"name": "Building",
"subtitle": "Structure"
}
3 changes: 2 additions & 1 deletion data/presets/presets/club.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@
"terms": [
"social"
],
"name": "Club"
"name": "Club",
"subtitle": "Meeting place of a social group"
}
3 changes: 2 additions & 1 deletion data/presets/presets/craft.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@
"craft": "*"
},
"terms": [],
"name": "Craft"
"name": "Craft",
"subtitle": "Workshop"
}
3 changes: 2 additions & 1 deletion data/presets/presets/ford.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
"tags": {
"ford": "yes"
},
"name": "Ford"
"name": "Ford",
"subtitle": "Where water flows over a road"
}
3 changes: 2 additions & 1 deletion data/presets/presets/historic.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
"tags": {
"historic": "*"
},
"name": "Historic Site"
"name": "Historic Site",
"subtitle": "Designated place of historic value"
}
3 changes: 2 additions & 1 deletion data/presets/presets/landuse/grass.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
"landuse": "grass"
},
"terms": [],
"name": "Grass"
"name": "Grass",
"subtitle": "Managed grass area"
}
3 changes: 2 additions & 1 deletion data/presets/presets/leisure/adult_gaming_centre.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@
"tags": {
"leisure": "adult_gaming_centre"
},
"name": "Adult Gaming Center"
"name": "Adult Gaming Center",
"subtitle": "Gambling arcade"
}
4 changes: 2 additions & 2 deletions data/presets/presets/man_made/adit.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
],
"terms": [
"cave",
"horizontal mine entrance",
"tunnel",
"underground"
],
"tags": {
"man_made": "adit"
},
"name": "Adit"
"name": "Adit",
"subtitle": "Horizontal mine entrance"
}
3 changes: 2 additions & 1 deletion data/presets/presets/man_made/mast.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,6 @@
"tags": {
"man_made": "mast"
},
"name": "Mast"
"name": "Mast",
"subtitle": "Tall vertical structure"
}
6 changes: 3 additions & 3 deletions data/presets/presets/man_made/mineshaft.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
"cave",
"mine shaft",
"tunnel",
"underground",
"vertical mine entrance"
"underground"
],
"tags": {
"man_made": "mineshaft"
},
"name": "Mineshaft"
"name": "Mineshaft",
"subtitle": "Vertical mine entrance"
}
3 changes: 2 additions & 1 deletion data/presets/presets/man_made/tower.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@
"tags": {
"man_made": "tower"
},
"name": "Tower"
"name": "Tower",
"subtitle": "Building constructed for its height"
}
3 changes: 2 additions & 1 deletion data/presets/presets/manhole.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@
"sewage",
"telecom"
],
"name": "Manhole"
"name": "Manhole",
"subtitle": "Access to areas below ground level"
}
3 changes: 2 additions & 1 deletion data/presets/presets/natural/grassland.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
"prairie",
"savanna"
],
"name": "Grassland"
"name": "Grassland",
"subtitle": "Grass-dominated natural landscape"
}
3 changes: 2 additions & 1 deletion data/presets/presets/noexit/yes.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@
"key": "noexit",
"value": "*"
},
"name": "No Exit"
"name": "No Exit",
"subtitle": "Indicates a road does not continue"
}
3 changes: 2 additions & 1 deletion data/presets/presets/piste/downhill.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@
"tags": {
"piste:type": "downhill"
},
"name": "Downhill Piste/Ski Run"
"name": "Downhill Ski Trail",
"subtitle": "Alpine piste"
}
6 changes: 4 additions & 2 deletions data/presets/presets/piste/nordic.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@
"nordic",
"crosscountry",
"skating",
"piste"
"piste",
"XC skiing trail"
],
"tags": {
"piste:type": "nordic"
},
"name": "Nordic or Crosscountry Piste/Ski Trail"
"name": "Cross-country Ski Trail",
"subtitle": "Nordic piste"
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,6 @@
"key": "generator:method",
"value": "photovoltaic"
},
"name": "Solar Panel"
"name": "Solar Panel",
"subtitle": "Generates electricity from sunlight"
}
3 changes: 2 additions & 1 deletion data/presets/presets/power/generator/source/wind.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@
"key": "generator:source",
"value": "wind"
},
"name": "Wind Turbine"
"name": "Wind Turbine",
"subtitle": "Generates electricity from wind"
}
1 change: 1 addition & 0 deletions data/presets/presets/public_transport/platform.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,6 @@
"transportation"
],
"name": "Transit Platform",
"subtitle": "Where passengers board",
"matchScore": 0.2
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,6 @@
"transit",
"transportation"
],
"name": "Aerialway Platform"
"name": "Aerialway Platform",
"subtitle": "Where passengers board"
}
Loading