forked from CGM_Public/pretix_original
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:
@@ -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 () {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user