fatfreecrm/fat_free_crm

View on GitHub
app/views/contacts/_new.html.haml

Summary

Maintainability
Test Coverage
= simple_form_for(@contact, html: one_submit_only, remote: true) do |f|
  = link_to_close new_contact_path
  = f.hidden_field :user_id
  = hidden_field_tag "opportunity", "#{@opportunity.id if @opportunity}"

  = f.error_messages object_name: t('contact')

  = render "contacts/top_section", f: f
  = render "fields/edit_custom_field_group", f: f
  = render "shared/add_comment",   f: f
  = render "contacts/extra",       f: f
  = render "contacts/web",         f: f
  = render "fields/groups",        f: f
  = render "entities/permissions", f: f, entity: @contact
  = hook(:entity_form, self, {f: f, entity: @contact})

  .buttonbar
    = f.submit t(:create_contact), onclick: "crm.create_contact()", class: 'btn btn-primary'
    #{t :or}
    = link_to_cancel new_contact_path