Skip to content

Commit

Permalink
bank payment notice being deleted when a free ticket is selected
Browse files Browse the repository at this point in the history
  • Loading branch information
BrentyMcFatty authored and TomNaessens committed Mar 17, 2024
1 parent 964f3a1 commit debf60d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
11 changes: 11 additions & 0 deletions app/assets/javascripts/registrations.js
Original file line number Diff line number Diff line change
Expand Up @@ -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());

});
4 changes: 2 additions & 2 deletions app/views/registrations/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
<% end %>
</p>

<div class="well well-sm">
<div id="payment-info" class="well well-sm">
Payments can be done by bank transfer, <strong>not by credit card</strong>.
</div>

</div>
</div>

0 comments on commit debf60d

Please sign in to comment.