Sha256: 843145f49ff4e4bd94b795e81ab8c6274fe6ec1a5e95a27da26e6787e1c9fc34

Contents?: true

Size: 1.05 KB

Versions: 19

Compression:

Stored size: 1.05 KB

Contents

- entity_name = controller.controller_name.singularize.underscore
- @entity = instance_variable_get("@#{entity_name}")
- create_id = "create_#{entity_name}"

- if @entity.valid?
  $('##{create_id}_arrow').html(crm.COLLAPSED);
  $('##{create_id}_title').html('#{ j t(entity_name.pluralize) }');
  $('##{create_id}').slideUp(250);
  $('##{entity_name.pluralize}').prepend('#{ j render(:partial => entity_name, :collection => [ @entity ]) }');
  $('##{dom_id(@entity)}').effect("highlight", { duration:1500 });

  - if called_from_index_page?
    = refresh_sidebar(:index)
    $('#paginate').html('#{ j render(:partial => "shared/paginate_with_per_page") }');
  - else
    $('#recently').replaceWith('#{ j render(:partial => "shared/recently") }');
  crm.flick('empty', 'remove');

- else
  $('##{create_id}').html('#{ j render(:partial => "new") }');
  crm.create_or_select_account(#{ request.referer =~ /\/accounts\// || @account.id.blank? });
  $('##{create_id}').effect("shake", { duration:250, distance: 6 });
  $('#new_#{entity_name} input[type!=hidden]').first().focus();

Version data entries

19 entries across 19 versions & 2 rubygems

Version Path
fat_free_crm-0.14.2 app/views/contacts/create.js.haml
fat_free_crm-0.15.2 app/views/contacts/create.js.haml
fat_free_crm-0.16.4 app/views/contacts/create.js.haml
fat_free_crm-0.14.1 app/views/contacts/create.js.haml
fat_free_crm-0.15.1 app/views/contacts/create.js.haml
fat_free_crm-0.16.3 app/views/contacts/create.js.haml
fat_free_crm-0.16.2 app/views/contacts/create.js.haml
fat_free_crm-0.16.1 app/views/contacts/create.js.haml
fat_free_crm-0.16.0 app/views/contacts/create.js.haml
fat_free_crm-0.15.0 app/views/contacts/create.js.haml
fat_free_crm-0.15.0.beta.2 app/views/contacts/create.js.haml
fat_free_crm-0.15.0.beta app/views/contacts/create.js.haml
fat_free_crm-0.14.0 app/views/contacts/create.js.haml
reduced_fat_crm-0.15.0.beta app/views/contacts/create.js.haml
reduced_fat_crm-0.14.0 app/views/contacts/create.js.haml
fat_free_crm-0.13.6 app/views/contacts/create.js.haml
fat_free_crm-0.13.5 app/views/contacts/create.js.haml
fat_free_crm-0.13.4 app/views/contacts/create.js.haml
fat_free_crm-0.13.3 app/views/contacts/create.js.haml