Sha256: de396e2d39267de159a35a73bb7f6aaf818347a5815baeb493f3de9c6073b321

Contents?: true

Size: 982 Bytes

Versions: 18

Compression:

Stored size: 982 Bytes

Contents

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

- if @entity.errors.empty?
  - if called_from_landing_page?
    crm.flip_form('edit_#{entity_name}');
    crm.set_title('edit_#{entity_name}', '#{h @entity.name}');
    = refresh_sidebar(:show, :summary)
  - else
    $('##{id}').replaceWith('#{ j render(:partial => entity_name, :collection => [ @entity ]) }');
    $('##{id}').effect("highlight", { duration:1500 });
    = refresh_sidebar(:index, :filters)
- else
  $('##{id}').html('#{ j render(:partial => "edit") }');
  $('##{id}').effect("shake", { duration:250, distance: 6 });
  - if @campaign.errors[:name].blank? and @campaign.errors[:ends_on].present?
    $('#campaign_ends_on').focus();
  - else
    $('##{dom_id(@entity, :edit)} input[type!=hidden]').first().focus();

= hook(:entity_update, self, {entity: @entity})

Version data entries

18 entries across 18 versions & 2 rubygems

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