add route for communities

This commit is contained in:
Adam Hoyle 2021-08-07 15:46:39 +01:00
parent cf54b68f84
commit d8d1ab1776
6 changed files with 12 additions and 1 deletions

View file

@ -7,7 +7,7 @@ class Ability
can [:relation, :relation_history, :way, :way_history, :node, :node_history, can [:relation, :relation_history, :way, :way_history, :node, :node_history,
:changeset, :note, :new_note, :query], :browse :changeset, :note, :new_note, :query], :browse
can :search, :direction 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 [:finish, :embed], :export
can [:search, :search_latlon, :search_ca_postcode, :search_osm_nominatim, can [:search, :search_latlon, :search_ca_postcode, :search_osm_nominatim,
:search_geonames, :search_osm_nominatim_reverse, :search_geonames_reverse], :geocoder :search_geonames, :search_osm_nominatim_reverse, :search_geonames_reverse], :geocoder

View file

@ -106,6 +106,10 @@ class SiteController < ApplicationController
@locale = params[:about_locale] || I18n.locale @locale = params[:about_locale] || I18n.locale
end end
def communities
@locale = I18n.locale
end
def export; end def export; end
def offline; end def offline; end

View file

@ -59,6 +59,9 @@
<li class="compact-hide nav-item <%= current_page_class(about_path) %>"> <li class="compact-hide nav-item <%= current_page_class(about_path) %>">
<%= link_to t("layouts.about"), about_path, :class => "nav-link" %> <%= link_to t("layouts.about"), about_path, :class => "nav-link" %>
</li> </li>
<li class="compact-hide nav-item <%= current_page_class(communities_path) %>">
<%= link_to t("layouts.communities"), communities_path, :class => "nav-link" %>
</li>
<li id="compact-secondary-nav" class="dropdown nav-item"> <li id="compact-secondary-nav" class="dropdown nav-item">
<a class="dropdown-toggle nav-link" data-toggle="dropdown" href="#"><%= t "layouts.more" %></a> <a class="dropdown-toggle nav-link" data-toggle="dropdown" href="#"><%= t "layouts.more" %></a>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
@ -75,6 +78,7 @@
<li class="<%= current_page_class(copyright_path) %>"><%= link_to t("layouts.copyright"), copyright_path, :class => "dropdown-item" %></li> <li class="<%= current_page_class(copyright_path) %>"><%= link_to t("layouts.copyright"), copyright_path, :class => "dropdown-item" %></li>
<li class="<%= current_page_class(help_path) %>"><%= link_to t("layouts.help"), help_path, :class => "dropdown-item" %></li> <li class="<%= current_page_class(help_path) %>"><%= link_to t("layouts.help"), help_path, :class => "dropdown-item" %></li>
<li class="<%= current_page_class(about_path) %>"><%= link_to t("layouts.about"), about_path, :class => "dropdown-item" %></li> <li class="<%= current_page_class(about_path) %>"><%= link_to t("layouts.about"), about_path, :class => "dropdown-item" %></li>
<li class="<%= current_page_class(communities_path) %>"><%= link_to t("layouts.communities"), communities_path, :class => "dropdown-item" %></li>
</ul> </ul>
</li> </li>
</ul> </ul>

View file

@ -0,0 +1 @@
COMMUNITIES PAGE WILL GO HERE 🎉

View file

@ -1431,6 +1431,7 @@ en:
help: Help help: Help
about: About about: About
copyright: Copyright copyright: Copyright
communities: Communities
community: Community community: Community
community_blogs: "Community Blogs" community_blogs: "Community Blogs"
community_blogs_title: "Blogs from members of the OpenStreetMap community" community_blogs_title: "Blogs from members of the OpenStreetMap community"

View file

@ -147,6 +147,7 @@ OpenStreetMap::Application.routes.draw do
get "/help" => "site#help" get "/help" => "site#help"
get "/about/:about_locale" => "site#about" get "/about/:about_locale" => "site#about"
get "/about" => "site#about" get "/about" => "site#about"
get "/communities" => "site#communities"
get "/history" => "changesets#index" get "/history" => "changesets#index"
get "/history/feed" => "changesets#feed", :defaults => { :format => :atom } get "/history/feed" => "changesets#feed", :defaults => { :format => :atom }
get "/history/comments/feed" => "changeset_comments#index", :as => :changesets_comments_feed, :defaults => { :format => "rss" } get "/history/comments/feed" => "changeset_comments#index", :as => :changesets_comments_feed, :defaults => { :format => "rss" }