From c39183cc628ea9556db53af5059656d6b63609ba Mon Sep 17 00:00:00 2001 From: ThibG Date: Sun, 23 Sep 2018 20:42:13 +0200 Subject: Refactor active_nav_class for use with multiple paths (#8757) --- app/helpers/application_helper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/helpers') diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 758f864d7..f8e2c0e11 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -7,8 +7,8 @@ module ApplicationHelper follow ).freeze - def active_nav_class(path) - current_page?(path) ? 'active' : '' + def active_nav_class(*paths) + paths.any? { |path| current_page?(path) } ? 'active' : '' end def active_link_to(label, path, **options) -- cgit From 8bae14591bfb4fc9dd9d89d8082ac0123b03edaa Mon Sep 17 00:00:00 2001 From: Naoki Kosaka Date: Fri, 28 Sep 2018 00:08:56 +0900 Subject: Migrate to font-awesome 5.0. (#8799) --- app/helpers/application_helper.rb | 2 +- .../__tests__/__snapshots__/avatar-test.js.snap | 4 ++-- .../mastodon/components/attachment_list.js | 4 ++-- app/javascript/mastodon/components/bot_icon.js | 2 +- .../mastodon/components/column_back_button.js | 2 +- .../mastodon/components/column_back_button_slim.js | 2 +- .../mastodon/components/column_header.js | 14 +++++++------- app/javascript/mastodon/components/icon_button.js | 4 ++-- app/javascript/mastodon/components/load_gap.js | 2 +- app/javascript/mastodon/components/status.js | 4 ++-- .../mastodon/features/account/components/header.js | 4 ++-- .../account_timeline/components/moved_note.js | 2 +- .../features/compose/components/compose_form.js | 2 +- .../compose/components/privacy_dropdown.js | 2 +- .../mastodon/features/compose/components/search.js | 4 ++-- .../features/compose/components/search_results.js | 8 ++++---- .../mastodon/features/compose/components/upload.js | 4 ++-- .../features/compose/components/upload_progress.js | 2 +- app/javascript/mastodon/features/compose/index.js | 14 +++++++------- .../mastodon/features/getting_started/index.js | 2 +- .../features/list_editor/components/search.js | 4 ++-- .../mastodon/features/list_timeline/index.js | 4 ++-- .../components/clear_column_button.js | 2 +- .../notifications/components/notification.js | 6 +++--- .../mastodon/features/pinned_statuses/index.js | 2 +- .../mastodon/features/status/components/card.js | 4 ++-- .../features/status/components/detailed_status.js | 6 +++--- app/javascript/mastodon/features/status/index.js | 2 +- .../mastodon/features/ui/components/boost_modal.js | 2 +- .../features/ui/components/column_header.js | 2 +- .../mastodon/features/ui/components/column_link.js | 4 ++-- .../features/ui/components/columns_area.js | 2 +- .../mastodon/features/ui/components/media_modal.js | 4 ++-- .../features/ui/components/onboarding_modal.js | 4 ++-- .../mastodon/features/ui/components/tabs_bar.js | 12 ++++++------ app/javascript/mastodon/features/video/index.js | 12 ++++++------ app/javascript/styles/mastodon/about.scss | 2 +- app/javascript/styles/mastodon/accounts.scss | 4 ++-- app/javascript/styles/mastodon/admin.scss | 2 +- app/javascript/styles/mastodon/components.scss | 22 +++++++++++----------- app/javascript/styles/mastodon/forms.scss | 2 +- app/javascript/styles/mastodon/rtl.scss | 6 +++--- app/javascript/styles/mastodon/tables.scss | 2 +- app/javascript/styles/mastodon/widgets.scss | 2 +- app/views/about/_links.html.haml | 2 +- app/views/stream_entries/_status.html.haml | 2 +- spec/helpers/application_helper_spec.rb | 2 +- 47 files changed, 102 insertions(+), 102 deletions(-) (limited to 'app/helpers') diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index f8e2c0e11..49621f55f 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -55,7 +55,7 @@ module ApplicationHelper def fa_icon(icon, attributes = {}) class_names = attributes[:class]&.split(' ') || [] - class_names << 'fa' + class_names << 'fas' class_names += icon.split(' ').map { |cl| "fa-#{cl}" } content_tag(:i, nil, attributes.merge(class: class_names.join(' '))) diff --git a/app/javascript/mastodon/components/__tests__/__snapshots__/avatar-test.js.snap b/app/javascript/mastodon/components/__tests__/__snapshots__/avatar-test.js.snap index f6f6bfbf4..1ab59836a 100644 --- a/app/javascript/mastodon/components/__tests__/__snapshots__/avatar-test.js.snap +++ b/app/javascript/mastodon/components/__tests__/__snapshots__/avatar-test.js.snap @@ -15,7 +15,7 @@ exports[` Autoplay renders a animated avatar 1`] = ` } > `; @@ -35,7 +35,7 @@ exports[` Still renders a still avatar 1`] = ` } > `; diff --git a/app/javascript/mastodon/components/attachment_list.js b/app/javascript/mastodon/components/attachment_list.js index 8e5bb0e0b..14e6cfc65 100644 --- a/app/javascript/mastodon/components/attachment_list.js +++ b/app/javascript/mastodon/components/attachment_list.js @@ -24,7 +24,7 @@ export default class AttachmentList extends ImmutablePureComponent { return (
  • - {filename(displayUrl)} + {filename(displayUrl)}
  • ); })} @@ -36,7 +36,7 @@ export default class AttachmentList extends ImmutablePureComponent { return (
    - +
      diff --git a/app/javascript/mastodon/components/bot_icon.js b/app/javascript/mastodon/components/bot_icon.js index f4bd70282..4d824e762 100644 --- a/app/javascript/mastodon/components/bot_icon.js +++ b/app/javascript/mastodon/components/bot_icon.js @@ -13,7 +13,7 @@ export default class BotIcon extends ImmutablePureComponent { if (account.get('bot')) { return ( - + ); } diff --git a/app/javascript/mastodon/components/column_back_button.js b/app/javascript/mastodon/components/column_back_button.js index 8a60c4192..2560e31ee 100644 --- a/app/javascript/mastodon/components/column_back_button.js +++ b/app/javascript/mastodon/components/column_back_button.js @@ -19,7 +19,7 @@ export default class ColumnBackButton extends React.PureComponent { render () { return ( ); diff --git a/app/javascript/mastodon/components/column_back_button_slim.js b/app/javascript/mastodon/components/column_back_button_slim.js index 964c100be..a0d111aa7 100644 --- a/app/javascript/mastodon/components/column_back_button_slim.js +++ b/app/javascript/mastodon/components/column_back_button_slim.js @@ -8,7 +8,7 @@ export default class ColumnBackButtonSlim extends ColumnBackButton { return (
      - +
      diff --git a/app/javascript/mastodon/components/column_header.js b/app/javascript/mastodon/components/column_header.js index 613df1e79..420ce3eef 100644 --- a/app/javascript/mastodon/components/column_header.js +++ b/app/javascript/mastodon/components/column_header.js @@ -95,22 +95,22 @@ class ColumnHeader extends React.PureComponent { } if (multiColumn && pinned) { - pinButton = ; + pinButton = ; moveButtons = (
      - - + +
      ); } else if (multiColumn) { - pinButton = ; + pinButton = ; } if (!pinned && (multiColumn || showBackButton)) { backButton = ( ); @@ -126,7 +126,7 @@ class ColumnHeader extends React.PureComponent { } if (children || multiColumn) { - collapseButton = ; + collapseButton = ; } const hasTitle = icon && title; @@ -136,7 +136,7 @@ class ColumnHeader extends React.PureComponent {

      {hasTitle && ( )} diff --git a/app/javascript/mastodon/components/icon_button.js b/app/javascript/mastodon/components/icon_button.js index b96e48fd0..a303064ff 100644 --- a/app/javascript/mastodon/components/icon_button.js +++ b/app/javascript/mastodon/components/icon_button.js @@ -86,7 +86,7 @@ export default class IconButton extends React.PureComponent { style={style} tabIndex={tabIndex} > -