<commit_before>module ApplicationHelper
  def nav_link(name, path, title, current)
    content_tag(:li, class: ("active" if current)) do
      link_to name, path, title: title
    end
  end

  def nav_link_unless_current(name, path, title)
    nav_link(name, path, title, current_page?(path))
  end

  def electorate_path2(member)
    electorate_path({
        mpc: (member.url_electorate.downcase if member),
        house: (member.australian_house if member)
      })
  end

  def edit_division_path2(division)
    # TODO Remove type from url
    edit_division_path(type: "motion", rr: request.fullpath,
      date: division.date, number: division.number, house: division.australian_house)
  end

  # Returns Representatives or Senators
  def members_type(house)
    case house
    when "representatives"
      "Representatives"
    when "senate"
      "Senators"
    when "all"
      "Representatives and Senators"
    else
      raise<commit_msg>create link "button" version of nav_link<commit_after>module ApplicationHelper
  def nav_link(name, path, title, current)
    content_tag(:li, class: ("active" if current)) do
      link_to name, path, title: title
    end
  end

  def nav_link_unless_current(name, path, title)
    nav_link(name, path, title, current_page?(path))
  end

  def nav_button_link(name, path, title, current)
    link_to name, path, title: title, class: "btn btn-sm #{current ? "btn-primary" : "btn-default"}"
  end

  def electorate_path2(member)
    electorate_path({
        mpc: (member.url_electorate.downcase if member),
        house: (member.australian_house if member)
      })
  end

  def edit_division_path2(division)
    # TODO Remove type from url
    edit_division_path(type: "motion", rr: request.fullpath,
      date: division.date, number: division.number, house: division.australian_house)
  end

  # Returns Representatives or Senators
  def members_type(house)
    case house
    when "representatives"
      "Representatives"
    when "senate"
      "Senators"
    when "all"
      "Representatives and Senators"
    else
      raise
{'fraction_non_alphanumeric': 0.0920863309352518, 'fraction_numerical': 0.0019184652278177458, 'mean_word_length': 3.4668094218415417, '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': '6866669', 'n_tokens_mistral': 684, 'n_tokens_neox': 648, 'n_words': 181}