-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #124 from motohiro-mm/feature/add_flash_message
flashメッセージの表示を追加
- Loading branch information
Showing
16 changed files
with
74 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { Application } from "@hotwired/stimulus"; | ||
import { Alert } from "tailwindcss-stimulus-components"; | ||
|
||
const application = Application.start(); | ||
application.register("flash", Alert); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<% flash.each do |flash_type, message| %> | ||
<div data-controller="flash" data-flash-dismiss-after-value="5000" data-transition-enter="ease-in-out duration-500" data-transition-enter-from="translate-x-full opacity-0" data-transition-enter-to="translate-x-0 opacity-100" data-transition-leave="ease-in-out duration-500" data-transition-leave-from="translate-x-0 opacity-100" data-transition-leave-to="translate-x-full opacity-0" class="mb-4 rounded relative bg-orange-300/90 text-white translate-x-0 opacity-100"> | ||
<div class="flex items-center"> | ||
<p class="m-2 p-2 text-sm"> | ||
<%= message %> | ||
</p> | ||
</div> | ||
</div> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<div class="flex justify-around"> | ||
<%= button_to meeting_rooms_path(meal_plan:, meal_date: meal_plan.meal_date), method: :post, class: 'rounded-full py-3 px-4 bg-red-400 inline-block' do %> | ||
<i class="fa-regular fa-comments text-xl text-white"></i> | ||
<span class="ml-1 text-white">会議へ</span> | ||
<% end %> | ||
<%= link_to meal_plans_path(start_date: meal_plan.meal_date), | ||
class: 'inline-block flex items-center' do %> | ||
<i class="fa-regular fa-rectangle-list text-xl"></i> | ||
<span class="ml-2">献立表へ</span> | ||
<% end %> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,13 @@ | ||
<%= turbo_frame_tag meal_plan, autoscroll: true, data: { autoscroll_block: 'start' } do %> | ||
<div class="my-5"> | ||
<div class="flex justify-between"> | ||
<h1 class="font-bold text-2xl"><%= l meal_plan.meal_date, format: :long %></h1> | ||
<% if meal_plan.meals.present? %> | ||
<div class="flex items-center"> | ||
<%= link_to '編集', edit_meal_plan_path(meal_plan), class: 'text-l inline-block rounded-full py-2 px-4 flex items-center bg-orange-100/80' %> | ||
</div> | ||
<% end %> | ||
</div> | ||
<% meal_plan.meals_sort_by_timing.each do |meal| %> | ||
<%= render 'meals/meal', meal: %> | ||
<div class="my-5"> | ||
<div class="flex justify-between"> | ||
<h1 class="font-bold text-2xl"><%= l meal_plan.meal_date, format: :long %></h1> | ||
<% if meal_plan.meals.present? %> | ||
<div class="flex items-center"> | ||
<%= link_to '編集', edit_meal_plan_path(meal_plan), class: 'text-l inline-block rounded-full py-2 px-4 flex items-center bg-orange-100/80' %> | ||
</div> | ||
<% end %> | ||
</div> | ||
<% end %> | ||
<div class="text-right"> | ||
<%= button_to 'この献立を削除する', meal_plan, method: :delete, class: 'text-orange-950/70' %> | ||
<% meal_plan.meals_sort_by_timing.each do |meal| %> | ||
<%= render 'meals/meal', meal: %> | ||
<% end %> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
<div class="mx-auto p-4 w-full"> | ||
<%= turbo_frame_tag @meal_plan do %> | ||
<div class="mt-4"> | ||
<%= render 'form', meal_plan: @meal_plan %> | ||
</div> | ||
<div class="text-center"> | ||
<%= link_to 'キャンセル', @meal_plan, class: 'rounded-full py-3 px-4 text-red-9500/50 bg-stone-100 inline-block' %> | ||
</div> | ||
<% end %> | ||
<%= render 'header_button', meal_plan: @meal_plan %> | ||
<div class="mt-4"> | ||
<%= render 'form', meal_plan: @meal_plan %> | ||
</div> | ||
<div class="text-center"> | ||
<%= link_to 'キャンセル', @meal_plan, class: 'rounded-full py-3 px-4 text-red-9500/50 bg-stone-100 inline-block' %> | ||
</div> | ||
<div class="text-right my-4"> | ||
<%= button_to 'この献立を削除する', @meal_plan, method: :delete, class: 'text-orange-950/70' %> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,9 @@ | ||
<div class="mx-auto p-4 w-full"> | ||
<div class="flex justify-around"> | ||
<%= button_to meeting_rooms_path(meal_plan: @meal_plan, meal_date: @meal_plan.meal_date), method: :post, data: { turbo_frame: '_top' }, class: 'rounded-full py-3 px-4 bg-red-400 inline-block' do %> | ||
<i class="fa-regular fa-comments text-xl text-white"></i> | ||
<span class="ml-1 text-white">会議へ</span> | ||
<% end %> | ||
<%= link_to meal_plans_path(start_date: @meal_plan.meal_date), | ||
class: 'inline-block flex items-center' do %> | ||
<i class="fa-regular fa-rectangle-list text-xl"></i> | ||
<span class="ml-2">献立表へ</span> | ||
<% end %> | ||
</div> | ||
<%= render 'header_button', meal_plan: @meal_plan %> | ||
<div class="mt-4"> | ||
<%= render @meal_plan %> | ||
</div> | ||
<div class="text-right my-4"> | ||
<%= button_to 'この献立を削除する', @meal_plan, method: :delete, class: 'text-orange-950/70' %> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ | |
<% end %> | ||
<%= turbo_stream.update Remark.new, "" %> | ||
<%= turbo_stream.prepend "flash", partial: "layouts/flash" %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
<%= turbo_stream.remove @remark %> | ||
<%= turbo_stream.prepend "flash", partial: "layouts/flash" %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<% if @remark.proposal? %> | ||
<%= turbo_stream.replace "proposal", partial: "remarks/proposal", locals: {remark: @remark} %> | ||
<% else %> | ||
<%= turbo_stream.replace "comment", partial: "remarks/comment", locals: {remark: @remark} %> | ||
<% end %> | ||
<%= turbo_stream.prepend "flash", partial: "layouts/flash" %> |