Render yearly view
This commit is contained in:
@@ -1,18 +1,19 @@
|
||||
<div class="bootstrap">
|
||||
|
||||
|
||||
<div class="text-center">
|
||||
<%= first_day.strftime("%b") %>
|
||||
</div>
|
||||
<div class="flex flex-col w-full">
|
||||
<% (first_day..first_day.end_of_month).each do |day| %>
|
||||
<% todays_events = days_events(events, day) %>
|
||||
<div class="relative border-t w-full flex h-6 <%= 'bg-gray-200' if day.on_weekend? %>">
|
||||
<div class="text-xs font-bold <%= 'border-red-600 border-b-4' if day.today? %>"
|
||||
<%= raw('data-toggle="tooltip" title="Today"') if day.today? %> <%= raw("data-toggle='tooltip' title='#{day.strftime('%a, %m/%d/%y')}'") unless day.today? %> data-placement="right" >
|
||||
<%= day.strftime('%d') %>
|
||||
</div>
|
||||
|
||||
<div class="w-full flex-grow flex justify-end">
|
||||
<% todays_events.each do |event| %>
|
||||
<div class="w-2 bg-red-700 cursor-pointer" title="test" data-toggle="tooltip" data-placement="right"></div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -4,6 +4,11 @@ first_days = (1..12).map do |index|
|
||||
end
|
||||
%>
|
||||
|
||||
<div class="w-1/3 mx-auto flex justify-between pb-4">
|
||||
<%= link_to (@year-1), root_path(year: @year-1) %>
|
||||
<%= @year %>
|
||||
<%= link_to (@year+1), root_path(year: @year+1) %>
|
||||
</div>
|
||||
<div class="container mx-auto flex justify-between">
|
||||
<% first_days.each do |first_day| %>
|
||||
<div class="border-l w-full">
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<main class="container mx-auto mt-28 px-5 flex">
|
||||
<main class=" mx-auto mt-28 px-5 ">
|
||||
<%= yield %>
|
||||
</main>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user