From e8f6995198ebc6648438f6a5d0cc19bac7b6cac2 Mon Sep 17 00:00:00 2001 From: divyabaid16 Date: Tue, 9 Jul 2019 15:48:33 +0530 Subject: [PATCH 1/2] Map and gallery templete added to tags page --- app/controllers/tags_controller.rb | 6 +- app/views/tags/index.html.erb | 129 +++++++++++++++++++++++++++++ 2 files changed, 134 insertions(+), 1 deletion(-) create mode 100644 app/views/tags/index.html.erb diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb index b3bf053c2..7032f0395 100644 --- a/app/controllers/tags_controller.rb +++ b/app/controllers/tags_controller.rb @@ -16,7 +16,11 @@ def show @tag = Tag.find_by_name params[:id] @maps = @tag.maps.paginate(page: params[:page], per_page: 24) @title = "Maps tagged with ' #{@tag.name} '" - render template: 'maps/index' + tag = Tag.where(name: 'featured').first # note that this is not a join table but the .maps method still works + @unpaginated = true + @authors = User.where(login: tag.maps.collect(&:author)) if tag + @authors ||= [] + render template: 'tags/index' end def destroy diff --git a/app/views/tags/index.html.erb b/app/views/tags/index.html.erb new file mode 100644 index 000000000..a2152708e --- /dev/null +++ b/app/views/tags/index.html.erb @@ -0,0 +1,129 @@ +<%= stylesheet_link_tag "/lib/leaflet/dist/leaflet.css" %> +<%= stylesheet_link_tag "/lib/leaflet-environmental-layers/dist/LeafletEnvironmentalLayers.css" %> +<%= javascript_include_tag('/lib/leaflet-environmental-layers/dist/LeafletEnvironmentalLayers.js') %> +<%= javascript_include_tag('/lib/leaflet-environmental-layers/dist/windRoseLayer.js') %> +<%= javascript_include_tag('/lib/leaflet-fullhash/leaflet-fullHash.js') %> +<%= javascript_include_tag('https://api.mapbox.com/mapbox.js/plugins/leaflet-fullscreen/v1.0.1/Leaflet.fullscreen.min.js') %> +<%= stylesheet_link_tag "https://api.mapbox.com/mapbox.js/plugins/leaflet-fullscreen/v1.0.1/leaflet.fullscreen.css" %> + +<%= javascript_include_tag('/lib/leaflet-spin/example/spin/dist/spin.min.js') %> +<%= javascript_include_tag('/lib/leaflet-spin/example/leaflet.spin.min.js') %> + +
+
+
+
+ <%= render :template => 'front_ui/gallery' %> +
+
+ + \ No newline at end of file From 0b375eae599f19871af0963822acb783c1d37ba5 Mon Sep 17 00:00:00 2001 From: divyabaid16 Date: Thu, 1 Aug 2019 23:29:16 +0530 Subject: [PATCH 2/2] Gallery template --- app/views/tags/index.html.erb | 194 +++++++++++++++------------------- 1 file changed, 88 insertions(+), 106 deletions(-) diff --git a/app/views/tags/index.html.erb b/app/views/tags/index.html.erb index a2152708e..88ca2b3d0 100644 --- a/app/views/tags/index.html.erb +++ b/app/views/tags/index.html.erb @@ -13,117 +13,99 @@
- <%= render :template => 'front_ui/gallery' %> +

+

<%= @title %>

+
+

+ <%= render :partial => 'front_ui/maps', :locals => { :maps => @maps } %>
\ No newline at end of file