@@ -11,24 +11,34 @@ In this chapter, you will discover how to:
11
11
- Change the action of the form.
12
12
- Stylize the form thanks to Bootstrap variables.
13
13
14
+ .. _website_themes/forms/default_forms :
15
+
14
16
Default form
15
17
============
16
18
17
- To add a form to your page, you can simply copy and paste the code generated by the Website Builder
18
- in your view.
19
+ To add a form to a page, copy and paste the code generated by the Website Builder in the page.
19
20
20
21
It should look something like the following.
21
22
22
23
.. code-block :: xml
23
24
24
- <form action =" /website/form/" method =" post" enctype =" multipart/form-data" class =" o_mark_required" data-mark =" *" data-pre-fill =" true" data-success-mode =" redirect" data-success-page =" /contactus-thank-you" data-model_name =" mail.mail" >
25
+ <form
26
+ action =" /website/form/" method =" post"
27
+ enctype =" multipart/form-data"
28
+ class =" o_mark_required"
29
+ data-mark =" *" data-pre-fill =" true"
30
+ data-success-mode =" redirect"
31
+ data-success-page =" /contactus-thank-you"
32
+ data-model_name =" mail.mail" >
25
33
<div class =" s_website_form_rows row s_col_no_bgcolor" >
26
- <div class =" form-group s_website_form_field col-12 s_website_form_dnone" data-name =" Field" >
27
- <!-- form fields -->
34
+ <div class =" form-group s_website_form_field col-12 s_website_form_dnone" data-name =" Field" >
35
+ <!-- Form fields -->
28
36
</div >
29
37
</div >
30
38
</form >
31
39
40
+ .. _website_themes/forms/actions :
41
+
32
42
Actions
33
43
=======
34
44
@@ -71,10 +81,22 @@ Create a task.
71
81
72
82
<form data-model_name =" project.task" >
73
83
84
+ .. note ::
85
+
86
+ The default action is :guilabel: `Send an E-mail ` but following the Apps installed on the database, some
87
+ other options can be found, such as: Apply for a job, create a customer, create a ticket, create an
88
+ opportunity, etc.
89
+
90
+ Please, note that some of these actions may need specific required fields in order to be
91
+ functional. To not forget some requirements, we highly recommend to preset the form snippet with
92
+ the Website Builder and copy/paste the generated source code.
93
+
94
+ .. _website_themes/forms/success :
95
+
74
96
Success
75
97
=======
76
98
77
- You can also define what happens once the form is submitted thanks to the `data-success-mode `.
99
+ Define what happens once the form is submitted thanks to the `data-success-mode ` attribute .
78
100
79
101
Redirect the user to a page defined in the `data-success-page `.
80
102
@@ -88,8 +110,8 @@ Show a message (on the same page).
88
110
89
111
<form data-success-mode =" message" >
90
112
91
- You can add your success message directly under the form tag. Always add the `d-none ` class to make
92
- sure that your success message is hidden if the form hasn't been submitted.
113
+ Add a success message directly under the form tag. Always add the `d-none ` class to make
114
+ sure that the success message is hidden if the form hasn't been submitted.
93
115
94
116
.. code-block :: xml
95
117
@@ -102,33 +124,3 @@ sure that your success message is hidden if the form hasn't been submitted.
102
124
</section >
103
125
</div >
104
126
</div >
105
-
106
- Bootstrap variables
107
- ===================
108
-
109
- As you already know, the Website Builder creates content based on Bootstrap. This is also true for
110
- forms. Below you can find a selection of Bootstrap variables, or check out the `full list of
111
- variables <https://github.com/twbs/bootstrap/blob/main/scss/_variables.scss> `_.
112
-
113
- .. code-block :: scss
114
- :caption: ``/website_airproof/static/src/scss/bootstrap_overridden.scss``
115
-
116
- $input-padding-y: $input-btn-padding-y !default;
117
- $input-padding-x: $input-btn-padding-x !default;
118
-
119
- $input-font-family: $input-btn-font-family !default;
120
- $input-font-size: $input-btn-font-size !default;
121
- $input-font-weight: $font-weight-base !default;
122
- $input-line-height: $input-btn-line-height !default;
123
-
124
- $input-color: $gray-700 !default;
125
- $input-border-color: $gray-400 !default;
126
- $input-border-width: $input-btn-border-width !default;
127
- $input-box-shadow: inset 0 1px 1px rgba($black, .075) !default;
128
- $input-border-radius: $border-radius !default;
129
-
130
- $input-focus-bg: $input-bg !default;
131
- $input-focus-border-color: lighten($component-active-bg, 25%) !default;
132
- $input-focus-color: $input-color !default;
133
- $input-focus-width: $input-btn-focus-width !default;
134
- $input-focus-box-shadow: $input-btn-focus-box-shadow !default;
0 commit comments