| 
									
										
										
										
											2018-03-25 13:20:54 -04:00
										 |  |  | <%- # License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later -%> | 
					
						
							| 
									
										
										
										
											2018-03-25 13:30:42 -04:00
										 |  |  | <!-- partial start: nonprofits/_overview_media --> | 
					
						
							|  |  |  | <div class='overview-media'> | 
					
						
							| 
									
										
										
										
											2020-05-15 14:01:59 -05:00
										 |  |  |   <% if @nonprofit.main_image.attached? %> | 
					
						
							| 
									
										
										
										
											2018-03-25 13:30:42 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  |     <div> | 
					
						
							|  |  |  | 			<div style='overflow: hidden; height: initial;'> | 
					
						
							| 
									
										
										
										
											2020-05-15 14:01:59 -05:00
										 |  |  |         <%= image_tag @nonprofit.main_image_by_size(:nonprofit_carousel) %> | 
					
						
							| 
									
										
										
										
											2018-03-25 13:30:42 -04:00
										 |  |  | 			</div> | 
					
						
							|  |  |  | 		</div> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	<% elsif Format::Address.full_address(@nonprofit.address, @nonprofit.city, @nonprofit.state_code) %> | 
					
						
							| 
									
										
										
										
											2018-06-06 12:44:52 -05:00
										 |  |  |     <script> | 
					
						
							|  |  |  |       var script = document.createElement('script') | 
					
						
							|  |  |  |       script.type = 'text/javascript' | 
					
						
							|  |  |  |       script.id = 'google_maps' | 
					
						
							|  |  |  |       let key = "" | 
					
						
							|  |  |  |       if (app.map_provider_options && app.map_provider_options.key) { | 
					
						
							| 
									
										
										
										
											2018-07-17 17:05:00 -05:00
										 |  |  |         key = `key=${app.map_provider_options.key}&` | 
					
						
							| 
									
										
										
										
											2018-06-06 12:44:52 -05:00
										 |  |  |       } | 
					
						
							| 
									
										
										
										
											2018-07-17 17:05:00 -05:00
										 |  |  |       script.src = `https://maps.googleapis.com/maps/api/js?${key}v=3.exp&libraries=places` | 
					
						
							| 
									
										
										
										
											2018-06-06 12:44:52 -05:00
										 |  |  |       document.body.appendChild(script) | 
					
						
							|  |  |  |     </script> | 
					
						
							| 
									
										
										
										
											2018-03-25 13:30:42 -04:00
										 |  |  | 		<% npo_full_address = Format::Address.full_address(@nonprofit.address, @nonprofit.city, @nonprofit.state_code, @nonprofit.zip_code) %> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		<div class='overview-map' id='js-map' data-address='<%= npo_full_address %>'> | 
					
						
							|  |  |  | 		</div> | 
					
						
							|  |  |  | 	<% end %> | 
					
						
							|  |  |  | </div> | 
					
						
							|  |  |  | <!-- partial end: nonprofits/_overview_media --> |