@@ -69,7 +69,7 @@ def download_shapefiles(fmus)
6969 }
7070 end
7171
72- sidebar "Shapefiles" do
72+ sidebar "Shapefiles" , only : :index do
7373 div do
7474 link_to "Download Filtered Shapefiles" , download_filtered_shapefiles_admin_fmus_path (
7575 q : params [ :q ] &.to_unsafe_h
@@ -101,29 +101,45 @@ def download_shapefiles(fmus)
101101 end
102102
103103 show do
104- attributes_table do
105- row :id
106- row :name
107- row :forest_type
108- row :country
109- row :operator
110- row :certification_fsc
111- row :certification_pefc
112- row :certification_olb
113- row :certification_pafc
114- row :certification_fsc_cw
115- row :certification_tlv
116- row :certification_ls
117- if resource . geojson && resource . centroid . present?
118- row :map do |r |
119- render partial : "map" , locals : { center : [ r . centroid . x , r . centroid . y ] , center_marker : false , geojson : r . geojson , bbox : r . bbox }
104+ columns class : "d-flex" do
105+ column class : "flex-1" do
106+ attributes_table do
107+ row :id
108+ row :name
109+ row :forest_type
110+ row :country
111+ row :operator
112+
113+ if resource . geojson && resource . centroid . present?
114+ row :map do |r |
115+ render partial : "map" , locals : { center : [ r . centroid . x , r . centroid . y ] , center_marker : false , geojson : r . geojson , bbox : r . bbox }
116+ end
117+ end
118+ if resource . geojson
119+ row ( :geojson ) do
120+ div id : "geojson_modal" , style : "display: none;" do
121+ resource . geojson
122+ end
123+ link_to "Show" , "javascript:void(0)" , onclick : "$('#geojson_modal').dialog({ modal: true, dialogClass: 'custom_dialog' })"
124+ end
125+ end
126+ row :created_at
127+ row :updated_at
128+ row :deleted_at
129+ end
130+ end
131+
132+ column max_width : "250px" do
133+ attributes_table title : t ( "active_admin.fmus_page.certification" ) do
134+ row :certification_fsc
135+ row :certification_pefc
136+ row :certification_olb
137+ row :certification_pafc
138+ row :certification_fsc_cw
139+ row :certification_tlv
140+ row :certification_ls
120141 end
121142 end
122- row ( :geojson ) { |fmu | fmu . geojson . to_json }
123- row ( :properties ) { |fmu | fmu . geojson &.dig ( "properties" ) &.to_json }
124- row :created_at
125- row :updated_at
126- row :deleted_at
127143 end
128144 end
129145
0 commit comments