mirror of
https://github.com/pretix/pretix.git
synced 2026-06-12 01:35:16 +00:00
use placeholder name as label default
This commit is contained in:
@@ -287,7 +287,10 @@ class PassStyle:
|
|||||||
*context.get("evaluation_context", [])
|
*context.get("evaluation_context", [])
|
||||||
)
|
)
|
||||||
if placeholder_value:
|
if placeholder_value:
|
||||||
return placeholder_value
|
return placeholder["label"], placeholder_value
|
||||||
|
|
||||||
|
return None, None
|
||||||
|
|
||||||
def get_pass_fields(self, layout, context):
|
def get_pass_fields(self, layout, context):
|
||||||
fields = {}
|
fields = {}
|
||||||
for group in self.fieldgroups:
|
for group in self.fieldgroups:
|
||||||
@@ -301,7 +304,10 @@ class PassStyle:
|
|||||||
if group.labels:
|
if group.labels:
|
||||||
field_entry["label"] = LazyI18nString(field["label"])
|
field_entry["label"] = LazyI18nString(field["label"])
|
||||||
if field["type"] == FieldEntryType.PLACEHOLDER.value:
|
if field["type"] == FieldEntryType.PLACEHOLDER.value:
|
||||||
field_entry["value"] = self.render_placeholder(context, group.content_type.value, field['content'])
|
label, field_entry["value"] = self.render_placeholder(context, group.content_type.value, field['content'])
|
||||||
|
if group.labels and not str(field_entry['label']) and label:
|
||||||
|
field_entry['label'] = LazyI18nString(label)
|
||||||
|
|
||||||
elif field["type"] == FieldEntryType.CUSTOM.value:
|
elif field["type"] == FieldEntryType.CUSTOM.value:
|
||||||
field_entry["value"] = LazyI18nString(field["content"])
|
field_entry["value"] = LazyI18nString(field["content"])
|
||||||
if "value" in field_entry and field_entry["value"]:
|
if "value" in field_entry and field_entry["value"]:
|
||||||
|
|||||||
Reference in New Issue
Block a user