Skip to content

Commit

Permalink
931- Disable drop-down status button on adoption made and remove new …
Browse files Browse the repository at this point in the history
…adoption made button (rubyforgood#957)

* Disable drop-down status button on adoption made and remove new adoption made button

* Removed Turbo request
  • Loading branch information
Aaryanpal authored Sep 6, 2024
1 parent 3470658 commit d17403b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
match_type: :adoption}
},
class: "btn btn-outline-primary",
data: { turbo_method: :post,
turbo_confirm: "Click OK to finalize this adoption."
}
data: { turbo_confirm: "Click OK to finalize this adoption." }
%>
<% else %>
<span class="d-inline-block" tabindex="0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,14 @@
<%= render 'organizations/staff/pets/tabs/partials/application_status', app: app %>
</div>
<!-- create -->
<% unless app.status == 'adoption_made' %>
<div class="align-middle text-center col">
<%= render 'organizations/staff/pets/tabs/partials/application_create_button', app: app %>
</div>
<% else %>
<div class="align-middle text-center col">
</div>
<% end %>
<!-- notes -->
<div class="align-middle col text-nowrap">
<%= render 'organizations/staff/pets/tabs/partials/application_notes', app: app, modal_id: 'table' %>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
<div class="dropdown">
<button class="btn dropdown-toggle <%= application_status_classes(app)%>" data-bs-toggle="dropdown" aria-expanded="false">
<button class="btn dropdown-toggle <%= application_status_classes(app) %>" data-bs-toggle="dropdown" aria-expanded="false" <%= 'disabled' if app.status == 'adoption_made' %>>
<%= app.human_enum_name(:status) %>
</button>
<ul class="dropdown-menu">
<% AdopterApplication.statuses.keys.each do |status| %>
<%unless status == "adoption_made" %>
<li>
<%= button_to t("organizations.staff.pets.application_status.#{status}"),
staff_adoption_application_review_path(app, params: { adopter_application: { status: status}}),
:method => :patch, class: 'dropdown-item' %>
</li>
<% unless app.status == 'adoption_made' %>
<ul class="dropdown-menu">
<% AdopterApplication.statuses.keys.each do |status| %>
<% unless status == "adoption_made" %>
<li>
<%= button_to t("organizations.staff.pets.application_status.#{status}"),
staff_adoption_application_review_path(app, params: { adopter_application: { status: status}}),
:method => :patch, class: 'dropdown-item' %>
</li>
<% end %>
<% end %>
<% end %>
</ul>
</ul>
<% end %>
</div>

0 comments on commit d17403b

Please sign in to comment.