diff --git a/app/javascript/material-icons/400-24px/system_update_alt-fill.svg b/app/javascript/material-icons/400-24px/system_update_alt-fill.svg new file mode 100644 index 0000000000..468081b046 --- /dev/null +++ b/app/javascript/material-icons/400-24px/system_update_alt-fill.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/javascript/material-icons/400-24px/system_update_alt.svg b/app/javascript/material-icons/400-24px/system_update_alt.svg new file mode 100644 index 0000000000..468081b046 --- /dev/null +++ b/app/javascript/material-icons/400-24px/system_update_alt.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/models/software_update.rb b/app/models/software_update.rb index 266ca1326f..58b8342742 100644 --- a/app/models/software_update.rb +++ b/app/models/software_update.rb @@ -47,6 +47,10 @@ class SoftwareUpdate < ApplicationRecord all.to_a.filter(&:pending?) end + def pending? + pending_to_a.present? + end + def urgent_pending? pending_to_a.any?(&:urgent?) end diff --git a/config/locales/en.yml b/config/locales/en.yml index 6309e1a22b..bb1f7f2cc2 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1226,6 +1226,7 @@ en: other: Used by %{count} people over the last week title: Recommendations & Trends trending: Trending + update_available: Update available username_blocks: add_new: Add new block_registrations: Block registrations diff --git a/config/navigation.rb b/config/navigation.rb index 9ace5d5158..61ee10cb22 100644 --- a/config/navigation.rb +++ b/config/navigation.rb @@ -7,10 +7,12 @@ SimpleNavigation::Configuration.run do |navigation| n.item :web, safe_join([material_symbol('chevron_left'), t('settings.back')]), root_path n.item :software_updates, - safe_join([material_symbol('report'), t('admin.critical_update_pending')]), + safe_join( + SoftwareUpdate.urgent_pending? ? [material_symbol('report'), t('admin.critical_update_pending')] : [material_symbol('system_update_alt'), t('admin.update_available')] + ), admin_software_updates_path, - if: -> { Rails.configuration.x.mastodon.software_update_url.present? && current_user.can?(:view_devops) && SoftwareUpdate.urgent_pending? }, - html: { class: 'warning' } + html: { class: SoftwareUpdate.urgent_pending? ? 'warning' : nil }, + if: -> { Rails.configuration.x.mastodon.software_update_url.present? && current_user.can?(:view_devops) && SoftwareUpdate.pending? } n.item :profile, safe_join([material_symbol('person'), t('settings.profile')]), settings_profile_path, if: -> { current_user.functional? && !self_destruct }, highlights_on: %r{/settings/profile|/settings/featured_tags|/settings/verification} n.item :privacy, safe_join([material_symbol('globe'), t('privacy.title')]), settings_privacy_path, if: -> { current_user.functional? && !self_destruct }, highlights_on: %r{/settings/privacy}