This commit is contained in:
2026-07-29 08:20:58 +02:00
parent b8e3c64868
commit 922ceed996
5 changed files with 31 additions and 5 deletions
+12
View File
@@ -41,6 +41,18 @@ ActiveAdmin.register Software do
filter :status, as: :select, collection: %w[development demo released archived]
filter :highlighted
sidebar "Quick Links", only: :show, priority: 0 do
site_url = ENV.fetch("SITE_URL", "https://teletypegames.hu")
catalog_url = "#{site_url}/catalog/#{resource.name}"
div style: "margin-bottom:8px;" do
a href: catalog_url, target: "_blank", style: "display:inline-flex;align-items:center;gap:6px;font-weight:bold;color:#5850ec;" do
span "🌐", style: "font-size:16px;"
text_node "View on site"
end
end
end
sidebar "Download Statistics", only: :show do
sw = resource
total = Download.joins(:release).where(releases: { software_id: sw.id }).count
@@ -11,4 +11,16 @@ ActiveAdmin.setup do |config|
config.filter_attributes = [:password, :password_confirmation, :current_password, :encrypted_password]
config.localize_format = :long
config.namespace :admin do |admin|
admin.build_menu :utility_navigation do |menu|
menu.add id: "site_link",
label: "🏠",
url: "/",
html_options: { target: "_blank", title: "Open site", style: "font-size:18px;" },
priority: 1
admin.add_logout_button_to_menu menu
end
end
end