mirror of
https://github.com/pretix/pretix.git
synced 2026-05-09 15:54:03 +00:00
Check-in rule editor: Add duplicate option
This commit is contained in:
@@ -119,6 +119,7 @@ $(document).ready(function () {
|
|||||||
date_tolerance: gettext('Tolerance (minutes)'),
|
date_tolerance: gettext('Tolerance (minutes)'),
|
||||||
condition_add: gettext('Add condition'),
|
condition_add: gettext('Add condition'),
|
||||||
minutes: gettext('minutes'),
|
minutes: gettext('minutes'),
|
||||||
|
duplicate: gettext('Duplicate'),
|
||||||
},
|
},
|
||||||
hasRules: false,
|
hasRules: false,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<div v-bind:class="classObject">
|
<div v-bind:class="classObject">
|
||||||
<div class="btn-group pull-right">
|
<div class="btn-group pull-right">
|
||||||
|
<button type="button" class="checkin-rule-remove btn btn-xs btn-default" @click.prevent="duplicate"
|
||||||
|
v-if="level > 0" data-toggle="tooltip" :title="texts.duplicate">
|
||||||
|
<span class="fa fa-copy"></span>
|
||||||
|
</button>
|
||||||
<button type="button" class="checkin-rule-remove btn btn-xs btn-default" @click.prevent="wrapWithOR">OR
|
<button type="button" class="checkin-rule-remove btn btn-xs btn-default" @click.prevent="wrapWithOR">OR
|
||||||
</button>
|
</button>
|
||||||
<button type="button" class="checkin-rule-remove btn btn-xs btn-default" @click.prevent="wrapWithAND">AND
|
<button type="button" class="checkin-rule-remove btn btn-xs btn-default" @click.prevent="wrapWithAND">AND
|
||||||
@@ -260,6 +264,10 @@
|
|||||||
remove: function () {
|
remove: function () {
|
||||||
this.$parent.rule[this.$parent.operator].splice(this.index, 1);
|
this.$parent.rule[this.$parent.operator].splice(this.index, 1);
|
||||||
},
|
},
|
||||||
|
duplicate: function () {
|
||||||
|
var r = JSON.parse(JSON.stringify(this.rule));
|
||||||
|
this.$parent.rule[this.$parent.operator].splice(this.index, 0, r);
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user