Address form: Add provinces for Italy

This commit is contained in:
Raphael Michel
2025-03-17 10:36:29 +01:00
committed by GitHub
parent 9581457d2f
commit 0cca053d45
11 changed files with 44 additions and 15 deletions

View File

@@ -40,7 +40,7 @@ from django.utils.translation import get_language_info
from django_scopes import get_scope
from i18nfield.strings import LazyI18nString
from pretix.base.settings import GlobalSettingsObject
from pretix.base.settings import COUNTRY_STATE_LABEL, GlobalSettingsObject
from pretix.helpers.i18n import (
get_javascript_format_without_seconds, get_moment_locale,
)
@@ -187,6 +187,7 @@ def _default_context(request):
ctx['html_locale'] = translation.get_language_info(get_language_without_region()).get('public_code', translation.get_language())
ctx['settings'] = pretix_settings
ctx['django_settings'] = settings
ctx['COUNTRY_STATE_LABEL'] = COUNTRY_STATE_LABEL
ctx['ie_deprecation_warning'] = 'MSIE' in request.headers.get('User-Agent', '') or 'Trident/' in request.headers.get('User-Agent', '')

View File

@@ -4,6 +4,7 @@
{% load money %}
{% load eventurl %}
{% load eventsignal %}
{% load getitem %}
{% block title %}{% trans "Review order" %}{% endblock %}
{% block content %}
<main aria-label="{% trans "Review order" %}">
@@ -92,7 +93,7 @@
<dt>{% trans "Country" %}</dt>
<dd>{{ addr.country.name }}</dd>
{% if addr.state %}
<dt>{% trans "State" context "address" %}</dt>
<dt>{% trans "State" context "address" as state_label %}{{ COUNTRY_STATE_LABEL|getitem:addr.country.code|default:state_label }}</dt>
<dd>{{ addr.state_name }}</dd>
{% endif %}
{% if request.event.settings.invoice_address_vatid and addr.vat_id %}

View File

@@ -200,8 +200,8 @@
<span data-toggle="tooltip" title="{% trans "Attendee address" %}">
{{ line.street|default_if_none:""|linebreaksbr }}<br>
{{ line.zipcode|default_if_none:"" }} {{ line.city|default_if_none:"" }}<br>
{% if line.state %}{{ line.state_for_address }}<br>{% endif %}
{{ line.country.name|default_if_none:"" }}
{% if line.state %}<br>{{ line.state }}{% endif %}
</span>
</dd>
{% endif %}

View File

@@ -7,6 +7,7 @@
{% load eventurl %}
{% load phone_format %}
{% load rich_text %}
{% load getitem %}
{% block title %}
{% if "thanks" in request.GET or "paid" in request.GET %}
{% trans "Thank you!" %}
@@ -319,7 +320,7 @@
<dt>{% trans "Country" %}</dt>
<dd>{{ order.invoice_address.country.name|default:order.invoice_address.country_old }}</dd>
{% if order.invoice_address.state %}
<dt>{% trans "State" context "address" %}</dt>
<dt>{% trans "State" context "address" as state_label %}{{ COUNTRY_STATE_LABEL|getitem:order.invoice_address.country.code|default:state_label }}</dt>
<dd>{{ order.invoice_address.state_name }}</dd>
{% endif %}
{% if request.event.settings.invoice_address_vatid and order.invoice_address.vat_id %}