<commit_before>ActiveAdmin.register_page "Dashboard" do

  menu priority: 1, label: proc{ I18n.t("active_admin.dashboard") }

  content title: proc{ I18n.t("active_admin.dashboard") } do
    div class: "blank_slate_container", id: "dashboard_default_message" do
      span class: "blank_slate" do
        span I18n.t("active_admin.dashboard_welcome.welcome")
        small I18n.t("active_admin.dashboard_welcome.call_to_action")
      end
    end

    # Here is an example of a simple dashboard with columns and panels.
    #
    # columns do
    #   column do
    #     panel "Recent Posts" do
    #       ul do
    #         Post.recent(5).map do |post|
    #           li link_to(post.title, admin_post_path(post))
    #         end
    #       end
    #     end
    #   end

    #   column do
    #     panel "Info" do
    #       para "Welcome to ActiveAdmin."
    #     end
    #   end
    # end
  end # content
end
<commit_msg>Add some example panels to the admin dashboard<commit_after>ActiveAdmin.register_page "Dashboard" do
  menu priority: 1, label: proc { I18n.t("active_admin.dashboard") }

  content title: proc { I18n.t("active_admin.dashboard") } do
    columns do
      column do
        panel "Studies over 12 months old that haven't completed" do
          ul do
            completion = StudyStage.find_by_name!("Completion")
            withdrawn = StudyStage.find_by_name!("Withdrawn or Postponed")
            query = "concept_paper_date < :year_ago AND study_stage_id NOT " \
              "IN (:completed_stage_ids)"
            Study.where(
              query,
              year_ago: Time.zone.today - 1.year,
              completed_stage_ids: [completion.id, withdrawn.id]
            ).limit(5).map do |study|
              li link_to(study.title, admin_study_path(study))
            end
          end
        end
      end

      column do
        panel "Info" do
          para "Welcome to ReMIT's Admin pages."
          para "Some helpful links or notes could go here..."
        end
      end
    end
  end # content
end

{'fraction_non_alphanumeric': 0.08887809616318601, 'fraction_numerical': 0.009227780475959204, 'mean_word_length': 2.0116959064327484, 'pattern_counts': {'":': 0, '<': 4, '<?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': '2060511', 'n_tokens_mistral': 647, 'n_tokens_neox': 619, 'n_words': 172}