Sha256: 4d0c62db0830ae069186fbdbca72677dc5434632798e45e93bc1430ec4aa4a04

Contents?: true

Size: 817 Bytes

Versions: 5

Compression:

Stored size: 817 Bytes

Contents

partial = params[:assets].singularize

if @attached
  if partial == "task"
    view = if @attachment.completed?
      "completed"
    elsif @attachment.my?(current_user)
      "pending"
    else
      "assigned"
    end
    page.insert_html :top, :tasks, :partial => "tasks/#{view}", :collection => [ @attachment ], :locals => { :bucket => @attachment.computed_bucket }

  else
    page.insert_html :top, params[:assets], :partial => "#{params[:assets]}/#{partial}", :collection => [ @attachment ]
    if called_from_landing_page?(:accounts)
      page << refresh_sidebar_for(:accounts, :show, :summary)
    elsif called_from_landing_page?(:campaigns)
      page << refresh_sidebar_for(:campaigns, :show, :summary)
    end
  end
end

page["#{partial}_#{params[:asset_id]}"].visual_effect :highlight, :duration => 1.5

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
fat_free_crm-0.12.3 app/views/entities/attach.js.rjs
fat_free_crm-0.12.2 app/views/entities/attach.js.rjs
fat_free_crm-0.12.1 app/views/entities/attach.js.rjs
fat_free_crm-0.12.0 app/views/entities/attach.js.rjs
fat_free_crm-0.11.4 app/views/entities/attach.js.rjs