diff --git a/app/assets/config/manifest.js b/app/assets/config/manifest.js index 90c461e2..59b996fc 100644 --- a/app/assets/config/manifest.js +++ b/app/assets/config/manifest.js @@ -12,6 +12,8 @@ //= link baby.jpg //= link psychology-of-money.jpg //= link second-mountain.jpg +//= link anxious.jpg +//= link monkey-wrench.jpg //= link application.css //= link application.js diff --git a/app/assets/images/anxious.jpg b/app/assets/images/anxious.jpg new file mode 100644 index 00000000..fd3df6f4 Binary files /dev/null and b/app/assets/images/anxious.jpg differ diff --git a/app/assets/images/monkey-wrench.jpg b/app/assets/images/monkey-wrench.jpg new file mode 100644 index 00000000..c278795f Binary files /dev/null and b/app/assets/images/monkey-wrench.jpg differ diff --git a/app/assets/stylesheets/entries.scss b/app/assets/stylesheets/entries.scss index 1866432e..e87aa970 100644 --- a/app/assets/stylesheets/entries.scss +++ b/app/assets/stylesheets/entries.scss @@ -326,7 +326,6 @@ mark { top: 0px; display: inline-block; z-index: 1; - width: 331px; background-color: rgba(252, 251, 249, 0.7); } .s-review-details, .s-review-details p { diff --git a/app/views/entries/review.html.haml b/app/views/entries/review.html.haml index b9541e82..55d61ff6 100644 --- a/app/views/entries/review.html.haml +++ b/app/views/entries/review.html.haml @@ -86,14 +86,14 @@ .s-entry-date %h2 Total Words %h3 - - percent_book = ((@words_counter.length.to_f/96_000).to_f * 100).round + - percent_book = ((@words_counter.length.to_f/105_250).to_f * 100).round - book_height = 500-((percent_book.to_f / 100) * 500) - %span= "#{format_number(@words_counter.length)} - #{percent_book}% of Second Mountain".html_safe + %span= "#{format_number(@words_counter.length)} - #{percent_book}% of The Monkey Wrench Gang".html_safe .s-review-details %div{style: 'position: relative;'} - =link_to 'https://www.amazon.com/Second-Mountain-David-Brooks/dp/0812993268/?&_encoding=UTF8&tag=thewashburnex-20&linkCode=ur2&linkId=d0631357c1e457da2fff80a1d8c51432&camp=1789&creative=9325', target: '_blank', style: "margin-top: 20px; display: block;margin-bottom: 10px;" do - .s-book-cover{style: "height: #{book_height < 0 ? 0 : book_height}px"} - = image_tag 'second-mountain.jpg', width: 324, height: 500 + =link_to 'https://amzn.to/3BsRghE', target: '_blank', style: "margin-top: 20px; display: block;margin-bottom: 10px;" do + .s-book-cover{style: "width: 360px; height: #{book_height < 0 ? 0 : book_height}px"} + = image_tag 'monkey-wrench.jpg', width: 360, height: 500 .clearfix .col-md-8.col-md-offset-2.well @@ -103,8 +103,8 @@ %h3 - your_avg_words = @words_counter.length / @total_count %span= format_number(your_avg_words) - - if @year.to_s == "2023" - .s-review-details + - if @year.to_s == "2024" + .s-review-details{style: "margin: 30px auto;"} - if your_avg_words > 274 - compared = 'way more' - elsif your_avg_words > 183 @@ -115,8 +115,8 @@ - compared = 'less' %p= "That's #{compared} than the average of all Dabble Me users (183 words per post)." %p - %span Collectively, all Dabble Me users could have wrote 58 books equivalent to David Brooks's, - %span<= link_to "The Second Mountain", "https://www.amazon.com/Second-Mountain-David-Brooks/dp/0812993268/?&_encoding=UTF8&tag=thewashburnex-20&linkCode=ur2&linkId=d0631357c1e457da2fff80a1d8c51432&camp=1789&creative=9325", target: :_blank + %span Collectively, all Dabble Me users could have wrote 58 books equivalent to Edward Abbey's, + %span<= link_to "The Monkey Wrench Gang", "https://amzn.to/3BsRghE", target: :_blank %span ! .clearfix diff --git a/lib/tasks/entry.rake b/lib/tasks/entry.rake index 3590dc83..19518237 100644 --- a/lib/tasks/entry.rake +++ b/lib/tasks/entry.rake @@ -24,7 +24,13 @@ namespace :entry do # TRIGGERED MANUALLY # heroku run bundle exec rake "entry:stats[2022]" --app dabble-me --size=standard-2x - task :stats, [:year] => :environment do |_, year:| + task :stats, [:year] => :environment do |_, args| + year = args[:year] + # Ensure the year argument is provided + if year.nil? + raise ArgumentError, "Year argument is required" + end + # Stats for 2015 # 3,872 users created # 87,572 entries created @@ -123,6 +129,8 @@ namespace :entry do # "Most Frequent Words:" # i: 216,727 + + p "*"*100 p "STATS FOR #{year}" p "*"*100