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