From e626002260dea9663bc5ef839fd270f96ab4d18c Mon Sep 17 00:00:00 2001 From: rhymes Date: Thu, 9 May 2019 17:16:03 +0200 Subject: [PATCH] Add alternative texts to images (#2771) [ci skip] --- README.md | 32 +++----- .../initializers/initializeBaseUserData.js | 13 ++- .../initializers/initializeLiveArticle.js.erb | 7 +- .../utilities/buildArticleHTML.js.erb | 2 +- .../utilities/buildCommentHTML.js.erb | 2 +- app/helpers/application_helper.rb | 13 ++- .../__snapshots__/articleForm.test.jsx.snap | 4 + app/javascript/article-form/articleForm.jsx | 8 +- .../__snapshots__/article.test.jsx.snap | 3 + .../__snapshots__/userDetails.test.jsx.snap | 8 ++ app/javascript/chat/article.jsx | 4 +- app/javascript/chat/userDetails.jsx | 4 + app/javascript/src/Onboarding.jsx | 1 + .../__snapshots__/Onboarding.test.jsx.snap | 11 +++ .../github_tag/github_issue_tag.rb | 2 +- .../github_tag/github_readme_tag.rb | 2 +- app/liquid_tags/medium_tag.rb | 2 +- .../_article_followable_area.html.erb | 20 +++-- app/views/articles/_actions.html.erb | 4 +- app/views/articles/_markdown_form.html.erb | 4 +- .../articles/_podcast_episodes_feed.html.erb | 3 +- app/views/articles/_single_story.html.erb | 2 +- app/views/articles/_sticky_nav.html.erb | 8 +- app/views/articles/_v2_form.html.erb | 12 +-- app/views/articles/edit.html.erb | 2 +- app/views/articles/show.html.erb | 2 +- app/views/articles/tags/_sidebar.html.erb | 2 +- app/views/badges/show.html.erb | 2 +- app/views/comments/_comment_proper.html.erb | 2 +- app/views/dashboards/show.html.erb | 2 +- .../registrations/_registration_form.html.erb | 4 +- app/views/events/_event.html.erb | 8 +- app/views/events/index.html.erb | 2 +- .../fields/carrierwave_field/_form.html.erb | 2 +- .../fields/carrierwave_field/_index.html.erb | 2 +- .../fields/carrierwave_field/_show.html.erb | 2 +- .../internal/events/_event_form.html.erb | 2 +- app/views/internal/events/index.html.erb | 4 +- app/views/internal/users/_mentee_match.erb | 4 +- app/views/layouts/_signup_modal.html.erb | 8 +- app/views/layouts/_top_bar.html.erb | 8 +- app/views/liquids/_tweet.html.erb | 34 ++++---- ...new_membership_subscription_email.html.erb | 2 +- ...subscription_update_confirm_email.html.erb | 2 +- .../notify_mailer/new_badge_email.html.erb | 2 +- .../scholarship_awarded_email.html.erb | 2 +- app/views/moderations/mod.html.erb | 8 +- .../_aggregated_reactions.html.erb | 5 +- app/views/notifications/_comment.html.erb | 2 +- .../_notifications_list.html.erb | 4 +- app/views/notifications/_reaction.html.erb | 3 +- .../notifications/_signup_cta_test.html.erb | 2 +- .../notifications/_tagadjustment.html.erb | 2 +- .../shared/_comment_box.html.erb | 12 +-- .../_sidebar_additional.html.erb | 2 +- app/views/pages/about.html.erb | 34 +------- app/views/pages/badges.html.erb | 4 +- app/views/pages/generator.html.erb | 82 +++++++++---------- app/views/pages/information.html.erb | 10 +-- app/views/pages/live.html.erb | 4 +- app/views/pages/now.html.erb | 2 +- app/views/pages/rlyweb.html.erb | 80 +++++++++--------- app/views/pages/shecoded.html.erb | 10 +-- app/views/pages/sponsors.html.erb | 4 +- app/views/pages/workshops.html.erb | 2 +- .../podcast_episodes/_episodes_feed.html.erb | 3 +- app/views/podcast_episodes/_liquid.html.erb | 81 +++++++++--------- .../podcast_episodes/_podcast_bar.html.erb | 9 +- app/views/podcast_episodes/admin.html.erb | 3 +- app/views/podcast_episodes/edit.html.erb | 4 +- app/views/podcast_episodes/show.html.erb | 18 ++-- app/views/social_previews/article.html.erb | 2 +- app/views/social_previews/shecoded.html.erb | 2 +- app/views/social_previews/tag.html.erb | 2 +- app/views/social_previews/user.html.erb | 4 +- app/views/users/_account.html.erb | 8 +- app/views/users/_liquid.html.erb | 12 +-- app/views/users/_profile_header.html.erb | 24 +++--- app/views/users/_sidebar_additional.html.erb | 4 +- app/views/users/show.html.erb | 26 +++--- public/404.html | 14 +--- public/503.html | 6 +- spec/models/classified_listing_spec.rb | 4 +- .../github_liquid_tag_default.approved.html | 2 +- .../liquid_tweet_tag_spec.approved.html | 8 +- 85 files changed, 393 insertions(+), 386 deletions(-) diff --git a/README.md b/README.md index ba81acdf241f0..09ce45b1e3e09 100644 --- a/README.md +++ b/README.md @@ -1,35 +1,31 @@

- DEV + DEV

DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

The Human Layer of the Stack
-
+

- ruby version + ruby version - rails version + rails version - Travis Status for thepracticaldev/dev.to + Travis Status for thepracticaldev/dev.to - + Code Climate maintainability - + Code Climate test coverage - Skylight badge + Skylight badge - CodeTriage badge + CodeTriage badge

@@ -242,14 +238,10 @@ Our version of the CLA was adapted from the Microsoft Contributor License Agreem Any questions, please refer to our [license FAQ](http://docs.dev.to/license-faq/) doc or email yo@dev.to -
+

- sloan -
+ Sloan, the sloth mascot +
Happy Coding ❀️

diff --git a/app/assets/javascripts/initializers/initializeBaseUserData.js b/app/assets/javascripts/initializers/initializeBaseUserData.js index d4de5bd17b3c4..cc3590c544414 100644 --- a/app/assets/javascripts/initializers/initializeBaseUserData.js +++ b/app/assets/javascripts/initializers/initializeBaseUserData.js @@ -57,7 +57,9 @@ function initializeUserSidebar(user) { function initializeUserProfileContent(user) { document.getElementById('sidebar-profile-pic').innerHTML = - ''; document.getElementById('sidebar-profile-name').innerHTML = filterXSS( @@ -73,12 +75,17 @@ function addRelevantButtonsToArticle(user) { var articleContainer = document.getElementById('article-show-container'); if (articleContainer) { if (parseInt(articleContainer.dataset.authorId) == user.id) { - var manageButtonHTML = 'MANAGE' + var manageButtonHTML = + 'MANAGE'; document.getElementById('action-space').innerHTML = 'EDIT' + - (JSON.parse(articleContainer.dataset.published) == true ? manageButtonHTML : "") + (JSON.parse(articleContainer.dataset.published) == true + ? manageButtonHTML + : ''); } else if (user.trusted) { document.getElementById('action-space').innerHTML = '#"+t+""}).join(" ") - return '<%=image_tag("/assets/cancel.svg")%>\ + return '<%= image_tag("/assets/cancel.svg", alt: "cancel live") %>\
\
Live Now
\
'+article.title+'
\ -
'+article.user.name+'
\ +
'+user.name+''+user.name+'
\
'+tagsHTML+'
\
' } @@ -73,4 +74,4 @@ function checkForOnPage(article){ } } }); -} \ No newline at end of file +} diff --git a/app/assets/javascripts/utilities/buildArticleHTML.js.erb b/app/assets/javascripts/utilities/buildArticleHTML.js.erb index 31ba2921cb480..8914444c6b422 100644 --- a/app/assets/javascripts/utilities/buildArticleHTML.js.erb +++ b/app/assets/javascripts/utilities/buildArticleHTML.js.erb @@ -104,7 +104,7 @@ function buildArticleHTML(article) { } var videoHTML = ''; if (article.cloudinary_video_url) { - videoHTML = '
" />'+article.video_duration_in_minutes+'
' + videoHTML = '
" alt="video camera">'+article.video_duration_in_minutes+'
' } var timeAgoInWords = ''; if (article.published_at_int) { diff --git a/app/assets/javascripts/utilities/buildCommentHTML.js.erb b/app/assets/javascripts/utilities/buildCommentHTML.js.erb index 5748ac56c2416..41518d9293522 100644 --- a/app/assets/javascripts/utilities/buildCommentHTML.js.erb +++ b/app/assets/javascripts/utilities/buildCommentHTML.js.erb @@ -38,7 +38,7 @@ function buildCommentHTML(comment) {
\
\ \ - \ + '+comment.user.username+'\ '+comment.user.name+'\ \ '+twitterIcon+'\ diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 9237b4f4c6ab6..0633a60109b44 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -69,7 +69,7 @@ def title_with_timeframe(page_title:, timeframe:, content_for: false) end def icon(name, pixels = "20") - image_tag icon_url(name), alt: name, class: "icon-img", height: pixels, width: pixels + image_tag(icon_url(name), alt: name, class: "icon-img", height: pixels, width: pixels) end def icon_url(name) @@ -183,12 +183,11 @@ def list_path end def logo_svg - logo = if ApplicationConfig["LOGO_SVG"].present? - ApplicationConfig["LOGO_SVG"].html_safe - else - inline_svg("devplain.svg", class: "logo", size: "20% * 20%") - end - logo + if ApplicationConfig["LOGO_SVG"].present? + ApplicationConfig["LOGO_SVG"].html_safe + else + inline_svg("devplain.svg", class: "logo", size: "20% * 20%", aria: true, title: "App logo") + end end def community_qualified_name diff --git a/app/javascript/article-form/__tests__/__snapshots__/articleForm.test.jsx.snap b/app/javascript/article-form/__tests__/__snapshots__/articleForm.test.jsx.snap index 1838d70361af3..30710be59e046 100644 --- a/app/javascript/article-form/__tests__/__snapshots__/articleForm.test.jsx.snap +++ b/app/javascript/article-form/__tests__/__snapshots__/articleForm.test.jsx.snap @@ -39,6 +39,7 @@ exports[` renders properly 1`] = ` onClick={[Function]} > upload images IMAGES @@ -48,6 +49,7 @@ exports[` renders properly 1`] = ` onClick={[Function]} > open overlay menu @@ -65,6 +67,7 @@ exports[` renders properly 1`] = ` onClick={[Function]} > upload images IMAGES @@ -74,6 +77,7 @@ exports[` renders properly 1`] = ` onClick={[Function]} > open overlay menu diff --git a/app/javascript/article-form/articleForm.jsx b/app/javascript/article-form/articleForm.jsx index b26ba288f813a..af93210410b13 100644 --- a/app/javascript/article-form/articleForm.jsx +++ b/app/javascript/article-form/articleForm.jsx @@ -321,7 +321,7 @@ export default class ArticleForm extends Component { className="articleform__detailsButton articleform__detailsButton--image" onClick={this.toggleImageManagement} > - + upload images {' '} IMAGES @@ -329,7 +329,7 @@ IMAGES className="articleform__detailsButton articleform__detailsButton--moreconfig" onClick={this.toggleMoreConfig} > - + open overlay menu
- + upload images {' '} IMAGES @@ -348,7 +348,7 @@ IMAGES className="articleform__detailsButton articleform__detailsButton--moreconfig articleform__detailsButton--bottom" onClick={this.toggleMoreConfig} > - + open overlay menu
); diff --git a/app/javascript/chat/__tests__/__snapshots__/article.test.jsx.snap b/app/javascript/chat/__tests__/__snapshots__/article.test.jsx.snap index 57ae568305790..cc9ed24fc3b17 100644 --- a/app/javascript/chat/__tests__/__snapshots__/article.test.jsx.snap +++ b/app/javascript/chat/__tests__/__snapshots__/article.test.jsx.snap @@ -86,6 +86,7 @@ exports[`
should load article 1`] = ` onClick={[Function]} > like reaction @@ -96,6 +97,7 @@ exports[`
should load article 1`] = ` onClick={[Function]} > unicorn reaction @@ -106,6 +108,7 @@ exports[`
should load article 1`] = ` onClick={[Function]} > readinglist reaction diff --git a/app/javascript/chat/__tests__/__snapshots__/userDetails.test.jsx.snap b/app/javascript/chat/__tests__/__snapshots__/userDetails.test.jsx.snap index fccddbc7a30a4..c3d1a942dc70f 100644 --- a/app/javascript/chat/__tests__/__snapshots__/userDetails.test.jsx.snap +++ b/app/javascript/chat/__tests__/__snapshots__/userDetails.test.jsx.snap @@ -3,6 +3,7 @@ exports[` for user1 should render and test snapshot 1`] = `
bojackhorseman profile image for user1 should render and test snapshot 1`] = ` target="_blank" > twitter logo for user1 should render and test snapshot 1`] = ` target="_blank" > github logo for user1 should render and test snapshot 1`] = ` target="_blank" > external link icon for user1 should render and test snapshot 1`] = ` exports[` for user2 should render and test snapshot 1`] = `
mrpeanutbutter profile image for user2 should render and test snapshot 1`] = ` target="_blank" > twitter logo for user2 should render and test snapshot 1`] = ` target="_blank" > github logo for user2 should render and test snapshot 1`] = ` target="_blank" > external link icon - + {`${curType[1]} ) }; @@ -173,7 +173,7 @@ export default class Article extends Component { {' '} - | + | {' '} {article.readable_publish_date} diff --git a/app/javascript/chat/userDetails.jsx b/app/javascript/chat/userDetails.jsx index 6b7675055df11..04ab14bf7e1e1 100644 --- a/app/javascript/chat/userDetails.jsx +++ b/app/javascript/chat/userDetails.jsx @@ -25,6 +25,7 @@ export default class UserDetails extends Component { twitter logo , ); @@ -35,6 +36,7 @@ export default class UserDetails extends Component { github logo , ); @@ -46,6 +48,7 @@ export default class UserDetails extends Component { className="external-link-img" src={websiteImage} style={{ width: '30px', margin: '5px 15px 15px 0px' }} + alt="external link icon" /> , ); @@ -63,6 +66,7 @@ export default class UserDetails extends Component {
{`${user.username}
{this.toggleOnboardingSlide()}
diff --git a/app/javascript/src/__tests__/__snapshots__/Onboarding.test.jsx.snap b/app/javascript/src/__tests__/__snapshots__/Onboarding.test.jsx.snap index 9271c077fb3d4..e0d8aa833b236 100644 --- a/app/javascript/src/__tests__/__snapshots__/Onboarding.test.jsx.snap +++ b/app/javascript/src/__tests__/__snapshots__/Onboarding.test.jsx.snap @@ -30,6 +30,7 @@ preact-render-spy (1 nodes) Sloan, the sloth mascot
@@ -146,6 +147,7 @@ preact-render-spy (1 nodes) Sloan, the sloth mascot
@@ -231,6 +233,7 @@ preact-render-spy (1 nodes) Sloan, the sloth mascot
@@ -374,6 +377,7 @@ preact-render-spy (1 nodes) Sloan, the sloth mascot
@@ -490,6 +494,7 @@ preact-render-spy (1 nodes) Sloan, the sloth mascot
@@ -640,6 +645,7 @@ preact-render-spy (1 nodes) Sloan, the sloth mascot
@@ -712,6 +718,7 @@ preact-render-spy (1 nodes) Sloan, the sloth mascot
@@ -862,6 +869,7 @@ preact-render-spy (1 nodes) Sloan, the sloth mascot
@@ -1005,6 +1013,7 @@ preact-render-spy (1 nodes) Sloan, the sloth mascot
@@ -1121,6 +1130,7 @@ preact-render-spy (1 nodes) Sloan, the sloth mascot
@@ -1264,6 +1274,7 @@ preact-render-spy (1 nodes) Sloan, the sloth mascot
diff --git a/app/liquid_tags/github_tag/github_issue_tag.rb b/app/liquid_tags/github_tag/github_issue_tag.rb index 743891f494ba3..fe1d47a516679 100644 --- a/app/liquid_tags/github_tag/github_issue_tag.rb +++ b/app/liquid_tags/github_tag/github_issue_tag.rb @@ -75,7 +75,7 @@ def generate_title "

" \ "" \ - "#{title} ##{number} " \ + "\"GitHub#{title} ##{number} " \ "" \ "

" end diff --git a/app/liquid_tags/github_tag/github_readme_tag.rb b/app/liquid_tags/github_tag/github_readme_tag.rb index 76ff78b4bebc4..6e310188d534a 100644 --- a/app/liquid_tags/github_tag/github_readme_tag.rb +++ b/app/liquid_tags/github_tag/github_readme_tag.rb @@ -12,7 +12,7 @@ def render
diff --git a/app/liquid_tags/medium_tag.rb b/app/liquid_tags/medium_tag.rb index 4c94a9b7d93a2..826e73631fbb6 100644 --- a/app/liquid_tags/medium_tag.rb +++ b/app/liquid_tags/medium_tag.rb @@ -20,7 +20,7 @@ def render(_context) diff --git a/app/views/additional_content_boxes/_article_followable_area.html.erb b/app/views/additional_content_boxes/_article_followable_area.html.erb index e234c88892a10..258fb18956cb8 100644 --- a/app/views/additional_content_boxes/_article_followable_area.html.erb +++ b/app/views/additional_content_boxes/_article_followable_area.html.erb @@ -1,14 +1,17 @@ <% if followable.class.name == "Organization" && followable.nav_image.present? %> <% else %> @@ -18,6 +21,7 @@ data-details="<%= followable&.slug if classification == "boosted" %>__PROFILE"> <%= followable.name %> profile image__PROFILE" style="border: 4px solid <%= followable.bg_color_hex %>" />
diff --git a/app/views/articles/_actions.html.erb b/app/views/articles/_actions.html.erb index 3a30ccbe8f61f..969c6880bb144 100644 --- a/app/views/articles/_actions.html.erb +++ b/app/views/articles/_actions.html.erb @@ -13,7 +13,7 @@ - " /> + " alt="twitter logo"> DISCUSS @@ -24,7 +24,7 @@