Add “Update available” navigation item at top of navbar when new Mastodon versions are available (#39705)
This commit is contained in:
parent
7db2a99504
commit
f4cdbb9015
@ -0,0 +1 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="M160-160q-33 0-56.5-23.5T80-240v-480q0-33 23.5-56.5T160-800h200v80H160v480h640v-480H600v-80h200q33 0 56.5 23.5T880-720v480q0 33-23.5 56.5T800-160H160Zm320-184L280-544l56-56 104 104v-304h80v304l104-104 56 56-200 200Z"/></svg>
|
||||||
|
After Width: | Height: | Size: 321 B |
@ -0,0 +1 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="M160-160q-33 0-56.5-23.5T80-240v-480q0-33 23.5-56.5T160-800h200v80H160v480h640v-480H600v-80h200q33 0 56.5 23.5T880-720v480q0 33-23.5 56.5T800-160H160Zm320-184L280-544l56-56 104 104v-304h80v304l104-104 56 56-200 200Z"/></svg>
|
||||||
|
After Width: | Height: | Size: 321 B |
@ -47,6 +47,10 @@ class SoftwareUpdate < ApplicationRecord
|
|||||||
all.to_a.filter(&:pending?)
|
all.to_a.filter(&:pending?)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def pending?
|
||||||
|
pending_to_a.present?
|
||||||
|
end
|
||||||
|
|
||||||
def urgent_pending?
|
def urgent_pending?
|
||||||
pending_to_a.any?(&:urgent?)
|
pending_to_a.any?(&:urgent?)
|
||||||
end
|
end
|
||||||
|
|||||||
@ -1226,6 +1226,7 @@ en:
|
|||||||
other: Used by %{count} people over the last week
|
other: Used by %{count} people over the last week
|
||||||
title: Recommendations & Trends
|
title: Recommendations & Trends
|
||||||
trending: Trending
|
trending: Trending
|
||||||
|
update_available: Update available
|
||||||
username_blocks:
|
username_blocks:
|
||||||
add_new: Add new
|
add_new: Add new
|
||||||
block_registrations: Block registrations
|
block_registrations: Block registrations
|
||||||
|
|||||||
@ -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 :web, safe_join([material_symbol('chevron_left'), t('settings.back')]), root_path
|
||||||
|
|
||||||
n.item :software_updates,
|
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,
|
admin_software_updates_path,
|
||||||
if: -> { Rails.configuration.x.mastodon.software_update_url.present? && current_user.can?(:view_devops) && SoftwareUpdate.urgent_pending? },
|
html: { class: SoftwareUpdate.urgent_pending? ? 'warning' : nil },
|
||||||
html: { class: 'warning' }
|
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 :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}
|
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}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user