Sha256: a7d4ebe5b48f9a8e688f2f9438bb8776cebc6dbcb43f5b118553ac4235175eef

Contents?: true

Size: 1.14 KB

Versions: 3

Compression:

Stored size: 1.14 KB

Contents

class Admin::EssenceFilesController < AlchemyController

  filter_access_to :all
	helper :contents

  def edit
    @content = Content.find(params[:id])
    @essence_file = @content.essence
    render :layout => false
  end

  def update
    @essence_file = EssenceFile.find(params[:id])
    @essence_file.update_attributes(params[:essence_file])
    render :update do |page|
      page.call "Alchemy.closeCurrentWindow"
      page.call "Alchemy.reloadPreview"
    end
  end

  def assign
    @content = Content.find_by_id(params[:id])
    @attachment = Attachment.find_by_id(params[:attachment_id])
    @content.essence.attachment = @attachment
    @content.essence.save
    @content.save
    @options = params[:options]
    render :update do |page|
      page << "jQuery('##{@content.essence_type.underscore}_#{@content.id}').replaceWith('#{escape_javascript(render(:partial => "essences/essence_file_editor.html.erb", :locals => {:content => @content, :options => @options}))}')"
      page.call "Alchemy.closeCurrentWindow"
      page.call "Alchemy.reloadPreview"
      page.call "Alchemy.setElementDirty", "#element_#{@content.element.id}"
    end
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
alchemy_cms-2.0.7 app/controllers/admin/essence_files_controller.rb
alchemy_cms-2.0.6.1 app/controllers/admin/essence_files_controller.rb
alchemy_cms-2.0.5 app/controllers/admin/essence_files_controller.rb