Skip to content

Commit

Permalink
only show year in review if entries
Browse files Browse the repository at this point in the history
  • Loading branch information
parterburn committed Dec 14, 2024
1 parent 893688c commit 884b4c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/views/entries/latest.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
= link_to random_entry_path, title: "Random Entry", rel: "tooltip", style: "width: 20%; margin-left: 15px; top: 2px; position: relative;" do
%i.fa.fa-random
- if year_in_review
- if year_in_review && current_user.entries.where("date >= '#{review_year}-01-01'::DATE AND date <= '#{review_year}-12-31'::DATE").count.positive?
= javascript_include_tag "//www.gstatic.com/charts/loader.js", "chartkick"
- total_count = current_user.entries.where("date >= '#{review_year}-01-01'::DATE AND date <= '#{review_year}-12-31'::DATE").count
.col-md-8.well.col-md-offset-1{id: "year-in-review"}
Expand Down

0 comments on commit 884b4c8

Please sign in to comment.