From 32f1ab75e94dcd21105a346f6c1b1cd4d518a111 Mon Sep 17 00:00:00 2001 From: Carlo Beltrame Date: Mon, 5 Dec 2022 15:19:42 +0100 Subject: [PATCH 1/2] Use tenant_type for determining which tenant we are in --- .../decidim/system/organizations/_smtp_settings.html.erb | 2 +- config/initializers/decidim_ocl_customization.rb | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/app/views/decidim/system/organizations/_smtp_settings.html.erb b/app/views/decidim/system/organizations/_smtp_settings.html.erb index 0f33243..a63f18e 100644 --- a/app/views/decidim/system/organizations/_smtp_settings.html.erb +++ b/app/views/decidim/system/organizations/_smtp_settings.html.erb @@ -26,7 +26,7 @@

<%= t("decidim.system.models.organization.fields.tenant_type") %>

<%= f.select :tenant_type, - [:deinklima], + [:dialogluzern, :deinklima, :gemeinsamerspace], { include_blank: t("decidim.system.organizations.tenant_type.none") }, { multiple: false } %>
diff --git a/config/initializers/decidim_ocl_customization.rb b/config/initializers/decidim_ocl_customization.rb index 4c84092..1e8ab9f 100644 --- a/config/initializers/decidim_ocl_customization.rb +++ b/config/initializers/decidim_ocl_customization.rb @@ -34,13 +34,7 @@ Decidim.config[:devise_custom_scope] = lambda { |org, base = nil| base ||= %i[decidim_ocl devise] - org_scope = - case org.id - when 2 then :dialogluzern - when 7 then :deinklima - when 8 then :gemeinsamerspace - else :other - end + org_scope = (org.tenant_type || 'other').to_sym # Ensure that the current tenant is using custom translations for the devise mails base + [org_scope] if I18n.t(org_scope, scope: base, default: nil) From 0729b6caced593f567db3824d24478b7cf073564 Mon Sep 17 00:00:00 2001 From: Carlo Beltrame Date: Tue, 6 Dec 2022 10:05:32 +0100 Subject: [PATCH 2/2] Update app/views/decidim/system/organizations/_smtp_settings.html.erb Co-authored-by: Thomas Burkhalter --- app/views/decidim/system/organizations/_smtp_settings.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/decidim/system/organizations/_smtp_settings.html.erb b/app/views/decidim/system/organizations/_smtp_settings.html.erb index a63f18e..c1b38a6 100644 --- a/app/views/decidim/system/organizations/_smtp_settings.html.erb +++ b/app/views/decidim/system/organizations/_smtp_settings.html.erb @@ -26,7 +26,7 @@

<%= t("decidim.system.models.organization.fields.tenant_type") %>

<%= f.select :tenant_type, - [:dialogluzern, :deinklima, :gemeinsamerspace], + [:dialogluzern, :deinklima, :gemeinsamerspace, :winterthur], { include_blank: t("decidim.system.organizations.tenant_type.none") }, { multiple: false } %>