Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions hypha/apply/funds/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class ApplicationMustIncludeFieldBlock(MustIncludeFieldBlock):
class TitleBlock(ApplicationMustIncludeFieldBlock):
name = "title"
description = "The title of the project"
widget = forms.TextInput(attrs={"x-model.fill": "titleblock"})
field_label = blocks.CharBlock(
label=_("Label"), default=_("What is the title of your application?")
)
Expand All @@ -35,11 +36,17 @@ class TitleBlock(ApplicationMustIncludeFieldBlock):
label=_("Help text"),
default=_("This project name can be changed if a full proposal is requested."),
)
max_length = blocks.IntegerBlock(required=False, label=_("Max length"))

class Meta:
label = _("Application title")
icon = "tag"

def get_field_kwargs(self, struct_value):
kwargs = super().get_field_kwargs(struct_value)
kwargs["max_length"] = struct_value["max_length"]
return kwargs


class ValueBlock(ApplicationSingleIncludeFieldBlock):
name = "value"
Expand Down
Loading
Loading