Skip to content

Commit

Permalink
include admin fields and translations
Browse files Browse the repository at this point in the history
  • Loading branch information
Crashillo committed Apr 4, 2024
1 parent 03ec242 commit ce8695a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,21 @@
<div class="row column">
<%= form.check_box :phone_number, label: t(".label"), help_text: t(".description") %>
</div>
<div class="row column pl-4">
<%
# TODO: move wherever it takes
def telephone_pattern
"^(\\+34)?[0-9]{9}$"
end

def telephone_placeholder
"+34987654321"
end
%>
<%# TODO: replace with the proper rails helpers fields %>
<label for=""><%= t(".pattern") %> <input type="text" placeholder="<%= telephone_pattern %>"></label>
<label for=""><%= t(".placeholder") %> <input type="text" placeholder="<%= telephone_placeholder %>"></label>
<%#= form.text_field :phone_number_pattern, label: t(".pattern"), placeholder: telephone_pattern %>
<%#= form.text_field :phone_number_placeholder, label: t(".placeholder"), placeholder: telephone_placeholder %>
</div>
</div>
4 changes: 3 additions & 1 deletion config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,11 @@ en:
in a location
label: Enable location field
phone_number:
description: This field is a String field. User will be able to fill
description: This field is a telephone field. User will be able to fill
in a phone number
label: Enable phone number field
pattern: Phone number pattern
placeholder: Phone number placeholder
postal_code:
description: This field is a String field. User will be able to fill
in a postal code
Expand Down

0 comments on commit ce8695a

Please sign in to comment.