From f492e8ff70d46db1f923b6d08196ed05d1c0eabd Mon Sep 17 00:00:00 2001 From: rhymes Date: Tue, 7 May 2019 22:10:16 +0200 Subject: [PATCH] Fix flagged settings accessibility problems (#2744) [ci skip] --- app/assets/stylesheets/settings.scss | 4 +-- app/views/users/_account.html.erb | 4 +-- app/views/users/_language_settings.html.erb | 2 +- app/views/users/_misc.html.erb | 28 ++++++++++----------- app/views/users/_org_admin.html.erb | 10 ++++---- app/views/users/_org_non_member.html.erb | 8 +++--- app/views/users/_profile.html.erb | 11 +++++--- 7 files changed, 35 insertions(+), 32 deletions(-) diff --git a/app/assets/stylesheets/settings.scss b/app/assets/stylesheets/settings.scss index bca778461..d0d4fd757 100755 --- a/app/assets/stylesheets/settings.scss +++ b/app/assets/stylesheets/settings.scss @@ -215,7 +215,7 @@ max-width: 100%; padding: 14px 0px; margin-top: 20px; - font-size: 1.8em; + font-size: 1.5em; cursor: pointer; &.danger-button { background: $red; @@ -247,7 +247,7 @@ } cursor: pointer; &.danger-button { - background-color: $red; + background-color: #b30000; color: $off-white; } &:disabled { diff --git a/app/views/users/_account.html.erb b/app/views/users/_account.html.erb index 5b831b75a..d306a22fe 100644 --- a/app/views/users/_account.html.erb +++ b/app/views/users/_account.html.erb @@ -1,7 +1,7 @@ <% unless @user.identities.exists?(provider: 'github') %>
- " /> CONNECT GITHUB ACCOUNT + " alt="github logo" /> CONNECT GITHUB ACCOUNT

@@ -10,7 +10,7 @@ <% unless @user.identities.exists?(provider: 'twitter') %>
<%= ApplicationConfig["APP_DOMAIN"] %>/users/auth/twitter/callback" class="big-button cta" data-no-instant> - " /> CONNECT TWITTER ACCOUNT + " alt="twitter logo" /> CONNECT TWITTER ACCOUNT

diff --git a/app/views/users/_language_settings.html.erb b/app/views/users/_language_settings.html.erb index 3b7fa5950..cf0b655bd 100644 --- a/app/views/users/_language_settings.html.erb +++ b/app/views/users/_language_settings.html.erb @@ -1,5 +1,5 @@

Languages

-

Select which languages you'd prefer to see in your feed (beta)

+

Select which languages you'd prefer to see in your feed (beta)

This setting controls which languages you are more likely to see throughout the site, but you may still see other languages, especially English.

diff --git a/app/views/users/_misc.html.erb b/app/views/users/_misc.html.erb index 08413026c..6534640ab 100644 --- a/app/views/users/_misc.html.erb +++ b/app/views/users/_misc.html.erb @@ -10,7 +10,7 @@ <% end %>

Features

-<%= form_for(@user) do |f| %> +<%= form_for(@user, html: { id: nil }) do |f| %>
<%= f.label :editor_version, "Editor version: v1 or v2" %> <%= f.select :editor_version, options_for_select(%w[v1 v2], @user.editor_version) %> @@ -18,12 +18,13 @@
- <%= f.hidden_field :tab, value: @tab %> + <%= f.hidden_field :tab, value: @tab, id: nil %> <%= f.submit "SUBMIT", class: "cta" %>
<% end %> +

Feed Customization

-<%= form_for(@user) do |f| %> +<%= form_for(@user, html: { id: nil }) do |f| %>
<%= f.label :experience_level, "Enter your coding experience level (1-10)" %> <%= f.text_field :experience_level %> @@ -31,12 +32,13 @@
- <%= f.hidden_field :tab, value: @tab %> + <%= f.hidden_field :tab, value: @tab, id: nil %> <%= f.submit "SUBMIT", class: "cta" %>
<% end %> +

Style Customization

-<%= form_for(@user) do |f| %> +<%= form_for(@user, html: { id: nil }) do |f| %>
<%= f.label :config_theme, "Site Theme" %> <%= f.select(:config_theme, options_for_select(["default", "night theme", "pink theme"], @user.config_theme.tr("_", " "))) %> @@ -49,7 +51,7 @@
- <%= f.hidden_field :tab, value: @tab %> + <%= f.hidden_field :tab, value: @tab, id: nil %> <%= f.submit "SUBMIT", class: "cta" %>
<% end %> @@ -60,8 +62,7 @@

You have the option to remove sponsor messaging (where it is practical to do so). Our wonderful sponsors help sustain the platform and improve your experience, and we strive to make their presence constructive to the community, but feel free to use this setting if you wish.

- -<%= form_for(@user) do |f| %> +<%= form_for(@user, html: { id: nil }) do |f| %>
<%= f.check_box :display_sponsors %> @@ -74,13 +75,12 @@
- <%= f.hidden_field :tab, value: @tab %> + <%= f.hidden_field :tab, value: @tab, id: nil %> <%= f.submit "SUBMIT", class: "cta" %>
<% end %>

Export content

- <% if @user.export_requested? %>

You have recently requested an export of your content. @@ -93,7 +93,7 @@ They will be emailed to your inbox.

- <%= form_for(@user) do |f| %> + <%= form_for(@user, html: { id: nil }) do |f| %>
<%= f.check_box :export_requested %> @@ -102,17 +102,15 @@
- <%= f.hidden_field :tab, value: @tab %> + <%= f.hidden_field :tab, value: @tab, id: nil %> <%= f.submit "SUBMIT", class: "cta" %>
<% end %> <% end %>

Connect

-

Inbox Type

- -<%= form_for(@user) do |f| %> +<%= form_for(@user, html: { id: nil }) do |f| %>
<%= f.label :inbox_type, "Open your inbox to messages from people you don't follow or keep your inbox private to mutual follows." %>
diff --git a/app/views/users/_org_admin.html.erb b/app/views/users/_org_admin.html.erb index 6e10d3f0a..40ba15e11 100644 --- a/app/views/users/_org_admin.html.erb +++ b/app/views/users/_org_admin.html.erb @@ -54,7 +54,7 @@
  • Paste the secret code below and click Join Organization
  • Your secret: (You should rotate this regularly)
    - + <%= form_tag "/organizations/generate_new_secret", onsubmit: "return confirm('Are you sure you want to generate a new secret? All outstanding secrets will be invalid.');" do %> <% end %> @@ -66,7 +66,7 @@ <%= f.text_field :name, maxlength: 50 %>
    - <%= f.label :username %> + <%= f.label :slug, "Username" %> <%= f.text_field :slug, maxlength: 18, minlength: 2 %> Your organization's URL is: https://dev.to/<%= @organization.slug %>
    @@ -135,7 +135,7 @@ /devteam/the-dev-badge-is-available-on-font-awesome-2ihe" target="_blank">DEV Team.
    - <%= f.label "Body text (Limited markdown — bold/italic/etc)" %> + <%= f.label :cta_body_markdown, "Body text (Limited markdown — bold/italic/etc)" %> <%= f.text_area :cta_body_markdown, maxlength: 256, placeholder: "**This is an example** _italic_ and **bold** is okay. Links, and headers etc. will not show up. @@ -143,11 +143,11 @@ _italic_ and **bold** is okay. Links, and headers etc. will not show up. 256 character limit." %>
    - <%= f.label "Link Text" %> + <%= f.label :cta_button_text, "Link Text" %> <%= f.text_field :cta_button_text, maxlength: 20, placeholder: "Limit of 20 characters" %>
    - <%= f.label "Link url" %> + <%= f.label :cta_button_url, "Link url" %> <%= f.text_field :cta_button_url, placeholder: "https://example.com" %>
    diff --git a/app/views/users/_org_non_member.html.erb b/app/views/users/_org_non_member.html.erb index be0c36486..37b7c4c03 100644 --- a/app/views/users/_org_non_member.html.erb +++ b/app/views/users/_org_non_member.html.erb @@ -20,7 +20,7 @@ <%= form_for @organization do |f| %>
    - <%= f.label "Name *" %> + <%= f.label :name, "Name *" %> <%= f.text_field :name %>
    @@ -29,7 +29,7 @@ Your organization URL will be dev.to/{username}
    - <%= f.label "Profile Image *" %> + <%= f.label :profile_image, "Profile Image *" %> <%= f.file_field :profile_image %>
    @@ -54,11 +54,11 @@
    - <%= f.label "Summary *" %> + <%= f.label :summary, "Summary *" %> <%= f.text_area :summary %>
    - <%= f.label "Proof *" %> + <%= f.label :proof, "Proof *" %> <%= f.text_area :proof, placeholder: "This is just a quick blurb indicating or link that shows that you clearly are associated with this organization." %>
    You must have your organization's permission to submit this form. Dishonesty may result in a permanent ban. diff --git a/app/views/users/_profile.html.erb b/app/views/users/_profile.html.erb index fbb416fb4..2dd6b84b9 100644 --- a/app/views/users/_profile.html.erb +++ b/app/views/users/_profile.html.erb @@ -4,7 +4,7 @@ <% unless @user.identities.exists?(provider: 'github') %> <% end %> @@ -12,12 +12,17 @@ <% unless @user.identities.exists?(provider: 'twitter') %> <% end %>

    - /<%= current_user.username %>"> + /<%= current_user.username %>" aria-label="Go to your profile page"> + DEV badge + Add the DEV badge to your personal site. Click here for the code

    <%= form_for(@user) do |f| %>