<commit_before>ActiveAdmin::Dashboards.build do

  section "Groups", :priority => 1 do
    h1 { Group.count }
    div { link_to "See all groups", admin_groups_path }
  end

  section "Users", :priority => 2 do
    h1 { User.count }
    div { link_to "See all users", admin_users_path }
  end

  section "Members Per Group (average)", :priority => 3 do
    h1{ Group.average("memberships_count").round unless Group.count == 0 }
  end

  section "Discussions", :priority => 4 do
    h1 { Discussion.count }
  end

  section "Proposals", :priority => 7 do
    h1 { Motion.count }
  end

  # Define your dashboard sections here. Each block will be
  # rendered on the dashboard in the context of the view. So just
  # return the content which you would like to display.

  # == Simple Dashboard Section
  # Here is an example of a simple dashboard section<commit_msg>add count of new groups to admin panel<commit_after>ActiveAdmin::Dashboards.build do

  section "Groups", :priority => 1 do
    h1 { Group.count }
    div { "New today: #{Group.where('created_at >= ?', 24.hours.ago).count}"}
    div { "New this week: #{Group.where('created_at >= ?', 1.week.ago).count}"}
    div { link_to "See all groups", admin_groups_path }
  end

  section "Users", :priority => 2 do
    h1 { User.count }
    div { link_to "See all users", admin_users_path }
  end

  section "Members Per Group (average)", :priority => 3 do
    h1{ Group.average("memberships_count").round unless Group.count == 0 }
  end

  section "Discussions", :priority => 4 do
    h1 { Discussion.count }
  end

  section "Proposals", :priority => 7 do
    h1 { Motion.count }
  end

  # Define your dashboard sections here. Each block will be
  # rendered on the dashboard in the context of the view. So just
  # return the content which you would like to display.

  # == Simple Dashboard Section
  # Here is an example of a simple dashboard section
{'fraction_non_alphanumeric': 0.10581456259821896, 'fraction_numerical': 0.013095861707700367, 'mean_word_length': 3.292134831460674, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '5594353', 'n_tokens_mistral': 613, 'n_tokens_neox': 566, 'n_words': 221}