mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Improve HTML to improve tests readability
- Specify `for` attribute to `<label />` element - Initialize component with its default value So, it's linked to its `<input />`
This commit is contained in:
@@ -15,17 +15,17 @@
|
||||
{include_blank: true, class: 'select2', 'ng-model' => 'q.state_eq'})
|
||||
.four.columns
|
||||
.field
|
||||
= label_tag nil, t(:order_number)
|
||||
= label_tag "q_number_cont", t(:order_number)
|
||||
= text_field_tag "q[number_cont]", nil, "ng-model" => "q.number_cont", "ng-keypress" => "$event.keyCode === 13 && fetchResults()"
|
||||
.field
|
||||
= label_tag nil, t(:email)
|
||||
= label_tag "q_email_cont", t(:email)
|
||||
= email_field_tag "q[email_cont", nil, "ng-model" => "q.email_cont", "ng-keypress" => "$event.keyCode === 13 && fetchResults()"
|
||||
.four.columns
|
||||
.field
|
||||
= label_tag nil, t(:first_name_begins_with)
|
||||
= label_tag "q_bill_address_firstname_start", t(:first_name_begins_with)
|
||||
= text_field_tag "q[bill_address_firstname_start]", nil, size: 25, "ng-model" => "q.bill_address_firstname_start", "ng-keypress" => "$event.keyCode === 13 && fetchResults()"
|
||||
.field
|
||||
= label_tag nil, t(:last_name_begins_with)
|
||||
= label_tag "q_bill_address_lastname_start", t(:last_name_begins_with)
|
||||
= text_field_tag "q[bill_address_lastname_start]", nil, size: 25, "ng-model" => "q.bill_address_lastname_start", "ng-keypress" => "$event.keyCode === 13 && fetchResults()"
|
||||
.omega.four.columns
|
||||
.field.checkbox
|
||||
@@ -36,7 +36,7 @@
|
||||
= label_tag nil, t(:shipping_method)
|
||||
= select_tag("shipping_method_id",
|
||||
options_for_select(Spree::ShippingMethod.managed_by(spree_current_user).collect {|s| [t("spree.shipping_method_names.#{s.name}"), s.id]}),
|
||||
{include_blank: true, class: 'select2', 'ng-model' => 'shipping_method_id'})
|
||||
{include_blank: true, class: 'select2', 'ng-model' => 'shipping_method_id', 'ng-value' => 'shipping_method_id'})
|
||||
.field-block.alpha.eight.columns
|
||||
= label_tag nil, t(:distributors)
|
||||
= select_tag("q[distributor_id_in]",
|
||||
|
||||
Reference in New Issue
Block a user