From 20f893e5b9f0926ede6ab05911d87c12622250e3 Mon Sep 17 00:00:00 2001 From: BoHung Chiu Date: Mon, 24 Apr 2023 10:22:37 +0800 Subject: [PATCH] Fix bug. --- app/views/admin/galleries/_form.html.erb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/views/admin/galleries/_form.html.erb b/app/views/admin/galleries/_form.html.erb index 14a1315..d3822c9 100644 --- a/app/views/admin/galleries/_form.html.erb +++ b/app/views/admin/galleries/_form.html.erb @@ -135,7 +135,14 @@ input.minicolors-input{ <%= t('gallery.thumb_resize_reference') %>
- <%= f.select :resize_gravity, [["---#{t("default")}: #{t("gallery.gravity.#{AlbumSetting::ResizeGravities[0]}")}---",nil]]+AlbumSetting::ResizeGravities.collect{|v| [t("gallery.gravity.#{v}"),v]} %> + <% + default_resize_gravity = AlbumSetting::ResizeGravities[0] + setting = AlbumSetting.first + if setting + default_resize_gravity = setting.resize_gravity + end + %> + <%= f.select :resize_gravity, [["---#{t("default")}: #{t("gallery.gravity.#{default_resize_gravity}")}---",nil]]+AlbumSetting::ResizeGravities.collect{|v| [t("gallery.gravity.#{v}"),v]} %>