Show major or patch version update on menu

This commit is contained in:
KMY 2023-09-21 13:22:10 +09:00
parent fa511c3eab
commit e11be48100
5 changed files with 20 additions and 2 deletions

View file

@ -997,6 +997,9 @@ en:
other: Used by %{count} people over the last week
title: Trends
trending: Trending
update-pendings:
major: Major update pending
patch: Patch update pending
warning_presets:
add_new: Add new
delete: Delete

View file

@ -991,6 +991,9 @@ ja:
other: 週間%{count}人に使用されました
title: トレンド
trending: トレンド
update_pendings:
major: メジャーアップデートあり
patch: パッチアップデートあり
warning_presets:
add_new: 追加
delete: 削除

View file

@ -4,7 +4,11 @@ SimpleNavigation::Configuration.run do |navigation|
navigation.items do |n|
n.item :web, safe_join([fa_icon('chevron-left fw'), t('settings.back')]), root_path
n.item :software_updates, safe_join([fa_icon('exclamation-circle fw'), t('admin.critical_update_pending')]), admin_software_updates_path, if: -> { ENV['UPDATE_CHECK_URL'] != '' && current_user.can?(:view_devops) && SoftwareUpdate.urgent_pending? }, html: { class: 'warning' }
if ENV['UPDATE_CHECK_URL'] != '' && current_user.can?(:view_devops)
n.item :software_updates, safe_join([fa_icon('exclamation-circle fw'), t('admin.critical_update_pending')]), admin_software_updates_path, if: -> { SoftwareUpdate.urgent_pending? }, html: { class: 'warning' }
n.item :software_updates, safe_join([fa_icon('exclamation-circle fw'), t('admin.update_pendings.major')]), admin_software_updates_path, if: -> { !SoftwareUpdate.urgent_pending? && SoftwareUpdate.major_pending? }, html: { class: 'warning' }
n.item :software_updates, safe_join([fa_icon('exclamation-circle fw'), t('admin.update_pendings.patch')]), admin_software_updates_path, if: -> { !SoftwareUpdate.urgent_pending? && SoftwareUpdate.patch_pending? }, html: { class: 'warning' }
end
n.item :profile, safe_join([fa_icon('user fw'), t('settings.profile')]), settings_profile_path, if: -> { current_user.functional? }, highlights_on: %r{/settings/profile|/settings/featured_tags|/settings/verification|/settings/privacy}