Add expiry dates and individual conditions to gift cards (#1656)

* Add expiry dates and individual conditions to gift cards

* Display refund gift cards with more details and prettier interface

* Allow to set gift card expiry and conditions when cancelling event

* Extend gift card search

* Fix #1565 -- Some gift card filters

* Improve list of gift cards

* Allow to edit gift cards

* Note on validity
This commit is contained in:
Raphael Michel
2020-04-21 15:57:02 +02:00
committed by GitHub
parent d9fd4b33a0
commit f2844ac686
31 changed files with 450 additions and 70 deletions

View File

@@ -247,6 +247,12 @@ $(function () {
$tr.show();
});
$(".print-this-page").on("click", function (e) {
window.print();
e.preventDefault();
return true;
});
// Invoice address form
$("input[data-required-if]").each(function () {
var dependent = $(this),
@@ -263,24 +269,28 @@ $(function () {
dependency.closest('.form-group').find('input[name=' + dependency.attr("name") + ']').on("dp.change", update);
});
$("input[data-display-dependency]").each(function () {
$("input[data-display-dependency], div[data-display-dependency]").each(function () {
var dependent = $(this),
dependency = $($(this).attr("data-display-dependency")),
update = function (ev) {
var enabled = (dependency.attr("type") === 'checkbox' || dependency.attr("type") === 'radio') ? dependency.prop('checked') : !!dependency.val();
var $toggling = dependent;
if (dependent.get(0).tagName.toLowerCase() !== "div") {
$toggling = dependent.closest('.form-group');
}
if (ev) {
if (enabled) {
dependent.closest('.form-group').stop().slideDown();
$toggling.stop().slideDown();
} else {
dependent.closest('.form-group').stop().slideUp();
$toggling.stop().slideUp();
}
} else {
dependent.closest('.form-group').toggle(enabled);
$toggling.stop().toggle(enabled);
}
};
update();
dependency.closest('.form-group').find('input[name=' + dependency.attr("name") + ']').on("change", update);
dependency.closest('.form-group').find('input[name=' + dependency.attr("name") + ']').on("dp.change", update);
dependency.closest('.form-group, form').find('input[name=' + dependency.attr("name") + ']').on("change", update);
dependency.closest('.form-group, form').find('input[name=' + dependency.attr("name") + ']').on("dp.change", update);
});
$("select[name$=state]").each(function () {

View File

@@ -230,3 +230,8 @@ h2.subevent-head {
.info-download {
margin-top: 15px;
}
.refund-gift-card-code {
font-size: 24px;
font-family: $font-family-monospace;
padding: 8px 0;
}