<commit_before>- btn_size = expanded ? 'btn-lg' : 'btn-xs'

- if dataset.release_date && dataset.release_date <= Date.today
  - agreements = (current_user ? dataset.agreements.where(user_id: current_user.id) : Agreement.none)
  - if agreement = agreements.find_by(status: 'submitted')
    - if expanded
      .info-header Request Submitted
    = link_to 'Under Review', submissions_path, class: "btn #{btn_size} btn-call-to-default"
  - elsif agreement = agreements.find_by(status: 'resubmit')
    - if expanded
      .info-header Changes Required
    = link_to 'Resubmit Your DAUA', submissions_path, class: "btn #{btn_size} btn-call-to-danger"
  - elsif agreement = agreements.expired.first
    - if expanded
      .info-header Request Expired
    = link_to 'Renew Access', submissions_path(dataset: dataset), class: "btn #{btn_size} btn-call-to-danger"
  - elsif agreement = agreements.find_by(status: ['', 'started', nil])
    - if expanded
      .info-header Request Started
    - if agreement.fully_filled_out?
      = link_to 'Complete Your DAUA', proof_agreement_path(agreement), class: "btn #{btn_size} btn-call-to-info"
    - else
      = link_to 'Complete Your DAUA', step_agreement_path(agreement, step: agreement.current_step), class: "btn #{btn_size} btn-call-to-info"
  - elsif agreement = agreements.find_by(status: 'approved')
    - if expanded
      .info-header Data Access
    = link_to 'Approved', files_dataset_path(dataset), class: "btn #{btn_size} btn-call-to-action"
  - else
    = link_to 'Request Access', submissions_path(dataset: dataset), class: "btn #{btn_size} btn-call-to-info"
- elsif dataset.release_date
  = link_to dataset, class: "btn #{btn_size} btn-call-to-default" do
    Coming<commit_msg>Dataset requests now first check to see if an approved agreement exists, closes #173.<commit_after>- btn_size = expanded ? 'btn-lg' : 'btn-xs'

- if dataset.release_date && dataset.release_date <= Date.today
  - agreements = (current_user ? dataset.agreements.where(user_id: current_user.id) : Agreement.none)
  - if agreement = agreements.find_by(status: 'approved')
    - if expanded
      .info-header Data Access
    = link_to 'Approved', files_dataset_path(dataset), class: "btn #{btn_size} btn-call-to-action"
  - elsif agreement = agreements.find_by(status: 'submitted')
    - if expanded
      .info-header Request Submitted
    = link_to 'Under Review', submissions_path, class: "btn #{btn_size} btn-call-to-default"
  - elsif agreement = agreements.find_by(status: 'resubmit')
    - if expanded
      .info-header Changes Required
    = link_to 'Resubmit Your DAUA', submissions_path, class: "btn #{btn_size} btn-call-to-danger"
  - elsif agreement = agreements.expired.first
    - if expanded
      .info-header Request Expired
    = link_to 'Renew Access', submissions_path(dataset: dataset), class: "btn #{btn_size} btn-call-to-danger"
  - elsif agreement = agreements.find_by(status: ['', 'started', nil])
    - if expanded
      .info-header Request Started
    - if agreement.fully_filled_out?
      = link_to 'Complete Your DAUA', proof_agreement_path(agreement), class: "btn #{btn_size} btn-call-to-info"
    - else
      = link_to 'Complete Your DAUA', step_agreement_path(agreement, step: agreement.current_step), class: "btn #{btn_size} btn-call-to-info"
  - else
    = link_to 'Request Access', submissions_path(dataset: dataset), class: "btn #{btn_size} btn-call-to-info"
- elsif dataset.release_date
  = link_to dataset, class: "btn #{btn_size} btn-call-to-default" do
    Coming
{'fraction_non_alphanumeric': 0.1264855687606112, 'fraction_numerical': 0.0008488964346349745, 'mean_word_length': 3.9165507649513214, 'pattern_counts': {'":': 0, '<': 5, '<?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': '4875759', 'n_tokens_mistral': 1147, 'n_tokens_neox': 1118, 'n_words': 282}