@@ -69,7 +69,7 @@ def download_shapefiles(fmus)
69
69
}
70
70
end
71
71
72
- sidebar "Shapefiles" do
72
+ sidebar "Shapefiles" , only : :index do
73
73
div do
74
74
link_to "Download Filtered Shapefiles" , download_filtered_shapefiles_admin_fmus_path (
75
75
q : params [ :q ] &.to_unsafe_h
@@ -101,29 +101,45 @@ def download_shapefiles(fmus)
101
101
end
102
102
103
103
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
120
141
end
121
142
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
127
143
end
128
144
end
129
145
0 commit comments