fatfreecrm/fat_free_crm

View on GitHub
app/views/leads/_top_section.html.haml

Summary

Maintainability
Test Coverage

= hook(:lead_top_section, self, f: f) do
  .section
    %table
      %tr
        %td{ class: (@lead.errors['first_name'].present? ? 'fieldWithErrors' : nil)}
          .label.top{ class: "#{Setting.require_first_names ? 'req' : nil}" } #{t :first_name}:
          = f.text_field :first_name, autofocus: true, required: (Setting.require_first_names ? "required" : nil)
        %td= spacer
        %td{ class: (@lead.errors['last_name'].present? ? 'fieldWithErrors' : nil)}
          .label.top{ class: "#{Setting.require_last_names ? 'req' : nil}" } #{t :last_name}:
          = f.text_field :last_name, required: (Setting.require_last_names ? "required" : nil)
      %tr
        %td
          .label #{t :email}:
          = f.text_field :email
        %td= spacer
        %td
          .label #{t :phone}:
          = f.text_field :phone

      - if Setting.background_info && Setting.background_info.include?(:lead)
        %tr
          %td(colspan="3")
            .label= t(:background_info) + ':'
            = f.text_area :background_info, style: "width:500px", rows: 3

      = render partial: "/shared/tags", locals: {f: f, span: 3}

      = hook(:lead_top_section_bottom, self, f: f)