fatfreecrm/fat_free_crm

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

Summary

Maintainability
Test Coverage
= hook(:account_top_section, self, f: f) do
  .section
    %table
      %tr
        %td{class: (@account.errors['name'].present? ? 'fieldWithErrors' : nil)}(colspan="5")
          .label.top.req #{t :name}:
          = f.text_field :name, autofocus: true, style: "width:500px", required: "required"
      %tr
        %td
          .label #{t :assigned_to}:
          = user_select(:account, User.without_user(current_user), current_user)
        %td= spacer
        %td
          .label #{t :category}:
          = f.select :category, Setting.unroll(:account_category), { selected: (@account.category || "other").to_sym, include_blank: t(:other) }, { style: "width:160px", class: 'select2' }
        %td= spacer
        %td
          .label #{t :rating}:
          = rating_select "account[rating]", { id: :account_rating, selected: @account.rating, style: "width:160px" }

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

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

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