Sha256: e8c8d54962550163e7a5f23830b787f16fc35a3355b7fbae657c9b283f30eaeb

Contents?: true

Size: 1.32 KB

Versions: 8

Compression:

Stored size: 1.32 KB

Contents

- entity_name = controller.controller_name.singularize.underscore #account
- @entity = instance_variable_get("@#{entity_name}")
- id = called_from_landing_page? ? "convert_#{entity_name}" : dom_id(@entity)

- if @entity.status == "converted"
  - if called_from_landing_page?
    crm.flip_form('convert_#{entity_name}');
    crm.set_title('convert_#{entity_name}', '#{h @entity.full_name}');
    = refresh_sidebar(:show, :summary)
  - else
    $('##{id}').replaceWith('#{ j render(partial: entity_name, collection: [ @entity ]) }');
    $('##{id}').effect("highlight", { duration:1500 });
    - if called_from_index_page?
      = refresh_sidebar(:index, :filters)
    - elsif called_from_landing_page?("campaigns")
      = refresh_sidebar_for(:campaigns, :show, :summary)
      - if @opportunity.id # Make sure the opportunity has been saved.
        $('#opportunities').prepend('#{ j render(partial: "opportunities/opportunity", collection: [ @opportunity ]) }');
    - else
      $('#recently').replaceWith('#{ j render(partial: "shared/recently") }');

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

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
fat_free_crm-0.19.2 app/views/leads/promote.js.haml
fat_free_crm-0.19.0 app/views/leads/promote.js.haml
fat_free_crm-0.18.2 app/views/leads/promote.js.haml
fat_free_crm-0.17.3 app/views/leads/promote.js.haml
fat_free_crm-0.18.1 app/views/leads/promote.js.haml
fat_free_crm-0.18.0 app/views/leads/promote.js.haml
fat_free_crm-0.17.2 app/views/leads/promote.js.haml
fat_free_crm-0.17.1 app/views/leads/promote.js.haml