mirror of
https://github.com/pretix/pretix.git
synced 2025-12-14 13:32:28 +00:00
Compare commits
1 Commits
plaintext-
...
i18n-field
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e06c9225fa |
@@ -222,6 +222,12 @@ class RelativeDateTimeWidget(forms.MultiWidget):
|
|||||||
def get_context(self, name, value, attrs):
|
def get_context(self, name, value, attrs):
|
||||||
ctx = super().get_context(name, value, attrs)
|
ctx = super().get_context(name, value, attrs)
|
||||||
ctx['required'] = self.status_choices[0][0] == 'unset'
|
ctx['required'] = self.status_choices[0][0] == 'unset'
|
||||||
|
|
||||||
|
ctx['rendered_subwidgets'] = [
|
||||||
|
self._render(w['template_name'], {**ctx, 'widget': w})
|
||||||
|
for w in ctx['widget']['subwidgets']
|
||||||
|
]
|
||||||
|
|
||||||
return ctx
|
return ctx
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -11,10 +11,9 @@
|
|||||||
{% if selopt.value == "absolute" %}
|
{% if selopt.value == "absolute" %}
|
||||||
{% include widget.subwidgets.1.template_name with widget=widget.subwidgets.1 %}
|
{% include widget.subwidgets.1.template_name with widget=widget.subwidgets.1 %}
|
||||||
{% elif selopt.value == "relative" %}
|
{% elif selopt.value == "relative" %}
|
||||||
{% include widget.subwidgets.2.template_name with widget=widget.subwidgets.2 %}
|
{% blocktrans trimmed with number=rendered_subwidgets.2 relation=rendered_subwidgets.4 relation_to=rendered_subwidgets.3 %}
|
||||||
{% trans "days" %}
|
{{ number }} days {{ relation }} {{ relation_to }}
|
||||||
{% include widget.subwidgets.4.template_name with widget=widget.subwidgets.4 %}
|
{% endblocktrans %}
|
||||||
{% include widget.subwidgets.3.template_name with widget=widget.subwidgets.3 %}
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|||||||
@@ -11,17 +11,13 @@
|
|||||||
{% if selopt.value == "absolute" %}
|
{% if selopt.value == "absolute" %}
|
||||||
{% include widget.subwidgets.1.template_name with widget=widget.subwidgets.1 %}
|
{% include widget.subwidgets.1.template_name with widget=widget.subwidgets.1 %}
|
||||||
{% elif selopt.value == "relative_minutes" %}
|
{% elif selopt.value == "relative_minutes" %}
|
||||||
{% include widget.subwidgets.5.template_name with widget=widget.subwidgets.5 %}
|
{% blocktrans trimmed with number=rendered_subwidgets.5 relation=rendered_subwidgets.7 relation_to=rendered_subwidgets.3 %}
|
||||||
{% trans "minutes" %}
|
{{ number }} minutes {{ relation }} {{ relation_to }}
|
||||||
{% include widget.subwidgets.7.template_name with widget=widget.subwidgets.7 %}
|
{% endblocktrans %}
|
||||||
{% include widget.subwidgets.3.template_name with widget=widget.subwidgets.3 %}
|
|
||||||
{% elif selopt.value == "relative" %}
|
{% elif selopt.value == "relative" %}
|
||||||
{% include widget.subwidgets.2.template_name with widget=widget.subwidgets.2 %}
|
{% blocktrans trimmed with number=rendered_subwidgets.2 relation=rendered_subwidgets.8 relation_to=rendered_subwidgets.6 time_of_day=rendered_subwidgets.4 %}
|
||||||
{% trans "days" %}
|
{{ number }} days {{ relation }} {{ relation_to }} at {{ time_of_day }}
|
||||||
{% include widget.subwidgets.8.template_name with widget=widget.subwidgets.8 %}
|
{% endblocktrans %}
|
||||||
{% include widget.subwidgets.6.template_name with widget=widget.subwidgets.6 %}
|
|
||||||
{% trans "at" %}
|
|
||||||
{% include widget.subwidgets.4.template_name with widget=widget.subwidgets.4 %}
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|||||||
Reference in New Issue
Block a user