forked from CGM_Public/pretix_original
Scheduled exports (#3033)
This commit is contained in:
@@ -192,6 +192,13 @@ function async_task_error(jqXHR, textStatus, errorThrown) {
|
||||
$(function () {
|
||||
"use strict";
|
||||
$("body").on('submit', 'form[data-asynctask]', function (e) {
|
||||
// Not supported on IE, may lead to wrong results, but we don't support IE in the backend anymore
|
||||
var submitter = e.originalEvent ? e.originalEvent.submitter : null;
|
||||
|
||||
if (submitter && submitter.hasAttribute("data-no-asynctask")) {
|
||||
return;
|
||||
}
|
||||
|
||||
e.preventDefault();
|
||||
$(this).removeClass("dirty"); // Avoid problems with are-you-sure.js
|
||||
if ($("body").data('ajaxing')) {
|
||||
@@ -218,17 +225,19 @@ $(function () {
|
||||
'this page and try again.'
|
||||
));
|
||||
|
||||
var action = this.action;
|
||||
var formData = new FormData(this);
|
||||
formData.append('ajax', '1');
|
||||
// Not supported on IE, may lead to wrong results, but we don't support IE in the backend anymore
|
||||
var submitter = e.originalEvent ? e.originalEvent.submitter : null;
|
||||
if (submitter && submitter.name) {
|
||||
formData.append(submitter.name, submitter.value);
|
||||
}
|
||||
if (submitter && submitter.getAttribute("formaction")) {
|
||||
action = submitter.getAttribute("formaction");
|
||||
}
|
||||
$.ajax(
|
||||
{
|
||||
'type': 'POST',
|
||||
'url': this.action,
|
||||
'url': action,
|
||||
'data': formData,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
|
||||
21
src/pretix/static/pretixcontrol/js/ui/rrule.js
Normal file
21
src/pretix/static/pretixcontrol/js/ui/rrule.js
Normal file
@@ -0,0 +1,21 @@
|
||||
/*globals $, Morris, gettext, RRule, RRuleSet*/
|
||||
function rrule_form_toggles($form) {
|
||||
var freq = $form.find("select[name*=freq]").val();
|
||||
$form.find(".repeat-yearly").toggle(freq === "yearly");
|
||||
$form.find(".repeat-monthly").toggle(freq === "monthly");
|
||||
$form.find(".repeat-weekly").toggle(freq === "weekly");
|
||||
}
|
||||
|
||||
function rrule_bind_form($form) {
|
||||
$form.find("select[name*=freq]").change(function () {
|
||||
rrule_form_toggles($form);
|
||||
});
|
||||
rrule_form_toggles($form);
|
||||
}
|
||||
|
||||
|
||||
$(document).on("pretix:bind-forms", function () {
|
||||
$(".rrule-form").each(function () {
|
||||
rrule_bind_form($(this));
|
||||
});
|
||||
});
|
||||
@@ -122,20 +122,6 @@ $(document).on("pretix:bind-forms", function () {
|
||||
}
|
||||
}
|
||||
|
||||
function rrule_form_toggles($form) {
|
||||
var freq = $form.find("select[name*=freq]").val();
|
||||
$form.find(".repeat-yearly").toggle(freq === "yearly");
|
||||
$form.find(".repeat-monthly").toggle(freq === "monthly");
|
||||
$form.find(".repeat-weekly").toggle(freq === "weekly");
|
||||
}
|
||||
|
||||
function rrule_bind_form($form) {
|
||||
$form.find("select[name*=freq]").change(function () {
|
||||
rrule_form_toggles($form);
|
||||
});
|
||||
rrule_form_toggles($form);
|
||||
}
|
||||
|
||||
$("#subevent_add_many_slots_go").on("click", function () {
|
||||
$("#time-formset [data-formset-form]").each(function () {
|
||||
var tf = $(this).find("[name$=time_from]").val()
|
||||
@@ -186,7 +172,6 @@ $(document).on("pretix:bind-forms", function () {
|
||||
});
|
||||
rrule_preview();
|
||||
|
||||
$(".rrule-form").each(function () { rrule_bind_form($(this)); });
|
||||
$("#rrule-formset").on("formAdded", "div", function (event) { rrule_bind_form($(event.target)); });
|
||||
|
||||
var $namef = $("input[id^=id_name]").first();
|
||||
|
||||
@@ -78,7 +78,7 @@ div[data-formset-body], div[data-formset-form], div[data-nested-formset-form], d
|
||||
// btn-lg
|
||||
@include button-size($padding-large-vertical, $padding-large-horizontal, $font-size-large, $line-height-large, $btn-border-radius-large);
|
||||
}
|
||||
.btn-cancel {
|
||||
.btn-cancel, .btn-alternative {
|
||||
float: left !important;
|
||||
// btn-lg
|
||||
@include button-size($padding-large-vertical, $padding-large-horizontal, $font-size-large, $line-height-large, $btn-border-radius-large);
|
||||
@@ -461,7 +461,7 @@ table td > .checkbox input[type="checkbox"] {
|
||||
width: 100px;
|
||||
display: inline;
|
||||
}
|
||||
.form-horizontal [data-formset] .rrule-form .form-group {
|
||||
.form-horizontal .rrule-form .form-group {
|
||||
margin: 0;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user