Browse Source

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

aboriginal_lands
parent
commit
1906a9ccaf
  1. 456
      shop.json

456
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"
],
"sign": "fa-times"
}, },
{ "alcohol": {
"types": [ "sign": "fas:wine-bottle"
"alcohol",
"beverages"
],
"sign": "fa-wine-bottle"
}, },
{ "beverages": {
"types": [ "sign": "fas:wine-bottle"
"baby_goods"
],
"sign": "&#128700;"
}, },
{ "baby_goods": {
"types": [ "sign": "fas:baby"
"bag",
"general",
"variety_store"
],
"sign": "fa-shopping-bag"
}, },
{ "bag": {
"types": [ "sign": "fas:shopping-bag"
"bakery",
"confectionery",
"pastry"
],
"sign": "fa-birthday-cake"
}, },
{ "general": {
"types": [ "sign": "fas:shopping-bag"
"bicycle"
],
"sign": "fa-bicycle"
}, },
{ "variety_store": {
"types": [ "sign": "fas:shopping-bag"
"motorcycle"
],
"sign": "fa-motorcycle"
}, },
{ "bakery": {
"types": [ "sign": "fas:birthday-cake"
"boutique", },
"clothes", "confectionery": {
"fabric", "sign": "fas:birthday-cake"
"fashion", },
"leather", "pastry": {
"sewing", "sign": "fas:birthday-cake"
"tailor", },
"dry_cleaning" "bicycle": {
], "sign": "fas:bicycle"
},
"motorcycle": {
"sign": "fas:motorcycle"
},
"boutique": {
"sign": "&#128090;" "sign": "&#128090;"
}, },
{ "clothes": {
"types": [ "sign": "&#128090;"
"sea_food"
],
"sign": "fa-fish"
}, },
{ "fabric": {
"types": [ "sign": "&#128090;"
"butcher",
"cheese",
"chocolate",
"deli",
"dairy",
"farm",
"greengrocer",
"pasta",
"spices"
],
"sign": "fa-cutlery"
}, },
{ "fashion": {
"types": [ "sign": "&#128090;"
"coffee",
"tea"
],
"sign": "fa-coffee"
}, },
{ "leather": {
"types": [ "sign": "&#128090;"
"convenience"
],
"sign": "fa-shopping-basket"
}, },
{ "sewing": {
"types": [ "sign": "&#128090;"
"department_store",
"mall"
],
"sign": "fa-building"
}, },
{ "tailor": {
"types": [ "sign": "&#128090;"
"electronics",
"computer"
],
"sign": "fa-tv"
}, },
{ "dry_cleaning": {
"types": [ "sign": "&#128090;"
"electrical"
],
"sign": "fa-bolt"
}, },
{ "sea_food": {
"types": [ "sign": "fas:fish"
"lighting"
],
"sign": "fa-bulb"
}, },
{ "butcher": {
"types": [ "sign": "fas:utensils"
"fishing"
],
"sign": "&#127907;"
}, },
{ "cheese": {
"types": [ "sign": "fas:utensils"
"toys"
],
"sign": "fa-dice"
}, },
{ "chocolate": {
"types": [ "sign": "fas:utensils"
"florist", },
"garden_centre" "deli": {
], "sign": "fas:utensils"
},
"dairy": {
"sign": "fas:utensils"
},
"farm": {
"sign": "fas:utensils"
},
"greengrocer": {
"sign": "fas:utensils"
},
"pasta": {
"sign": "fas:utensils"
},
"spices": {
"sign": "fas:utensils"
},
"coffee": {
"sign": "fas:coffee"
},
"tea": {
"sign": "fas:coffee"
},
"convenience": {
"sign": "fas:shopping-basket"
},
"department_store": {
"sign": "fas:building"
},
"mall": {
"sign": "fas:building"
},
"electronics": {
"sign": "fas:tv"
},
"computer": {
"sign": "fas:desktop"
},
"electrical": {
"sign": "fas:bolt"
},
"lighting": {
"sign": "fas:bulb"
},
"fishing": {
"sign": "fas:fish"
},
"toys": {
"sign": "fas:dice"
},
"florist": {
"sign": "&#127799;" "sign": "&#127799;"
}, },
{ "garden_centre": {
"types": [ "sign": "&#127799;"
"hairdresser" },
], "hairdresser": {
"sign": "&#128113;" "sign": "&#128113;"
}, },
{ "ice_cream": {
"types": [ "sign": "fas:ice-cream"
"ice_cream"
],
"sign": "&#127848;"
}, },
{ "jewelry": {
"types": [ "sign": "fas:ring"
"jewelry"
],
"sign": "fa-ring"
}, },
{ "kiosk": {
"types": [ "sign": "fas:newspaper"
"kiosk",
"newsagent"
],
"sign": "fa-newspaper-o"
}, },
{ "newsagent": {
"types": [ "sign": "fas:newspaper"
"shoes"
],
"sign": "fa-shoe-prints"
}, },
{ "shoes": {
"types": [ "sign": "fas:shoe-prints"
"travel_agency" },
], "travel_agency": {
"sign": "&#129523;" "sign": "&#129523;"
}, },
{ "supermarket": {
"types": [ "sign": "fas:shopping-cart"
"supermarket"
],
"sign": "fa-shopping-cart"
}, },
{ "watches": {
"types": [ "sign": "far:clock"
"watches"
],
"sign": "&#8986;"
}, },
{ "gift": {
"types": [ "sign": "fas:gift"
"gift"
],
"sign": "fa-gift"
}, },
{ "locksmith": {
"types": [ "sign": "fas:key"
"locksmith"
],
"sign": "fa-key"
}, },
{ "doityourself": {
"types": [ "sign": "fas:tools"
"doityourself",
"hardware"
],
"sign": "fa-tools"
}, },
{ "hardware": {
"types": [ "sign": "fas:tools"
"art"
],
"sign": "fa-palette"
}, },
{ "art": {
"types": [ "sign": "fas:palette"
"stationery"
],
"sign": "fa-pencil-ruler"
}, },
{ "stationery": {
"types": [ "sign": "fas:pencil-ruler"
"funeral_directors" },
], "funeral_directors": {
"sign": "maki:monument" "sign": "maki:monument"
}, },
{ "copyshop": {
"types": [ "sign": "fas:copy"
"copyshop"
],
"sign": "fa-copy"
}, },
{ "tobacco": {
"types": [ "sign": "fas:smoking"
"tobacco"
],
"sign": "fa-smoking"
}, },
{ "furniture": {
"types": [ "sign": "fas:couch"
"furniture",
"interior_decoration"
],
"sign": "fa-couch"
}, },
{ "interior_decoration": {
"types": [ "sign": "fas:couch"
"car_repair",
"car",
"car_parts",
"tyres"
],
"sign": "fa-car"
}, },
{ "car_repair": {
"types": [ "sign": "fas:car"
"beauty", },
"cosmetics" "car": {
], "sign": "fas:car"
},
"car_parts": {
"sign": "fas:car"
},
"tyres": {
"sign": "fas:car"
},
"beauty": {
"sign": "" "sign": ""
}, },
{ "cosmetics": {
"types": [ "sign": ""
"music"
],
"sign": "fa-guitar"
}, },
{ "music": {
"types": [ "sign": "fas:guitar"
"optician"
],
"sign": "fa-glasses"
}, },
{ "optician": {
"types": [ "sign": "fas:glasses"
"books"
],
"sign": "fa-book"
}, },
{ "books": {
"types": [ "sign": "fas:book"
"sports"
],
"sign": "fa-basketball-ball"
}, },
{ "sports": {
"types": [ "sign": "fas:basketball-ball"
"chemist"
],
"sign": "fa-tablets"
}, },
{ "chemist": {
"types": [ "sign": "fas:tablets"
"pet"
],
"sign": "fa-paw"
}, },
{ "pet": {
"types": [ "sign": "fas:paw"
"mobile_phone" },
], "mobile_phone": {
"sign": "fa-mobile-alt" "sign": "fas: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