From d8d1ab17764e5e0a7af99248cb5047d2af99d534 Mon Sep 17 00:00:00 2001 From: Adam Hoyle Date: Sat, 7 Aug 2021 15:46:39 +0100 Subject: [PATCH] add route for communities --- app/abilities/ability.rb | 2 +- app/controllers/site_controller.rb | 4 ++++ app/views/layouts/_header.html.erb | 4 ++++ app/views/site/communities.html.erb | 1 + config/locales/en.yml | 1 + config/routes.rb | 1 + 6 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 app/views/site/communities.html.erb diff --git a/app/abilities/ability.rb b/app/abilities/ability.rb index 018ce0096..ec32a4607 100644 --- a/app/abilities/ability.rb +++ b/app/abilities/ability.rb @@ -7,7 +7,7 @@ class Ability can [:relation, :relation_history, :way, :way_history, :node, :node_history, :changeset, :note, :new_note, :query], :browse can :search, :direction - can [:index, :permalink, :edit, :help, :fixthemap, :offline, :export, :about, :preview, :copyright, :key, :id], :site + can [:index, :permalink, :edit, :help, :fixthemap, :offline, :export, :about, :communities, :preview, :copyright, :key, :id], :site can [:finish, :embed], :export can [:search, :search_latlon, :search_ca_postcode, :search_osm_nominatim, :search_geonames, :search_osm_nominatim_reverse, :search_geonames_reverse], :geocoder diff --git a/app/controllers/site_controller.rb b/app/controllers/site_controller.rb index 00b3e78da..1845ecfaf 100644 --- a/app/controllers/site_controller.rb +++ b/app/controllers/site_controller.rb @@ -106,6 +106,10 @@ class SiteController < ApplicationController @locale = params[:about_locale] || I18n.locale end + def communities + @locale = I18n.locale + end + def export; end def offline; end diff --git a/app/views/layouts/_header.html.erb b/app/views/layouts/_header.html.erb index 6b6271c2b..a6e390071 100644 --- a/app/views/layouts/_header.html.erb +++ b/app/views/layouts/_header.html.erb @@ -59,6 +59,9 @@ + diff --git a/app/views/site/communities.html.erb b/app/views/site/communities.html.erb new file mode 100644 index 000000000..8bea6d14c --- /dev/null +++ b/app/views/site/communities.html.erb @@ -0,0 +1 @@ +COMMUNITIES PAGE WILL GO HERE 🎉 \ No newline at end of file diff --git a/config/locales/en.yml b/config/locales/en.yml index 7dce96dd6..1d5128293 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1431,6 +1431,7 @@ en: help: Help about: About copyright: Copyright + communities: Communities community: Community community_blogs: "Community Blogs" community_blogs_title: "Blogs from members of the OpenStreetMap community" diff --git a/config/routes.rb b/config/routes.rb index dc10818b9..aff5126f8 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -147,6 +147,7 @@ OpenStreetMap::Application.routes.draw do get "/help" => "site#help" get "/about/:about_locale" => "site#about" get "/about" => "site#about" + get "/communities" => "site#communities" get "/history" => "changesets#index" get "/history/feed" => "changesets#feed", :defaults => { :format => :atom } get "/history/comments/feed" => "changeset_comments#index", :as => :changesets_comments_feed, :defaults => { :format => "rss" } -- 2.39.5