<%= form_with model: [:admin_portal, @project], local: true, data: { turbo: false }, class: "needs-validation" do |f| %> <% if @project.errors.any? %>
Please fix the following errors:
<% end %>
Project Details
<%= f.label :name, "Project Name", class: "form-label" %> <%= f.text_field :name, class: "form-control", placeholder: "e.g. Hillside Estate" %>
<%= f.label :scope, class: "form-label" %> <%= f.text_field :scope, class: "form-control", placeholder: "e.g. Residential Development" %>
<%= f.label :location, class: "form-label" %> <%= f.text_field :location, class: "form-control", placeholder: "e.g. Harare" %>
<%= f.label :township, class: "form-label" %> <%= f.text_field :township, class: "form-control", placeholder: "e.g. Glen View" %>
<%= f.label :description, class: "form-label" %> <%= f.text_area :description, class: "form-control", rows: 3, placeholder: "Brief description of the project..." %>
<%= f.label :start_date, class: "form-label" %> <%= f.date_field :start_date, class: "form-control" %>
<%= f.label :end_date, class: "form-label" %> <%= f.date_field :end_date, class: "form-control" %>
<%= f.label :takeon_date, class: "form-label" %> <%= f.date_field :takeon_date, class: "form-control" %>
<%= f.label :council, class: "form-label" %> <%= f.text_field :council, class: "form-control", placeholder: "Responsible authority" %>
<%= f.check_box :active, class: "form-check-input" %> <%= f.label :active, "Mark project as active", class: "form-check-label" %>
Project Settings
<%= f.check_box :include_decimal, class: "form-check-input" %> <%= f.label :include_decimal, "Include Decimal", class: "form-check-label" %>
<%= f.check_box :include_alphabet, class: "form-check-input" %> <%= f.label :include_alphabet, "Include Alphabet in Lot Numbers", class: "form-check-label" %>
<%= f.check_box :compounding_interest, class: "form-check-input" %> <%= f.label :compounding_interest, "Compounding Interest", class: "form-check-label" %>
<%= f.check_box :prepost_interest, class: "form-check-input" %> <%= f.label :prepost_interest, "Pre/Post Interest", class: "form-check-label" %>
<%= f.label :deposit_term, "Deposit Term (months)", class: "form-label" %> <%= f.number_field :deposit_term, class: "form-control" %>
<%= f.label :prefix, "Lot Prefix", class: "form-label" %> <%= f.text_field :prefix, class: "form-control", placeholder: "e.g. L-" %>
Sales Agreement Template
<%= f.fields_for :sales_agreement_templates do |t| %>
<%= t.label :name, class: "form-label" %> <%= t.text_field :name, class: "form-control", placeholder: "Template name" %>
<%= t.label :content, class: "form-label" %> <%= t.rich_text_area :content, class: "form-control", style: "min-height: 300px;" %>
<% if @project.persisted? %>
<%= t.check_box :default, class: "form-check-input" %> <%= t.label :default, "Set as default for this project", class: "form-check-label" %>
<% end %> <% end %>
<%= f.submit "Save Project", class: "btn btn-primary px-4 rounded-pill shadow-sm" %>
<% end %>