File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ class ApplicationMustIncludeFieldBlock(MustIncludeFieldBlock):
2727class TitleBlock (ApplicationMustIncludeFieldBlock ):
2828 name = "title"
2929 description = "The title of the project"
30+ widget = forms .TextInput (attrs = {"x-model.fill" : "titleblock" })
3031 field_label = blocks .CharBlock (
3132 label = _ ("Label" ), default = _ ("What is the title of your application?" )
3233 )
@@ -35,11 +36,17 @@ class TitleBlock(ApplicationMustIncludeFieldBlock):
3536 label = _ ("Help text" ),
3637 default = _ ("This project name can be changed if a full proposal is requested." ),
3738 )
39+ max_length = blocks .IntegerBlock (required = False , label = _ ("Max length" ))
3840
3941 class Meta :
4042 label = _ ("Application title" )
4143 icon = "tag"
4244
45+ def get_field_kwargs (self , struct_value ):
46+ kwargs = super ().get_field_kwargs (struct_value )
47+ kwargs ["max_length" ] = struct_value ["max_length" ]
48+ return kwargs
49+
4350
4451class ValueBlock (ApplicationSingleIncludeFieldBlock ):
4552 name = "value"
You can’t perform that action at this time.
0 commit comments