Module: WhatsNewHelper
- Defined in:
- app/helpers/whats_new_helper.rb
Instance Method Summary collapse
- #display_whats_new? ⇒ Boolean
- #whats_new_most_recent_release_items_count ⇒ Object
- #whats_new_read_articles ⇒ Object
- #whats_new_variants ⇒ Object
- #whats_new_variants_description(variant) ⇒ Object
- #whats_new_variants_label(variant) ⇒ Object
- #whats_new_version_digest ⇒ Object
Instance Method Details
#display_whats_new? ⇒ Boolean
12 13 14 15 |
# File 'app/helpers/whats_new_helper.rb', line 12 def display_whats_new? (Gitlab.org_or_com? || user_signed_in?) && !Gitlab::CurrentSettings.current_application_settings.whats_new_variant_disabled? end |
#whats_new_most_recent_release_items_count ⇒ Object
4 5 6 |
# File 'app/helpers/whats_new_helper.rb', line 4 def whats_new_most_recent_release_items_count ReleaseHighlight.most_recent_item_count end |
#whats_new_read_articles ⇒ Object
44 45 46 47 48 49 |
# File 'app/helpers/whats_new_helper.rb', line 44 def whats_new_read_articles return [] unless current_user Onboarding::WhatsNew::ReadStatusService.new(current_user.id, whats_new_version_digest).most_recent_version_read_articles end |
#whats_new_variants ⇒ Object
17 18 19 |
# File 'app/helpers/whats_new_helper.rb', line 17 def whats_new_variants ApplicationSetting.whats_new_variants end |
#whats_new_variants_description(variant) ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 |
# File 'app/helpers/whats_new_helper.rb', line 32 def whats_new_variants_description(variant) case variant when 'all_tiers' _("Include new features from all tiers.") when 'current_tier' _("Only include features new to your current subscription tier.") when 'disabled' safe_format(_("%{italic_start}What's new%{italic_end} is inactive and cannot be viewed."), tag_pair(tag.i, :italic_start, :italic_end)) end end |
#whats_new_variants_label(variant) ⇒ Object
21 22 23 24 25 26 27 28 29 30 |
# File 'app/helpers/whats_new_helper.rb', line 21 def whats_new_variants_label(variant) case variant when 'all_tiers' _("Enable What's new: All tiers") when 'current_tier' _("Enable What's new: Current tier only") when 'disabled' _("Disable What's new") end end |
#whats_new_version_digest ⇒ Object
8 9 10 |
# File 'app/helpers/whats_new_helper.rb', line 8 def whats_new_version_digest ReleaseHighlight.most_recent_version_digest end |