forked from CGM_Public/pretix_original
Show local time zone of visitor in more places
This commit is contained in:
@@ -115,8 +115,10 @@
|
|||||||
<ul class="addon-list">
|
<ul class="addon-list">
|
||||||
{{ pos.subevent.name }} · {{ pos.subevent.get_date_range_display }}
|
{{ pos.subevent.name }} · {{ pos.subevent.get_date_range_display }}
|
||||||
{% if pos.event.settings.show_times %}
|
{% if pos.event.settings.show_times %}
|
||||||
<span class="fa fa-clock-o"></span>
|
<span data-time="{{ pos.subevent.date_from.isoformat }}" data-timezone="{{ request.event.timezone }}">
|
||||||
{{ pos.subevent.date_from|date:"TIME_FORMAT" }}
|
<span class="fa fa-clock-o"></span>
|
||||||
|
{{ pos.subevent.date_from|date:"TIME_FORMAT" }}
|
||||||
|
</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -28,8 +28,10 @@
|
|||||||
{% if line.subevent %}
|
{% if line.subevent %}
|
||||||
<br /><span class="fa fa-calendar fa-fw"></span> {{ line.subevent.name }} · {{ line.subevent.get_date_range_display }}
|
<br /><span class="fa fa-calendar fa-fw"></span> {{ line.subevent.name }} · {{ line.subevent.get_date_range_display }}
|
||||||
{% if event.settings.show_times %}
|
{% if event.settings.show_times %}
|
||||||
<span class="fa fa-clock-o"></span>
|
<span data-time="{{ line.subevent.date_from.isoformat }}" data-timezone="{{ request.event.timezone }}" data-time-short>
|
||||||
{{ line.subevent.date_from|date:"TIME_FORMAT" }}
|
<span class="fa fa-clock-o"></span>
|
||||||
|
{{ line.subevent.date_from|date:"TIME_FORMAT" }}
|
||||||
|
</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|||||||
@@ -11,8 +11,10 @@
|
|||||||
<span class="fa fa-calendar"></span>
|
<span class="fa fa-calendar"></span>
|
||||||
{{ subev.get_date_range_display }}
|
{{ subev.get_date_range_display }}
|
||||||
{% if event.settings.show_times %}
|
{% if event.settings.show_times %}
|
||||||
<span class="fa fa-clock-o"></span>
|
<span data-time="{{ subev.date_from.isoformat }}" data-timezone="{{ event.timezone }}" data-time-short>
|
||||||
{{ subev.date_from|date:"TIME_FORMAT" }}
|
<span class="fa fa-clock-o"></span>
|
||||||
|
{{ subev.date_from|date:"TIME_FORMAT" }}
|
||||||
|
</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-2 text-right flip">
|
<div class="col-md-2 text-right flip">
|
||||||
|
|||||||
@@ -51,17 +51,15 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% if not event.continued %}
|
{% if not event.continued %}
|
||||||
{% if event.time %}
|
{% if event.time %}
|
||||||
<span class="event-time">
|
<span class="event-time" data-time="{{ event.event.date_from.isoformat }}" data-timezone="{{ event.timezone }}" data-time-short>
|
||||||
<span class="fa fa-clock-o"></span>
|
<span class="fa fa-clock-o"></span>
|
||||||
{% if not show_names|default_if_none:True %}
|
{% if not show_names|default_if_none:True %}
|
||||||
<strong>
|
<strong>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{{ event.time|date:"TIME_FORMAT" }}
|
{{ event.time|date:"TIME_FORMAT" }}
|
||||||
{% if event.time_end %}
|
{% if event.event.settings.show_date_to and event.time_end %}
|
||||||
– {{ event.time_end|date:"TIME_FORMAT" }}
|
– {{ event.time_end|date:"TIME_FORMAT" }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if event.event.settings.show_date_to and event. %}
|
|
||||||
{% endif %}
|
|
||||||
{% if not show_names|default_if_none:True %}
|
{% if not show_names|default_if_none:True %}
|
||||||
</strong>
|
</strong>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
@@ -37,7 +37,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% if not event.continued %}
|
{% if not event.continued %}
|
||||||
{% if event.time %}
|
{% if event.time %}
|
||||||
<span class="event-time">
|
<span class="event-time" data-time="{{ event.event.date_from.isoformat }}" data-timezone="{{ event.timezone }}" data-time-short>
|
||||||
<span class="fa fa-clock-o"></span>
|
<span class="fa fa-clock-o"></span>
|
||||||
{% if not show_names|default_if_none:True %}
|
{% if not show_names|default_if_none:True %}
|
||||||
<strong>
|
<strong>
|
||||||
|
|||||||
@@ -84,7 +84,7 @@
|
|||||||
{{ e.daterange|default:e.get_date_range_display }}
|
{{ e.daterange|default:e.get_date_range_display }}
|
||||||
{% if e.settings.show_times and not e.has_subevents %}
|
{% if e.settings.show_times and not e.has_subevents %}
|
||||||
{% timezone e.tzname %}
|
{% timezone e.tzname %}
|
||||||
<br><small class="text-muted">
|
<br><small class="text-muted" data-time="{{ e.date_from.isoformat }}" data-timezone="{{ e.tzname }}">
|
||||||
{{ e.date_from|date:"TIME_FORMAT" }}
|
{{ e.date_from|date:"TIME_FORMAT" }}
|
||||||
{% if e.settings.show_date_to and e.date_to and e.date_to.date == e.date_from.date %}
|
{% if e.settings.show_date_to and e.date_to and e.date_to.date == e.date_from.date %}
|
||||||
– {{ e.date_to|date:"TIME_FORMAT" }}
|
– {{ e.date_to|date:"TIME_FORMAT" }}
|
||||||
|
|||||||
@@ -424,7 +424,7 @@ $(function () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var local_tz = moment.tz.guess()
|
var local_tz = moment.tz.guess()
|
||||||
$("span[data-timezone]").each(function() {
|
$("span[data-timezone], small[data-timezone]").each(function() {
|
||||||
var t = moment.tz($(this).attr("data-time"), $(this).attr("data-timezone"))
|
var t = moment.tz($(this).attr("data-time"), $(this).attr("data-timezone"))
|
||||||
var tz = moment.tz.zone($(this).attr("data-timezone"))
|
var tz = moment.tz.zone($(this).attr("data-timezone"))
|
||||||
|
|
||||||
@@ -432,17 +432,22 @@ $(function () {
|
|||||||
'title': gettext("Time zone:") + " " + tz.abbr(t)
|
'title': gettext("Time zone:") + " " + tz.abbr(t)
|
||||||
});
|
});
|
||||||
if (t.tz(tz.name).format() !== t.tz(local_tz).format()) {
|
if (t.tz(tz.name).format() !== t.tz(local_tz).format()) {
|
||||||
var $add = $("<span>").addClass("text-muted")
|
var $add = $("<span>")
|
||||||
$add.append($("<span>").addClass("fa fa-globe"))
|
$add.append($("<span>").addClass("fa fa-globe"))
|
||||||
$add.append(" " + gettext("Your local time:") + " ")
|
if ($(this).is("[data-time-short]")) {
|
||||||
if (t.tz(tz.name).format("YYYY-MM-DD") != t.tz(local_tz).format("YYYY-MM-DD")) {
|
$add.append($("<em>").text(" " + t.tz(local_tz).format($("body").attr("data-timeformat"))))
|
||||||
$add.append(t.tz(local_tz).format($("body").attr("data-datetimeformat")))
|
|
||||||
} else {
|
} else {
|
||||||
$add.append(t.tz(local_tz).format($("body").attr("data-timeformat")))
|
$add.addClass("text-muted")
|
||||||
|
$add.append(" " + gettext("Your local time:") + " ")
|
||||||
|
if (t.tz(tz.name).format("YYYY-MM-DD") != t.tz(local_tz).format("YYYY-MM-DD")) {
|
||||||
|
$add.append(t.tz(local_tz).format($("body").attr("data-datetimeformat")))
|
||||||
|
} else {
|
||||||
|
$add.append(t.tz(local_tz).format($("body").attr("data-timeformat")))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$add.insertAfter($(this));
|
$add.insertAfter($(this));
|
||||||
$add.tooltip({
|
$add.tooltip({
|
||||||
'title': gettext("Time zone:") + " " + moment.tz.zone(local_tz).abbr(t)
|
'title': gettext("Time zone:") + " " + moment.tz.zone(local_tz).abbr(t),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user