<commit_before>module KnbAuction
  module AuctionsHelper
    
    def start_at_local_time( auction )
      auction.start_at.localtime
    end
    
    def end_at_local_time( auction )
      auction.end_at.localtime
    end
    
    def status_label( status )
      haml_tag(:span, yield, class: "label #{status_labeler( status )}")
    end
    
    def status_labeler( status )
      case status
      when :active
        "label-success"
      when :closed
        "label-important"
      when :upcoming
        "label-warning"
      else
        "label-info"
      end
    end
    
    def bid_owner_name( bid )
      if current_user.admin?
        bid.owner_name
        # concat link_to(auction.high_bid.owner_name, auction.high_bidder)
      elsif current_user == bid.owner
        if current_user == bid.auction.high_bidder && bid.goodles == bid.auction.high_bid.goodles && bid.auction.active? 
          "You're winning!"
        elsif current_user == bid.auction.high_bidder && bid.goodles == bid.auction.high_bid.goodles && bid.auction.closed?
          "You won!"
        else
          "You"
        end
      else
        "Another goodler"
      end
    end
    
    def auction_time_left( auction )
      distance_of_time_in_words_to_now(auction.end_at)
    end
    
  end
end<commit_msg>High Bid Copy<commit_after>module KnbAuction
  module AuctionsHelper
    
    def status_label( status )
      haml_tag(:span, yield, class: "label #{status_labeler( status )}")
    end
    
    def status_labeler( status )
      case status
      when :active
        "label-success"
      when :closed
        "label-important"
      when :upcoming
        "label-warning"
      else
        "label-info"
      end
    end
    
    def bid_owner_name( bid )
      if current_user.admin?
        bid.owner_name
        # concat link_to(auction.high_bid.owner_name, auction.high_bidder)
      elsif current_user == bid.owner
        if current_user == bid.auction.high_bidder && bid.goodles == bid.auction.high_bid.goodles && bid.auction.active? 
          "You're winning!"
        elsif current_user == bid.auction.high_bidder && bid.goodles == bid.auction.high_bid.goodles && bid.auction.closed?
          "You won!"
        else
          "You"
        end
      else
        ""
      end
    end
    
    def auction_time_left( auction )
      distance_of_time_in_words_to_now(auction.end_at)
    end
    
  end
end
{'fraction_non_alphanumeric': 0.0859149111937216, 'fraction_numerical': 0.0, 'mean_word_length': 2.058080808080808, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '357625', 'n_tokens_mistral': 785, 'n_tokens_neox': 783, 'n_words': 159}