Compare commits

...

2 Commits

Author SHA1 Message Date
Richard Schreiber
75b9d5e393 move webmanifest from presale to base urls 2025-06-30 09:24:25 +02:00
Richard Schreiber
1aa386bde9 Remove webmanifest from presale 2025-06-26 14:25:37 +02:00
7 changed files with 56 additions and 32 deletions

View File

@@ -0,0 +1,52 @@
#
# This file is part of pretix (Community Edition).
#
# Copyright (C) 2014-2020 Raphael Michel and contributors
# Copyright (C) 2020-2021 rami.io GmbH and contributors
#
# This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General
# Public License as published by the Free Software Foundation in version 3 of the License.
#
# ADDITIONAL TERMS APPLY: Pursuant to Section 7 of the GNU Affero General Public License, additional terms are
# applicable granting you additional permissions and placing additional restrictions on your usage of this software.
# Please refer to the pretix LICENSE file to obtain the full terms applicable to this work. If you did not receive
# this file, see <https://pretix.eu/about/en/license>.
#
# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
# details.
#
# You should have received a copy of the GNU Affero General Public License along with this program. If not, see
# <https://www.gnu.org/licenses/>.
#
from django.http import HttpResponse
from django.templatetags.static import static
from django.views.decorators.cache import cache_page
@cache_page(3600)
def webmanifest(request):
return HttpResponse(
"""{
"name": "",
"short_name": "",
"icons": [
{
"src": "%s",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "%s",
"sizes": "512x512",
"type": "image/png"
}
],
"theme_color": "#3b1c4a",
"background_color": "#3b1c4a",
"display": "standalone"
}""" % (
static('pretixbase/img/icons/android-chrome-192x192.png'),
static('pretixbase/img/icons/android-chrome-512x512.png'),
), content_type='text/json'
)

View File

@@ -20,7 +20,7 @@
{% endif %}
<link rel="apple-touch-icon" sizes="180x180" href="{% static "pretixbase/img/icons/apple-touch-icon.png" %}">
<link rel="icon" type="image/png" sizes="192x192" href="{% static "pretixbase/img/icons/android-chrome-192x192.png" %}">
<link rel="manifest" href="{% url "presale:site.webmanifest" %}">
<link rel="manifest" href="{% url "site.webmanifest" %}">
<link rel="mask-icon" href="{% static "pretixbase/img/icons/safari-pinned-tab.svg" %}" color="#3b1c4a">
<meta name="msapplication-TileColor" content="#3b1c4a">
<meta name="msapplication-config" content="{% url "presale:browserconfig.xml" %}">

View File

@@ -79,7 +79,7 @@
{% endif %}
<link rel="apple-touch-icon" sizes="180x180" href="{% static "pretixbase/img/icons/apple-touch-icon.png" %}">
<link rel="icon" type="image/png" sizes="192x192" href="{% static "pretixbase/img/icons/android-chrome-192x192.png" %}">
<link rel="manifest" href="{% url "presale:site.webmanifest" %}">
<link rel="manifest" href="{% url "site.webmanifest" %}">
<link rel="mask-icon" href="{% static "pretixbase/img/icons/safari-pinned-tab.svg" %}" color="#3b1c4a">
<meta name="msapplication-TileColor" content="#3b1c4a">
<meta name="msapplication-config" content="{% url "presale:browserconfig.xml" %}">

View File

@@ -37,7 +37,6 @@
<link rel="icon" type="image/png" sizes="192x192" href="{% static "pretixbase/img/icons/android-chrome-192x192.png" %}">
<link rel="apple-touch-icon" sizes="180x180" href="{% static "pretixbase/img/icons/apple-touch-icon.png" %}">
{% endif %}
<link rel="manifest" href="{% url "presale:site.webmanifest" %}">
<meta name="msapplication-TileColor" content="{{ settings.primary_color|default:"#3b1c4a" }}">
<meta name="msapplication-config" content="{% url "presale:browserconfig.xml" %}">
<meta name="theme-color" content="{{ settings.primary_color|default:"#3b1c4a" }}">

View File

@@ -236,6 +236,5 @@ locale_patterns = [
re_path(r'^locale/set$', pretix.presale.views.locale.LocaleSet.as_view(), name='locale.set'),
re_path(r'^robots.txt$', pretix.presale.views.robots.robots_txt, name='robots.txt'),
re_path(r'^browserconfig.xml$', pretix.presale.views.theme.browserconfig_xml, name='browserconfig.xml'),
re_path(r'^site.webmanifest$', pretix.presale.views.theme.webmanifest, name='site.webmanifest'),
path('widget/v<int:version>.<slug:lang>.js', pretix.presale.views.widget.widget_js, name='widget.js'),
]

View File

@@ -63,34 +63,6 @@ def browserconfig_xml(request):
)
@cache_page(3600)
def webmanifest(request):
return HttpResponse(
"""{
"name": "",
"short_name": "",
"icons": [
{
"src": "%s",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "%s",
"sizes": "512x512",
"type": "image/png"
}
],
"theme_color": "#3b1c4a",
"background_color": "#3b1c4a",
"display": "standalone"
}""" % (
static('pretixbase/img/icons/android-chrome-192x192.png'),
static('pretixbase/img/icons/android-chrome-512x512.png'),
), content_type='text/json'
)
@gzip_page
@condition(etag_func=lambda request, **kwargs: request.GET.get("version"))
def theme_css(request, **kwargs):

View File

@@ -43,6 +43,7 @@ from pretix.base.views import applepay, js_helpers
from .base.views import (
cachedfiles, csp, health, js_catalog, metrics, redirect, source,
webmanifest,
)
base_patterns = [
@@ -51,6 +52,7 @@ base_patterns = [
re_path(r'^healthcheck/$', health.healthcheck,
name='healthcheck'),
re_path(r'^redirect/$', redirect.redir_view, name='redirect'),
re_path(r'^site.webmanifest$', webmanifest.webmanifest, name='site.webmanifest'),
re_path(r'^jsi18n/(?P<lang>[a-zA-Z-_]+)/$', js_catalog.js_catalog, name='javascript-catalog'),
re_path(r'^metrics$', metrics.serve_metrics,
name='metrics'),