Commit 96f036d0 authored by Birger Schacht's avatar Birger Schacht Committed by mh
Browse files

Use the html required attribute where applicable

parent 4597a359
Pipeline #8928 failed with stages
......@@ -43,11 +43,11 @@
<%= form_tag(app_passwords_path, method: "post") do %>
<div class="form-group">
<%= label_tag(:app_name, t(:app_name)) %>
<%= text_field_tag(:app_name, '', value: t(:app_name), autocomplete: 'off', class: "form-control") %>
<%= text_field_tag(:app_name, '', value: t(:app_name), autocomplete: 'off', class: "form-control", required: true) %>
</div>
<div class="form-group">
<%= label_tag(:password, t(:your_main_pw)) %>
<%= password_field_tag(:password, nil, placeholder: t(:enter_your_current_pw), class: "form-control") %>
<%= password_field_tag(:password, nil, placeholder: t(:enter_your_current_pw), class: "form-control", required: true) %>
</div>
<%= submit_tag(t(:generate), class: "btn btn-primary") %>
<% end %>
......
......@@ -24,11 +24,11 @@
<%= form_tag do %>
<div class="form-group">
<%= label_tag "CHF" %>
<%= text_field_tag('amount', "", class: 'form-control') %>
<%= text_field_tag('amount', "", class: 'form-control', required: true) %>
</div>
<div class="form-group">
<%= label_tag t("subject") %>
<%= text_field_tag('subject', "", class: 'form-control') %>
<%= text_field_tag('subject', "", class: 'form-control', required: true) %>
</div>
<%= submit_tag t(:create), name: 'create', class: "btn btn-primary" %>
......
......@@ -4,7 +4,7 @@
<div class="form-group row">
<%= label_tag(:pass, t(:your_main_pw), class: "col-form-label col-sm-3") %>
<div class="col-sm-8">
<%= password_field_tag(:pass, nil, class: "form-control", placeholder: t(:enter_your_current_pw)) %>
<%= password_field_tag(:pass, nil, class: "form-control", placeholder: t(:enter_your_current_pw), required: true) %>
</div>
</div>
<div class="form-group row">
......
......@@ -57,7 +57,7 @@
<%= form_tag(jabber_path, method: "post") do %>
<div class="form-group">
<%= label_tag(:jid_alias, t(:username)) %>
<%= text_field_tag(:jid_alias, "", class: 'form-control') %>
<%= text_field_tag(:jid_alias, "", class: 'form-control', required: true) %>
</div>
<div class="form-group">
<%= label_tag(:domain, t(:domain)) %>
......
......@@ -22,7 +22,7 @@
<%= form_tag(mail_crypt_token_path, method: "post") do %>
<div class="form-group">
<%= label_tag(:pass, (t :password_for_recovery_token)) %>
<%= password_field_tag(:pass, "", class: "form-control") %>
<%= password_field_tag(:pass, "", class: "form-control", required: true) %>
</div>
<div class="form-group">
<%= submit_tag(t(:recovery_token_show), class: "btn btn-primary") %>
......
......@@ -4,17 +4,17 @@
<%= form_tag(password_path, method: "post") do %>
<div class="form-group">
<%= label_tag(:old, (t :old_pw)) %>
<%= password_field_tag(:old, "", class: "form-control") %>
<%= password_field_tag(:old, "", class: "form-control", required: true) %>
</div>
<div class="form-group">
<%= label_tag(:new, (t :new_pw)) %>
<span id="pwscore"></span>
<%= password_field_tag(:new, "", class: "form-control") %>
<%= password_field_tag(:new, "", class: "form-control", required: true) %>
</div>
<div class="form-group">
<%= label_tag(:confirm, (t :confirm_pw)) %>
<span id="confirm_ok"></span>
<%= password_field_tag(:confirm, "", class: "form-control") %>
<%= password_field_tag(:confirm, "", class: "form-control", required: true) %>
</div>
<div class="form-group">
<%= submit_tag((t :change_pw), class: "btn btn-primary") %>
......
......@@ -27,7 +27,7 @@
<h5 class="card-title"><%= t(:pgpkeys_upload_key) %></h5>
<%= form_tag(pgpkeys_path, multipart: true) do %>
<div class="form-group">
<%= file_field_tag 'pgpkey' %>
<%= file_field_tag 'pgpkey', required: true %>
</div>
<div class="form-group">
<%= submit_tag t(:pgpkeys_submit_button), class: 'btn btn-primary' %>
......
......@@ -16,7 +16,7 @@
<%= form_tag(recovery_email_path, method: "post") do %>
<div class="form-group">
<%= label_tag(:recovery_email, (t :recovery_email) + (recovery_email_set? ? " (#{t(:present)})" : '')) %>
<%= text_field_tag(:recovery_email, '', value: @recovery_email, class: "form-control") %>
<%= text_field_tag(:recovery_email, '', value: @recovery_email, class: "form-control", required: true) %>
</div>
<% if mail_crypt_enabled? %>
......@@ -30,7 +30,7 @@
<div class="form-group">
<%= label_tag(:password, t(:your_main_pw)) %>
<%= password_field_tag(:password, nil, placeholder: t(:enter_your_current_pw), class: "form-control") %>
<%= password_field_tag(:password, nil, placeholder: t(:enter_your_current_pw), class: "form-control", required: true) %>
</div>
<div class="form-group">
......
......@@ -47,7 +47,7 @@ allowed = [q['max'].to_i - q['cur'].to_i, 0].max
select_tag('data_'+n, options_for_select(v), class: 'form-control')
end
else
text_field_tag('data_'+n, "", class: 'form-control')
text_field_tag('data_'+n, "", class: 'form-control', required: true)
end %>
</div>
<% end %>
......
......@@ -19,15 +19,15 @@
<%= hidden_field('', :secret, :value => totp_secret) %>
<div class="form-group">
<%= label_tag(:name, (t :name)) %>
<%= text_field_tag(:name, '', value: (existing_totps.any?{|t| t == 'default' } ? "default-#{random_label_suffix}" : 'default'), maxlength: 255, autocomplete: 'off', class: "form-control") %>
<%= text_field_tag(:name, '', value: (existing_totps.any?{|t| t == 'default' } ? "default-#{random_label_suffix}" : 'default'), maxlength: 255, autocomplete: 'off', class: "form-control", required: true) %>
</div>
<div class="form-group">
<%= label_tag(:pass, t(:your_main_pw)) %>
<%= password_field_tag(:password, nil, placeholder: t(:enter_your_current_pw), class: "form-control") %>
<%= password_field_tag(:password, nil, placeholder: t(:enter_your_current_pw), class: "form-control", required: true) %>
</div>
<div class="form-group">
<%= label_tag(:totp, t(:current_totp)) %>
<%= text_field_tag(:current_totp, nil, autocomplete: :off, class: "form-control") %>
<%= text_field_tag(:current_totp, nil, autocomplete: :off, class: "form-control", required: true) %>
</div>
<div class="form-group">
<%= submit_tag(t(:create), class: "btn btn-primary") %>
......
......@@ -5,11 +5,11 @@
<%= form_tag(tfa_webauthn_path, method: "post") do %>
<div class="form-group">
<%= label_tag(:name, (t :name)) %>
<%= text_field_tag(:name, '', value: (existing_webauthn_credentials.keys.any?{|t| t == 'default' } ? "default-#{random_label_suffix}" : 'default'), maxlength: 255, autocomplete: 'off', class: 'form-control') %>
<%= text_field_tag(:name, '', value: (existing_webauthn_credentials.keys.any?{|t| t == 'default' } ? "default-#{random_label_suffix}" : 'default'), maxlength: 255, autocomplete: 'off', class: 'form-control', required: true) %>
</div>
<div class="form-group">
<%= label_tag(:password, t(:your_main_pw)) %>
<%= password_field_tag(:password, nil, placeholder: t(:enter_your_current_pw), class: 'form-control') %>
<%= password_field_tag(:password, nil, placeholder: t(:enter_your_current_pw), class: 'form-control', required: true) %>
</div>
<div class="form-group">
<%= submit_tag(t(:register), class: "btn btn-primary") %>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment