Skip to content

Commit

Permalink
Change default order for send_needs, accessibilities and suitabilities
Browse files Browse the repository at this point in the history
  • Loading branch information
apricot13 committed Mar 28, 2024
1 parent 32c65d8 commit c01349b
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion app/controllers/api/v1/accessibilities_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ class API::V1::AccessibilitiesController < ApplicationController
skip_before_action :authenticate_user!

def index
render json: json_tree(Accessibility.all).to_json
render json: json_tree(Accessibility.all.order(:name)).to_json
end

private
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/api/v1/send_needs_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ class API::V1::SendNeedsController < ApplicationController
skip_before_action :authenticate_user!

def index
render json: json_tree(SendNeed.all).to_json
render json: json_tree(SendNeed.all.order(:name)).to_json
end

private
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/api/v1/suitabilities_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ class API::V1::SuitabilitiesController < ApplicationController
skip_before_action :authenticate_user!

def index
render json: json_tree(Suitability.all).to_json
render json: json_tree(Suitability.all.order(:name)).to_json
end

private
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/accessibilities/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<tbody>
<% @accessibilities.each do |sn| %>
<tr>
<td><%= sn.id %></td>
<td><span class="table__small"><%= sn.id %></span></td>
<td><%= sn.name %></td>
<td><%= time_ago_in_words(sn.updated_at).humanize %> ago</td>
<td><%= time_ago_in_words(sn.created_at).humanize %> ago</td>
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/locations/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

<%= render "shared/collapsible", name: "Accessibility", id: "location-accessibility" do %>
<div class="field-group field-group--two-cols">
<%= f.collection_check_boxes( :accessibility_ids, Accessibility.all, :id, :display_name) do |c| %>
<%= f.collection_check_boxes( :accessibility_ids, Accessibility.all.order(:name), :id, :display_name) do |c| %>
<div class="field checkbox">
<%= c.check_box class: "checkbox__input" %>
<%= c.label class: "checkbox__label" %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/send_needs/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<tbody>
<% @send_needs.each do |sn| %>
<tr>
<td><%= sn.id %></td>
<td><span class="table__small"><%= sn.id %></span></td>
<td><%= sn.name %></td>
<td><%= time_ago_in_words(sn.updated_at).humanize %> ago</td>
<td><%= time_ago_in_words(sn.created_at).humanize %> ago</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<fieldset class="field-group field-group--two-cols field-group--no-top-margin margin-bottom">
<legend class="field-group__legend">Which SEND needs can you support?</legend>
<%= s.collection_check_boxes( :send_need_ids, SendNeed.all, :id, :display_name) do |c| %>
<%= s.collection_check_boxes( :send_need_ids, SendNeed.all.order(:name), :id, :display_name) do |c| %>
<div class="field checkbox checkbox--small">
<%= c.check_box class: "checkbox__input" %>
<%= c.label class: "checkbox__label" %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/services/editors/_location-fields.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<fieldset class="field-group field-group--two-cols field-group--no-top-margin margin-bottom">
<legend class="field-group__legend">Accessibility</legend>

<%= l.collection_check_boxes( :accessibility_ids, Accessibility.all, :id, :display_name) do |c| %>
<%= l.collection_check_boxes( :accessibility_ids, Accessibility.all.order(:name), :id, :display_name) do |c| %>
<div class="field checkbox checkbox--small">
<%= c.check_box class: "checkbox__input" %>
<%= c.label class: "checkbox__label" %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/services/editors/_suitabilities.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<h3>What needs does it meet?</h3>
</legend>

<%= s.collection_check_boxes( :suitability_ids, Suitability.all, :id, :display_name) do |c| %>
<%= s.collection_check_boxes( :suitability_ids, Suitability.all.order(:name), :id, :display_name) do |c| %>
<div class="field checkbox checkbox--small">
<%= c.check_box class: "checkbox__input" %>
<%= c.label class: "checkbox__label" %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/suitabilities/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<tbody>
<% @suitabilities.each do |sn| %>
<tr>
<td><%= sn.id %></td>
<td><span class="table__small"><%= sn.id %></span></td>
<td><%= sn.name %></td>
<td><%= time_ago_in_words(sn.updated_at).humanize %> ago</td>
<td><%= time_ago_in_words(sn.created_at).humanize %> ago</td>
Expand Down

0 comments on commit c01349b

Please sign in to comment.