<commit_before>class EmailAlertSignupContentItemPresenter

  def initialize(policy, update_type="major")
    @policy = policy
    @update_type = update_type
  end

  def exportable_attributes
    {
      format: "email_alert_signup",
      content_id: policy.email_alert_signup_content_id,
      title: policy.name,
      description: "",
      public_updated_at: public_updated_at,
      locale: "en",
      update_type: update_type,
      publishing_app: "policy-publisher",
      rendering_app: "email-alert-frontend",
      routes: routes,
      details: details,
      links: {},
    }
  end

  def base_path
    "#{policy.base_path}/email-signup"
  end

private
  attr_reader :policy, :update_type

  def public_updated_at
    policy.updated_at
  end

  def routes
    [
      {
        path: base_path,
        type: "exact",
      },
    ]
  end

  def details
    {
      breadcrumbs: breadcrumbs,
      summary: summary,
      tags: {
        policy: [policy.slug],
      },
      govdelivery_title: "#{policy.name} policy",
    }
  end

  def summary
    %q[
      You'll get an email each time a document about
      this policy is published or updated.
    ]
  end

  def breadcrumbs
    [
      {
        title: policy.name,
        link: policy.base_path,
      }
    ]
  end

end
<commit_msg>Add parent link to email alert signup presenter<commit_after>class EmailAlertSignupContentItemPresenter

  def initialize(policy, update_type="major")
    @policy = policy
    @update_type = update_type
  end

  def exportable_attributes
    {
      format: "email_alert_signup",
      content_id: policy.email_alert_signup_content_id,
      title: policy.name,
      description: "",
      public_updated_at: public_updated_at,
      locale: "en",
      update_type: update_type,
      publishing_app: "policy-publisher",
      rendering_app: "email-alert-frontend",
      routes: routes,
      details: details,
      links: { parent: [policy.content_id] },
    }
  end

  def base_path
    "#{policy.base_path}/email-signup"
  end

private
  attr_reader :policy, :update_type

  def public_updated_at
    policy.updated_at
  end

  def routes
    [
      {
        path: base_path,
        type: "exact",
      },
    ]
  end

  def details
    {
      breadcrumbs: breadcrumbs,
      summary: summary,
      tags: {
        policy: [policy.slug],
      },
      govdelivery_title: "#{policy.name} policy",
    }
  end

  def summary
    %q[
      You'll get an email each time a document about
      this policy is published or updated.
    ]
  end

  def breadcrumbs
    [
      {
        title: policy.name,
        link: policy.base_path,
      }
    ]
  end

end

{'fraction_non_alphanumeric': 0.08883911907428145, 'fraction_numerical': 0.0, 'mean_word_length': 2.2603406326034063, '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': '825797', 'n_tokens_mistral': 872, 'n_tokens_neox': 865, 'n_words': 197}