mirror of
https://github.com/pretix/pretix.git
synced 2026-05-06 15:24:02 +00:00
Add sub-events and relative date settings (#503)
* Data model * little crud * SubEventItemForm etc * Drop SubEventItem.active, quota editor * Fix failing tests * First frontend stuff * Addons form stuff * Quota calculation * net price display on EventIndex * Add tests, solve some bugs * Correct quota selection in more places, consolidate pricing logic * Fix failing quota tests * Fix TypeError * Add tests for checkout * Fixed a bug in QuotaForm * Prevent immutable cart if a quota was removed from an item * Add tests for pricing * Handle waiting list * Filter in check-in list * Fixed import lost in rebase * Fix waiting list widget * Voucher management * Voucher redemption * Fix broken tests * Add subevents to OrderChangeManager * Create a subevent during event creation * Fix bulk voucher creation * Introduce subevent.active * Copy from for subevents * Show active in list * ICal download for subevents * Check start and end of presale * Failing tests / show cart logic * Test * Rebase migrations * REST API integration of sub-events * Integrate quota calculation into the traditional quota form * Make subevent argument to add_position optional * Log-display foo * pretixdroid and subevents * Filter by subevent * Add more tests * Some mor tests * Rebase fixes * More tests * Relative dates * Restrict selection in relative datetime widgets * Filter subevent list * Re-label has_subevents * Rebase fixes, subevents in calendar view * Performance and caching issues * Refactor calendar templates * Permission tests * Calendar fixes and month selection * subevent selection * Rename subevents to dates * Add tests for calendar views
This commit is contained in:
@@ -180,6 +180,29 @@ $(function () {
|
||||
$(this).datetimepicker(opts);
|
||||
});
|
||||
|
||||
$(".timepickerfield").each(function() {
|
||||
var opts = {
|
||||
format: $("body").attr("data-timeformat"),
|
||||
locale: $("body").attr("data-datetimelocale"),
|
||||
useCurrent: false,
|
||||
showClear: !$(this).prop("required"),
|
||||
icons: {
|
||||
time: 'fa fa-clock-o',
|
||||
date: 'fa fa-calendar',
|
||||
up: 'fa fa-chevron-up',
|
||||
down: 'fa fa-chevron-down',
|
||||
previous: 'fa fa-chevron-left',
|
||||
next: 'fa fa-chevron-right',
|
||||
today: 'fa fa-screenshot',
|
||||
clear: 'fa fa-trash',
|
||||
close: 'fa fa-remove'
|
||||
}
|
||||
};
|
||||
if ($(this).is('[data-is-payment-date]'))
|
||||
opts["daysOfWeekDisabled"] = JSON.parse($("body").attr("data-payment-weekdays-disabled"));
|
||||
$(this).datetimepicker(opts);
|
||||
});
|
||||
|
||||
$(".datetimepicker[data-date-after], .datepickerfield[data-date-after]").each(function() {
|
||||
var later_field = $(this),
|
||||
earlier_field = $($(this).attr("data-date-after")),
|
||||
|
||||
@@ -164,3 +164,14 @@ pre.mail-preview {
|
||||
.input-group-btn .btn {
|
||||
padding-bottom: 7px;
|
||||
}
|
||||
.reldatetime {
|
||||
input[type=text], select {
|
||||
display: inline-block;
|
||||
max-width: 200px;
|
||||
}
|
||||
input[type=number] {
|
||||
display: inline-block;
|
||||
width: 80px;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -52,6 +52,25 @@ $(function () {
|
||||
copy_answers(idx);
|
||||
});
|
||||
|
||||
// Subevent choice
|
||||
if ($(".subevent-toggle").length) {
|
||||
$(".subevent-list").hide();
|
||||
$(".subevent-toggle").css("display", "block").click(function() {
|
||||
$(".subevent-list").slideToggle(300);
|
||||
});
|
||||
}
|
||||
|
||||
$("#monthselform select").change(function () {
|
||||
$(this).closest("form").get(0).submit();
|
||||
});
|
||||
|
||||
$(".table-calendar td.has-events").click(function () {
|
||||
var $tr = $(this).closest(".table-calendar").find(".selected-day");
|
||||
$tr.find("td").html($(this).find(".events").html());
|
||||
$tr.find("td").prepend($("<h3>").text($(this).attr("data-date")));
|
||||
$tr.show();
|
||||
});
|
||||
|
||||
// Lightbox
|
||||
lightbox.init();
|
||||
});
|
||||
|
||||
@@ -33,4 +33,20 @@
|
||||
background: darken($brand-primary, 15%);
|
||||
}
|
||||
}
|
||||
}
|
||||
.selected-day {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
@media (max-width: $screen-xs-max) {
|
||||
.table-calendar .day .events {
|
||||
display: none;
|
||||
}
|
||||
.table-calendar td.day.has-events {
|
||||
background: $brand-primary;
|
||||
cursor: pointer;
|
||||
color: white;
|
||||
}
|
||||
.table-calendar td.day.has-events:hover {
|
||||
background: darken($brand-primary, 15%);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,3 +128,49 @@ section.front-page {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
}
|
||||
|
||||
.subevent-list {
|
||||
background-color: $body-bg;
|
||||
|
||||
form {
|
||||
padding: 10px 0;
|
||||
}
|
||||
|
||||
.row {
|
||||
margin: 0;
|
||||
}
|
||||
a.subevent-row {
|
||||
display: block;
|
||||
color: $text-color;
|
||||
padding: 3px 0;
|
||||
}
|
||||
a.subevent-row:nth-child(2n) {
|
||||
background-color: $gray-lighter;
|
||||
}
|
||||
a.subevent-row:hover {
|
||||
text-decoration: none;
|
||||
background-color: darken($gray-lighter, 10%);
|
||||
}
|
||||
.subevent-row .row > div {
|
||||
padding: 5px;
|
||||
min-height: 35px; /* label height */
|
||||
vertical-align: middle;
|
||||
}
|
||||
}
|
||||
.subevent-toggle {
|
||||
padding: 5px;
|
||||
text-align: center;
|
||||
background-color: darken($gray-lighter, 30%);
|
||||
display: none;
|
||||
color: white;
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
color: white;
|
||||
text-decoration: none;
|
||||
background-color: darken($gray-lighter, 40%);
|
||||
}
|
||||
}
|
||||
h2.subevent-head {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user