From d732f23db0e8e5dba643f5e94be1c0ae3be17ffd Mon Sep 17 00:00:00 2001
From: kinoppyd
Date: Wed, 21 Aug 2024 09:09:05 +0900
Subject: [PATCH] Add teams skeleton screen
---
app/views/schedules/_table_skeleton.html.erb | 8 +-
app/views/teams/show.html.erb | 110 ++++++++++---------
2 files changed, 63 insertions(+), 55 deletions(-)
diff --git a/app/views/schedules/_table_skeleton.html.erb b/app/views/schedules/_table_skeleton.html.erb
index 80c23011..662ab754 100644
--- a/app/views/schedules/_table_skeleton.html.erb
+++ b/app/views/schedules/_table_skeleton.html.erb
@@ -42,13 +42,13 @@
- <%= render partial: "card_skeleton" %>
+ <%= render partial: "schedules/card_skeleton" %>
|
- <%= render partial: "card_skeleton" %>
+ <%= render partial: "schedules/card_skeleton" %>
|
- <%= render partial: "card_skeleton" %>
+ <%= render partial: "schedules/card_skeleton" %>
|
<% end %>
@@ -59,7 +59,7 @@
<% 5.times do %>
- <%= render partial: "card_skeleton" %>
+ <%= render partial: "schedules/card_skeleton" %>
<% end %>
diff --git a/app/views/teams/show.html.erb b/app/views/teams/show.html.erb
index 677ed9af..aba2ae9c 100644
--- a/app/views/teams/show.html.erb
+++ b/app/views/teams/show.html.erb
@@ -48,61 +48,69 @@
-
-
-
- <% @schedule_table.days.each do |day| %>
-
- <% end %>
-
-
-
- <% @schedule_table.days.each do |day| %>
-
-
-
- <%= I18n.t('table.start_end') %> |
- <% @schedule_table[day].track_list.each do |track| %>
- <%= track %> |
- <% end %>
-
-
- <% @schedule_table[day].rows.each do |row| %>
- <% @selected = @plan.plan_schedules.map(&:schedule).any? { row.schedules.include?(_1) } %>
-
-
-
-
- <%= row.start_end %>
-
-
- <%= row.timezone %>
-
- <% @team.active_profiles.reject { |prof| row.schedules.any? { @member_schedules_map[prof.id].include?(_1.id) } }.each do |prof| %>
-
- <% end %>
+<% if turbo_frame_request? %>
+ <%= turbo_frame_tag "teams" do %>
+
+
+
+ <% @schedule_table.days.each do |day| %>
+
+ <% end %>
+
+
+
+ <% @schedule_table.days.each do |day| %>
+
+
+
+ <%= I18n.t('table.start_end') %> |
+ <% @schedule_table[day].track_list.each do |track| %>
+ <%= track %> |
+ <% end %>
+
+
+ <% @schedule_table[day].rows.each do |row| %>
+ <% @selected = @plan.plan_schedules.map(&:schedule).any? { row.schedules.include?(_1) } %>
+
+
+
+
+ <%= row.start_end %>
+
+
+ <%= row.timezone %>
+
+ <% @team.active_profiles.reject { |prof| row.schedules.any? { @member_schedules_map[prof.id].include?(_1.id) } }.each do |prof| %>
+
+ <% end %>
+
-
- |
- <% @schedule_table[day].track_list.each do |track| %>
+
+ <% @schedule_table[day].track_list.each do |track| %>
<%= row.tracks[track] ? render("schedules/card", schedule: row.tracks[track], mode: :team, inactive: @selected) : nil %>
|
- <% end %>
-
- <% end %>
-
-
-
- <% @schedule_table[day].rows.each do |row| %>
- <%= render partial: 'mobile_table_row', locals: { row: row, plan: @plan, track_list: @schedule_table[day].track_list } %>
- <% end %>
-
+ <% end %>
+ |
+ <% end %>
+
+
+
+ <% @schedule_table[day].rows.each do |row| %>
+ <%= render partial: 'mobile_table_row', locals: { row: row, plan: @plan, track_list: @schedule_table[day].track_list } %>
+ <% end %>
+
+
+ <% end %>
- <% end %>
-
-
+
+ <% end %>
+<% else %>
+ <%= turbo_frame_tag "teams", src: team_path(@team) do %>
+ <%= render partial: "schedules/table_skeleton", locals: { schedule_table: @schedule_table } %>
+ <% end %>
+<% end %>
<%= turbo_frame_tag "modal" %>