Skip to content

Commit

Permalink
Updated fontawesome to V6
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminfaure committed Jul 18, 2023
1 parent d7d64e6 commit b0cbb37
Show file tree
Hide file tree
Showing 24 changed files with 137 additions and 104 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## v4.2.0

- Updated fontawesome to V6

## v4.1.0

**Note this upgrade is a migration from Ruby v2.7.6 to v3.0.5.** Note that this could have an impact on any customizations you may have made to your fork of this project. Please see https://www.fastruby.io/blog/ruby/upgrades/upgrade-ruby-from-2.7-to-3.0.html for further information on what to check. In particular, please note the changes to the way [Ruby 3 handles keyword arguments](https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/)
Expand Down
4 changes: 2 additions & 2 deletions app/assets/stylesheets/blocks/_font_awesomes.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
}

/* change color of search icon */
.fa-search {
.fa-magnifying-glass {
color: $color-primary-text;
}

/* adjust the position of the 'remove - X' button for links */
.link .fa-times-circle {
.link .fa-circle-xmark {
margin-top: $grid-gutter-width;
}

Expand Down
6 changes: 3 additions & 3 deletions app/helpers/notifications_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ module NotificationsHelper
def fa_classes(notification)
case notification.level
when 'warning'
'fa-exclamation-circle'
'fa-circle-exclamation'
when 'danger'
'fa-times-circle'
'fa-circle-xmark'
else
'fa-info-circle'
'fa-circle-info'
end
end
end
2 changes: 1 addition & 1 deletion app/helpers/template_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def direct_link(template, hidden = false, text = nil, id = nil)
link_to(plans_url(plan: params), method: :post, title: _('Create plan'),
class: cls, id: id, style: style) do
if text.nil?
'<span class="fas fa-plus-square"></span>'.html_safe
'<span class="fas fa-square-plus"></span>'.html_safe
else
text.html_safe
end
Expand Down
10 changes: 5 additions & 5 deletions app/javascript/src/answers/rdaMetadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,9 @@ $(() => {
Object.keys(standardsArray).forEach((key) => {
// add the standard to list
if (key === standardsArray[key]) {
selectedStandards.append(`<li class="${key}">${key}<button class="remove-standard"><i class="fas fa-times-circle"></i></button></li`);
selectedStandards.append(`<li class="${key}">${key}<button class="remove-standard"><i class="fas fa-circle-xmark"></i></button></li`);
} else {
selectedStandards.append(`<li class="${key}">${descriptions[key].title}<button class="remove-standard"><i class="fas fa-times-circle"></i></button></li>`);
selectedStandards.append(`<li class="${key}">${descriptions[key].title}<button class="remove-standard"><i class="fas fa-circle-xmark"></i></button></li>`);
}
});
});
Expand Down Expand Up @@ -240,7 +240,7 @@ $(() => {
standard = standardId;
}
});
selectedStandards.append(`<li class="${standard}">${descriptions[standard].title}<button class="remove-standard"><i class="fas fa-times-circle"></i></button></li>`);
selectedStandards.append(`<li class="${standard}">${descriptions[standard].title}<button class="remove-standard"><i class="fas fa-circle-xmark"></i></button></li>`);
const formStandards = group.next('form').find('#standards');
// get the data for selected standards from the data attribute 'standard'
// of the hidden field #standards within the answer form
Expand Down Expand Up @@ -271,7 +271,7 @@ $(() => {
// the identifier for the standard which was selected
const standard = target.data('standard');
// append the standard to the displayed list of selected standards
selectedStandards.append(`<li class="${standard}">${descriptions[standard].title}<button class="remove-standard"><i class="fas fa-times-circle"></i></button></li>`);
selectedStandards.append(`<li class="${standard}">${descriptions[standard].title}<button class="remove-standard"><i class="fas fa-circle-xmark"></i></button></li>`);
const formStandards = group.next('form').find('#standards');
// get the data for selected standards from the data attribute 'standard'
// of the hidden field #standards within the answer form
Expand Down Expand Up @@ -327,7 +327,7 @@ $(() => {
const group = target.closest('.rda_metadata');
const selectedStandards = group.find('.selected_standards .list');
const standardName = group.find('.custom-standard-name').val();
selectedStandards.append(`<li class="${standardName}">${standardName}<button class="remove-standard"><i class="fas fa-times-circle"></i></button></li>`);
selectedStandards.append(`<li class="${standardName}">${standardName}<button class="remove-standard"><i class="fas fa-circle-xmark"></i></button></li>`);
const formStandards = group.next('form').find('#standards');
// get the data for selected standards from the data attribute 'standard'
// of the hidden field #standards within the answer form
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/src/orgAdmin/phases/show.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ $(() => {
// Initialize the draggable-sections element as a jQuery sortable.
// Read the docs here for more info: http://api.jqueryui.com/sortable/
$('.draggable-sections').sortable({
handle: 'i.fa-arrows-alt',
handle: 'i.fa-up-down-left-right',
axis: 'y',
cursor: 'move',
// Remove the placeholder object from the DOM once the item has been placed
Expand Down
29 changes: 29 additions & 0 deletions app/javascript/src/plans/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import * as notifier from '../utils/notificationHelper';
import getConstant from '../utils/constants';
import { paginableSelector } from '../utils/paginable';

$(() => {
$(paginableSelector).on('ajax:success', 'input.set_test_plan', (e) => {
const checkbox = $(e.target);
const data = e.detail[0];
if (data.code === 1 && data.msg && data.msg !== '') {
notifier.renderNotice(data.msg);
} else {
notifier.renderAlert(data.msg);
}

if (checkbox.is(':checked')) {
checkbox.parent().siblings('.plan-visibility').html(getConstant('PLAN_VISIBILITY_WHEN_TEST'))
.attr('title', '');
} else {
checkbox.parent().siblings('.plan-visibility').html(getConstant('PLAN_VISIBILITY_WHEN_NOT_TEST'))
.attr('title', getConstant('PLAN_VISIBILITY_WHEN_NOT_TEST_TOOLTIP'));
}
});
$(paginableSelector).on('ajax:error', 'input.set_test_plan', (e) => {
const xhr = e.detail(2);
notifier.renderAlert(xhr.responseText);
});

$('#create-modal').modal('show');
});
4 changes: 2 additions & 2 deletions app/javascript/src/utils/notificationHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function renderMessage(options = {}) {
export function renderNotice(msg, options = {}) {
renderMessage({
message: msg,
icon: 'check-circle',
icon: 'circle-check',
className: 'alert-info',
floating: options.floating === true,
autoDismiss: options.autoDismiss === true,
Expand All @@ -50,7 +50,7 @@ export function renderNotice(msg, options = {}) {
export function renderAlert(msg, options = {}) {
renderMessage({
message: msg,
icon: 'times-circle',
icon: 'circle-xmark',
className: 'alert-warning',
floating: options.floating === true,
autoDismiss: options.autoDismiss === true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
<% unlinktext = _("Unlink your account from #{scheme.description}. You can link again at any time.") %>
<% unlinkconf = _("Are you sure you want to unlink #{scheme.description} ID?") %>
<% end %>
<%= link_to '<i class="fas fa-fw fa-times-circle" aria-hidden="true"></i>'.html_safe,
<%= link_to '<i class="fas fa-fw fa-circle-xmark" aria-hidden="true"></i>'.html_safe,
destroy_user_identifier_path(id),
method: :delete,
title: unlinktext,
Expand Down
134 changes: 67 additions & 67 deletions app/views/devise/registrations/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,67 +1,67 @@
<div class="row">
<div class="col-md-12">
<h1><%= _('Sign in or Create account') %></h1>
</div>
</div>

<div class="row">
<div id="dual_columns" class="container" style="display:table">
<% unless session["devise.shibboleth_data"].nil? %>
<% cookies[:show_shib_link] = { value: 'show_shib_link',
expires: 3.hours.from_now } %>

<div class="col-md-6" style="border-top:1px solid black; border-bottom:1px solid black; border-left:1px solid black; display:table-cell; float:none">
<p class="text-center">
<%= _("Do you have a %{application_name} account?") % {
application_name: ApplicationService.application_name} %>
</p>
<p class="text-center fontsize-h3 color-heading-text">
<i class="fas fa-arrow-circle-down" aria-hidden="true"></i>
</p>
<h2 class="text-center">
<%= _("Sign in") %>
</h2>
<p class="text-center">
<%= _("This will link your existing account to your credentials.") %>
</p>
<p><%= render partial: 'shared/sign_in_form' %><br></p>
</div>

<div class="col-md-6"
style="border:1px solid black; display:table-cell; float:none">

<p class="text-center fontsize-h3 color-heading-text">
<%= _("No %{application_name} account?") % {
application_name: ApplicationService.application_name} %>
</p>

<p class="text-center">
<i class="fas fa-arrow-circle-down" aria-hidden="true"></i>
</p>

<h2 class="text-center">
<%= _("Create account") %>
</h2>
<p class="text-center">
<%= _("This will create an account and link it to your credentials.") %>
</p>
<div id="create-account-form">
<p >
<%= render partial: 'shared/create_account_form', locals: {orgs: @all_orgs, org_partial: @org_partial} %>
<br>
</p>
</div>
</div>
<% else %>
<div>
<h2>
<%= _("Create account") %>&nbsp;&nbsp;
<i class="fas fa-user-plus" aria-hidden="true">&nbsp;&nbsp;</i>
</h2>
<div id="create-account-form">
<%= render partial: 'shared/create_account_form', locals: {orgs: @all_orgs, org_partial: @org_partial} %>
</div>
</div>
<% end %>
</div>
</div>
<div class="row">
<div class="col-md-12">
<h1><%= _('Sign in or Create account') %></h1>
</div>
</div>

<div class="row">
<div id="dual_columns" class="container" style="display:table">
<% unless session["devise.shibboleth_data"].nil? %>
<% cookies[:show_shib_link] = { value: 'show_shib_link',
expires: 3.hours.from_now } %>

<div class="col-md-6" style="border-top:1px solid black; border-bottom:1px solid black; border-left:1px solid black; display:table-cell; float:none">
<p class="text-center">
<%= _("Do you have a %{application_name} account?") % {
application_name: ApplicationService.application_name} %>
</p>
<p class="text-center fontsize-h3 color-heading-text">
<i class="fas fa-circle-arrow-down" aria-hidden="true"></i>
</p>
<h2 class="text-center">
<%= _("Sign in") %>
</h2>
<p class="text-center">
<%= _("This will link your existing account to your credentials.") %>
</p>
<p><%= render partial: 'shared/sign_in_form' %><br></p>
</div>

<div class="col-md-6"
style="border:1px solid black; display:table-cell; float:none">

<p class="text-center fontsize-h3 color-heading-text">
<%= _("No %{application_name} account?") % {
application_name: ApplicationService.application_name} %>
</p>

<p class="text-center">
<i class="fas fa-circle-arrow-down" aria-hidden="true"></i>
</p>

<h2 class="text-center">
<%= _("Create account") %>
</h2>
<p class="text-center">
<%= _("This will create an account and link it to your credentials.") %>
</p>
<div id="create-account-form">
<p >
<%= render partial: 'shared/create_account_form', locals: {orgs: @all_orgs, org_partial: @org_partial} %>
<br>
</p>
</div>
</div>
<% else %>
<div>
<h2>
<%= _("Create account") %>&nbsp;&nbsp;
<i class="fas fa-user-plus" aria-hidden="true">&nbsp;&nbsp;</i>
</h2>
<div id="create-account-form">
<%= render partial: 'shared/create_account_form', locals: {orgs: @all_orgs, org_partial: @org_partial} %>
</div>
</div>
<% end %>
</div>
</div>
2 changes: 1 addition & 1 deletion app/views/layouts/_notifications.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<span><%= sanitize a.body %></span>
<% if a.dismissable? %>
<button class="close" data-dismiss="alert" data-url="<%= user_acknowledge_notification_path(a) %>" data-remote="true" data-method="post" data-params="notification_id=<%= a.id %>" aria-label="Close">
<span class="fas fa-times-circle" aria-hidden="true"></span>
<span class="fas fa-circle-xmark" aria-hidden="true"></span>
</button>
<% end %>
</div>
Expand Down
6 changes: 3 additions & 3 deletions app/views/layouts/_signin_signout.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,18 @@
</a>
<ul class="dropdown-menu inverse-dropdown" aria-labelledby="user-menu">
<li>
<%= link_to '<i class="fas fa-pen-square" aria-hidden="true">&nbsp;</i>&nbsp;'.html_safe + _('Edit profile'), edit_user_registration_path %>
<%= link_to '<i class="fas fa-square-pen" aria-hidden="true">&nbsp;</i>&nbsp;'.html_safe + _('Edit profile'), edit_user_registration_path %>
</li>
<li>
<%= link_to '<i class="fas fa-sign-in-alt" aria-hidden="true">&nbsp;</i>&nbsp;'.html_safe + _('Logout'), destroy_user_session_path, method: :delete %>
<%= link_to '<i class="fas fa-right-to-bracket" aria-hidden="true">&nbsp;</i>&nbsp;'.html_safe + _('Logout'), destroy_user_session_path, method: :delete %>
</li>
</ul>
</li>
<% else %>
<% if !active_page?(root_path, true) %>
<li>
<a href="<%= root_path %>">
<i class="fas fa-sign-in-alt" aria-hidden="true">&nbsp;</i>
<i class="fas fa-right-to-bracket" aria-hidden="true">&nbsp;</i>
<%= _('Sign in') %>
</a>
</li>
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
class="notification-area alert <%= has_alert ? 'alert-warning ' : 'alert-info ' %>
<%= (has_alert or has_notice) ? 'show' : 'hide' %>"
role="<%= (has_notice ? 'status' : (has_alert ? 'alert' : '')) %>">
<i class="fas <%= has_alert ? ' fa-times-circle' : ' fa-check-circle' %>" aria-hidden="true"></i>
<i class="fas <%= has_alert ? ' fa-circle-xmark' : ' fa-circle-check' %>" aria-hidden="true"></i>
<span class="aria-only"><%= has_alert ? _('Error:') : _('Notice:') %></span>
<span><%= sanitize (has_alert ? alert : notice) %></span>
<%= yield :errors %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/org_admin/phases/container.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
<div class="col-sm-6">
<div class='text-right text-muted'>
<% if template.latest? && (modifiable || template.customization_of.present?) %>
<i class="fas fa-info-circle small"></i>
<i class="fas fa-circle-info small"></i>
<%= _("Drag arrows to rearrange sections.") %>
<% unless phase.sections.all?(&:modifiable?) %>
<%= _("You may place them before or after the main template sections.") %>
Expand Down
4 changes: 2 additions & 2 deletions app/views/org_admin/sections/_section.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<% plussign = "fa-minus" if current_section.present? && section.id == current_section.id %>
<i class="fas <%= plussign %> pull-right" aria-hidden="true" title="Click to expand"></i>
<% if local_assigns[:draggable] %>
<i class="fas fa-arrows-alt pull-right" aria-hidden="true"
<i class="fas fa-up-down-left-right pull-right" aria-hidden="true"
title="Drag to reposition">
</i>
<% end %>
Expand All @@ -46,4 +46,4 @@
<% end %>
</div>
</div>
</div>
</div>
4 changes: 2 additions & 2 deletions app/views/orgs/_profile_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
<legend>
<%= _('Organisation Types') %>
&nbsp; <a href="#" aria-label="<%= _('Text') %>" data-toggle="tooltip" data-placement="right" title="<%= org_types_tooltip %>">
<i class="fas fa-question-circle fa-reverse" ></i>
<i class="fas fa-circle-question fa-reverse" ></i>
<em class="sr-only"></em>
</a>
</legend>
Expand Down Expand Up @@ -171,7 +171,7 @@
<dt>
<%= _('Organisation type(s)') %>
&nbsp; <a href="#" aria-label="<%= _('Text') %>" data-toggle="tooltip" data-placement="right" title="<%= org_types_tooltip %>">
<i class="fas fa-question-circle fa-reverse" ></i>
<i class="fas fa-circle-question fa-reverse" ></i>
<em class="sr-only"></em>
</a>
</dt>
Expand Down
4 changes: 2 additions & 2 deletions app/views/shared/_links.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</small>&nbsp;
<a href="#" aria-label="<%= _('Text') %>" data-toggle="tooltip"
data-placement="right" title="<%= tooltip %>">
<i class="fas fa-question-circle fa-reverse" aria-hidden="true"></i>
<i class="fas fa-circle-question fa-reverse" aria-hidden="true"></i>
<em class="sr-only"><%= tooltip %></em>
</a>
</h3>
Expand Down Expand Up @@ -40,7 +40,7 @@
<div class="col-xs-2">
<div class="form-group">
<a href="#" class="delete" aria-label="<%= _('Remove this link') %>">
<i class="fas fa-times-circle fa-reverse" aria-hidden="true"></i>
<i class="fas fa-circle-xmark fa-reverse" aria-hidden="true"></i>
</a>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/views/shared/_popover.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<% if message.present? %>
<a href="#" class="btn btn-default" data-toggle="tooltip"
title="<%= message %>" placement="<%= placement %>">
<i class="fas fa-question-circle"></i>
<i class="fas fa-circle-question"></i>
<em class="sr-only"><%= message %>></em>
</a>
<% end %>
Loading

0 comments on commit b0cbb37

Please sign in to comment.