You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							72 lines
						
					
					
						
							2.4 KiB
						
					
					
				
			
		
		
	
	
							72 lines
						
					
					
						
							2.4 KiB
						
					
					
				<% content_for :title, "Create a new organisation" %> | 
						|
 | 
						|
<% content_for :before_content do %> | 
						|
  <%= govuk_back_link(href: :back) %> | 
						|
<% end %> | 
						|
 | 
						|
<%= form_for(@organisation, as: :organisation, html: { method: :post }) do |f| %> | 
						|
  <div class="govuk-grid-row"> | 
						|
    <div class="govuk-grid-column-two-thirds"> | 
						|
      <%= f.govuk_error_summary %> | 
						|
 | 
						|
      <h1 class="govuk-heading-l"> | 
						|
        <%= content_for(:title) %> | 
						|
      </h1> | 
						|
 | 
						|
      <%= f.govuk_text_field :name, | 
						|
        label: { size: "m" }, | 
						|
        autocomplete: "name" %> | 
						|
 | 
						|
      <%= f.govuk_text_field :address_line1, | 
						|
        label: { text: "Address line 1", size: "m" }, | 
						|
        autocomplete: "address-line1" %> | 
						|
 | 
						|
      <%= f.govuk_text_field :address_line2, | 
						|
        label: { text: "Address line 2", size: "m" }, | 
						|
        autocomplete: "address-line2" %> | 
						|
 | 
						|
      <%= f.govuk_text_field :postcode, | 
						|
        label: { size: "m" }, | 
						|
        autocomplete: "postal-code", | 
						|
        width: 10 %> | 
						|
 | 
						|
      <%= f.govuk_phone_field :phone, | 
						|
        label: { text: "Telephone number", size: "m" }, | 
						|
        autocomplete: "tel", | 
						|
        width: 20 %> | 
						|
 | 
						|
      <%= f.govuk_text_field :housing_registration_no, | 
						|
        label: { text: "Regulator of Social Housing registration number", size: "m" }, | 
						|
        width: 10 %> | 
						|
 | 
						|
      <% null_option = [OpenStruct.new(id: "", name: "Select an option")] %> | 
						|
      <% types = Organisation::PROVIDER_TYPE.map { |key, _val| OpenStruct.new(id: key, name: Organisation::DISPLAY_PROVIDER_TYPE[key]) } %> | 
						|
      <% type_answer_options = null_option + types %> | 
						|
 | 
						|
      <%= f.govuk_collection_select :provider_type, | 
						|
        type_answer_options, | 
						|
        :id, | 
						|
        :name, | 
						|
        label: { text: "Organisation type", size: "m" }, | 
						|
        options: { disabled: [""], selected: @organisation.provider_type || "" } %> | 
						|
 | 
						|
      <%= f.govuk_collection_radio_buttons :holds_own_stock, | 
						|
        [OpenStruct.new(id: true, name: "Yes"), OpenStruct.new(id: false, name: "No")], | 
						|
        :id, | 
						|
        :name, | 
						|
        legend: { text: "Does the organisation hold its own stock?", size: "m" } %> | 
						|
 | 
						|
      <%= f.govuk_check_boxes_fieldset :rent_periods, | 
						|
        legend: { text: "What are the rent periods for the organisation?" } do %> | 
						|
        <% @rent_periods.map do |key, period| %> | 
						|
          <%= f.govuk_check_box :rent_periods, | 
						|
            key, | 
						|
            label: { text: period["value"] }, | 
						|
            checked: period[:checked] %> | 
						|
        <% end %> | 
						|
      <% end %> | 
						|
 | 
						|
      <%= f.govuk_submit "Create organisation" %> | 
						|
    </div> | 
						|
  </div> | 
						|
<% end %>
 | 
						|
 |