diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index df132061..fff58e09 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -5,9 +5,12 @@ <%= content_tag(:footer, class: class_names("print:hidden bottom-0 h-16 items-center flex flex-col gap-y-4 space-x-2 justify-center w-full text-center z-0", "fixed pb-8": user_signed_in?)) do %> <%# TODO: Let's configure this the same way `flash_messages` are used in `base.html.erb`, let it be a shareable banner and trigger it with turbo %> - <%- if @active_time_reg %> - <%= render BannerComponent.new(title: "Notice", message: t("time_regs.active_timer_description"), variant: :warning, dismissible: false, action: { url: root_path(date: @active_time_reg.date_worked), method: :get }) %> - <% end %> + + <%= content_tag(:div, class: class_names("flex flex-row justify-between items-start lg:items-center w-full section-container py-4 gap-y-4": !user_signed_in?)) do %> Stemplin <%= Date.current.year %> <%= content_tag(:div, class: class_names("flex flex-col lg:flex-row items-start justify-center gap-x-4", "hidden": user_signed_in?)) do %> diff --git a/app/views/time_regs/_time_reg.html.erb b/app/views/time_regs/_time_reg.html.erb index b3e62b85..c0d4bcb8 100644 --- a/app/views/time_regs/_time_reg.html.erb +++ b/app/views/time_regs/_time_reg.html.erb @@ -1,7 +1,7 @@ <%= turbo_stream_from time_reg %> <%= content_tag(:div, id: dom_id(time_reg), data: { controller: "refresh-minutes", refresh_minutes_active_value: time_reg.active?, refresh_minutes_minutes_value: time_reg.current_minutes, refresh_minutes_format_value: "H:mm" }, class: "shadow-sm rounded-md p-4 flex flex-col lg:flex-row lg:items-center lg:justify-between gap-y-4") do %>
-
+ -
+
+
+ <%= render RubyUI::Badge.new(variant: time_reg.is_zero_minutes? ? :red : :gray, class: "!rounded-full flex gap-x-1") do %> + + + <%= convert_time_int(time_reg.current_minutes) %> + + <% end %> +
+ <% if time_reg.date_worked != Date.today && !time_reg.active? %> <%= render ButtonComponent.new(path: new_modal_time_regs_path(date: Date.today, assigned_task_id: time_reg.assigned_task_id, notes: time_reg.notes), method: :post, class: "gap-x-2", variant: :outline) do %> diff --git a/app/views/time_regs/index.html.erb b/app/views/time_regs/index.html.erb index 57579012..0eedb1fa 100644 --- a/app/views/time_regs/index.html.erb +++ b/app/views/time_regs/index.html.erb @@ -1,4 +1,9 @@ <% content_for :title, t("common.home") %> <%= render partial: "time_regs/top_nav" %> +
+ <%- if @active_time_reg %> + <%= render BannerComponent.new(title: "Notice", message: t("time_regs.active_timer_description"), variant: :warning, dismissible: false, action: { url: root_path(date: @active_time_reg.date_worked), method: :get }) %> + <% end %> +
<%= render partial: "time_regs/main", locals: { chosen_date: @chosen_date } %>