From 46df77f0e04a472fb344e26a6f6d0b338dff2ee8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B1=E5=8D=9A=E4=BA=9E?= Date: Sat, 18 Feb 2023 11:26:07 +0800 Subject: [PATCH] add crop option --- app/assets/javascripts/theater.js | 3 ++- app/uploaders/gallery_uploader.rb | 2 ++ config/locales/en.yml | 1 + config/locales/zh_tw.yml | 1 + 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/theater.js b/app/assets/javascripts/theater.js index 6a411c7..43a7ab3 100644 --- a/app/assets/javascripts/theater.js +++ b/app/assets/javascripts/theater.js @@ -1,6 +1,7 @@ $('.show-gallery .show-content.col-sm-2').ready(function() { if ($('.show-gallery .show-content.col-sm-2').eq(0).css('float') == 'left') { - $('.show-gallery .show-content.col-sm-2').eq(0).parent().css('float', 'left') + $('.show-gallery .show-content.col-sm-2').eq(0).parent().css('float', 'left'); + $('.show-gallery .show-content.col-sm-2').eq(0).parent().css('width', '100%'); } }) window.GalleryTheater = function() { diff --git a/app/uploaders/gallery_uploader.rb b/app/uploaders/gallery_uploader.rb index eaef6b3..82bf8b7 100644 --- a/app/uploaders/gallery_uploader.rb +++ b/app/uploaders/gallery_uploader.rb @@ -182,6 +182,8 @@ class GalleryUploader < CarrierWave::Uploader::Base resize_and_pad(w, h, (transparent? ? :transparent : now_album.album_colors.first['color']), (now_album.resize_gravity rescue 'Center')) when 1 limit_process(w, h) + when 2 + resize_to_fill(w, h) end end end diff --git a/config/locales/en.yml b/config/locales/en.yml index afb6350..b64c6a6 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -7,6 +7,7 @@ en: thumb_process_option: - resize and padding - resize only + - resize and crop inner_page_layout: Inner Page Layout card_style: Card Style grid_style: Grid Style diff --git a/config/locales/zh_tw.yml b/config/locales/zh_tw.yml index 5e72d6b..1b54c49 100644 --- a/config/locales/zh_tw.yml +++ b/config/locales/zh_tw.yml @@ -7,6 +7,7 @@ zh_tw: thumb_process_option: - 縮放並填充 - 僅縮放 + - 縮放並裁切 inner_page_layout: 內頁頁面樣式 card_style: 卡片樣式 grid_style: 格子排版樣式