app/controllers/alchemy/admin/attachments_controller.rb in alchemy_cms-2.6.3 vs app/controllers/alchemy/admin/attachments_controller.rb in alchemy_cms-2.7.0
- old
+ new
@@ -18,24 +18,24 @@
def new
@attachment = Attachment.new
if in_overlay?
@while_assigning = true
- @content = Content.find(params[:content_id], :select => 'id') if !params[:content_id].blank?
+ @content = Content.find(params[:content_id], :select => 'id')
@swap = params[:swap]
- @options = hashified_options
+ @options = options_from_params
end
render :layout => !request.xhr?
end
def create
@attachment = Attachment.create!(:file => params[:Filedata])
if in_overlay?
@while_assigning = true
@content = Content.find(params[:content_id], :select => 'id') if !params[:content_id].blank?
@swap = params[:swap]
- @options = hashified_options
+ @options = options_from_params
end
@attachments = Attachment.find_paginated(params, per_page_value_for_screen_size, sort_order)
@message = _t('File %{name} uploaded succesfully', :name => @attachment.name)
# Are we using the Flash uploader? Or the plain html file uploader?
if params[Rails.application.config.session_options[:key]].blank?
@@ -62,11 +62,16 @@
def destroy
@attachment = Attachment.find(params[:id])
name = @attachment.name
@attachment.destroy
- flash[:notice] = _t("File: '%{name}' deleted successfully", :name => name)
+ @url = admin_attachments_url(
+ per_page: params[:per_page],
+ page: params[:page],
+ query: params[:query]
+ )
+ flash[:notice] = _t("File: '%{name}' deleted successfully", name: name)
end
def show
@attachment = Attachment.find(params[:id])
render layout: !request.xhr?
@@ -88,10 +93,10 @@
params[:content_id].present?
end
def archive_overlay
@content = Content.find(params[:content_id], select: 'id')
- @options = hashified_options
+ @options = options_from_params
respond_to do |format|
format.html {
render partial: 'archive_overlay'
}
format.js {