|
4 | 4 |
|
5 | 5 | <%= thredded_page do %> |
6 | 6 | <div class="thredded--main-section mt-6"> |
| 7 | + <% |
| 8 | + pending_review_count = Thredded::Post.pending_moderation.count |
| 9 | + approved_today_count = Thredded::Post.where(moderation_state: :approved).where('updated_at >= ?', Time.zone.now.beginning_of_day).count |
| 10 | + blocked_today_count = Thredded::Post.where(moderation_state: :blocked).where('updated_at >= ?', Time.zone.now.beginning_of_day).count |
| 11 | + %> |
7 | 12 | <!-- Moderation Stats Dashboard --> |
8 | | - <div class="moderation-dashboard grid grid-cols-2 lg:grid-cols-4 gap-4 mb-8"> |
| 13 | + <div class="moderation-dashboard grid grid-cols-2 lg:grid-cols-3 gap-4 mb-8"> |
9 | 14 | <div class="stat-card bg-white dark:bg-slate-800 rounded-lg shadow-sm border border-slate-200 dark:border-slate-700 p-6 flex flex-col items-center text-center"> |
10 | 15 | <div class="stat-icon pending text-3xl mb-2 text-amber-500"> |
11 | 16 | <i class="material-icons text-current text-3xl">pending_actions</i> |
12 | 17 | </div> |
13 | | - <div class="stat-value text-3xl font-bold dark:text-white"><%= @posts.try(:total_count) || 0 %></div> |
| 18 | + <div class="stat-value text-3xl font-bold dark:text-white"><%= pending_review_count %></div> |
14 | 19 | <div class="stat-label text-sm text-gray-500 dark:text-gray-400 uppercase tracking-widest mt-1">Pending Review</div> |
15 | 20 | </div> |
16 | 21 |
|
17 | 22 | <div class="stat-card bg-white dark:bg-slate-800 rounded-lg shadow-sm border border-slate-200 dark:border-slate-700 p-6 flex flex-col items-center text-center"> |
18 | 23 | <div class="stat-icon approved text-3xl mb-2 text-emerald-500"> |
19 | 24 | <i class="material-icons text-current text-3xl">check_circle</i> |
20 | 25 | </div> |
21 | | - <div class="stat-value text-3xl font-bold dark:text-white">--</div> |
| 26 | + <div class="stat-value text-3xl font-bold dark:text-white"><%= approved_today_count %></div> |
22 | 27 | <div class="stat-label text-sm text-gray-500 dark:text-gray-400 uppercase tracking-widest mt-1">Approved Today</div> |
23 | 28 | </div> |
24 | 29 |
|
25 | 30 | <div class="stat-card bg-white dark:bg-slate-800 rounded-lg shadow-sm border border-slate-200 dark:border-slate-700 p-6 flex flex-col items-center text-center"> |
26 | 31 | <div class="stat-icon blocked text-3xl mb-2 text-red-500"> |
27 | 32 | <i class="material-icons text-current text-3xl">block</i> |
28 | 33 | </div> |
29 | | - <div class="stat-value text-3xl font-bold dark:text-white">--</div> |
| 34 | + <div class="stat-value text-3xl font-bold dark:text-white"><%= blocked_today_count %></div> |
30 | 35 | <div class="stat-label text-sm text-gray-500 dark:text-gray-400 uppercase tracking-widest mt-1">Blocked Today</div> |
31 | 36 | </div> |
32 | 37 |
|
33 | | - <div class="stat-card bg-white dark:bg-slate-800 rounded-lg shadow-sm border border-slate-200 dark:border-slate-700 p-6 flex flex-col items-center text-center"> |
34 | | - <div class="stat-icon users text-3xl mb-2 text-blue-500"> |
35 | | - <i class="material-icons text-current text-3xl">group</i> |
36 | | - </div> |
37 | | - <div class="stat-value text-3xl font-bold dark:text-white">--</div> |
38 | | - <div class="stat-label text-sm text-gray-500 dark:text-gray-400 uppercase tracking-widest mt-1">Active Users</div> |
39 | | - </div> |
40 | 38 | </div> |
41 | 39 |
|
42 | 40 | <!-- Last Moderated Notice --> |
|
0 commit comments