app/helpers/works_helper.rb
# List of date, chapter and length info for the work show page
List of date, chapter and length info for the work show page
List of date chapter and length info for the work show page
def show_hit_count?(work)
    return false if logged_in? && current_user.preference.try(:hide_all_hit_counts)
    author_wants_to_see_hits = is_author_of?(work) && !current_user.preference.try(:hide_private_hit_count)
    all_authors_want_public_hits = work.users.select {|u| u.preference.try(:hide_public_hit_count)}.empty?
    author_wants_to_see_hits || (!is_author_of?(work) && all_authors_want_public_hits)
  end
def show_hit_count? ( work ) return false if logged_in? && current_user . preference . try ( :hide_all_hit_counts ) author_wants_to_see_hits = is_author_of? ( work ) && ! current_user . preference . try ( :hide_private_hit_count ) all_authors_want_public_hits = work . users . select { | u | u . preference . try ( :hide_public_hit_count ) } . empty? author_wants_to_see_hits || ( ! is_author_of? ( work ) && all_authors_want_public_hits ) end
List of date, chapter and length info for the work show page
List of date chapter and length info for the work show page
work