Skip to content

Commit

Permalink
[rubyforgood#4504] edit agency info in a step-wise form
Browse files Browse the repository at this point in the history
  • Loading branch information
danielabar committed Aug 27, 2024
1 parent cbca1d3 commit 31e4cb5
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 5 deletions.
59 changes: 59 additions & 0 deletions app/views/partners/profiles/step/_agency_information_form.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<%= simple_form_for partner, url: partners_profile_path, html: { multipart: true } do |f| %>
<div class="form-group">
<%= f.input :name, label: "Agency Name", required: true, class: "form-control" %>
</div>

<%= f.fields_for :profile, profile do |pf| %>
<div class="form-group">
<%= pf.input :agency_type, collection: Partner::AGENCY_TYPES.values, label: "Agency Type", class: "form-control", wrapper: :input_group %>
</div>

<div class="form-group">
<%= pf.input :other_agency_type, label: "Other Agency Type", class: "form-control" %>
</div>

<div class="form-group row">
<label class="control-label col-md-3">501(c)(3) IRS Determination Letter</label>
<% if profile.proof_of_partner_status.attached? %>
<div class="col-md-8">
Attached file: <%= link_to profile.proof_of_partner_status.blob['filename'], rails_blob_path(profile.proof_of_partner_status), class: "font-weight-bold" %>
<%= pf.file_field :proof_of_partner_status, class: "form-control-file" %>
</div>
<% else %>
<div class="col-md-8">
<%= pf.file_field :proof_of_partner_status, class: "form-control-file" %>
</div>
<% end %>
</div>

<div class="form-group">
<%= pf.input :agency_mission, as: :text, label: "Agency Mission", class: "form-control" %>
</div>

<div class="form-group">
<%= pf.input :address1, label: "Address (line 1)", class: "form-control" %>
</div>

<div class="form-group">
<%= pf.input :address2, label: "Address (line 2)", class: "form-control" %>
</div>

<div class="form-group">
<%= pf.input :city, label: "City", class: "form-control" %>
</div>

<div class="form-group">
<%= pf.input :state, label: "State", class: "form-control" %>
</div>

<div class="form-group">
<%= pf.input :zip_code, label: "Zip Code", class: "form-control" %>
</div>
<% end %>

<%# Buttons: FIXME: 4504 need separate actions for these %>
<div class="form-group mt-4 d-flex justify-content-start">
<%= f.button :submit, 'Save and Next', class: 'btn btn-primary mr-2' %>
<%= f.button :submit, 'Submit for Approval', class: 'btn btn-success' %>
</div>
<% end %>
11 changes: 6 additions & 5 deletions app/views/partners/profiles/step/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -29,31 +29,32 @@
</h2>
<div id="collapseOne" class="accordion-collapse collapse show" data-bs-parent="#accordionExample">
<div class="accordion-body">
<strong>TODO: Form with only agency details</strong>
<%# TODO: 4504 Maybe don't need to specify path because its in the same dir %>
<%= render 'partners/profiles/step/agency_information_form', partner: current_partner, profile: current_partner.profile %>
</div>
</div>
</div>
<div class="accordion-item">
<h2 class="accordion-header">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo">
Social Media
Program Delivery Address
</button>
</h2>
<div id="collapseTwo" class="accordion-collapse collapse" data-bs-parent="#accordionExample">
<div class="accordion-body">
<strong>TODO: Form with only social media details</strong>
<%# TODO: Partial with form for Program Delivery Address %>
</div>
</div>
</div>
<div class="accordion-item">
<h2 class="accordion-header">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseThree" aria-expanded="false" aria-controls="collapseThree">
Next section
Agency Stability
</button>
</h2>
<div id="collapseThree" class="accordion-collapse collapse" data-bs-parent="#accordionExample">
<div class="accordion-body">
<strong>TODO: Whatever the next form is...</strong>
<%# TODO: Partial with form for Agency Stability %>
</div>
</div>
</div>
Expand Down

0 comments on commit 31e4cb5

Please sign in to comment.