Files
simple-aircraft-manager-rails/app/helpers/help_helper.rb
T
rickyandClaude Opus 5.5 e8b0cd030e What's new stays short as releases pile up
- Admin → About shows the running version's release notes, with a link
  to all releases.
- The What's new page keeps the running version (and any newer) open and
  folds each older release to one line, grouped by month: its version
  and a count of its changes, fixes and notes for administrators.
- CHANGELOG.md itself is unchanged and reads the same on GitHub; the
  app splits it into releases when shown (Changelog).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 13:38:45 -05:00

22 lines
965 B
Ruby

module HelpHelper
def help_page_url_for(slug, anchor = nil)
slug == "README" ? help_path(anchor: anchor) : help_page_path(slug, anchor: anchor)
end
def guide_html(page, links: true, title: true)
html = HelpGuide.html(page, title: title, link: (links ? method(:help_page_url_for) : nil))
tag.div(html.html_safe, class: "markdown guide") # rubocop:disable Rails/OutputSafety -- sanitized in HelpGuide
end
# A piece of the guide's Markdown (an intro, one release's notes).
def guide_markdown(markdown, class: nil)
html = HelpGuide.render(markdown, link: method(:help_page_url_for))
tag.div(html.html_safe, class: [ "markdown guide", binding.local_variable_get(:class) ]) # rubocop:disable Rails/OutputSafety -- sanitized in HelpGuide
end
# "4 changes · 3 fixes · 2 for administrators"
def release_summary(release)
release.counts.map { |key, count| t("help.changelog.counts.#{key}", count: count) }.join(" · ")
end
end