|
64 | 64 | <% end %> |
65 | 65 | </header> |
66 | 66 |
|
67 | | -<%= form_with(model: @submission, url: public_form_path(@form.code, @device.id), method: :post, scope: :submission) do |f| %> |
68 | | - <% if @submission.errors.any? %> |
69 | | - <div> |
70 | | - <h2><%= pluralize(@submission.errors.count, "error") %> prohibited this submission from being saved:</h2> |
71 | | - <ul> |
72 | | - <% @submission.errors.each do |error| %> |
73 | | - <li><%= error.full_message %></li> |
74 | | - <% end %> |
75 | | - </ul> |
76 | | - </div> |
77 | | - <% end %> |
| 67 | + <%= form_with(model: @submission, url: public_form_path(@form.code, @device.id), method: :post, scope: :submission) do |f| %> |
| 68 | + <% if @submission.errors.any? %> |
| 69 | + <div class="errors"> |
| 70 | + <h2><%= pluralize(@submission.errors.count, "error") %> prohibited this submission from being saved:</h2> |
| 71 | + <ul> |
| 72 | + <% @submission.errors.each do |error| %> |
| 73 | + <li><%= error.full_message %></li> |
| 74 | + <% end %> |
| 75 | + </ul> |
| 76 | + </div> |
| 77 | + <% end %> |
78 | 78 |
|
79 | | - <% if @form.enable_name %> |
80 | | - <div> |
81 | | - <%= f.label :name, @form.name_field_label %> |
82 | | - <%= f.text_field :name, required: @form.enable_name, placeholder: @form.name_field_placeholder %> |
83 | | - </div> |
84 | | - <% end %> |
| 79 | + <% if @form.enable_name %> |
| 80 | + <div class="name"> |
| 81 | + <%= f.label :name, @form.name_field_label %> |
| 82 | + <%= f.text_field :name, required: @form.enable_name, placeholder: @form.name_field_placeholder %> |
| 83 | + </div> |
| 84 | + <% end %> |
85 | 85 |
|
86 | | - <% if @form.enable_email_address %> |
87 | | - <div> |
88 | | - <%= f.label :email_address, @form.email_field_label %> |
89 | | - <%= f.email_field :email_address, required: @form.enable_email_address, placeholder: @form.email_field_placeholder %> |
90 | | - </div> |
91 | | - <% end %> |
| 86 | + <% if @form.enable_email_address %> |
| 87 | + <div class="email-address"> |
| 88 | + <%= f.label :email_address, @form.email_field_label %> |
| 89 | + <%= f.email_field :email_address, required: @form.enable_email_address, placeholder: @form.email_field_placeholder %> |
| 90 | + </div> |
| 91 | + <% end %> |
92 | 92 |
|
93 | | - <% if @form.enable_phone %> |
94 | | - <div> |
95 | | - <%= f.label :phone, @form.phone_field_label %> |
96 | | - <%= f.telephone_field :phone, required: @form.enable_phone, placeholder: @form.phone_field_placeholder %> |
97 | | - </div> |
98 | | - <% end %> |
| 93 | + <% if @form.enable_phone %> |
| 94 | + <div class="phone"> |
| 95 | + <%= f.label :phone, @form.phone_field_label %> |
| 96 | + <%= f.telephone_field :phone, required: @form.enable_phone, placeholder: @form.phone_field_placeholder %> |
| 97 | + </div> |
| 98 | + <% end %> |
99 | 99 |
|
100 | | - <% if @form.enable_address %> |
101 | | - <div> |
102 | | - <%= f.label :address, @form.address_field_label %> |
103 | | - <%= f.text_area :address, rows: 3, required: @form.enable_address, placeholder: @form.address_field_placeholder %> |
104 | | - </div> |
105 | | - <% end %> |
| 100 | + <% if @form.enable_address %> |
| 101 | + <div class="address"> |
| 102 | + <%= f.label :address, @form.address_field_label %> |
| 103 | + <%= f.text_area :address, rows: 3, required: @form.enable_address, placeholder: @form.address_field_placeholder %> |
| 104 | + </div> |
| 105 | + <% end %> |
106 | 106 |
|
107 | | - <% if @form.enable_postcode %> |
108 | | - <div> |
109 | | - <%= f.label :postcode, @form.postcode_field_label %> |
110 | | - <%= f.text_field :postcode, required: @form.enable_postcode, placeholder: @form.postcode_field_placeholder %> |
111 | | - </div> |
112 | | - <% end %> |
| 107 | + <% if @form.enable_postcode %> |
| 108 | + <div class="postcode"> |
| 109 | + <%= f.label :postcode, @form.postcode_field_label %> |
| 110 | + <%= f.text_field :postcode, required: @form.enable_postcode, placeholder: @form.postcode_field_placeholder %> |
| 111 | + </div> |
| 112 | + <% end %> |
113 | 113 |
|
114 | | - <% if @form.terms_and_conditions.present? %> |
115 | | - <div> |
116 | | - <h3>Terms & Conditions</h3> |
117 | | - <%= markdown(@form.terms_and_conditions) %> |
| 114 | + <% if @form.terms_and_conditions.present? %> |
| 115 | + <div class="terms-and-conditions"> |
| 116 | + <h3>Terms & Conditions</h3> |
| 117 | + <%= markdown(@form.terms_and_conditions) %> |
| 118 | + </div> |
| 119 | + <% end %> |
| 120 | + |
| 121 | + <div class="submit-button"> |
| 122 | + <%= f.submit @form.button_text %> |
118 | 123 | </div> |
119 | 124 | <% end %> |
120 | | - |
121 | | - <div> |
122 | | - <%= f.submit @form.button_text %> |
123 | | - </div> |
124 | | -<% end %> |
125 | 125 | </div> |
126 | 126 |
|
127 | 127 | <script> |
|
0 commit comments