-
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 #81 from motohiro-mm/chore/add_css_to_tables_and_h…
…eader カレンダー表示とヘッダーにクラス名を追加
- Loading branch information
Showing
10 changed files
with
90 additions
and
76 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
<div id="<%= dom_id meal %>"> | ||
<strong><%= meal.timing %></strong> | ||
<div id="<%= dom_id meal %>" class="border border-stone-300 rounded-md p-4 my-5 text-stone-800"> | ||
<strong class="block font-bold text-lg"><%= meal.timing %></strong> | ||
|
||
<p class="my-5"> | ||
<strong class="block font-medium mb-1">Name:</strong> | ||
<%= meal.name %> | ||
<span class="block rounded-md px-3 py-2"><%= meal.name %></span> | ||
</p> | ||
|
||
<p class="my-5"> | ||
<strong class="block font-medium mb-1">Memo:</strong> | ||
<%= meal.memo %> | ||
<span class="block rounded-md px-3 py-2"><%= meal.memo %></span> | ||
</p> | ||
</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,11 +1,8 @@ | ||
<div id="<%= dom_id meal_plan %>"> | ||
<div id="<%= dom_id meal_plan %>" class="my-5"> | ||
|
||
<h2 class="font-bold text-3xl"><%= meal_plan.meal_date %></h2> | ||
<h2 class="font-bold text-3xl text-stone-800"><%= meal_plan.meal_date %></h2> | ||
|
||
<% @meal_plan.meals.sort_by(&:timing_before_type_cast).each do |meal| %> | ||
--------------- | ||
<%= render '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
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 |
---|---|---|
@@ -1,19 +1,18 @@ | ||
<div class="mx-auto md:w-2/3 w-full flex"> | ||
<div class="mx-auto"> | ||
<div class="mx-auto font-medium"> | ||
<% if notice.present? %> | ||
<p class="py-2 px-3 bg-green-50 mb-5 text-green-500 font-medium rounded-lg inline-block" id="notice"><%= notice %></p> | ||
<p class="py-2 px-3 bg-green-50 mb-5 text-green-500 rounded-lg inline-block" id="notice"><%= notice %></p> | ||
<% end %> | ||
<%#= link_to "相談部屋 >", meal_remarks_path(@meal_plan) %> | ||
<%= render @meal_plan %> | ||
<%= link_to 'Edit this meal_plan', edit_meal_plan_path(@meal_plan), | ||
class: 'mt-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium' %> | ||
<%= link_to 'Edit this meal plan', edit_meal_plan_path(@meal_plan), | ||
class: 'mt-2 rounded-lg py-3 px-5 text-stone-500 bg-stone-100 inline-block' %> | ||
<%= link_to 'Back to meal plans', meal_plans_path(start_date: @meal_plan.meal_date), | ||
class: 'ml-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium' %> | ||
class: 'ml-2 rounded-lg py-3 px-5 text-stone-500 bg-stone-100 inline-block' %> | ||
<div class="inline-block ml-2"> | ||
<%= button_to 'Destroy this meal_plan', @meal_plan, method: :delete, | ||
class: 'mt-2 rounded-lg py-3 px-5 bg-gray-100 font-medium' %> | ||
<%= button_to 'Destroy this meal plan', @meal_plan, method: :delete, | ||
class: 'rounded-lg py-3 px-5 text-stone-500 bg-stone-100' %> | ||
</div> | ||
</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 |
---|---|---|
@@ -1,36 +1,41 @@ | ||
<div class="simple-calendar"> | ||
<div class="calendar-heading"> | ||
<time datetime="<%= start_date.strftime('%Y-%m') %>" class="calendar-title"> | ||
<%= start_date.year %> | ||
<%= t('date.month_names')[start_date.month] %> | ||
</time> | ||
<div> | ||
<div class="header flex justify-between items-center border-b p-4 bg-stone-100"> | ||
<span class="text-lg font-bold text-stone-700"> | ||
<time datetime="<%= start_date.strftime('%Y-%m') %>"> | ||
<%= start_date.year %> | ||
<%= t('date.month_names')[start_date.month] %> | ||
</time> | ||
</span> | ||
|
||
<nav> | ||
<%= link_to t('simple_calendar.previous', default: 'Previous'), calendar.url_for_previous_view %> | ||
<%= link_to t('simple_calendar.today', default: 'Today'), calendar.url_for_today_view %> | ||
<%= link_to t('simple_calendar.next', default: 'Next'), calendar.url_for_next_view %> | ||
<nav class="space-x-4"> | ||
<%= link_to t('simple_calendar.previous', default: 'Previous'), calendar.url_for_previous_view, | ||
class: 'text-stone-500 hover:underline' %> | ||
<%= link_to t('simple_calendar.today', default: 'Today'), calendar.url_for_today_view, | ||
class: 'text-stone-500 hover:underline' %> | ||
<%= link_to t('simple_calendar.next', default: 'Next'), calendar.url_for_next_view, | ||
class: 'text-stone-500 hover:underline' %> | ||
</nav> | ||
</div> | ||
|
||
<table class="table table-striped"> | ||
<table class="w-full table-fixed border-collapse"> | ||
<thead> | ||
<tr> | ||
<% date_range.slice(0, 7).each do |day| %> | ||
<th><%= t('date.abbr_day_names')[day.wday] %></th> | ||
<% end %> | ||
</tr> | ||
<tr class="bg-stone-200"> | ||
<% date_range.slice(0, 7).each do |day| %> | ||
<th class="py-2 text-center text-stone-600"><%= t('date.abbr_day_names')[day.wday] %></th> | ||
<% end %> | ||
</tr> | ||
</thead> | ||
|
||
<tbody> | ||
<% date_range.each_slice(7) do |week| %> | ||
<tr> | ||
<% week.each do |day| %> | ||
<%= content_tag :td, class: calendar.td_classes_for(day) do %> | ||
<% instance_exec(day, calendar.sorted_events_for(day).first, &passed_block) %> | ||
<% end %> | ||
<% date_range.each_slice(7) do |week| %> | ||
<tr class="border-t"> | ||
<% week.each do |day| %> | ||
<%= content_tag :td, class: "px-4 py-2 text-center border hover:bg-stone-100 #{calendar.td_classes_for(day)}" do %> | ||
<% instance_exec(day, calendar.sorted_events_for(day).first, &passed_block) %> | ||
<% end %> | ||
</tr> | ||
<% end %> | ||
<% end %> | ||
</tr> | ||
<% end %> | ||
</tbody> | ||
</table> | ||
</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