<% political_membership = role_appointment.historical_account.try(:political_membership) %>
<%= content_tag_for :div, role_appointment, class: 'govuk-grid-column-one-quarter', role: "listitem" do %>
  <% if role_appointment.has_historical_account? %>
    <%= render "govuk_publishing_components/components/image_card", {
      href: historic_appointment_path(role_appointment.person),
      image_src: role_appointment.person.image_url(:s216),
      image_loading: "lazy",
      heading_text: role_appointment.person.name,
      extra_details: previous_dates_in_office_prime(role, role_appointment.person, political_membership),
      extra_details_no_indent: true
    } %>
  <% else %>
    <%= render "govuk_publishing_components/components/image_card", {
      image_src: role_appointment.person.image_url(:s216),
      image_loading: "lazy",
      heading_text: role_appointment.person.name,
      extra_details: previous_dates_in_office_prime(role, role_appointment.person, political_membership),
      extra_details_no_indent: true
    } %>
  <% end %>
<% end %>

<% political_membership = role_appointment.historical_account.try(:political_membership) %>
<%= content_tag_for :div, role_appointment, class: 'govuk-grid-column-one-quarter', role: "listitem" do %>
  <% if role_appointment.has_historical_account? %>
    <%= render "govuk_publishing_components/components/image_card", {
      href: historic_appointment_path(role.historic_param, role_appointment.person),
      image_src: role_appointment.person.image_url(:s216),
      image_loading: "lazy",
      heading_text: role_appointment.person.name,
      extra_details: previous_dates_in_office_prime(role, role_appointment.person, political_membership),
      extra_details_no_indent: true
    } %>
  <% else %>
    <%= render "govuk_publishing_components/components/image_card", {
      image_src: role_appointment.person.image_url(:s216),
      image_loading: "lazy",
      heading_text: role_appointment.person.name,
      extra_details: previous_dates_in_office_prime(role, role_appointment.person, political_membership),
      extra_details_no_indent: true
    } %>
  <% end %>
<% end %>

Revert "Fix past prime minister href"
Revert "Fix past prime minister href"

This reverts commit 9bfccc03b682f999791e210e86a14bd61f6b6316.

Work done to simplify routes in whitehall was slightly more complex than expected. Reverting this commit, along with another, until we can unpick it more cleanly.
