-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
112 additions
and
87 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
<% owner = Current.user && shot.user == Current.user %> | ||
<% show_start_time = owner || !shot.user&.hide_shot_times? %> | ||
<% bean_weight = shot.bean_weight.to_f %> | ||
<% drink_weight = shot.drink_weight.to_f %> | ||
<% ratio = drink_weight / bean_weight %> | ||
<% tds = shot.drink_tds.to_f %> | ||
<% ey = shot.drink_ey.to_f %> | ||
<tr class="cursor-pointer hover:bg-neutral-50 dark:hover:bg-neutral-800" id="<%= dom_id(shot) %>" data-action="click->shot#view" data-url="<%= shot_path(shot) %>"> | ||
<td class="px-1 py-4 sm:px-4"> | ||
<div class="flex items-center"> | ||
<% if shot.espresso_enjoyment.to_i > 0 %> | ||
<div class="w-8 h-8 mr-2 rounded-full shrink-0 sm:mr-4" style="background-color: <%= enjoyment_hex(shot.espresso_enjoyment) %>;"> | ||
<div class="py-1 text-center text-white"> | ||
<%= shot.espresso_enjoyment %> | ||
</div> | ||
</div> | ||
<% end %> | ||
<div class="sm"> | ||
<div class="text-sm text-neutral-500 dark:text-neutral-400"> | ||
<%= shot.profile_title %> | ||
</div> | ||
<% if show_start_time %> | ||
<div class="text-sm text-neutral-500 dark:text-neutral-400"> | ||
<%= shot.start_time.in_time_zone(@timezone).to_formatted_s(:long) %> | ||
</div> | ||
<% end %> | ||
<% if include_person %> | ||
<div class="flex items-center"> | ||
<div class="text-sm text-neutral-500 dark:text-neutral-400"><%= shot.user.display_name %></div> | ||
<% if shot.user.premium? %> | ||
<%= link_to premium_index_path do %> | ||
<svg class="w-4 h-4 ml-1 text-terracotta-600 hover:text-terracotta-800" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"> | ||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4M7.835 4.697a3.42 3.42 0 001.946-.806 3.42 3.42 0 014.438 0 3.42 3.42 0 001.946.806 3.42 3.42 0 013.138 3.138 3.42 3.42 0 00.806 1.946 3.42 3.42 0 010 4.438 3.42 3.42 0 00-.806 1.946 3.42 3.42 0 01-3.138 3.138 3.42 3.42 0 00-1.946.806 3.42 3.42 0 01-4.438 0 3.42 3.42 0 00-1.946-.806 3.42 3.42 0 01-3.138-3.138 3.42 3.42 0 00-.806-1.946 3.42 3.42 0 010-4.438 3.42 3.42 0 00.806-1.946 3.42 3.42 0 013.138-3.138z"/> | ||
</svg> | ||
<% end %> | ||
<% end %> | ||
</div> | ||
<% end %> | ||
<% if shot.barista.present? %> | ||
<div class="text-sm text-neutral-500 dark:text-neutral-400"> | ||
Barista: <%= shot.barista %> | ||
</div> | ||
<% end %> | ||
</div> | ||
</div> | ||
</td> | ||
<td class="px-1 py-4 sm:px-4"> | ||
<div class="flex flex-col"> | ||
<span class="text-sm text-neutral-500 dark:text-neutral-400"> | ||
<% if shot.bean_brand.present? %> | ||
<%= shot.bean_brand %> | ||
<% end %> | ||
<% if shot.bean_type.present? %> | ||
<%= shot.bean_type %> | ||
<% end %> | ||
<% if shot.roast_level.present? %> | ||
(<%= shot.roast_level %>) | ||
<% end %> | ||
<% if shot.roast_date.present? %> | ||
on <%= shot.parsed_roast_date&.to_fs(:long) %> | ||
<% end %> | ||
</span> | ||
<div class="flex flex-wrap items-center text-sm gap-x-1 text-neutral-500 dark:text-neutral-400"> | ||
<% if bean_weight > 0 %> | ||
<span><%= shot.bean_weight %>g</span> | ||
<% end %> | ||
<% if bean_weight > 0 && drink_weight > 0 %> | ||
<span>→</span> | ||
<% end %> | ||
<% if drink_weight > 0 %> | ||
<span><%= shot.drink_weight %>g</span> | ||
<% if bean_weight > 0 && drink_weight > 0 && ratio > 0 && ratio.finite? %> | ||
<span>(1:<%= ratio.round(1) %>)</span> | ||
<% end %> | ||
<% end %> | ||
<span>in <%= shot.duration.round(1) %>s</span> | ||
</div> | ||
<div class="flex flex-wrap items-center text-sm gap-x-1 text-neutral-500 dark:text-neutral-400"> | ||
<% if shot.grinder_model.present? %> | ||
<span><%= shot.grinder_model %></span> | ||
<% end %> | ||
<% if shot.grinder_setting.present? && shot.grinder_setting != "0" && shot.grinder_setting != "0.0" %> | ||
<span>@ <%= shot.grinder_setting %></span> | ||
<% end %> | ||
</div> | ||
<div class="flex items-center text-sm gap-x-2 text-neutral-500 dark:text-neutral-400"> | ||
<% if tds > 0 %> | ||
<span>TDS <%= tds %>%</span> | ||
<% end %> | ||
<% if ey > 0 %> | ||
<span>EY <%= ey %>%</span> | ||
<% end %> | ||
</div> | ||
</div> | ||
</td> | ||
<td class="px-1 py-4 sm:px-4"> | ||
<div class="flex flex-col lg:flex-row"> | ||
<div class="grow"></div> | ||
<span> | ||
<a class="inline-flex items-center px-4 py-2 text-sm font-medium bg-white border rounded-md shadow-sm cursor-pointer border-neutral-300 dark:border-neutral-600 text-neutral-700 dark:bg-neutral-800 dark:text-neutral-300 hover:bg-neutral-50 dark:hover:bg-neutral-900" href="<%= shot_path(shot) %>"> | ||
<%# Heroicon name: eye %> | ||
<svg class="w-4 h-4 -ml-1 -mr-1 text-neutral-500 dark:text-neutral-300" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor"> | ||
<path d="M10 12a2 2 0 100-4 2 2 0 000 4z"/> | ||
<path fill-rule="evenodd" d="M.458 10C1.732 5.943 5.522 3 10 3s8.268 2.943 9.542 7c-1.274 4.057-5.064 7-9.542 7S1.732 14.057.458 10zM14 10a4 4 0 11-8 0 4 4 0 018 0z" clip-rule="evenodd"/> | ||
</svg> | ||
<span class="hidden ml-2 xl:block">View</span> | ||
</a> | ||
</span> | ||
</div> | ||
</td> | ||
</tr> |
This file was deleted.
Oops, something went wrong.