Sha256: 2944d742f8f9a4db7ad2436472a63aca3795411b1403ce5bfe1fb959bb50ff62

Contents?: true

Size: 1.72 KB

Versions: 19

Compression:

Stored size: 1.72 KB

Contents

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

- if params[:cancel].true? # <--------------------- Hide [Edit]

  - if called_from_landing_page?
    crm.flip_form('convert_#{entity_name}');
    crm.set_title('convert_#{entity_name}', '#{h @entity.full_name}');
  - else                                            # Called from index page...
    $('##{id}').replaceWith('#{ j render(:partial => entity_name, :collection => [ @entity ]) }');

- else # <----------------------------------------  Show [Edit] form.

  - if params[:cancel].blank?                       # Called from index page...
    - if @previous                                  # Hide open [Edit] form if any.
      - if @previous.is_a?(@entity.class)
        $('##{dom_id(@previous)}').replaceWith('#{ j render(:partial => entity_name, :collection => [ @previous ]) }');
      - else
        crm.flick('#{entity_name}_#{@previous}', 'remove');
    -# Disable onMouseOver for the list item.
    crm.highlight_off('#{id}');
    -# Hide [Create] form if any.
    crm.hide_form('create_#{entity_name}')
    -# Show [Edit] form.
    $('##{id}').html('#{ j render(:partial => "convert") }');

  - elsif params[:cancel].false?                    # Called from title of the lead landing page...
    $('#convert_#{entity_name}').html('#{ j render(:partial => "convert") }');
    crm.hide_form('edit_lead');
    crm.flip_form('convert_#{entity_name}');
    crm.set_title('convert_#{entity_name}', "#{t :convert} #{h @entity.full_name}");

  crm.create_or_select_account(#{ request.referer =~ /\/accounts\// || @account.id.blank? });
  $('#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/leads/convert.js.haml
fat_free_crm-0.15.2 app/views/leads/convert.js.haml
fat_free_crm-0.16.4 app/views/leads/convert.js.haml
fat_free_crm-0.14.1 app/views/leads/convert.js.haml
fat_free_crm-0.15.1 app/views/leads/convert.js.haml
fat_free_crm-0.16.3 app/views/leads/convert.js.haml
fat_free_crm-0.16.2 app/views/leads/convert.js.haml
fat_free_crm-0.16.1 app/views/leads/convert.js.haml
fat_free_crm-0.16.0 app/views/leads/convert.js.haml
fat_free_crm-0.15.0 app/views/leads/convert.js.haml
fat_free_crm-0.15.0.beta.2 app/views/leads/convert.js.haml
fat_free_crm-0.15.0.beta app/views/leads/convert.js.haml
fat_free_crm-0.14.0 app/views/leads/convert.js.haml
reduced_fat_crm-0.15.0.beta app/views/leads/convert.js.haml
reduced_fat_crm-0.14.0 app/views/leads/convert.js.haml
fat_free_crm-0.13.6 app/views/leads/convert.js.haml
fat_free_crm-0.13.5 app/views/leads/convert.js.haml
fat_free_crm-0.13.4 app/views/leads/convert.js.haml
fat_free_crm-0.13.3 app/views/leads/convert.js.haml