farmitry_hvac/app/views/environment/view_temp.html.erb

65 lines
2.5 KiB
Plaintext

<div class="flex flex-col h-full lg:rounded-lg">
<div class="flex flex-row items-center space-x-4 p-2">
<%= link_to environment_index_path(id: params[:id]), class: "flex items-center" do %>
<i class="fa-solid fa-angle-left text-2xl"></i>
<% end %>
<div class="text-2xl font-bold leading-10"><%= @controller.id %>동 온도 스케줄러</div>
</div>
<div class="flex flex-col flex-1 space-y-4 overflow-y-hidden lg:p-4 bg-base-content rounded-lg">
<div class="flex justify-between">
<%= link_to "수정", edit_temp_environment_path(@controller.id), class: "btn bg-default-slate" %>
</div>
<div class="lg:rounded-lg border border-base-border overflow-y-hidden">
<table class="base-table border-b border-base-border table-fixed w-full">
<thead>
<tr>
<th class="w-1/3">시간</th>
<th class="w-1/3">온도</th>
<th>사용여부</th>
</tr>
</thead>
</table>
<!-- tbody 감싸는 div -->
<div class="overflow-y-auto max-h-full overflow-x-hidden">
<table class="base-table table-fixed w-full">
<tbody>
<% if @schedule.present? %>
<% @schedule.each do |s| %>
<tr>
<td class="w-1/3">
<div class="text-2xl flex items-baseline space-x-1">
<div class="text-center w-[36px]"><%= s.hour.to_s.rjust(2, '0') %></div>
<div>:</div>
<div class="text-center w-[36px]"><%= s.minute.to_s.rjust(2, '0') %></div>
</div>
</td>
<td class="w-1/3">
<div class="text-2xl flex items-end space-x-2">
<div class="text-left w-[50px]"><%= s.temperature %></div>
<div class="text-base leading-7">°C</div>
</div>
</td>
<td>
<div class="text-2xl w-8 mr-0">
<% if s.is_active %>
<i class="fa-solid fa-check text-notice"></i>
<% else %>
<i class="fa-solid fa-xmark text-danger"></i>
<% end %>
</div>
</td>
</tr>
<% end %>
<% else %>
<tr>
<td colspan="3" class="text-center p-4 w-full">저장된 스케줄이 없습니다.</td>
</tr>
<% end %>
</tbody>
</table>
</div>
</div>
</div>
</div>