From 97bfc3f6012027077077ea4a6b5f2f709c76158e Mon Sep 17 00:00:00 2001 From: hellekin Date: Fri, 22 Jan 2021 10:35:07 +0100 Subject: Add markers and popups - Replace MakiMarkers with ExtraMarkers and ForkAwesome - Add HTML popup binding --- db/migrate/20210122050635_add_section_icon.rb | 5 ++ db/schema.rb | 3 +- db/seeds.rb | 82 +++++++++++++++++++++++++++ 3 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20210122050635_add_section_icon.rb (limited to 'db') diff --git a/db/migrate/20210122050635_add_section_icon.rb b/db/migrate/20210122050635_add_section_icon.rb new file mode 100644 index 0000000..a89c201 --- /dev/null +++ b/db/migrate/20210122050635_add_section_icon.rb @@ -0,0 +1,5 @@ +class AddSectionIcon < ActiveRecord::Migration[6.1] + def change + add_column :sections, :icon_name, :string, limit: 32, default: 'fa-neuter' + end +end diff --git a/db/schema.rb b/db/schema.rb index c97f290..60a2c99 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2021_01_21_192039) do +ActiveRecord::Schema.define(version: 2021_01_22_050635) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -124,6 +124,7 @@ ActiveRecord::Schema.define(version: 2021_01_21_192039) do t.datetime "created_at", precision: 6, null: false t.datetime "updated_at", precision: 6, null: false t.integer "dewey_id" + t.string "icon_name", limit: 32, default: "circle" t.index ["category_id"], name: "index_sections_on_category_id" t.index ["dewey_id"], name: "index_sections_on_dewey_id", unique: true end diff --git a/db/seeds.rb b/db/seeds.rb index 6252ebf..60cebe2 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -53,3 +53,85 @@ end if Map.count == 0 Map.create(uuid: "1a42651e-3fe8-4e83-bfcd-f14bb8d0c713", latitude: 50.8503396, longitude: 4.3517103, zoom: 13, taxonomy_id: 1) end + +# TODO: Fix section icons +# This thing below was a start with maki icons but we need more... +# And fork-awesome is missing some as well, so we need to create them. +=begin +if Section.first.icon_name == 'circle' + { + # cat-30 + 148: 'fa-campsite', + 158: 'hospital', + 130: 'landmark-JP', + 198: 'shelter', + 150: 'lodging', + 149: 'playground', + 165: 'residential-community', + 131: 'home', + 168: 'residential-community', + 164: 'residential-community', + 114: 'home', + # cat-31 + 170: 'convenience', + 180: 'sushi', + 155: 'garden', + 135: 'shop', + 115: 'drinking-water', + 154: 'restaurant', + 118: 'restaurant', + 28: 'recycling', + 27: 'garden-center', + 185: 'farm', + 182: 'fast-food', + 123: 'beer', + # cat-32 + 210: 'square', + 156: 'clothing-store', + 46: 'gift', + 144: 'waterfall', + 104: 'clothing-store', + 207: 'toilet', + # cat-33 + 18: 'hospital', + 145: 'doctor', + 157: 'doctor', + 192: 'shelter', + 199: 'defibrillator', + 190: 'shelter', + 143: 'heart', + 208: 'hospital', + 191: 'heart', + # cat-34 + 699: 'shop', + 138: 'logging', + 136: 'recycling', + 50: 'library', + 132: 'garden-center', + 42: 'hardware', + 113: 'building', + 206: 'clothing-store', + 47: 'recycling', + 205: 'recycling', + 120: 'shop', + # cat-35 + 128: 'garden-center', + 121: 'waste-basket', + 116: 'garden', + 133: 'park', + 194: 'natural', + 129: 'picnic-site', + 125: 'recycle', + 127: 'natural', + # cat-36 + 102: 'ranger-station', + 19: 'town', + 17: 'skateboard', + 14: '' + + + }.each do |id, name| + Section.find_by(dewey_id: id).update(icon_name: name) + end +end +=end -- cgit v1.2.3