diff --git a/Gemfile b/Gemfile index c0601e2..e55b901 100644 --- a/Gemfile +++ b/Gemfile @@ -35,6 +35,8 @@ gem 'elasticsearch-model' gem 'elasticsearch-rails' gem 'elasticsearch-dsl' +gem 'leaflet-rails' + gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw] # bundle exec rake doc:rails generates the API under doc/api. diff --git a/Gemfile.lock b/Gemfile.lock index caa54fb..67a42dd 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -127,6 +127,8 @@ GEM rails launchy (2.4.3) addressable (~> 2.3) + leaflet-rails (1.3.1) + rails (>= 4.2.0) loofah (2.2.2) crass (~> 1.0.2) nokogiri (>= 1.5.9) @@ -292,6 +294,7 @@ DEPENDENCIES kaminari kaminari-i18n launchy + leaflet-rails omniauth omniauth-browserid pry diff --git a/app/controllers/geo_controller.rb b/app/controllers/geo_controller.rb new file mode 100644 index 0000000..6b6955a --- /dev/null +++ b/app/controllers/geo_controller.rb @@ -0,0 +1,6 @@ +class GeoController < ApplicationController + + def index + render action: "index" + end +end diff --git a/app/views/geo/index.html.slim b/app/views/geo/index.html.slim new file mode 100644 index 0000000..1d374a3 --- /dev/null +++ b/app/views/geo/index.html.slim @@ -0,0 +1,25 @@ +doctype html +html + head + title Stadtratmonitor Leipzig - Karte + = stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true + = stylesheet_link_tag 'https://unpkg.com/leaflet@1.0.1/dist/leaflet.css' + = javascript_include_tag 'vendor/modernizr' + = javascript_include_tag 'https://unpkg.com/leaflet@1.0.1/dist/leaflet.js' + = csrf_meta_tags + + body + .row + .small-12.columns + .clearfix + h3#title = 'Karte' + div#map/ + javascript: + var map = L.map('map').setView([51.4437366804, 11.865234375], 9); + L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', + { + attribution: 'Map data @ OpenStreetMap contributors', + maxZoom: 12, + minZoom: 8 + } + ).addTo(map); \ No newline at end of file diff --git a/app/views/layouts/application.html.slim b/app/views/layouts/application.html.slim index 2f193f1..cd71dcd 100644 --- a/app/views/layouts/application.html.slim +++ b/app/views/layouts/application.html.slim @@ -25,6 +25,7 @@ html h1[id="title" class="left"] = link_to 'Stadtratmonitor Leipzig', search_path div(class="right") div(class="left") = link_to_unless_current 'Suche', search_path + div(class="left header_indent") = link_to_unless_current 'Karte', geo_path div(class="left header_indent") = link_to_unless_current 'Glossar', glossary_url div(class="right header_indent") = link_to_unless_current 'Impressum', impressum_url div(class="clear") diff --git a/config/routes.rb b/config/routes.rb index 70685ad..a177ad8 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,6 +1,7 @@ Rails.application.routes.draw do root :to => 'search#index', as: :search post '/import' => 'import#new_papers_callback' + get '/map' => 'geo#index', as: :geo get '/glossary' => 'application#glossary', as: :glossary get '/impressum' => 'application#impressum', as: :impressum