Skip to content

Commit

Permalink
Party page and request form
Browse files Browse the repository at this point in the history
  • Loading branch information
markottaviani committed Jan 9, 2025
1 parent f85f52b commit e4dcb75
Show file tree
Hide file tree
Showing 11 changed files with 221 additions and 1 deletion.
Binary file added app/assets/images/party-1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/party-2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/party-3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions app/controllers/party_contact_form_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
class PartyContactFormController < ApplicationController
before_action :select_bootstrap41

def create
@name = params[:party_contact_form][:name]
@email = params[:party_contact_form][:email]
@phone = params[:party_contact_form][:phone]
@organization = params[:party_contact_form][:organization]
@event_date_and_time = params[:party_contact_form][:event_date_and_time]
@event_location = params[:party_contact_form][:event_location]
@event_description = params[:party_contact_form][:event_description]
@guest_count = params[:party_contact_form][:guest_count]
@event_details = params[:party_contact_form][:event_details]


PartyMailer.notify(@name, @email, @phone, @organization, @event_date_and_time, @event_location, @event_description, @guest_count, @event_details).deliver_later

flash[:success] = "Your message has been sent successfully. An OPH representative will be in touch with you to discuss your request."
redirect_to :root
end

private
# def party_contact_form
# params.require(:party_contact_form).permit(:name,
# :email,
# :phone,
# :organization,
# :event_date_and_time,
# :event_location,
# :event_description,
# :guest_count,
# :event_details
# )
# end

end
24 changes: 24 additions & 0 deletions app/mailers/party_mailer.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
class PartyMailer < ActionMailer::Base
default from: 'Operation Paws for Homes <noreply@ophrescue.org>'

def notify(name, email, phone, organization, event_date_and_time, event_location, event_description, guest_count, event_details)

@name = name
@email = email
@phone = phone
@organization = organization
@event_date_and_time = event_date_and_time
@event_location = event_location
@event_description = event_description
@guest_count = guest_count
@event_details = event_details

mail(
to: 'puptasticparties@ophrescue.org',
subject: "Pup-Tastic Party Request",
content_type: 'text/html'
) do |format|
format.mjml
end
end
end
1 change: 1 addition & 0 deletions app/views/layouts/_topbar_bs41.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
<%= link_to "Adoption Fee Payments", '/adoption-fee-payments', class: "nav-link" %>
<%= link_to "Campaigns", scoped_campaigns_path("active"), class: "nav-link" %>
<%= link_to "Donate", '/donate', class: "nav-link" %>
<%= link_to "Pup-Tastic Parties", '/pup-tastic-parties', class: "nav-link" %>
<%= link_to "Sponsor", '/sponsor', class: "nav-link" %>
<%= link_to "Other Ways to Give", '/other-ways-to-give', class: "nav-link" %>
</div>
Expand Down
81 changes: 81 additions & 0 deletions app/views/pages/pup_tastic_parties.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
<div class="container-fluid">
<div class="row">
<div class="col-sm-8 offset-sm-4 col-md-8 offset-md-4 col-lg-8 offset-lg-4">
<div class="pages">
<h1>OPH Pup-tastic Parties</h1>
</div>
</div>

<div class="col-sm-4 col-md-4 col-lg-4 d-none d-sm-block">
<div class="left">
<%= image_tag "party-1.jpg", class: "rounded side img-fluid" %>
</div>
<div class="left">
<%= image_tag "party-2.jpg", class: "rounded side img-fluid" %>
</div>
<div class="left">
<%= image_tag "party-3.jpg", class: "rounded side img-fluid" %>
</div>
</div>

<div class="col-sm-8 col-md-8 col-lg-8">
<div class="article pages">

<p>Interested in having a litter of puppies visit your office, conference, or birthday party? We can
provide puppies! There is nothing like snuggling and playing with puppies to bring joy to people
of all ages. Our puppies are rescued from overcrowded shelters in the South and are available
for adoption (see https://ophrescue.org/guide for information on adopting from OPH). Your
donation will support our work to rescue and find forever homes for dogs in need!
These events are available in the areas where OPH operates: northern Virginia (as far south as
Springfield), the District of Columbia, central Maryland, and southern Pennsylvania (as far north
as York). These events and parties are subject to availability of puppies and volunteers.</p>


<%= link_to "Pup-Tastic Party Request", "/party_contact_form/new", :class => "btn btn-primary btn-large" %>

<h2>Corporate or Conference events</h2>
<ul>
<li>Up to 2 hours on a weekday</li>
<li>Minimum donation $1000</li>
</ul>

<h2>Children's birthday party or other personal event</h2>
<ul>
<li>Up to 90 minutes on a weekend</li>
<li>Minimum donation $400</li>
<li>OPH volunteers will supervise the interaction of puppies and children.</li>
</ul>

<h2>What the host provides</h2>
<ul>
<li>Space for puppy pen setup that is protected from the weather. The event can be outdoors
if the temperature is between 65-75 degrees; otherwise it needs to be indoors for the
health and safety of the puppies.</li>
<li>Free parking for at least two cars for OPH volunteers</li>
<li>Chairs for guests to sit while holding puppies</li>
</ul>

<h2>What we provide</h2>
<ul>
<li>A puppy pen</li>
<li>Floor covering</li>
<li>Puppy pads and cleanup supplies</li>
<li>Any other supplies needed for the puppies</li>
</ul>

<p>The puppies we have in our rescue varies at any particular time, and the size of litters and type of
puppies also varies widely. We are usually able to provide several puppies, but we may not
know the number of puppies or other details until shortly before the event.</p>

<p>If the puppies have not yet had all their vaccinations, which is often the case with puppies
younger than three months, we will follow puppy quarantine procedures. This means that
puppies cannot be put down on the ground except in the pen provided by OPH, and guests must
sanitize their hands before touching the puppies.</p>

<p>To request a puppy event or party, please fill out the form and OPH will get back to you.</p>

<%= link_to "Pup-Tastic Party Request", "/party_contact_form/new", :class => "btn btn-primary btn-large" %>
</div>
</div>
</div>
</div>
54 changes: 54 additions & 0 deletions app/views/party_contact_form/new.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<div class="container">
<div class="row">
<div class="col-12">
<h1 class="mt-3 ml-2">Pup-Tastic Party Request</h1>

<%= form_with scope: :party_contact_form, url: party_contact_form_index_path, method: :post, local: true, class: "container" do |f| %>
<div class="ml-2">
<div class="form-group">
<%= f.label :name %>
<%= f.text_field :name, class: "col-8 form-control", required: true %>
</div>
<div class="form-group">
<%= f.label :email %>
<%= f.text_field :email, class: "col-8 form-control", required: true %>
</div>
<div class="form-group">
<%= f.label :phone %>
<%= f.text_field :phone, class: "col-8 form-control", required: true %>
</div>
<div class="form-group">
<%= f.label :organization, 'Organization (if applicable)' %>
<%= f.text_field :organization, class: "col-8 form-control", required: false %>
</div>
<div class="form-group">
<%= f.label :event_date_and_time, 'Event Date, Start and End Times' %>
<%= f.text_field :event_date_and_time, class: "col-8 form-control", required: true %>
</div>
<div class="form-group">
<%= f.label :event_location %>
<%= f.text_field :event_location, class: "col-8 form-control", required: true %>
</div>
<div class="form-group">
<%= f.label :event_description, 'Description of event (i.e., children\'s birthday, corporate event for employees, conference break
activity, etc.)' %>
<%= f.text_area :event_description, class: "col-8 form-control", required: true %>
</div>
<div class="form-group">
<%= f.label :guest_count, 'Expected number of guests' %>
<%= f.text_field :guest_count, class: "col-8 form-control", required: true %>
</div>
<div class="form-group">
<%= f.label :event_details, 'Anything else you would like to share about your event' %>
<%= f.text_area :event_details, class: "col-8 form-control", required: true %>
</div>

<p>An OPH representative will be in touch with you to discuss your request.</p>
<p>Note: if we are able to provide puppies for your event, the donation must be paid before we will
reserve your event.</p>
<%= f.submit "Submit", class: "btn btn-primary" %>
</div>
<% end %>
</div>
</div>
</div>
18 changes: 18 additions & 0 deletions app/views/party_mailer/notify.mjml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<mjml>
<mj-body>
<mj-section>
<mj-column>
<mj-text font-size="14px" font-family="helvetica">Pup-Tastic Party Request</mj-text>
<mj-text font-size="14px" font-family="helvetica">Name: <%= @name %></mj-text>
<mj-text font-size="14px" font-family="helvetica">email: <%= @email %></mj-text>
<mj-text font-size="14px" font-family="helvetica">phone: <%= @phone %> </mj-text>
<mj-text font-size="14px" font-family="helvetica">organization: <%= @organization %> </mj-text>
<mj-text font-size="14px" font-family="helvetica">event_date_and_time: <%= @event_date_and_time %> </mj-text>
<mj-text font-size="14px" font-family="helvetica">event_location: <%= @event_location %> </mj-text>
<mj-text font-size="14px" font-family="helvetica">event_description: <%= @event_description %> </mj-text>
<mj-text font-size="14px" font-family="helvetica">guest_count: <%= @guest_count %> </mj-text>
<mj-text font-size="14px" font-family="helvetica">event_details: <%= @event_details %> </mj-text>
</mj-column>
</mj-section>
</mj-body>
</mjml>
4 changes: 3 additions & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
STATIC_PAGES = ['contact', 'funding-partners', 'community-partners', 'non-profit-and-corporate-partners',
'training-partners', 'guide', 'aboutus', 'documentary', 'insurance', 'home',
'training-partners', 'guide', 'aboutus', 'documentary', 'insurance', 'home','pup-tastic-parties',
'get-involved', 'volunteer', 'faq', 'foster', 'fosterfaq', 'donate', 'sponsor', 'newsletters', 'calendar',
'other-ways-to-give', 'terms', 'resources', 'tips-for-finding-lost-pets', 'status_definitions', 'shop',
'education-and-outreach','adoption-fee-payments','microchip-registration'].freeze
Expand Down Expand Up @@ -92,6 +92,8 @@
resources :invoices
end

resources :party_contact_form, only: %i[new create]

resources :badges
resources :attachments, only: %i[show destroy]
resources :folder_attachments, only: %i[index update]
Expand Down
4 changes: 4 additions & 0 deletions spec/mailers/previews/party_mailer_preview.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Preview all emails at http://localhost:3000/rails/mailers/party_mailer
class PartyMailerPreview < ActionMailer::Preview

end

0 comments on commit e4dcb75

Please sign in to comment.