From debf60d3af6a46aa72ada394aaafd450c8fdda8d Mon Sep 17 00:00:00 2001
From: BrentyMcFatty
Date: Fri, 28 Oct 2022 00:59:50 +0200
Subject: [PATCH] bank payment notice being deleted when a free ticket is
selected
---
app/assets/javascripts/registrations.js | 11 +++++++++++
app/views/registrations/_form.html.erb | 4 ++--
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/app/assets/javascripts/registrations.js b/app/assets/javascripts/registrations.js
index 66b33b47..b79bd529 100644
--- a/app/assets/javascripts/registrations.js
+++ b/app/assets/javascripts/registrations.js
@@ -39,10 +39,21 @@ $(document).on('turbolinks:load', function() {
}
};
+ const hidePaymentInfoIfNeeded = function(value) {
+
+ if (value.search("€") === -1) {
+ $("#payment-info").hide();
+ } else {
+ $("#payment-info").show();
+ }
+ };
+
$("#registration_access_level").on('change', function() {
+ hidePaymentInfoIfNeeded($("option:selected", this).text());
return hideCommentFieldIfNeeded($(this).val());
});
+ hidePaymentInfoIfNeeded($("#registration_access_level option:selected").text());
return hideCommentFieldIfNeeded($("#registration_access_level").val());
});
diff --git a/app/views/registrations/_form.html.erb b/app/views/registrations/_form.html.erb
index 831aaeb4..a82830c2 100644
--- a/app/views/registrations/_form.html.erb
+++ b/app/views/registrations/_form.html.erb
@@ -17,8 +17,8 @@
<% end %>
-
+
Payments can be done by bank transfer, not by credit card.
-
+
\ No newline at end of file