<commit_before># FIXME: move these methods to presenter, view model etc. Phil asks Phil
module SidebarHelper

  def my_tasks_count
    current_user.tasks.for_circle(current_circle).volunteered.not_completed
    current_user.tasks.for_circle(current_circle).volunteered.not_completed.count
  end

  def open_tasks_count
    current_circle.tasks.unassigned.not_completed.select { |t| can?(:read, t) }.count
  end

  def all_supplies_count
    current_circle.supplies.not_completed.select { |s| can?(:read, s) }
  end

  def admin_actions_counter
    current_circle.pending_members.count 
  end

  def working_group_counter(working_group)
    working_group.tasks.not_completed.count + working_group.supplies.not_completed.count
  end

  def current_users_working_groups
    working_groups_per_user(:include?)
  end

  def other_users_working_groups
    working_groups_per_user(:exclude?)
  end

  def sidebar_link(name, path, opts={})
    opts[:text] = name
    opts[:path] = path
    opts[:css_selector] = "sidebar-item"
    opts[:css_selector] += " selected" if current_page?(path)
    opts[:icon_id]      ||= nil
    opts[:badge_text]   ||= nil
    opts[:after_icon]   ||= nil
    render partial: 'layouts/internal/sidebar_item', locals: opts<commit_msg>Count of supplies in sidebar was merged incorrectly.<commit_after># FIXME: move these methods to presenter, view model etc. Phil asks Phil
module SidebarHelper

  def my_tasks_count
    current_user.tasks.for_circle(current_circle).volunteered.not_completed
    current_user.tasks.for_circle(current_circle).volunteered.not_completed.count
  end

  def open_tasks_count
    current_circle.tasks.unassigned.not_completed.select { |t| can?(:read, t) }.count
  end

  def all_supplies_count
    current_circle.supplies.not_completed.select { |s| can?(:read, s) }.count
  end

  def admin_actions_counter
    current_circle.pending_members.count 
  end

  def working_group_counter(working_group)
    working_group.tasks.not_completed.count + working_group.supplies.not_completed.count
  end

  def current_users_working_groups
    working_groups_per_user(:include?)
  end

  def other_users_working_groups
    working_groups_per_user(:exclude?)
  end

  def sidebar_link(name, path, opts={})
    opts[:text] = name
    opts[:path] = path
    opts[:css_selector] = "sidebar-item"
    opts[:css_selector] += " selected" if current_page?(path)
    opts[:icon_id]      ||= nil
    opts[:badge_text]   ||= nil
    opts[:after_icon]   ||= nil
    render partial: 'layouts/internal/sidebar_item', locals: opts
{'fraction_non_alphanumeric': 0.0963572267920094, 'fraction_numerical': 0.0, 'mean_word_length': 4.457264957264957, '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': '4712551', 'n_tokens_mistral': 848, 'n_tokens_neox': 815, 'n_words': 161}