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 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								<script>
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								var app = {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  env: "<%= Rails.env %>"
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								, ip: "<%= request.remote_ip %>"
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								, current_user: <%= current_user ? current_user.id : 'undefined' %>
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								, current_admin: <%= !!(current_user && current_role?(:super_admin)) %>
							 
						 
					
						
							
								
									
										
										
										
											2020-05-20 13:23:55 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								, nonprofit: <%= @nonprofit ? raw(render('app_data/nonprofit', nonprofit: @nonprofit)) : 'undefined' %>
							 
						 
					
						
							
								
									
										
										
										
											2018-03-25 13:30:42 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								, nonprofit_id : <%= @nonprofit ? @nonprofit.id : 'undefined' %>
							 
						 
					
						
							
								
									
										
										
										
											2020-05-29 15:33:29 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								, user: <%= current_user ? raw(render('app_data/user', user: current_user)) : 'undefined' %>
							 
						 
					
						
							
								
									
										
										
										
											2018-03-25 13:30:42 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								, user_id: <%= current_user ? current_user.id : 'undefined' %>
							 
						 
					
						
							
								
									
										
										
										
											2020-05-29 15:33:29 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								, profile: <%= current_user&.profile ? raw(render('app_data/profile', profile: current_user.profile)) : 'undefined' %>
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 11:54:28 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								, profile_id: <%= current_user&.profile ? current_user.profile.id : 'undefined' %>
							 
						 
					
						
							
								
									
										
										
										
											2018-03-25 13:30:42 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								, asset_path: "<%= Rails.application.config.assets.prefix %>"
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								, host_with_port: "//<%= request.host_with_port %>"
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								, google_api:  "<%= ENV['GOOGLE_API_KEY'] %>"
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								, google_auth_client_id: "<%= ENV['GOOGLE_AUTH_CLIENT_ID'] %>"
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								, autocomplete: <%= @nonprofit ? @nonprofit.autocomplete_supporter_address : 'undefined'%> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								, facebook_app_id: "<%= ENV['FACEBOOK_APP_ID'] %>"
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								, map_provider: "<%= Settings.maps&.provider %>"
							 
						 
					
						
							
								
									
										
										
										
											2018-06-06 12:44:52 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  , map_provider_options: <%= Settings.maps&.options ? raw(Settings.maps.options.to_json) : {} %>
							 
						 
					
						
							
								
									
										
										
										
											2018-03-25 13:30:42 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								, editor: "<%= Settings.page_editor.editor%>"
							 
						 
					
						
							
								
									
										
										
										
											2018-05-22 13:31:19 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								<% if Settings&.page_editor&.editor == 'froala' and Settings&.page_editor&.editor_options&.froala_key %>, froala_key: "<%= Settings.page_editor.editor_options.froala_key %>"<% end %>
							 
						 
					
						
							
								
									
										
										
										
											2018-07-20 15:13:44 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  <%if @nonprofit&.currency_symbol %>, currency_symbol: "<%= @nonprofit.currency_symbol%>"<% end %>
							 
						 
					
						
							
								
									
										
										
										
											2018-03-25 13:30:42 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								};
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								var ENV = {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  nonprofitID: <%= @nonprofit ? @nonprofit.id : 'undefined' %>
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								, nonprofitTimezone: "<%= @nonprofit ? @nonprofit.timezone : '' %>"
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								, support_user_id: 540
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								, feeRate: <%= print_percent(CalculateFees::BaseFeeRate) %>
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								, perTransaction: <%= CalculateFees::PerTransaction %>
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								};
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								</script>