From de020b190f4fade17f9f6603b953c69374eb3d40 Mon Sep 17 00:00:00 2001 From: yamakeeeeeeeeen Date: Wed, 8 May 2024 10:25:23 +0900 Subject: [PATCH 1/4] =?UTF-8?q?chore:=20plan=E7=94=BB=E9=9D=A2=E3=81=AE?= =?UTF-8?q?=E3=83=A2=E3=83=90=E3=82=A4=E3=83=AB=E5=AF=BE=E5=BF=9C=E9=80=94?= =?UTF-8?q?=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/plans/_mobile_table_row.html.erb | 7 +++++++ app/views/plans/show.html.erb | 7 ++++++- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 app/views/plans/_mobile_table_row.html.erb diff --git a/app/views/plans/_mobile_table_row.html.erb b/app/views/plans/_mobile_table_row.html.erb new file mode 100644 index 00000000..b43068a6 --- /dev/null +++ b/app/views/plans/_mobile_table_row.html.erb @@ -0,0 +1,7 @@ +<% @selected = @plan.plan_schedules.map(&:schedule).any? { row.schedules.include?(_1) } %> +

<%= row.start_end %>

+<% track_list.each do |track| %> + <% if row.tracks[track] %> +
<%= render("schedules/card", schedule: row[:schedule], mode: :plan, inactive: false) %>
+ <% end %> +<% end %> diff --git a/app/views/plans/show.html.erb b/app/views/plans/show.html.erb index b954c228..19e34dfe 100644 --- a/app/views/plans/show.html.erb +++ b/app/views/plans/show.html.erb @@ -109,7 +109,7 @@
<% @plans_table.each do |k, v| %> <% end %>
From 2b64f0b7a80ed05ad959022b98a707c28d827991 Mon Sep 17 00:00:00 2001 From: kinoppyd Date: Fri, 10 May 2024 18:15:06 +0900 Subject: [PATCH 2/4] Fix mobile row, no partial simple 2 lines --- app/views/plans/_mobile_table_row.html.erb | 7 ------- app/views/plans/show.html.erb | 5 +++-- 2 files changed, 3 insertions(+), 9 deletions(-) delete mode 100644 app/views/plans/_mobile_table_row.html.erb diff --git a/app/views/plans/_mobile_table_row.html.erb b/app/views/plans/_mobile_table_row.html.erb deleted file mode 100644 index b43068a6..00000000 --- a/app/views/plans/_mobile_table_row.html.erb +++ /dev/null @@ -1,7 +0,0 @@ -<% @selected = @plan.plan_schedules.map(&:schedule).any? { row.schedules.include?(_1) } %> -

<%= row.start_end %>

-<% track_list.each do |track| %> - <% if row.tracks[track] %> -
<%= render("schedules/card", schedule: row[:schedule], mode: :plan, inactive: false) %>
- <% end %> -<% end %> diff --git a/app/views/plans/show.html.erb b/app/views/plans/show.html.erb index 19e34dfe..8bdd600b 100644 --- a/app/views/plans/show.html.erb +++ b/app/views/plans/show.html.erb @@ -134,8 +134,9 @@
- <% @plans_table[k].rows.each do |row| %> - <%= render partial: 'mobile_table_row', locals: { row: row, plan: @plan, track_list: @plans_table[k].track_list } %> + <% v.each do |row| %> +

<%= row[:time][:range] %>

+
<%= render("schedules/card", schedule: row[:schedule], mode: :plan, inactive: false) %>
<% end %>
From 09f3bb5093ecbfeb389b8b40be02a1ca424aa751 Mon Sep 17 00:00:00 2001 From: kinoppyd Date: Fri, 10 May 2024 19:07:13 +0900 Subject: [PATCH 3/4] Add uniq ids for dialog (and other non-uniq) elements. --- app/views/schedules/_card.html.erb | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/app/views/schedules/_card.html.erb b/app/views/schedules/_card.html.erb index b1d5df9b..2e4ae4cb 100644 --- a/app/views/schedules/_card.html.erb +++ b/app/views/schedules/_card.html.erb @@ -50,7 +50,8 @@
<% if mode == :plan && @plan.schedules.include?(schedule) %> -
+ <% memo_dialog_element_id = SecureRandom.uuid %> +
- + <%= form_with(url: event_plan_path(@plan, event_name: @plan.event.name), method: :patch) do |f| %>
@@ -66,8 +67,8 @@
- <%= f.hidden_field :edit_memo_schedule_id, value: schedule.id %> - <%= f.text_area :memo, value: @plan.plan_schedules.find { _1.schedule == schedule }&.memo, class: "border opacity-100 rounded-md border border-[rgb(214,211,208)] bg-white p-2 text-[rgb(35,34,30)] w-full", data: { "word-counter-target": "source", action: "input->word-counter#calc" } %> + <%= f.hidden_field :edit_memo_schedule_id, value: schedule.id, id: "#{schedule.id}-#{memo_dialog_element_id}" %> + <%= f.text_area :memo, value: @plan.plan_schedules.find { _1.schedule == schedule }&.memo, id: SecureRandom.uuid, class: "border opacity-100 rounded-md border border-[rgb(214,211,208)] bg-white p-2 text-[rgb(35,34,30)] w-full", data: { "word-counter-target": "source", action: "input->word-counter#calc" } %>
/<%= plan_memo_max_length %>
@@ -89,8 +90,8 @@
<% if @plan.plan_schedules.map(&:schedule).include?(schedule) # to avoid n+1 %> <%= form_with(url: event_plan_url(@plan, event_name: @plan.event.name), method: 'PATCH' ) do |form| %> - <%= form.hidden_field :remove_schedule_id, value: schedule.id %> - <%= form.hidden_field :mode, value: mode %> + <%= form.hidden_field :remove_schedule_id, value: schedule.id, id: SecureRandom.uuid %> + <%= form.hidden_field :mode, value: mode, id: SecureRandom.uuid %> <%= form.submit I18n.t('card.remove'), class: "remove-plan-button p-2 text-sm font-bold min-h-5 normal-button", data: { turbo_frame: "event_#{@event.id}" } %> <% end %> <% elsif @plan.new_record? %> From 8b4ff44cb11b3946df8b128e7368b8e6323de007 Mon Sep 17 00:00:00 2001 From: yamakeeeeeeeeen Date: Mon, 13 May 2024 10:53:58 +0900 Subject: [PATCH 4/4] =?UTF-8?q?fix:=20=E3=83=A2=E3=83=90=E3=82=A4=E3=83=AB?= =?UTF-8?q?=E3=81=AE=E6=99=82=E3=81=AB=E3=82=BF=E3=83=96=E3=81=8C=E5=B4=A9?= =?UTF-8?q?=E3=82=8C=E3=82=8B=E3=81=AE=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/plans/show.html.erb | 4 ++-- app/views/schedules/index.html.erb | 4 ++-- app/views/teams/show.html.erb | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/views/plans/show.html.erb b/app/views/plans/show.html.erb index 8bdd600b..ab456994 100644 --- a/app/views/plans/show.html.erb +++ b/app/views/plans/show.html.erb @@ -98,9 +98,9 @@ <% else %>
-
+
<% @plans_table.keys.map do |k| %> - <% end %> diff --git a/app/views/schedules/index.html.erb b/app/views/schedules/index.html.erb index c52b5278..12fb4a43 100644 --- a/app/views/schedules/index.html.erb +++ b/app/views/schedules/index.html.erb @@ -21,9 +21,9 @@
-
+
<% @schedule_table.days.each do |day| %> - <% end %> diff --git a/app/views/teams/show.html.erb b/app/views/teams/show.html.erb index 8421e536..570480c5 100644 --- a/app/views/teams/show.html.erb +++ b/app/views/teams/show.html.erb @@ -50,9 +50,9 @@
-
+
<% @schedule_table.days.each do |day| %> - <% end %>