]> git.openstreetmap.org Git - rails.git/commitdiff
render local chapters in html
authorAdam Hoyle <atomoil@gmail.com>
Wed, 11 Aug 2021 22:45:58 +0000 (23:45 +0100)
committerAdam Hoyle <atomoil@gmail.com>
Wed, 11 Aug 2021 22:45:58 +0000 (23:45 +0100)
app/models/communities.rb
app/views/site/communities.html.erb

index d09d62d6a54a6dd66aca67a3ca2b2ae26d1605e5..2379c59ad020df6cee7e5a54730b761b78395bac 100644 (file)
@@ -23,8 +23,8 @@ class Communities
     community_index['features'].each do |feature|
       feature['properties']['resources'].each do |id, data|
         data.each do |key, value|
-          if key == "type" and value == "osm-lc"
-            array_of_entries.push(id);
+          if key == "type" and value == "osm-lc" and data['strings']['community']
+            array_of_entries.push({ id: id, name: data['strings']['community'], url: data['strings']['url'] });
           end
         end
       end
index ad431d849286a395253cf70052548337e4d1fb79..b92b3140c031b7859c96d4bfb6bbed9a9bc4ea04 100644 (file)
@@ -11,7 +11,7 @@
   <p><%= t ".local_chapters.list_text", :locale => @locale %></p>
   <ul>
     <% @local_chapters.each do |chapter| %>
-      <li><%= chapter %></li>
+      <li><a href="<%= chapter[:url] %>"><%= chapter[:name] %></a></li>
     <% end %>
   </ul>
   <h2><%= t ".other_groups.title", :locale => @locale %></h2>