@@ -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,51 @@ 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 t ( "active_admin.view" ) , "javascript:void(0)" , onclick : "$('#geojson_modal').dialog({ modal: true, dialogClass: 'custom_dialog' })"
124
+ end
125
+ row ( :properties ) do
126
+ div id : "properties_modal" , style : "display: none;" do
127
+ resource . properties
128
+ end
129
+ link_to t ( "active_admin.view" ) , "javascript:void(0)" , onclick : "$('#properties_modal').dialog({ modal: true, dialogClass: 'custom_dialog' })"
130
+ end
131
+ end
132
+ row :created_at
133
+ row :updated_at
134
+ row :deleted_at
135
+ end
136
+ end
137
+
138
+ column max_width : "250px" do
139
+ attributes_table title : t ( "active_admin.fmus_page.certification" ) do
140
+ row :certification_fsc
141
+ row :certification_pefc
142
+ row :certification_olb
143
+ row :certification_pafc
144
+ row :certification_fsc_cw
145
+ row :certification_tlv
146
+ row :certification_ls
120
147
end
121
148
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
149
end
128
150
end
129
151
0 commit comments