From 9abbb5d09b3e21b1ea186a25e32c64c092271a13 Mon Sep 17 00:00:00 2001 From: BoHung Chiu Date: Wed, 5 Jul 2023 09:26:28 +0800 Subject: [PATCH] Updated. --- app/controllers/custom_galleries_controller.rb | 5 ++++- app/models/custom_album.rb | 2 +- .../admin/{images => custom_images}/batch_crop.html.erb | 0 .../admin/{images => custom_images}/crop_process.html.erb | 0 .../admin/{images => custom_images}/edit_image.html.erb | 0 app/views/admin/{images => custom_images}/show.html.erb | 0 .../admin/{images => custom_images}/upload_panel.html.erb | 0 source.txt | 1 + 8 files changed, 6 insertions(+), 2 deletions(-) rename app/views/admin/{images => custom_images}/batch_crop.html.erb (100%) rename app/views/admin/{images => custom_images}/crop_process.html.erb (100%) rename app/views/admin/{images => custom_images}/edit_image.html.erb (100%) rename app/views/admin/{images => custom_images}/show.html.erb (100%) rename app/views/admin/{images => custom_images}/upload_panel.html.erb (100%) create mode 100644 source.txt diff --git a/app/controllers/custom_galleries_controller.rb b/app/controllers/custom_galleries_controller.rb index d4b0f7f..64ea006 100644 --- a/app/controllers/custom_galleries_controller.rb +++ b/app/controllers/custom_galleries_controller.rb @@ -133,7 +133,10 @@ class CustomGalleriesController < ApplicationController def self.custom_widget_data @custom_configs = CustomAlbumConfig.all.to_a ac = ActionController::Base.new - ac.render_to_string("custom_galleries/custom_widget_data",:locals=>{:@custom_data_field=>@custom_data_field,:@custom_configs=>@custom_configs,:@field_name=>@field_name}) + ac.instance_variable_set(:@custom_data_field, @custom_data_field) + ac.instance_variable_set(:@custom_configs, @custom_configs) + ac.instance_variable_set(:@field_name, @field_name) + ac.render_to_string("custom_galleries/custom_widget_data") end def custom_album_widget @custom_album_setting = CustomAlbumSetting.first diff --git a/app/models/custom_album.rb b/app/models/custom_album.rb index 20013a6..9ae92a3 100644 --- a/app/models/custom_album.rb +++ b/app/models/custom_album.rb @@ -45,7 +45,7 @@ class CustomAlbum target_model = custom_album_config.bind_model.constantize rescue nil if target_model target_record = target_model.where(custom_album_config.uid_field=>self.bind_uid).first - target_record.send(custom_album_config.custom_record_callback,num) + target_record.send(custom_album_config.custom_record_callback,num) if target_record end end end diff --git a/app/views/admin/images/batch_crop.html.erb b/app/views/admin/custom_images/batch_crop.html.erb similarity index 100% rename from app/views/admin/images/batch_crop.html.erb rename to app/views/admin/custom_images/batch_crop.html.erb diff --git a/app/views/admin/images/crop_process.html.erb b/app/views/admin/custom_images/crop_process.html.erb similarity index 100% rename from app/views/admin/images/crop_process.html.erb rename to app/views/admin/custom_images/crop_process.html.erb diff --git a/app/views/admin/images/edit_image.html.erb b/app/views/admin/custom_images/edit_image.html.erb similarity index 100% rename from app/views/admin/images/edit_image.html.erb rename to app/views/admin/custom_images/edit_image.html.erb diff --git a/app/views/admin/images/show.html.erb b/app/views/admin/custom_images/show.html.erb similarity index 100% rename from app/views/admin/images/show.html.erb rename to app/views/admin/custom_images/show.html.erb diff --git a/app/views/admin/images/upload_panel.html.erb b/app/views/admin/custom_images/upload_panel.html.erb similarity index 100% rename from app/views/admin/images/upload_panel.html.erb rename to app/views/admin/custom_images/upload_panel.html.erb diff --git a/source.txt b/source.txt new file mode 100644 index 0000000..9e211c5 --- /dev/null +++ b/source.txt @@ -0,0 +1 @@ +http://gitlab.tp.rulingcom.com/chiu/custom_gallery.git \ No newline at end of file