From 757deccb3f41a61227e4c598d9c5f3802fe2ca6a Mon Sep 17 00:00:00 2001 From: Margarita Barvinok Date: Fri, 26 Jul 2024 18:08:03 -0400 Subject: [PATCH 1/2] temp --- app/assets/stylesheets/_custom_layout.scss | 2 +- app/controllers/rooms_controller.rb | 6 - app/controllers/rovers_controller.rb | 6 +- .../specific_attribute_states_controller.rb | 11 - app/controllers/zones_controller.rb | 6 +- app/views/app_preferences/_form.html.erb | 5 +- app/views/app_preferences/index.html.erb | 2 +- app/views/common_attributes/index.html.erb | 2 +- app/views/layouts/application.html.erb | 2 +- app/views/reports/index.html.erb | 34 +- app/views/rooms/index.html.erb | 14 - app/views/rooms/room_states/index.html.erb | 355 +++++++++--------- .../rooms/specific_attributes/index.html.erb | 2 +- .../rover_navigations/buildings.html.erb | 83 ++-- app/views/rover_navigations/rooms.html.erb | 85 ++--- app/views/rover_navigations/zones.html.erb | 38 +- app/views/rovers/_listing.html.erb | 6 - app/views/rovers/index.html.erb | 47 +-- app/views/rovers/show.html.erb | 8 - .../specific_attribute_states/index.html.erb | 14 - .../specific_attribute_states/show.html.erb | 10 - app/views/static_pages/about.html.erb | 2 +- app/views/static_pages/dashboard.html.erb | 2 +- .../static_pages/welcome_rovers.html.erb | 2 +- app/views/zones/index.html.erb | 26 +- config/routes.rb | 11 +- 26 files changed, 353 insertions(+), 428 deletions(-) delete mode 100644 app/views/rooms/index.html.erb delete mode 100644 app/views/rovers/show.html.erb delete mode 100644 app/views/specific_attribute_states/index.html.erb delete mode 100644 app/views/specific_attribute_states/show.html.erb diff --git a/app/assets/stylesheets/_custom_layout.scss b/app/assets/stylesheets/_custom_layout.scss index e944ae62..91b824fb 100644 --- a/app/assets/stylesheets/_custom_layout.scss +++ b/app/assets/stylesheets/_custom_layout.scss @@ -48,7 +48,7 @@ h1 { font-weight: 900; line-height: 54px; letter-spacing: 0em; - margin-top: 1rem; + margin-top: 2rem; } h2 { diff --git a/app/controllers/rooms_controller.rb b/app/controllers/rooms_controller.rb index bf9f179e..1ee03173 100644 --- a/app/controllers/rooms_controller.rb +++ b/app/controllers/rooms_controller.rb @@ -3,12 +3,6 @@ class RoomsController < ApplicationController before_action :set_room, only: %i[ show destroy archive unarchive ] include BuildingApi - # GET /rooms or /rooms.json - def index - @rooms = Room.active.order(:room_number) - authorize @rooms - end - # GET /rooms/1 or /rooms/1.json def show @common_attributes = CommonAttribute.active diff --git a/app/controllers/rovers_controller.rb b/app/controllers/rovers_controller.rb index 0a3fba8f..1a5a1a55 100644 --- a/app/controllers/rovers_controller.rb +++ b/app/controllers/rovers_controller.rb @@ -1,6 +1,6 @@ class RoversController < ApplicationController before_action :auth_user - before_action :set_rover, only: %i[ show edit update destroy ] + before_action :set_rover, only: %i[ edit update destroy ] # GET /rovers or /rovers.json def index @@ -14,10 +14,6 @@ def index end end - # GET /rovers/1 or /rovers/1.json - def show - end - # GET /rovers/new def new @rover = Rover.new diff --git a/app/controllers/specific_attribute_states_controller.rb b/app/controllers/specific_attribute_states_controller.rb index c39a0d29..e7535d51 100644 --- a/app/controllers/specific_attribute_states_controller.rb +++ b/app/controllers/specific_attribute_states_controller.rb @@ -2,17 +2,6 @@ class SpecificAttributeStatesController < ApplicationController before_action :auth_user before_action :set_room, only: %i[ new create edit update_specific_attribute_states ] - # GET /specific_attribute_states or /specific_attribute_states.json - def index - # currently not used - @specific_attribute_states = SpecificAttributeState.all - authorize @specific_attribute_states - end - - # GET /specific_attribute_states/1 or /specific_attribute_states/1.json - def show - end - # GET /specific_attribute_states/new def new @specific_attribute_states = @room.active_specific_attributes.map do |specific_attribute| diff --git a/app/controllers/zones_controller.rb b/app/controllers/zones_controller.rb index 0ba712df..20435429 100644 --- a/app/controllers/zones_controller.rb +++ b/app/controllers/zones_controller.rb @@ -1,6 +1,6 @@ class ZonesController < ApplicationController before_action :auth_user - before_action :set_zone, only: %i[ show edit update destroy ] + before_action :set_zone, only: %i[ edit update destroy ] # GET /zones or /zones.json def index @@ -8,10 +8,6 @@ def index authorize @zones end - # GET /zones/1 or /zones/1.json - def show - end - # GET /zones/new def new @zone = Zone.new diff --git a/app/views/app_preferences/_form.html.erb b/app/views/app_preferences/_form.html.erb index 60992309..e04a018e 100644 --- a/app/views/app_preferences/_form.html.erb +++ b/app/views/app_preferences/_form.html.erb @@ -27,10 +27,7 @@ <%= form.select :pref_type, @pref_types, { include_blank: "Select ...", required: true }, { class: "input_text_field" } %> -
+
<%= form.submit app_preference.persisted? ? 'Update' : 'Create', class: "btn btn-primary" %> - <% if app_preference.persisted? %> - <%= link_to "Cancel", app_preferences_path, class: "link_to" %> - <% end %>
<% end %> diff --git a/app/views/app_preferences/index.html.erb b/app/views/app_preferences/index.html.erb index 5e3fcbed..88d5fd47 100644 --- a/app/views/app_preferences/index.html.erb +++ b/app/views/app_preferences/index.html.erb @@ -1,4 +1,4 @@ -
+

App Preferences

diff --git a/app/views/common_attributes/index.html.erb b/app/views/common_attributes/index.html.erb index 94041218..ab3c6910 100644 --- a/app/views/common_attributes/index.html.erb +++ b/app/views/common_attributes/index.html.erb @@ -1,4 +1,4 @@ -
+

Common Attributes

<%= turbo_frame_tag 'new_common_attribute_form' do %> diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index c69e1931..377ea23d 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -22,7 +22,7 @@ <%= render "layouts/flash" %>
- <%= yield %> + <%= yield %>
<%= render partial: "shared/footer" %> diff --git a/app/views/reports/index.html.erb b/app/views/reports/index.html.erb index 2f003b6d..ec64a1c6 100644 --- a/app/views/reports/index.html.erb +++ b/app/views/reports/index.html.erb @@ -1,19 +1,21 @@ -

Reports

-
- <% @reports_list.each do |report| %> -
-
-
-

- <%= link_to report[:title], report[:url], class: "link_to" %> -

-
-
-

- <%= report[:description] %> -

+
+

Reports

+
+ <% @reports_list.each do |report| %> +
+
+
+

+ <%= link_to report[:title], report[:url], class: "link_to" %> +

+
+
+

+ <%= report[:description] %> +

+
-
- <% end %> + <% end %> +
diff --git a/app/views/rooms/index.html.erb b/app/views/rooms/index.html.erb deleted file mode 100644 index a58558dd..00000000 --- a/app/views/rooms/index.html.erb +++ /dev/null @@ -1,14 +0,0 @@ -

<%= notice %>

- -

Rooms

- -
- <% @rooms.each do |room| %> - <%= render room %> -

- <%= link_to "Show this room", room %> -

- <% end %> -
- -<%= link_to "New room", new_room_path %> diff --git a/app/views/rooms/room_states/index.html.erb b/app/views/rooms/room_states/index.html.erb index 420b407f..410026d1 100644 --- a/app/views/rooms/room_states/index.html.erb +++ b/app/views/rooms/room_states/index.html.erb @@ -1,190 +1,191 @@ -

-
-

Room States <%= @room.rmrecnbr? ? "for #{@room.room_number}" : '' %>

-
- <%= link_to "Back to Room", room_path(@room), class: "link_to" %> +
+
+

Room States <%= @room.rmrecnbr? ? "for #{@room.room_number}" : '' %>

+
+ <%= link_to "Back to Room", room_path(@room), class: "link_to" %> +
-
-

Location: <%= @room.floor.building.name %> (Floor <%= @room.floor.name %>)

-<%# Filter to get recent states %> -
-

- Enter a Time Period to Filter Room Checks -

-
-<%= form_with url: room_room_states_path(@room), method: :get, - data: { - controller: "autosubmit", - autosubmit_target: "form" - } do |form| %> -
- <%= form.label :from, "From: "%> - <%= form.date_field :from, value: params[:from], class: "form-control" %> - <%= form.label :to, "To: "%> - <%= form.date_field :to, value: params[:to], class: "form-control" %> +

Location: <%= @room.floor.building.name %> (Floor <%= @room.floor.name %>)

+ <%# Filter to get recent states %> +
+

+ Enter a Time Period to Filter Room Checks +

- <%= form.submit "Filter Room Checks" %> -Clear Filters -<%end%> -
-
- <% if @room_states.empty? %> - No room states found - <% else %> -
- <% @room_states.each_with_index do |room_state, index| %> -
- -
-
- <% if room_state.is_accessed %> -
- Tabs to display states -
- <% if room_tickets(@room, room_state.updated_at).count > 0 %> - - - <% end %> - - - + <%= form_with url: room_room_states_path(@room), method: :get, + data: { + controller: "autosubmit", + autosubmit_target: "form" + } do |form| %> +
+ <%= form.label :from, "From: "%> + <%= form.date_field :from, value: params[:from], class: "form-control" %> + <%= form.label :to, "To: "%> + <%= form.date_field :to, value: params[:to], class: "form-control" %> +
+ <%= form.submit "Filter Room Checks" %> + Clear Filters + <%end%> +
+
+ <% if @room_states.empty? %> + No room states found + <% else %> +
+ <% @room_states.each_with_index do |room_state, index| %> +
+ +
+
+ <% if room_state.is_accessed %> +
+ Tabs to display states +
+ <% if room_tickets(@room, room_state.updated_at).count > 0 %> + + + <% end %> - - + + - - -
-
-

Room Issues

- - - - - - - - - - <% room_tickets(@room, room_state.updated_at).each_with_index do |ticket, index| %> - - - - - - <% end %> - -
Sent ToDescriptionSubmitted By
- <%= ticket.tdx_email %> - - <%= ticket.description %> - - <%= ticket.submitted_by %> -
-
+ + -
-

Common Questions

- - - - - - - - - <% room_state.common_attribute_states.each_with_index do |common_attribute_state, index| %> - - - - - <% end %> - -
QuestionResponse
- <%= common_attribute_state.common_attribute.description %> - - <% if common_attribute_state.checkbox_value.present? %> - <%= common_attribute_state.checkbox_value ? 'Yes' : 'No' %> - <% elsif common_attribute_state.quantity_box_value.present? %> - <%= common_attribute_state.quantity_box_value %> - <% else %> - <% end %> -
-
+ + +
+
+

Room Issues

+ + + + + + + + + + <% room_tickets(@room, room_state.updated_at).each_with_index do |ticket, index| %> + + + + + + <% end %> + +
Sent ToDescriptionSubmitted By
+ <%= ticket.tdx_email %> + + <%= ticket.description %> + + <%= ticket.submitted_by %> +
+
-
-

Specific Questions

- - - - - - - - - <% room_state.specific_attribute_states.each_with_index do |specific_attribute_state, index| %> - - - - - <% end %> - +
+

Common Questions

+
QuestionResponse
- <%= specific_attribute_state.specific_attribute.description %> - - <% if specific_attribute_state.checkbox_value.present? %> - <%= specific_attribute_state.checkbox_value ? 'Yes' : 'No' %> - <% elsif specific_attribute_state.quantity_box_value.present?%> - <%= specific_attribute_state.quantity_box_value %> - <% else %> - Not Checked - <% end %> -
+ + + + + + + + <% room_state.common_attribute_states.each_with_index do |common_attribute_state, index| %> + + + + + <% end %> +
QuestionResponse
+ <%= common_attribute_state.common_attribute.description %> + + <% if common_attribute_state.checkbox_value.present? %> + <%= common_attribute_state.checkbox_value ? 'Yes' : 'No' %> + <% elsif common_attribute_state.quantity_box_value.present? %> + <%= common_attribute_state.quantity_box_value %> + <% else %> + <% end %> +
-
+
-
-

Resources

- - - - - - - - - <% @room.resources.each_with_index do |resource, index| %> - - - + + <% end %> + +
Item NameItem Status
- <%= resource.name %> - <%= resource.resource_type %> - - <% if room_state.resource_states[index].present? %> - <%= room_state.resource_states[index].is_checked ? 'Yes' : 'No' %> - <% else %> +
+

Specific Questions

+ + + + + + + + + <% room_state.specific_attribute_states.each_with_index do |specific_attribute_state, index| %> + + + - - <% end %> - -
QuestionResponse
+ <%= specific_attribute_state.specific_attribute.description %> + + <% if specific_attribute_state.checkbox_value.present? %> + <%= specific_attribute_state.checkbox_value ? 'Yes' : 'No' %> + <% elsif specific_attribute_state.quantity_box_value.present?%> + <%= specific_attribute_state.quantity_box_value %> + <% else %> Not Checked - <% end %> -
+ <% end %> +
+
+ +
+

Resources

+ + + + + + + + + <% @room.resources.each_with_index do |resource, index| %> + + + + + <% end %> + +
Item NameItem Status
+ <%= resource.name %> - <%= resource.resource_type %> + + <% if room_state.resource_states[index].present? %> + <%= room_state.resource_states[index].is_checked ? 'Yes' : 'No' %> + <% else %> + Not Checked + <% end %> +
+
+
+ <% else %> + - - <% else %> - - <% end %> + <% end %> +
-
- <% end %> -
- <%= paginate @room_states %> - <% end %> + <% end %> +
+ <%= paginate @room_states %> + <% end %> +
diff --git a/app/views/rooms/specific_attributes/index.html.erb b/app/views/rooms/specific_attributes/index.html.erb index 1fbd7ef3..2e35a634 100644 --- a/app/views/rooms/specific_attributes/index.html.erb +++ b/app/views/rooms/specific_attributes/index.html.erb @@ -1,4 +1,4 @@ -
+

Specific Attributes - <%= @room.room_number %> Room

<%= link_to "Back to Room", room_path(@room), class: "link_to" %> diff --git a/app/views/rover_navigations/buildings.html.erb b/app/views/rover_navigations/buildings.html.erb index 6938e7d9..1dae8e00 100644 --- a/app/views/rover_navigations/buildings.html.erb +++ b/app/views/rover_navigations/buildings.html.erb @@ -1,48 +1,49 @@ -
+
- + -

Buildings for <%= @zone.name %>

+

Buildings for <%= @zone.name %>

-<%= form_with url: buildings_rover_navigation_path, method: :get, local: true do |form| %> - <%= form.hidden_field :zone_id, value: @zone.id %> - <%= form.text_field :search, value: params[:search], placeholder: "Enter name, address, state, or zip", aria: { label: "search" } %> - <%= form.submit "Search" %> - <%= link_to 'Clear Filter', buildings_rover_navigation_path(zone_id: @zone.id), class: 'link_to' %> -<% end %> + <%= form_with url: buildings_rover_navigation_path, method: :get, local: true do |form| %> + <%= form.hidden_field :zone_id, value: @zone.id %> + <%= form.text_field :search, value: params[:search], placeholder: "Enter name, address, state, or zip", aria: { label: "search" } %> + <%= form.submit "Search" %> + <%= link_to 'Clear Filter', buildings_rover_navigation_path(zone_id: @zone.id), class: 'link_to' %> + <% end %> -<% @buildings.each_with_index do |building, i| %> -
-
-

- <%= building.name %> - -

-

- <%= show_building_status(building) %> -

-
-
-

- <%= building.full_address %> -

-
-
-<% end %> + <% end %> +
diff --git a/app/views/rover_navigations/rooms.html.erb b/app/views/rover_navigations/rooms.html.erb index 1c78b52b..cadef691 100644 --- a/app/views/rover_navigations/rooms.html.erb +++ b/app/views/rover_navigations/rooms.html.erb @@ -1,49 +1,50 @@ -
+
- + -

- Rooms for <%= @floor.building.name %> (Floor <%= @floor.name %>) - -

+

+ Rooms for <%= @floor.building.name %> (Floor <%= @floor.name %>) + +

-<%= form_with url: rooms_rover_navigation_path, method: :get, local: true do |form| %> - <%= form.hidden_field :floor_id, value: @floor.id %> - <%= form.text_field :search, value: params[:search], placeholder: "Enter a room number", aria: { label: "search" } %> - <%= form.submit "Search" %> - <%= link_to 'Clear Filter', rooms_rover_navigation_path(floor_id: @floor.id), class: 'link_to' %> -<% end %> + <%= form_with url: rooms_rover_navigation_path, method: :get, local: true do |form| %> + <%= form.hidden_field :floor_id, value: @floor.id %> + <%= form.text_field :search, value: params[:search], placeholder: "Enter a room number", aria: { label: "search" } %> + <%= form.submit "Search" %> + <%= link_to 'Clear Filter', rooms_rover_navigation_path(floor_id: @floor.id), class: 'link_to' %> + <% end %> -<% @rooms.each do |room| %> -
-
-

- Room: <%= room.room_number %> -

-

- <%= RoomStatus.new(room).show_status %> -

-
-
-

- Room Type: <%= room.room_type %> -

-

Last Time Checked: <%= show_date_with_time(room.last_time_checked) %>

- <% if RoomStatus.new(room).room_checked_today? %> - <% if RoomStatus.new(room).calculate_percentage.to_f < 100.00 %> - <%= link_to "Continue Checking #{room.room_number}", redirect_to_unchecked_form_path(room), class: "btn btn-primary" %> + <% @rooms.each do |room| %> +
+
+

+ Room: <%= room.room_number %> +

+

+ <%= RoomStatus.new(room).show_status %> +

+
+
+

+ Room Type: <%= room.room_type %> +

+

Last Time Checked: <%= show_date_with_time(room.last_time_checked) %>

+ <% if RoomStatus.new(room).room_checked_today? %> + <% if RoomStatus.new(room).calculate_percentage.to_f < 100.00 %> + <%= link_to "Continue Checking #{room.room_number}", redirect_to_unchecked_form_path(room), class: "btn btn-primary" %> + <% else %> + <%= link_to "Edit Today's #{room.room_number}", edit_room_room_state_path(room, RoomStatus.new(room).room_state_today.id), class: "btn btn-primary" %> + <% end %> <% else %> - <%= link_to "Edit Today's #{room.room_number}", edit_room_room_state_path(room, RoomStatus.new(room).room_state_today.id), class: "btn btn-primary" %> + <%= link_to "Start Checking #{room.room_number}", new_room_room_state_path(room), class: "btn btn-primary" %> <% end %> - <% else %> - <%= link_to "Start Checking #{room.room_number}", new_room_room_state_path(room), class: "btn btn-primary" %> - <% end %> +
-
-<% end %> + <% end %> +
diff --git a/app/views/rover_navigations/zones.html.erb b/app/views/rover_navigations/zones.html.erb index 2ca90f79..66e1f9a9 100644 --- a/app/views/rover_navigations/zones.html.erb +++ b/app/views/rover_navigations/zones.html.erb @@ -1,21 +1,21 @@ -
+
+

Zones Available

-

Zones Available

- -<% @zones.each do |zone| %> -
-
-

- <%= zone.name %> -

-
-
-

- <%= truncate( - zone.buildings.order(:name).pluck(:name).join(', '), - length: 60, omission: '...') %> -

- <%= link_to "#{zone.name} Details", buildings_rover_navigation_path(zone_id: zone.id), class: "btn btn-primary" %> + <% @zones.each do |zone| %> +
+
+

+ <%= zone.name %> +

+
+
+

+ <%= truncate( + zone.buildings.order(:name).pluck(:name).join(', '), + length: 60, omission: '...') %> +

+ <%= link_to "#{zone.name} Details", buildings_rover_navigation_path(zone_id: zone.id), class: "btn btn-primary" %> +
-
-<% end %> + <% end %> +
diff --git a/app/views/rovers/_listing.html.erb b/app/views/rovers/_listing.html.erb index b20adbdb..cd3cebd5 100644 --- a/app/views/rovers/_listing.html.erb +++ b/app/views/rovers/_listing.html.erb @@ -9,7 +9,6 @@ Uniqname First name Last name - View Edit Delete @@ -26,11 +25,6 @@ <%= rover.last_name %> - - <%= link_to rover_path(rover), data: { turbo_frame: "_top" }, aria: { label: "#{dom_id(rover)}" } do%> - - <%end%> - <%= link_to edit_rover_path(rover), data: { turbo_frame: "_top" }, aria: { label: "#{dom_id(rover)}_edit" } do%> diff --git a/app/views/rovers/index.html.erb b/app/views/rovers/index.html.erb index 63388b14..94b49d8d 100644 --- a/app/views/rovers/index.html.erb +++ b/app/views/rovers/index.html.erb @@ -1,25 +1,26 @@ -

-

Rover List

- +
+

Rover List

+ -
- <%= render "form", rover: @rover %> -
-
- <%= render "listing" %> +
+ <%= render "form", rover: @rover %> +
+
+ <%= render "listing" %> +
diff --git a/app/views/rovers/show.html.erb b/app/views/rovers/show.html.erb deleted file mode 100644 index 023c7a9c..00000000 --- a/app/views/rovers/show.html.erb +++ /dev/null @@ -1,8 +0,0 @@ -

<%= notice %>

- -<%= render "rover", rover: @rover %> - -
- <%= link_to "Edit This Rover", edit_rover_path(@rover), class: "btn btn-primary btn-sm" %> - <%= link_to "Back to Rovers", rovers_path, class: "link_to" %> -
diff --git a/app/views/specific_attribute_states/index.html.erb b/app/views/specific_attribute_states/index.html.erb deleted file mode 100644 index 13573e59..00000000 --- a/app/views/specific_attribute_states/index.html.erb +++ /dev/null @@ -1,14 +0,0 @@ -

<%= notice %>

- -

Specific attribute states

- -
- <% @specific_attribute_states.each do |specific_attribute_state| %> - <%= render specific_attribute_state %> -

- <%= link_to "Show this specific attribute state", specific_attribute_state %> -

- <% end %> -
- -<%= link_to "New specific attribute state", new_specific_attribute_state_path %> diff --git a/app/views/specific_attribute_states/show.html.erb b/app/views/specific_attribute_states/show.html.erb deleted file mode 100644 index 55fa452a..00000000 --- a/app/views/specific_attribute_states/show.html.erb +++ /dev/null @@ -1,10 +0,0 @@ -

<%= notice %>

- -<%= render @specific_attribute_state %> - -
- <%= link_to "Edit this specific attribute state", edit_specific_attribute_state_path(@specific_attribute_state) %> | - <%= link_to "Back to specific attribute states", specific_attribute_states_path %> - - <%= button_to "Destroy this specific attribute state", @specific_attribute_state, method: :delete %> -
diff --git a/app/views/static_pages/about.html.erb b/app/views/static_pages/about.html.erb index 079d643b..290eec20 100644 --- a/app/views/static_pages/about.html.erb +++ b/app/views/static_pages/about.html.erb @@ -1,4 +1,4 @@ -
+
diff --git a/app/views/static_pages/dashboard.html.erb b/app/views/static_pages/dashboard.html.erb index 7e44b1cc..ba113488 100644 --- a/app/views/static_pages/dashboard.html.erb +++ b/app/views/static_pages/dashboard.html.erb @@ -1,4 +1,4 @@ -
+

Admin Dashboard - <%= show_date_with_month_name(@selected_date) %>

diff --git a/app/views/static_pages/welcome_rovers.html.erb b/app/views/static_pages/welcome_rovers.html.erb index 879d784e..16b14d65 100644 --- a/app/views/static_pages/welcome_rovers.html.erb +++ b/app/views/static_pages/welcome_rovers.html.erb @@ -1,4 +1,4 @@ -
+
diff --git a/app/views/zones/index.html.erb b/app/views/zones/index.html.erb index c477ca4d..b918f5eb 100644 --- a/app/views/zones/index.html.erb +++ b/app/views/zones/index.html.erb @@ -1,17 +1,15 @@ -
-
-
-

All Zones

- <%= link_to "Add New Zone", new_zone_path, class: "btn btn-primary focus-ring h-50 mt-auto mb-auto", style: "--bs-focus-ring-color:#ffcb05;" %> -
-
- <% @zones.each do |zone| %> -
-
- <%= render zone %> -
+
+
+

All Zones

+ <%= link_to "Add New Zone", new_zone_path, class: "btn btn-primary focus-ring h-50 mt-auto mb-auto", style: "--bs-focus-ring-color:#ffcb05;" %> +
+
+ <% @zones.each do |zone| %> +
+
+ <%= render zone %>
- <% end %> -
+
+ <% end %>
diff --git a/config/routes.rb b/config/routes.rb index e4eeb6d0..cd53d901 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -8,19 +8,20 @@ end resources :announcements, only: [ :index, :show, :edit, :update ] - resources :resource_states + resources :resource_states, except: [:index, :show, :destroy] post '/resource_states/update_resource_states/:id', to: 'resource_states#update_resource_states', as: :update_resource_states - resources :specific_attribute_states, except: [:destroy] + resources :specific_attribute_states, except: [:index, :show, :destroy] post '/specific_attribute_states/update_specific_attribute_states/:id', to: 'specific_attribute_states#update_specific_attribute_states', as: :update_specific_attribute_states - resources :common_attribute_states + resources :common_attribute_states, except: [:index, :show, :destroy] post '/common_attribute_states/update_common_attribute_states/:id', to: 'common_attribute_states#update_common_attribute_states', as: :update_common_attribute_states resources :common_attributes, except: [:show] post 'unarchive_common_attribute/:id', to: 'common_attributes#unarchive', as: :unarchive_common_attribute - resources :rovers + resources :rovers, except: [:show, :show] + resources :zones, :except => [:show] resources :zones do resources :buildings, module: :zones end @@ -42,7 +43,7 @@ get 'dashboard', to: 'static_pages#dashboard', as: :dashboard - resources :rooms, :except => [:edit, :update] + resources :rooms, :except => [:index, :edit, :update] resources :rooms do resources :specific_attributes, module: :rooms, except: [:show] resources :room_states, module: :rooms, except: [:destroy] From 0e5b87d5f12ded9b93c39abdfe257424c05329a8 Mon Sep 17 00:00:00 2001 From: Margarita Barvinok Date: Sun, 28 Jul 2024 19:41:53 -0400 Subject: [PATCH 2/2] edit room show page --- app/views/rooms/show.html.erb | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/app/views/rooms/show.html.erb b/app/views/rooms/show.html.erb index 4220c7cf..e8f713f9 100644 --- a/app/views/rooms/show.html.erb +++ b/app/views/rooms/show.html.erb @@ -1,4 +1,5 @@ -
+
+

Room: <%= @room.full_name %>

@@ -9,8 +10,8 @@ <%= render @room %> -
-
+
+

Common Attributes

<%= link_to common_attributes_path, class: 'text-primary link-underline-primary link-underline-opacity-0 link-underline-opacity-100-hover' do %> Edit Common Attributes @@ -19,8 +20,8 @@ <%= render 'attributes_list', attributes: @common_attributes %>
-
-
+
+

Specific Attributes

<%= link_to room_specific_attributes_path(@room), class: 'text-primary link-underline-primary link-underline-opacity-0 link-underline-opacity-100-hover' do %> Edit Specific Attributes @@ -29,7 +30,7 @@ <%= render 'attributes_list', attributes: @room.active_specific_attributes %>
-
+

Resources

@@ -37,7 +38,7 @@
<% if is_admin? %> -
+

Notes:

<%= turbo_frame_tag "new_note" do %> <%= render "notes/form", note: @new_note %>