Show major or patch version update on menu
This commit is contained in:
parent
fa511c3eab
commit
e11be48100
5 changed files with 20 additions and 2 deletions
|
@ -36,5 +36,13 @@ class SoftwareUpdate < ApplicationRecord
|
|||
def urgent_pending?
|
||||
pending_to_a.any?(&:urgent?)
|
||||
end
|
||||
|
||||
def major_pending?
|
||||
pending_to_a.any?(&:major_type?)
|
||||
end
|
||||
|
||||
def patch_pending?
|
||||
pending_to_a.any?(&:patch_type?)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
|
||||
.fields-row
|
||||
.fields-group.fields-row__column.fields-row__column-12
|
||||
= ff.input :default_searchability, collection: Status.selectable_searchabilities, wrapper: :with_label, kmyblue: true, include_blank: false, label_method: lambda { |searchability| safe_join([I18n.t("statuses.searchabilities.#{searchability}"), I18n.t("statuses.searchabilities.#{searchability}_long")], ' - ') }, required: false, hint: false, label: I18n.t('simple_form.labels.defaults.setting_default_searchability')
|
||||
= ff.input :default_searchability, collection: Status.selectable_searchabilities, wrapper: :with_label, kmyblue: true, include_blank: false, label_method: lambda { |searchability| safe_join([I18n.t("statuses.searchabilities.#{searchability}"), I18n.t("statuses.searchabilities.#{searchability}_long")], ' - ') }, required: false, hint: false, label: I18n.t('simple_form.labels.defaults.setting_default_searchability'), hint: I18n.t('simple_form.hints.defaults.setting_default_searchability')
|
||||
|
||||
.fields-group
|
||||
= ff.input :disallow_unlisted_public_searchability, wrapper: :with_label, kmyblue: true, label: I18n.t('simple_form.labels.defaults.setting_disallow_unlisted_public_searchability'), hint: I18n.t('simple_form.hints.defaults.setting_disallow_unlisted_public_searchability')
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -991,6 +991,9 @@ ja:
|
|||
other: 週間%{count}人に使用されました
|
||||
title: トレンド
|
||||
trending: トレンド
|
||||
update_pendings:
|
||||
major: メジャーアップデートあり
|
||||
patch: パッチアップデートあり
|
||||
warning_presets:
|
||||
add_new: 追加
|
||||
delete: 削除
|
||||
|
|
|
@ -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}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue