<commit_before>class ApplicationController < ActionController::Base
  protect_from_forgery
  
  helper_method :character_picker
  helper_method :equipment_picker
  helper_method :language_picker
  helper_method :location_picker
  helper_method :universe_picker
  helper_method :universe_filter
  
  # View Helpers
  def character_picker
  	characters = Character.where(user_id: session[:user])
  	return if characters.length == 0
  
  	html = '<span class="btn-group input-append help-inline">'
  	html << '<button class="btn dropdown-toggle" data-toggle="dropdown">'
  	html << '<i class="icon-user"></i> '
  	html << '<span class="caret"></span>'
  	html << '</button>'
  	html << '<ul class="dropdown-menu dropdown-picker">'
  	characters.each do |i|
  		html << '<li><a href="#">' + i.name + '</a></li>'
  	end
  	html << '</ul>'
  	html << '</span>'

  	return html.html_safe
  end
  
  def equipment_picker
  	equipment = Equipment.where(user_id: session[:user])
  	return if equipment.length == 0
  
  	html = '<span class="btn-group input-append help-inline">'
  	html << '<button class="btn dropdown-toggle" data-toggle="dropdown">'
  	html << '<i class="icon-shopping-cart"></i> '
  	html << '<span class="caret"></span>'
  	html << '</button>'
  	html << '<ul class="dropdown-menu dropdown-picker">'
  	equipment.each do |i|
  		html << '<li><a href="#">' + i.name + '</a></li>'<commit_msg>add nl2br<commit_after>class ApplicationController < ActionController::Base
  protect_from_forgery
  
  helper_method :nl2br
  
  helper_method :character_picker
  helper_method :equipment_picker
  helper_method :language_picker
  helper_method :location_picker
  helper_method :universe_picker
  
  helper_method :universe_filter
  
  # View Helpers
  def nl2br(string)
    string.gsub("\n\r","<br>").gsub("\r", "").gsub("\n", "<br />").html_safe
  end
  
  def character_picker
  	characters = Character.where(user_id: session[:user])
  	return if characters.length == 0
  
  	html = '<span class="btn-group input-append help-inline">'
  	html << '<button class="btn dropdown-toggle" data-toggle="dropdown">'
  	html << '<i class="icon-user"></i> '
  	html << '<span class="caret"></span>'
  	html << '</button>'
  	html << '<ul class="dropdown-menu dropdown-picker">'
  	characters.each do |i|
  		html << '<li><a href="#">' + i.name + '</a></li>'
  	end
  	html << '</ul>'
  	html << '</span>'

  	return html.html_safe
  end
  
  def equipment_picker
  	equipment = Equipment.where(user_id: session[:user])
  	return if equipment.length == 0
  
  	html = '<span class="btn-group input-append help-inline">'
  	html << '<button class="btn dropdown-toggle" data-toggle="dropdown">'
  	html << '<i class="icon-shopping-cart"></i> '
  	html << '<span class="caret"></span>'
  	html << '</button>'
  	html << '<ul class="dropdown-menu dropdown-picker">'
  	equipment.each do |i|
  		html << '<li><a href="#">' + i.name + '</a></li>'
{'fraction_non_alphanumeric': 0.17558813501534265, 'fraction_numerical': 0.002386634844868735, 'mean_word_length': 3.8818635607321132, 'pattern_counts': {'":': 0, '<': 115, '<?xml version=': 0, '>': 57, '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': '399828', 'n_tokens_mistral': 1009, 'n_tokens_neox': 988, 'n_words': 217}