ministryofjustice/civil-claims-frontend-claimant

View on GitHub
app/views/claims/personal_details.html.haml

Summary

Maintainability
Test Coverage
= render partial: 'shared/header_message', :locals => {:title => "Start a property repossession case"}

.container
  %nav.progress
    %ol
      %li.active
        %span Personal details
      %li
        %span Case details
      %li
        %span Check details
      %li
        %span Pay court fee
      %li
        %span Confirmation

%header.content-header
  %h2= @page_title
  %p Fill in contact details for the tenant or tenants and confirm your details.

= form_for @claim do |claim_form|
  %section.property-details#property
    %span.right *required
    %h3.section-header Property*
    .moj-panel.sub-panel.js-address
      = claim_form.fields_for @claim.property do |f|
        .row.rel.street
          = f.label :street
          = f.text_area :street
        .row.rel.town
          = f.label :town
          = f.text_field :town
        .row.rel.postcode
          = f.label :postcode
          = f.text_field :postcode, class: 'smalltext'

  %section.review#council
    %h3.section-header
      Council (claimant)
      %a.right(href='#') Make changes
    .moj-panel
      - landlord = @claim.landlords.first
      .row.organisation_name
        .key Council
        .value= landlord.organisation_name
      .row.address
        .key Address
        .value= landlord.address.html_safe
      .row.full_name
        .key Full name
        .value= landlord.full_name
      .row.phone
        .key Phone
        .value= landlord.phone
      .row.email
        .key Email
        .value= landlord.email

  %section.tenant-details#tenant_details
    %h3.section-header Tenant (defendant)
    .moj-panel.has-multiple#tenants-panel(data-multiple="tenant" data-caption="You're taking court action against" data-single="person" data-plural="people")
      - 4.times do |i|
        = claim_form.fields_for(@claim.tenants[i], include_id: false) do |f|
          - if i >= 1
            .row.divider
          .sub-panel.tenant-form.tenant(id="tenant-#{i}")
            - id = @claim.tenants[i].id || ''
            - prefix = "[claim]tenants[]"
            %h4= "Tenant #{i = i + 1}"
            .row.title
              = f.label :title, for: "tenant-#{i}-title"
              = f.text_field :title, class: 'smalltext', name: "#{prefix}[title]", id: "tenant-#{i}-title"
            .row.rel.full_name
              = f.label :full_name, for: "tenant-#{i}-full_name"
              = f.text_field :full_name, name: "#{prefix}[full_name]", id: "tenant-#{i}-full_name"
            .row.rel.phone
              = f.label :phone, for: "tenant-#{i}-phone"
              = f.text_field :phone, name: "#{prefix}[phone]", id: "tenant-#{i}-phone"
            .row.rel.email
              = f.label :email, for: "tenant-#{i}-email"
              = f.text_field :email, name: "#{prefix}[email]", id: "tenant-#{i}-email"
            .row.full If the tenants are living somewhere else, please give the address below.
            .row.street
              = f.label :street, for: "tenant-#{i}-street"
              = f.text_area :street, name: "#{prefix}[street]", id: "tenant-#{i}-street"
            .row.rel.town
              = f.label :town, for: "tenant-#{i}-town"
              = f.text_field :town, name: "#{prefix}[town]", id: "tenant-#{i}-town"
            .row.rel.postcode
              = f.label :postcode, for: "tenant-#{i}-postcode"
              = f.text_field :postcode, class: 'smalltext', name: "#{prefix}[postcode]", id: "tenant-#{i}-postcode"
            = f.hidden_field :id, name: "#{prefix}[id]", id: ''
  %section
    .action-buttons.cf
      %button.button.primary.large.chevron.left{name: 'next_page', value: 'case_details'} Continue to next step



/ handlebars templates

= render :partial => 'partials/hbtemplates'