From d93e71dc28f9b9b05b2222884a6f1ed7cd78297f Mon Sep 17 00:00:00 2001 From: Sebastian Serth Date: Tue, 9 Aug 2022 13:13:41 +0200 Subject: [PATCH] Rename v5 FontAwesome icons to match v6 name While FontAwesome provides aliases for all icons, we switch to the new names for consistency. See all changes at: https://fontawesome.com/docs/web/setup/upgrade/whats-changed#icons-renamed-in-version-6 --- app/assets/javascripts/exercises.js.erb | 2 +- .../javascripts/pagedown/markdown.editor.js.erb | 2 +- app/helpers/application_helper.rb | 2 +- app/views/application/_session.html.slim | 2 +- app/views/community_solutions/_form.html.slim | 2 +- app/views/exercises/_editor.html.slim | 2 +- app/views/exercises/_editor_file_tree.html.slim | 12 ++++++------ app/views/exercises/_editor_output.html.slim | 4 ++-- .../exercises/external_users/statistics.html.slim | 4 ++-- app/views/tips/_sortable_tip.html.slim | 2 +- lib/assets/javascripts/flash.js | 2 +- lib/assets/stylesheets/flash.css.scss | 2 +- spec/helpers/application_helper_spec.rb | 2 +- 13 files changed, 20 insertions(+), 20 deletions(-) diff --git a/app/assets/javascripts/exercises.js.erb b/app/assets/javascripts/exercises.js.erb index e648d2fe..8d744b58 100644 --- a/app/assets/javascripts/exercises.js.erb +++ b/app/assets/javascripts/exercises.js.erb @@ -227,7 +227,7 @@ $(document).on('turbolinks:load', function () { '
' + '' + tip.title + '' + - '' + + '' + '
' + '
'; const tipList = $('#tip-list').append(template); diff --git a/app/assets/javascripts/pagedown/markdown.editor.js.erb b/app/assets/javascripts/pagedown/markdown.editor.js.erb index 4f5ecb6d..c6759007 100644 --- a/app/assets/javascripts/pagedown/markdown.editor.js.erb +++ b/app/assets/javascripts/pagedown/markdown.editor.js.erb @@ -1404,7 +1404,7 @@ buttons.heading = makeButton("wmd-heading-button", "<%= I18n.t('components.markdown_editor.heading.button_title', default: 'Heading (Ctrl+H)') %>", "m-1 fa fa-font", bindCommand("doHeading"), group3); var group4 = makeGroup(4); - buttons.undo = makeButton("wmd-undo-button", "<%= I18n.t('components.markdown_editor.undo.button_title', default: 'Undo (Ctrl+Z)') %>", "m-1 fa fa-undo", null, group4); + buttons.undo = makeButton("wmd-undo-button", "<%= I18n.t('components.markdown_editor.undo.button_title', default: 'Undo (Ctrl+Z)') %>", "m-1 fa fa-arrow-rotate-left", null, group4); buttons.undo.execute = function (manager) { if (manager) manager.undo(); }; var redoTitle = /win/.test(nav.platform.toLowerCase()) ? diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 4f46e81c..50663b6b 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -31,7 +31,7 @@ module ApplicationHelper private :label_column def no - tag.i(nil, class: 'fa fa-times') + tag.i(nil, class: 'fa fa-xmark') end def per_page_param diff --git a/app/views/application/_session.html.slim b/app/views/application/_session.html.slim index d5a1f906..12b7dca2 100644 --- a/app/views/application/_session.html.slim +++ b/app/views/application/_session.html.slim @@ -14,5 +14,5 @@ li = link_to(t('sessions.destroy.link'), sign_out_path, method: :delete, class: 'dropdown-item') - else li.nav-item = link_to(sign_in_path, class: 'nav-link') do - i.fa.fa-sign-in + i.fa.fa-arrow-right-to-bracket = t('sessions.new.link') diff --git a/app/views/community_solutions/_form.html.slim b/app/views/community_solutions/_form.html.slim index 3a262015..3b78f659 100644 --- a/app/views/community_solutions/_form.html.slim +++ b/app/views/community_solutions/_form.html.slim @@ -10,7 +10,7 @@ #description-card.lead class=(@embed_options[:collapse_exercise_description] ? 'description-card-collapsed' : 'description-card') .card.border-success.mb-3 .card-header - i.fa.fa-info-circle.text-success + i.fa.fa-circle-info.text-success strong.text-success => t('community_solutions.help_us_out') = t('community_solutions.explanation') diff --git a/app/views/exercises/_editor.html.slim b/app/views/exercises/_editor.html.slim index 59132d26..153d1691 100644 --- a/app/views/exercises/_editor.html.slim +++ b/app/views/exercises/_editor.html.slim @@ -45,7 +45,7 @@ = " | " button#start-over-active-file.p-0.border-0.btn-link.bg-white data-message-confirm=t('exercises.editor.confirm_start_over_active_file') data-url=reload_exercise_path(@exercise) - i.fa.fa-history + i.fa.fa-clock-rotate-left = t('exercises.editor.start_over_active_file') - unless @embed_options[:disable_run] && @embed_options[:disable_score] diff --git a/app/views/exercises/_editor_file_tree.html.slim b/app/views/exercises/_editor_file_tree.html.slim index 7f7d28b4..946d6748 100644 --- a/app/views/exercises/_editor_file_tree.html.slim +++ b/app/views/exercises/_editor_file_tree.html.slim @@ -1,16 +1,16 @@ div id='sidebar-collapsed' class=(@exercise.hide_file_tree && @tips.blank? ? '' : 'd-none') - = render('editor_button', classes: 'btn-block btn-outline-dark btn', data: {:'data-toggle' => 'tooltip', :'data-placement' => 'right'}, icon: 'fa fa-plus-square', id: 'sidebar-collapse-collapsed', label:'', title:t('exercises.editor.expand_action_sidebar')) + = render('editor_button', classes: 'btn-block btn-outline-dark btn', data: {:'data-toggle' => 'tooltip', :'data-placement' => 'right'}, icon: 'fa fa-square-plus', id: 'sidebar-collapse-collapsed', label:'', title:t('exercises.editor.expand_action_sidebar')) - unless @embed_options[:disable_hints] or @tips.blank? = render('editor_button', classes: 'btn-block btn-secondary btn mb-4', data: {:'data-toggle' => 'tooltip', :'data-placement' => 'right'}, icon: 'fa fa-lightbulb', id: 'tips-collapsed', label:'', title: t('exercises.form.tips')) //- if !@course_token.blank? - = render('editor_button', classes: 'btn-block btn-primary btn enforce-top-margin', data: {:'data-toggle' => 'tooltip', :'data-placement' => 'right'}, icon: 'fa fa-search', id: 'sidebar-search-collapsed', label: '', title: t('search.search_in_forum')) + = render('editor_button', classes: 'btn-block btn-primary btn enforce-top-margin', data: {:'data-toggle' => 'tooltip', :'data-placement' => 'right'}, icon: 'fa fa-magnifying-glass', id: 'sidebar-search-collapsed', label: '', title: t('search.search_in_forum')) div.h-100.col-sm-12.enforce-bottom-margin id='sidebar-uncollapsed' class=(@exercise.hide_file_tree && @tips.blank? ? 'd-none' : '') .position-absolute.d-flex.mb-1.w-100 style="overflow: auto; left: 0; top: 0; height: 100%;" .w-100 - = render('editor_button', classes: 'btn-block btn-outline-dark btn', icon: 'fa fa-minus-square', id: 'sidebar-collapse', label: t('exercises.editor.collapse_action_sidebar')) + = render('editor_button', classes: 'btn-block btn-outline-dark btn', icon: 'fa fa-square-minus', id: 'sidebar-collapse', label: t('exercises.editor.collapse_action_sidebar')) - unless @exercise.hide_file_tree div @@ -22,10 +22,10 @@ div.h-100.col-sm-12.enforce-bottom-margin id='sidebar-uncollapsed' class=(@exerc div - if @exercise.allow_file_creation = render('editor_button', classes: 'btn-default btn-sm', data: {:'data-toggle' => 'tooltip', :'data-cause' => 'file'}, icon: 'fa fa-plus', id: 'create-file', label: '', title: t('exercises.editor.create_file')) - = render('editor_button', classes: 'btn-default btn-sm', data: {:'data-toggle' => 'tooltip', :'data-cause' => 'file', :'data-message-confirm' => t('shared.confirm_destroy') }, icon: 'far fa-trash-alt', id: 'destroy-file', label: '', title: t('exercises.editor.destroy_file')) + = render('editor_button', classes: 'btn-default btn-sm', data: {:'data-toggle' => 'tooltip', :'data-cause' => 'file', :'data-message-confirm' => t('shared.confirm_destroy') }, icon: 'far fa-trash-can', id: 'destroy-file', label: '', title: t('exercises.editor.destroy_file')) - unless @embed_options[:disable_download] = render('editor_button', classes: 'btn-default btn-sm', data: {:'data-toggle' => 'tooltip'}, icon: 'fas fa-arrow-down', id: 'download', label:'', title: t('exercises.editor.download')) - = render('editor_button', classes: 'btn-default btn-sm', data: {:'data-toggle' => 'tooltip', :'data-message-confirm' => t('exercises.editor.confirm_start_over'), :'data-url' => reload_exercise_path(@exercise)}, icon: 'fa fa-history', id: 'start-over', label: '', title: t('exercises.editor.start_over')) + = render('editor_button', classes: 'btn-default btn-sm', data: {:'data-toggle' => 'tooltip', :'data-message-confirm' => t('exercises.editor.confirm_start_over'), :'data-url' => reload_exercise_path(@exercise)}, icon: 'fa fa-clock-rotate-left', id: 'start-over', label: '', title: t('exercises.editor.start_over')) .card-body.pt-0.pr-0.pl-1.pb-1 @@ -43,7 +43,7 @@ div.h-100.col-sm-12.enforce-bottom-margin id='sidebar-uncollapsed' class=(@exerc = text_field_tag 'search-input-text', nil, placeholder: t('search.search_in_forum'), class: 'form-control' .input-group-btn = button_tag(class: 'btn btn-primary', id: 'btn-search-col') do - i.fa.fa-search + i.fa.fa-magnifying-glass - if @exercise.allow_file_creation? = render('shared/modal', id: 'modal-file', template: 'code_ocean/files/_form', title: t('exercises.editor.create_file')) diff --git a/app/views/exercises/_editor_output.html.slim b/app/views/exercises/_editor_output.html.slim index 07072e33..423a127b 100644 --- a/app/views/exercises/_editor_output.html.slim +++ b/app/views/exercises/_editor_output.html.slim @@ -1,8 +1,8 @@ div id='output_sidebar_collapsed' - = render('editor_button', classes: 'btn-block btn-outline-dark btn', data: {:'data-toggle' => 'tooltip', :'data-placement' => 'left'}, title: t('exercises.editor.expand_output_sidebar'), icon: 'fa fa-plus-square', id: 'toggle-sidebar-output-collapsed', label: '') + = render('editor_button', classes: 'btn-block btn-outline-dark btn', data: {:'data-toggle' => 'tooltip', :'data-placement' => 'left'}, title: t('exercises.editor.expand_output_sidebar'), icon: 'fa fa-square-plus', id: 'toggle-sidebar-output-collapsed', label: '') div.h-100 id='output_sidebar_uncollapsed' class='d-none col-sm-12 enforce-bottom-margin' data-message-no-output=t('exercises.implement.no_output_yet') .row - = render('editor_button', classes: 'btn-block btn-outline-dark btn', icon: 'fa fa-minus-square', id: 'toggle-sidebar-output', label: t('exercises.editor.collapse_output_sidebar')) + = render('editor_button', classes: 'btn-block btn-outline-dark btn', icon: 'fa fa-square-minus', id: 'toggle-sidebar-output', label: t('exercises.editor.collapse_output_sidebar')) div.position-absolute.d-flex.mb-1.w-100 style="overflow: auto; left: 0; bottom: 0; height: calc(100% - 3rem);" div.w-100 diff --git a/app/views/exercises/external_users/statistics.html.slim b/app/views/exercises/external_users/statistics.html.slim index 22a10c98..23e5b55e 100644 --- a/app/views/exercises/external_users/statistics.html.slim +++ b/app/views/exercises/external_users/statistics.html.slim @@ -43,12 +43,12 @@ h1 .bg-light.w-100.p-2.mb-4.align-items-center.d-flex.justify-content-between - if @show_autosaves span.pl-1.pb-1 - i.fa.fa-info-circle.align-middle + i.fa.fa-circle-info.align-middle small.mr-5.ml-1 = t('.toggle_status_on') = link_to t('.toggle_autosave_off'), statistics_external_user_exercise_path(show_autosaves: false), class: "btn btn-outline-dark float-right btn-sm" - else span.pl-1.pb-1 - i.fa.fa-info-circle.align-middle + i.fa.fa-circle-info.align-middle small.mr-5.ml-1 = t('.toggle_status_off') = link_to t('.toggle_autosave_on'), statistics_external_user_exercise_path(show_autosaves: true), class: "btn btn-outline-dark float-right btn-sm" #timeline diff --git a/app/views/tips/_sortable_tip.html.slim b/app/views/tips/_sortable_tip.html.slim index eeb887f9..14e456df 100644 --- a/app/views/tips/_sortable_tip.html.slim +++ b/app/views/tips/_sortable_tip.html.slim @@ -3,6 +3,6 @@ span.fa.fa-bars.mr-3 = tip.to_s a.fa.fa-eye.ml-2 href=tip_path(tip) target='_blank' - a.fa.fa-times.ml-2.remove-tip href='#' + a.fa.fa-xmark.ml-2.remove-tip href='#' .list-group.nested-sortable-list class="#{exercise_tip.children.present? ? 'mt-3' : ''}" = render(partial: 'tips/sortable_tip', collection: exercise_tip.children, as: :exercise_tip) diff --git a/lib/assets/javascripts/flash.js b/lib/assets/javascripts/flash.js index 3f217e4a..f1bfa610 100644 --- a/lib/assets/javascripts/flash.js +++ b/lib/assets/javascripts/flash.js @@ -26,7 +26,7 @@ $( document ).on('turbolinks:load', function() { $('.flash').each(function() { var container = $(this); var message = container.find('p'); - var button = container.find('span.fa-times'); + var button = container.find('span.fa-xmark'); var hide = function() { container.slideUp(function () { diff --git a/lib/assets/stylesheets/flash.css.scss b/lib/assets/stylesheets/flash.css.scss index d339aff2..ddfb2628 100644 --- a/lib/assets/stylesheets/flash.css.scss +++ b/lib/assets/stylesheets/flash.css.scss @@ -5,7 +5,7 @@ .flash { display: none; - span.fa-times { + span.fa-xmark { position: relative; top: -1.2em; float: right; diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb index 241cae24..e7752b5d 100644 --- a/spec/helpers/application_helper_spec.rb +++ b/spec/helpers/application_helper_spec.rb @@ -39,7 +39,7 @@ describe ApplicationHelper do describe '#no' do it "builds an 'i' tag" do - expect(no).to have_css('i.fa.fa-times') + expect(no).to have_css('i.fa.fa-xmark') end end