<commit_before>module ApplicationHelper
  def page_title
    # TODO: Use this in the head title - doesn't seem to work properly...
    (@content_for_title + " &mdash; " if @content_for_title).to_s + 'Storyboard'
  end

  def page_heading(text)
    content_for(:title, text)
  end

  def sub_heading(text, id = nil)
    id ? "<div id='#{id}' class='subHeading'>#{text}</div>".html_safe : "<div class='subHeading'>#{text}</div>".html_safe
  end

  def status_badge(model)
    colour = case model.status.to_sym
      when :open then '#800'
      when :not_started then '#800'
      when :ready then '#E0981B'
      when :in_progress then '#E0981B'
      when :committed then '#080'
      when :done then '#008'
      when :finished then '#008'
      when :rejected then '#888'
    end
    "<span class='statusBadge' style='background-color: #{colour};'>#{model.status.to_s.humanize}</span>".html_safe
  end

  def assignee_badge(model)
    "<span class='assigneeBadge'>#{model.assignee_name}</span>".html_safe
  end

  def estimate_badge(model)
    case model.class
    when Story 
      "<span class='priorityBadge'>#{model.estimate}</span>".html_safe
    when Task
      "<span class='priorityBadge'>#{model.remaining}/#{model.estimate}</span>".html_safe
    else ''
    end
  end

  def login_or_logout_link
   if user_session.logged_in?
     link_to 'Logout', logout_path
   else
     link_to 'Login', login_path<commit_msg>Display Unassigned for tasks that have not been assigned to a user yet<commit_after>module ApplicationHelper
  def page_title
    # TODO: Use this in the head title - doesn't seem to work properly...
    (@content_for_title + " &mdash; " if @content_for_title).to_s + 'Storyboard'
  end

  def page_heading(text)
    content_for(:title, text)
  end

  def sub_heading(text, id = nil)
    id ? "<div id='#{id}' class='subHeading'>#{text}</div>".html_safe : "<div class='subHeading'>#{text}</div>".html_safe
  end

  def status_badge(model)
    colour = case model.status.to_sym
      when :open then '#800'
      when :not_started then '#800'
      when :ready then '#E0981B'
      when :in_progress then '#E0981B'
      when :committed then '#080'
      when :done then '#008'
      when :finished then '#008'
      when :rejected then '#888'
    end
    "<span class='statusBadge' style='background-color: #{colour};'>#{model.status.to_s.humanize}</span>".html_safe
  end

  def assignee_badge(model)
    return "<span class='assigneeBadge'>Unassigned</span>".html_safe if model.assignee_name.nil?
    "<span class='assigneeBadge'>#{model.assignee_name}</span>".html_safe
  end

  def estimate_badge(model)
    case model.class
    when Story 
      "<span class='priorityBadge'>#{model.estimate}</span>".html_safe
    when Task
      "<span class='priorityBadge'>#{model.remaining}/#{model.estimate}</span>".html_safe
    else ''
    end
  end

  def login_or_logout_link
   if user_session.logged_in?
     link_to 'Logout', logout_path
   else
     link_to 'Login', login_path
{'fraction_non_alphanumeric': 0.13581890812250333, 'fraction_numerical': 0.017310252996005325, 'mean_word_length': 3.6088957055214723, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, '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': '951367', 'n_tokens_mistral': 1046, 'n_tokens_neox': 1020, 'n_words': 240}