forked from CGM_Public/pretix_original
Fix -- copy answers even when matching customer profiles exist (#2209)
This commit is contained in:
committed by
GitHub
parent
2041d1213a
commit
2a3660f2d1
@@ -50,7 +50,7 @@
|
|||||||
<div id="invoice" class="profile-scope" data-profiles-id="addresses_json">
|
<div id="invoice" class="profile-scope" data-profiles-id="addresses_json">
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
{% if addresses_data %}
|
{% if addresses_data %}
|
||||||
<div class="form-group profile-select-container">
|
<div class="form-group profile-select-container js-do-not-copy-answers">
|
||||||
<label class="col-md-3 control-label" for="address-list-select">{% trans "Auto-fill with address" %}</label>
|
<label class="col-md-3 control-label" for="address-list-select">{% trans "Auto-fill with address" %}</label>
|
||||||
<div class="col-md-9">
|
<div class="col-md-9">
|
||||||
<p class="profile-select-control">
|
<p class="profile-select-control">
|
||||||
@@ -160,7 +160,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
<div data-idx="{{ forloop.parentloop.counter0 }}" data-addonidx="{{ forloop.counter0 }}" class="profile-scope{% if form.pos.item != pos.item %}{% if profiles_data %} profile-add-on{% endif %}{% endif %}">
|
<div data-idx="{{ forloop.parentloop.counter0 }}" data-addonidx="{{ forloop.counter0 }}" class="profile-scope{% if form.pos.item != pos.item %}{% if profiles_data %} profile-add-on{% endif %}{% endif %}">
|
||||||
{% if profiles_data %}
|
{% if profiles_data %}
|
||||||
<div class="form-group profile-select-container">
|
<div class="form-group profile-select-container js-do-not-copy-answers">
|
||||||
<label class="col-md-3 control-label" for="profile-select-{{ forloop.parentloop.counter0 }}-{{ forloop.counter0 }}">{% trans "Auto-fill with profile" %}</label>
|
<label class="col-md-3 control-label" for="profile-select-{{ forloop.parentloop.counter0 }}-{{ forloop.counter0 }}">{% trans "Auto-fill with profile" %}</label>
|
||||||
<div class="col-md-9">
|
<div class="col-md-9">
|
||||||
<p class="profile-select-control">
|
<p class="profile-select-control">
|
||||||
|
|||||||
@@ -481,10 +481,12 @@ $(function () {
|
|||||||
|
|
||||||
function copy_answers(elements, answers) {
|
function copy_answers(elements, answers) {
|
||||||
elements.not("[disabled], [readonly]").each(function (index) {
|
elements.not("[disabled], [readonly]").each(function (index) {
|
||||||
|
if (!this.name) return;
|
||||||
var input = $(this),
|
var input = $(this),
|
||||||
tagName = input.prop('tagName').toLowerCase(),
|
tagName = input.prop('tagName').toLowerCase(),
|
||||||
attributeType = input.attr('type'),
|
attributeType = input.attr('type'),
|
||||||
suffix = input.attr('name').split('-')[1];
|
suffix = input.attr('name').split('-')[1];
|
||||||
|
if (input.closest(".js-do-not-copy-answers").length) return;
|
||||||
|
|
||||||
switch (tagName) {
|
switch (tagName) {
|
||||||
case "textarea":
|
case "textarea":
|
||||||
|
|||||||
@@ -341,7 +341,7 @@ function questions_init_profiles(el) {
|
|||||||
var $checkboxContainer = $checkbox.closest(".form-group").addClass("profile-save");
|
var $checkboxContainer = $checkbox.closest(".form-group").addClass("profile-save");
|
||||||
var $help = $selectContainer.find(".help-block");
|
var $help = $selectContainer.find(".help-block");
|
||||||
|
|
||||||
var $container = $("<div class='profile-save-container'></div>");
|
var $container = $("<div class='profile-save-container js-do-not-copy-answers'></div>");
|
||||||
$selectContainer.after($container);
|
$selectContainer.after($container);
|
||||||
$container.append($checkboxContainer);
|
$container.append($checkboxContainer);
|
||||||
$container.append($selectContainer);
|
$container.append($selectContainer);
|
||||||
|
|||||||
Reference in New Issue
Block a user