diff --git a/app/assets/stylesheets/application.tailwind.css b/app/assets/stylesheets/application.tailwind.css index 93ebbb55d72..2ffebf128f4 100644 --- a/app/assets/stylesheets/application.tailwind.css +++ b/app/assets/stylesheets/application.tailwind.css @@ -10,28 +10,6 @@ } @layer components { - .prose { - table { - @apply divide-y divide-gray-300; - } - - tr { - @apply divide-x divide-gray-100; - } - - th { - @apply whitespace-nowrap px-2 text-left text-sm font-semibold text-gray-900 py-3.5; - } - - tbody { - @apply divide-y divide-gray-200; - } - - td { - @apply whitespace-nowrap px-2 py-2 text-sm text-gray-500; - } - } - .form-field { @apply relative rounded-md border bg-white border-alpha-black-100 shadow-xs; @apply focus-within:border-gray-900 focus-within:shadow-none focus-within:ring-4 focus-within:ring-gray-100; @@ -81,6 +59,20 @@ @apply after:content-[''] after:block after:absolute after:top-0.5 after:left-0.5 after:bg-white after:w-4 after:h-4 after:rounded-full after:transition-transform after:duration-300 after:ease-in-out; @apply peer-checked:bg-green-600 peer-checked:after:translate-x-4; } + + .prose--github-release-notes { + .octicon { + @apply inline-block overflow-visible align-text-bottom fill-current; + } + + .dropdown-caret { + @apply content-none border-4 border-b-0 border-transparent border-t-gray-500 size-0 inline-block; + } + + .user-mention { + @apply font-bold; + } + } } /* Small, single purpose classes that should take precedence over other styles */ diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb index 943dcf75865..5b8c5eedcb3 100644 --- a/app/controllers/pages_controller.rb +++ b/app/controllers/pages_controller.rb @@ -31,6 +31,7 @@ def dashboard end def changelog + @releases_notes = Provider::Github.new.fetch_latest_releases_notes end def feedback diff --git a/app/models/provider/github.rb b/app/models/provider/github.rb index ff00794cfa7..4cb19cbf487 100644 --- a/app/models/provider/github.rb +++ b/app/models/provider/github.rb @@ -40,6 +40,26 @@ def fetch_latest_upgrade_candidates end end + def fetch_latest_releases_notes + begin + Rails.cache.fetch("latest_github_releases_notes", expires_in: 2.hours) do + releases = Octokit.releases(repo) + releases.map do |release| + { + avatar: release.author.avatar_url, + name: release.name, + published_at: release.published_at, + body: Octokit.markdown(release.body, mode: "gfm", context: repo) + } + end + end + + rescue => e + Rails.logger.error "Failed to fetch latest GitHub releases notes: #{e.message}" + [] + end + end + private def repo "#{owner}/#{name}" diff --git a/app/views/pages/changelog.html.erb b/app/views/pages/changelog.html.erb index f44eef8c7f1..ba2302a7465 100644 --- a/app/views/pages/changelog.html.erb +++ b/app/views/pages/changelog.html.erb @@ -2,11 +2,27 @@ <%= render "settings/nav" %> <% end %>
Changelog coming soon...
-