Skip to content

Commit 3686c40

Browse files
committed
remove horizontal_field_wrapper
1 parent 3957c26 commit 3686c40

File tree

3 files changed

+3
-32
lines changed

3 files changed

+3
-32
lines changed

docs/source/layout.md

+3-6
Original file line numberDiff line numberDiff line change
@@ -117,16 +117,13 @@ What is more, after creating `Accordion` component, you can also use them in nor
117117

118118
Some people might have heard of a horizontal form, where the field labels and fields are arranged side by side
119119

120-
To make it work, please check below code
120+
To make it work, please use below code
121121

122122
```python
123123
form.formify_helper = FormifyHelper()
124124
form.formify_helper.field_wrapper_class = "md:flex md:items-center mb-6"
125-
form.formify_helper.field_wrapper_component = (
126-
"formify.tw.horizontal_field_wrapper"
127-
)
125+
form.formify_helper.label_container_class = "md:w-1/3"
126+
form.formify_helper.field_container_class = "md:w-2/3"
128127
```
129128

130-
`formify.tw.horizontal_field_wrapper` is a Component (built on django-viewcomponent) for horizontal layout, it can add css classes to the `label` and `field` to make them display side by side.
131-
132129
![](./images/horizontal_form.jpg)

src/django_formify/components/tw/field_wrapper.py

-11
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,3 @@ class FieldWrapperComponent(component.Component):
99
field_helper_text_and_errors = RendersOneField()
1010

1111
template_name = "formify/tailwind/components/field_wrapper.html"
12-
13-
14-
@component.register("formify.tw.horizontal_field_wrapper")
15-
class HorizontalFieldWrapperComponent(FieldWrapperComponent):
16-
"""
17-
The css classes are hard coded in this component.
18-
19-
But you can also set them in the formify_helper instance and get them in the template using formify_helper.xxx
20-
"""
21-
22-
template_name = "formify/tailwind/components/horizontal_field_wrapper.html"

src/django_formify/templates/formify/tailwind/components/horizontal_field_wrapper.html

-15
This file was deleted.

0 commit comments

Comments
 (0)