Browse Source

shop: rewrite from array with types to hash; also enable Font Awesome regular

pedestrian
parent
commit
e36b05c181
  1. 532
      shop.json

532
shop.json

@ -24,324 +24,268 @@
"16": "(node[shop];way[shop];relation[shop];);" "16": "(node[shop];way[shop];relation[shop];);"
}, },
"feature": { "feature": {
"pre": "{% set shop0 = tags.shop|split(';')[0] %}{% set current = const.default %}{% for v in const.shops %}{% if shop0 in v.types %}{% set current = v %}{% endif %}{% endfor %}", "pre": [
"{% set shop0 = tags.shop|split(';')[0] %}",
"{% set current = const.default %}",
"{% if const.shops[shop0] %}",
" {% set current = const.shops[shop0] %}",
"{% endif %}"
],
"description": "{{ tagTransList('shop', tags.shop) }}", "description": "{{ tagTransList('shop', tags.shop) }}",
"markerSign": "{% set c = current.sign %}{% if c|slice(0, 3) == 'fa-' %}<i class=\"fa {{ c }}\"></i>{% elseif c|slice(0, 5) == 'maki:' %}<img data-src=\"{{ c }}\">{% else %}{{ c|raw }}{% endif %}" "markerSign": [
"{% set c = current.sign %}",
"{% if c|slice(0, 4) == 'fas:' %}",
" <i class=\"fas fa-{{ c|slice(4) }}\"></i>",
"{% elseif c|slice(0, 4) == 'far:' %}",
" <i class=\"far fa-{{ c|slice(4) }}\"></i>",
"{% elseif c|slice(0, 5) == 'maki:' %}",
" <img data-src=\"{{ c }}\">",
"{% else %}",
" {{ c|raw }}",
"{% endif %}"
]
}, },
"const": { "const": {
"default": { "default": {
"sign": "fa-shopping-bag" "sign": "fas:shopping-bag"
}, },
"shops": [ "shops": {
{ "vacant": {
"types": [ "sign": "fas:times"
"vacant" },
], "alcohol": {
"sign": "fa-times" "sign": "fas:wine-bottle"
}, },
{ "beverages": {
"types": [ "sign": "fas:wine-bottle"
"alcohol", },
"beverages" "baby_goods": {
], "sign": "fas:baby"
"sign": "fa-wine-bottle" },
}, "bag": {
{ "sign": "fas:shopping-bag"
"types": [ },
"baby_goods" "general": {
], "sign": "fas:shopping-bag"
"sign": "&#128700;" },
}, "variety_store": {
{ "sign": "fas:shopping-bag"
"types": [ },
"bag", "bakery": {
"general", "sign": "fas:birthday-cake"
"variety_store" },
], "confectionery": {
"sign": "fa-shopping-bag" "sign": "fas:birthday-cake"
}, },
{ "pastry": {
"types": [ "sign": "fas:birthday-cake"
"bakery", },
"confectionery", "bicycle": {
"pastry" "sign": "fas:bicycle"
], },
"sign": "fa-birthday-cake" "motorcycle": {
}, "sign": "fas:motorcycle"
{ },
"types": [ "boutique": {
"bicycle" "sign": "&#128090;"
], },
"sign": "fa-bicycle" "clothes": {
}, "sign": "&#128090;"
{ },
"types": [ "fabric": {
"motorcycle" "sign": "&#128090;"
], },
"sign": "fa-motorcycle" "fashion": {
}, "sign": "&#128090;"
{ },
"types": [ "leather": {
"boutique",
"clothes",
"fabric",
"fashion",
"leather",
"sewing",
"tailor",
"dry_cleaning"
],
"sign": "&#128090;" "sign": "&#128090;"
}, },
{ "sewing": {
"types": [ "sign": "&#128090;"
"sea_food" },
], "tailor": {
"sign": "fa-fish" "sign": "&#128090;"
}, },
{ "dry_cleaning": {
"types": [ "sign": "&#128090;"
"butcher", },
"cheese", "sea_food": {
"chocolate", "sign": "fas:fish"
"deli", },
"dairy", "butcher": {
"farm", "sign": "fas:utensils"
"greengrocer", },
"pasta", "cheese": {
"spices" "sign": "fas:utensils"
], },
"sign": "fa-cutlery" "chocolate": {
}, "sign": "fas:utensils"
{ },
"types": [ "deli": {
"coffee", "sign": "fas:utensils"
"tea" },
], "dairy": {
"sign": "fa-coffee" "sign": "fas:utensils"
}, },
{ "farm": {
"types": [ "sign": "fas:utensils"
"convenience" },
], "greengrocer": {
"sign": "fa-shopping-basket" "sign": "fas:utensils"
}, },
{ "pasta": {
"types": [ "sign": "fas:utensils"
"department_store", },
"mall" "spices": {
], "sign": "fas:utensils"
"sign": "fa-building" },
}, "coffee": {
{ "sign": "fas:coffee"
"types": [ },
"electronics", "tea": {
"computer" "sign": "fas:coffee"
], },
"sign": "fa-tv" "convenience": {
}, "sign": "fas:shopping-basket"
{ },
"types": [ "department_store": {
"electrical" "sign": "fas:building"
], },
"sign": "fa-bolt" "mall": {
}, "sign": "fas:building"
{ },
"types": [ "electronics": {
"lighting" "sign": "fas:tv"
], },
"sign": "fa-bulb" "computer": {
}, "sign": "fas:desktop"
{ },
"types": [ "electrical": {
"fishing" "sign": "fas:bolt"
], },
"sign": "&#127907;" "lighting": {
}, "sign": "fas:bulb"
{ },
"types": [ "fishing": {
"toys" "sign": "fas:fish"
], },
"sign": "fa-dice" "toys": {
}, "sign": "fas:dice"
{ },
"types": [ "florist": {
"florist",
"garden_centre"
],
"sign": "&#127799;" "sign": "&#127799;"
}, },
{ "garden_centre": {
"types": [ "sign": "&#127799;"
"hairdresser" },
], "hairdresser": {
"sign": "&#128113;" "sign": "&#128113;"
}, },
{ "ice_cream": {
"types": [ "sign": "fas:ice-cream"
"ice_cream" },
], "jewelry": {
"sign": "&#127848;" "sign": "fas:ring"
}, },
{ "kiosk": {
"types": [ "sign": "fas:newspaper"
"jewelry" },
], "newsagent": {
"sign": "fa-ring" "sign": "fas:newspaper"
}, },
{ "shoes": {
"types": [ "sign": "fas:shoe-prints"
"kiosk", },
"newsagent" "travel_agency": {
],
"sign": "fa-newspaper-o"
},
{
"types": [
"shoes"
],
"sign": "fa-shoe-prints"
},
{
"types": [
"travel_agency"
],
"sign": "&#129523;" "sign": "&#129523;"
}, },
{ "supermarket": {
"types": [ "sign": "fas:shopping-cart"
"supermarket" },
], "watches": {
"sign": "fa-shopping-cart" "sign": "far:clock"
}, },
{ "gift": {
"types": [ "sign": "fas:gift"
"watches" },
], "locksmith": {
"sign": "&#8986;" "sign": "fas:key"
}, },
{ "doityourself": {
"types": [ "sign": "fas:tools"
"gift" },
], "hardware": {
"sign": "fa-gift" "sign": "fas:tools"
}, },
{ "art": {
"types": [ "sign": "fas:palette"
"locksmith" },
], "stationery": {
"sign": "fa-key" "sign": "fas:pencil-ruler"
}, },
{ "funeral_directors": {
"types": [
"doityourself",
"hardware"
],
"sign": "fa-tools"
},
{
"types": [
"art"
],
"sign": "fa-palette"
},
{
"types": [
"stationery"
],
"sign": "fa-pencil-ruler"
},
{
"types": [
"funeral_directors"
],
"sign": "maki:monument" "sign": "maki:monument"
}, },
{ "copyshop": {
"types": [ "sign": "fas:copy"
"copyshop" },
], "tobacco": {
"sign": "fa-copy" "sign": "fas:smoking"
}, },
{ "furniture": {
"types": [ "sign": "fas:couch"
"tobacco" },
], "interior_decoration": {
"sign": "fa-smoking" "sign": "fas:couch"
}, },
{ "car_repair": {
"types": [ "sign": "fas:car"
"furniture", },
"interior_decoration" "car": {
], "sign": "fas:car"
"sign": "fa-couch" },
}, "car_parts": {
{ "sign": "fas:car"
"types": [ },
"car_repair", "tyres": {
"car", "sign": "fas:car"
"car_parts", },
"tyres" "beauty": {
],
"sign": "fa-car"
},
{
"types": [
"beauty",
"cosmetics"
],
"sign": "" "sign": ""
}, },
{ "cosmetics": {
"types": [ "sign": ""
"music" },
], "music": {
"sign": "fa-guitar" "sign": "fas:guitar"
}, },
{ "optician": {
"types": [ "sign": "fas:glasses"
"optician" },
], "books": {
"sign": "fa-glasses" "sign": "fas:book"
}, },
{ "sports": {
"types": [ "sign": "fas:basketball-ball"
"books" },
], "chemist": {
"sign": "fa-book" "sign": "fas:tablets"
}, },
{ "pet": {
"types": [ "sign": "fas:paw"
"sports" },
], "mobile_phone": {
"sign": "fa-basketball-ball" "sign": "fas:mobile-alt"
},
{
"types": [
"chemist"
],
"sign": "fa-tablets"
},
{
"types": [
"pet"
],
"sign": "fa-paw"
},
{
"types": [
"mobile_phone"
],
"sign": "fa-mobile-alt"
} }
] }
}, },
"filter": { "filter": {
"shop": { "shop": {
"name": "{{ trans('filter:type') }}", "name": "{{ trans('filter:type') }}",
"type": "select", "type": "select",
"show_default": "true", "show_default": "true",
"values": "{% set list = [] %}{% for k, v in const.shops %}{% for t in v.types %}<option value=\"{{ t }}\">{% set list = list|merge([ t ]) %}{{ tagTrans('shop', t) }}</option>{% endfor %}{% endfor %}<option weight='1' value='other' query='nwr[shop][shop!~\"^(|.*;)({{ list|join('|') }})(|;.*)$\"]'>{{ trans('other') }}</option>", "values": "{% set list = [] %}{% for k, v in const.shops %}<option value=\"{{ k }}\">{% set list = list|merge([ k ]) %}{{ tagTrans('shop', k) }}</option>{% endfor %}<option weight='1' value='other' query='nwr[shop][shop!~\"^(|.*;)({{ list|join('|') }})(|;.*)$\"]'>{{ trans('other') }}</option>",
"sort": "natsort", "sort": "natsort",
"op": "has" "op": "has"
} }

|||||||
100:0
Loading…
Cancel
Save