<commit_before>ActiveAdmin.register GroupRequest do
  actions :all, :except => [:new]
  scope :waiting, :default => true
  scope :starred
  scope :unverified
  scope :all

  filter :name
  filter :description
  filter :admin_email
  filter :admin_name
  filter :high_touch

  index do
    column :id
    column :name_and_email do |gr|
      "#{gr.admin_name} <br/> #{gr.admin_email}".html_safe
    end
    column :description
    column :admin_notes
    column 'Size', :expected_size
    column 'Subscription' do |gr|
      gr.cannot_contribute? == false
    end
    column :created_at, sortable: :created_at do |gr|
      gr.created_at.to_date
    end
    column :actions do |gr|
      span do
        [link_to('Approve', 
                 approve_and_send_form_admin_group_request_path(gr)),
         link_to('Star', 
                 set_high_touch_admin_group_request_path(gr), 
                 :method => :put),
         link_to('Edit', 
                 edit_admin_group_request_path(gr)),
         link_to('Destroy', 
                 admin_group_requests_path(gr), 
                 method: :delete)].join(' ').html_safe
      end
    end
  end

  form partial: 'form'

  member_action :set_high_touch, :method => :put do
    @group_request = GroupRequest.find(params[:id])
    @group_request.update_attribute(:high_touch, true)
    redirect_to admin_group_requests_path
  end

  member_action :approve_and_send_form, :method => :get do
    @group_request = GroupRequest.find(params[:id])
  end

  member_action :approve_and_send, :method => :put do
    @group_request = GroupRequest.find(params[:id])
    setup_group = SetupGroup.new(@group_request)
    group = setup_group.approve_group_request(approved_by: current_user)
    setup_group.send_invitation_to_start_group(inviter: current_user, message_body: params[:message_body])
    redirect_to admin_group_requests_path,
      :notice => ("Group approved: " +
      "<a href='#{admin_group_path(group)}'>#{group.name}</a>").html_safe
  end

  member_action :update, method: :put do
    update! do |format|
      format.html {redirect_to admin_group_requests_path}<commit_msg>add show status on group requests in admin panel<commit_after>ActiveAdmin.register GroupRequest do
  actions :all, :except => [:new]
  scope :waiting, :default => true
  scope :starred
  scope :unverified
  scope :all

  filter :name
  filter :description
  filter :admin_email
  filter :admin_name
  filter :high_touch

  index do
    column :id
    column :name_and_email do |gr|
      "#{gr.admin_name} <br/> #{gr.admin_email}".html_safe
    end
    column :description
    column :admin_notes
    column 'Size', :expected_size
    column 'Subscription' do |gr|
      gr.cannot_contribute? == false
    end
    column :created_at, sortable: :created_at do |gr|
      gr.created_at.to_date
    end
    column :status
    column :actions do |gr|
      span do
        links = []
        unless gr.approved?
          links << link_to('Approve', approve_and_send_form_admin_group_request_path(gr))
        end
        links << link_to('Star', set_high_touch_admin_group_request_path(gr), :method => :put)
        links << link_to('Edit', edit_admin_group_request_path(gr))
        links << link_to('Destroy', admin_group_requests_path(gr), method: :delete)
        links.join(' ').html_safe
      end
    end
  end

  form partial: 'form'

  member_action :set_high_touch, :method => :put do
    @group_request = GroupRequest.find(params[:id])
    @group_request.update_attribute(:high_touch, true)
    redirect_to admin_group_requests_path
  end

  member_action :approve_and_send_form, :method => :get do
    @group_request = GroupRequest.find(params[:id])
  end

  member_action :approve_and_send, :method => :put do
    @group_request = GroupRequest.find(params[:id])
    setup_group = SetupGroup.new(@group_request)
    group = setup_group.approve_group_request(approved_by: current_user)
    setup_group.send_invitation_to_start_group(inviter: current_user, message_body: params[:message_body])
    redirect_to admin_group_requests_path,
      :notice => ("Group approved: " +
      "<a href='#{admin_group_path(group)}'>#{group.name}</a>").html_safe
  end

  member_action :update, method: :put do
    update! do |format|
      format.html {redirect_to admin_group_requests_path}
{'fraction_non_alphanumeric': 0.10617626648161, 'fraction_numerical': 0.0, 'mean_word_length': 3.5135699373695197, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 23, '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': '5870838', 'n_tokens_mistral': 1398, 'n_tokens_neox': 1379, 'n_words': 300}