<commit_before>class League
  class RosterPresenter < ActionPresenter::Base
    presents :roster

    delegate :id, to: :roster
    delegate :name, to: :roster
    delegate :league, to: :roster
    delegate :division, to: :roster
    delegate :approved?, to: :roster
    delegate :disbanded?, to: :roster
    delegate :points, to: :roster
    delegate :==, to: :roster

    def link(label = nil, options = {}, &block)
      label ||= name
      link_to(label, roster_path(roster), options, &block)
    end

    def title
      if league.signuppable?
        signup_title
      else
        active_title
      end
    end

    def score_s
      if disbanded?
        'Disbanded'
      else
        "Points: #{points}"
      end
    end

    def created_at_s
      roster.created_at.strftime('%c')
    end

    def league_p
      @league_p ||= present(league)
    end

    private

    def signup_title
      html_escape("#{roster.name} signed up on #{created_at_s} to ") + league_p.link
    end

    def active_title
      html_escape("#{roster.name} playing in #{roster.division.name} for ") + league_p.link
    end
  end
end<commit_msg>Added disbanded tag to roster titles<commit_after>class League
  class RosterPresenter < ActionPresenter::Base
    presents :roster

    delegate :id, to: :roster
    delegate :name, to: :roster
    delegate :league, to: :roster
    delegate :division, to: :roster
    delegate :approved?, to: :roster
    delegate :disbanded?, to: :roster
    delegate :points, to: :roster
    delegate :==, to: :roster

    def link(label = nil, options = {}, &block)
      label ||= name
      link_to(label, roster_path(roster), options, &block)
    end

    def title
      title = if league.signuppable?
                signup_title
              else
                active_title
              end
      title += disbanded_tag if roster.disbanded?
      title
    end

    def score_s
      if disbanded?
        'Disbanded'
      else
        "Points: #{points}"
      end
    end

    def created_at_s
      roster.created_at.strftime('%c')
    end

    def league_p
      @league_p ||= present(league)
    end

    private

    def disbanded_tag
      ' '.html_safe + content_tag(:span, 'Disbanded', class: 'label label-danger')
    end

    def signup_title
      html_escape("#{roster.name} signed up on #{created_at_s} to ") + league_p.link
    end

    def active_title
      html_escape("#{roster.name} playing in #{roster.division.name} for ") + league_p.link
    end
  end
end
{'fraction_non_alphanumeric': 0.09948269001193792, 'fraction_numerical': 0.0, 'mean_word_length': 2.3475366178428763, 'pattern_counts': {'":': 0, '<': 5, '<?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': '2637374', 'n_tokens_mistral': 841, 'n_tokens_neox': 802, 'n_words': 219}