Skip to content

Commit

Permalink
Feature: Adds active announcements tile to v2 admin dashboard.
Browse files Browse the repository at this point in the history
  • Loading branch information
ZachBaird committed Oct 13, 2024
1 parent f2f9562 commit f47a342
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/controllers/admin/dashboard_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ module Admin
class DashboardController < Admin::BaseController
def show
@active_flags_count = Flag.count_for(:active)
@active_announcements_count = Announcement.active.count
end
end
end
7 changes: 6 additions & 1 deletion app/views/admin/dashboard/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@
<dd class="mt-1 text-3xl font-semibold tracking-tight text-gray-800 dark:text-gray-200"><%= @active_flags_count %></dd>
</li>
<% end %>

<%= link_to admin_announcements_path do %>
<li class="overflow-hidden rounded-lg bg-white dark:bg-gray-800 px-4 py-5 hover:border-gray-300 border border-gray-200 dark:border-gray-700 dark:hover:border-gray-600 sm:p-6">
<dt class="truncate text-sm font-medium text-gray-500 dark:text-gray-300">Active announcements</dt>
<dd class="mt-1 text-3xl font-semibold tracking-tight text-gray-800 dark:text-gray-200"><%= @active_announcements_count %></dd>
</li>
<% end %>
</ul>

<div class="border-b border-gray-200 dark:border-gray-800 pb-5 mt-6">
Expand Down

0 comments on commit f47a342

Please sign in to comment.