rails-image-post-solution 0.1.3 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c7571374228755e2620e8e36a0ec464bbe97a52c6b1777700db8aa318576fdb9
4
- data.tar.gz: f39a22c93948a4765d7b56a615cb75dce86f5dcb1237ff211937e58888416869
3
+ metadata.gz: 53bedd05012e7de53fb923d5f59bfad301425de29b0878403c0b2567bfaddef5
4
+ data.tar.gz: d48a1d5c4f4ad3df39131b85b55ab47c4029c5cf44b29d16ae502b5ddd6039ed
5
5
  SHA512:
6
- metadata.gz: 86ab4ec85cc0745707befb5398e7b48adb115f788e995678f3af75b1033eabe899360a6ac173ddaca0b1591cf57a1f7a105e38b975aa08993dad1534e075e962
7
- data.tar.gz: b8d5afcecb509146557a7446ded4fd8dbc2fa277d7512ec14cef678e8e74a09e46dd3203ccf951afe46ea0454fedd87dc3ebde7325593a6a78164b93b2f53e27
6
+ metadata.gz: b6afda9c3e23182b67be36065bc91cc5208d5f43bcd60196f10565a9ae8f9fc42242bd44939fdc21474b9951a4fd856c528575247132b66c02e7e698923b7555
7
+ data.tar.gz: b021855c6bc5aaaba5059914e47641dca0bf3a8c9453fb20adf243d383553f5537b8a01993cc97bcfc9f2604c0a707c77ebaed421c555211fd9ec70d141eae67
data/README.md CHANGED
@@ -62,32 +62,9 @@ Mount the engine in your `config/routes.rb`:
62
62
 
63
63
  ```ruby
64
64
  Rails.application.routes.draw do
65
- # Mount the engine
65
+ # Mount the engine - all admin features will be accessible at /moderation/admin/*
66
66
  mount RailsImagePostSolution::Engine => "/moderation"
67
67
 
68
- # Optional: Add admin routes for extended features (user management, frozen posts)
69
- namespace :admin do
70
- resources :users, only: %i[index show] do
71
- member do
72
- post :suspend
73
- post :unsuspend
74
- post :ban
75
- post :unban
76
- end
77
- end
78
-
79
- resources :frozen_posts, only: [:index] do
80
- collection do
81
- post "unfreeze_stage/:id", to: "frozen_posts#unfreeze_stage", as: :unfreeze_stage
82
- post "unfreeze_comment/:id", to: "frozen_posts#unfreeze_comment", as: :unfreeze_comment
83
- post "permanent_freeze_stage/:id", to: "frozen_posts#permanent_freeze_stage", as: :permanent_freeze_stage
84
- post "permanent_freeze_comment/:id", to: "frozen_posts#permanent_freeze_comment", as: :permanent_freeze_comment
85
- delete "destroy_stage/:id", to: "frozen_posts#destroy_stage", as: :destroy_stage
86
- delete "destroy_comment/:id", to: "frozen_posts#destroy_comment", as: :destroy_comment
87
- end
88
- end
89
- end
90
-
91
68
  # ... your other routes
92
69
  end
93
70
  ```
@@ -319,64 +296,48 @@ end
319
296
 
320
297
  ## Routes
321
298
 
322
- ### Engine Routes (via /moderation mount point)
299
+ The engine provides the following routes when mounted at `/moderation`:
323
300
 
324
- The engine provides these routes when mounted at `/moderation`:
301
+ ### Using Route Helpers
325
302
 
326
- ```
327
- POST /moderation/image_reports # Create report
328
- GET /moderation/admin/image_reports # List all reports
329
- GET /moderation/admin/image_reports/:id # View report details
330
- PATCH /moderation/admin/image_reports/:id/confirm # Mark as inappropriate
331
- PATCH /moderation/admin/image_reports/:id/dismiss # Mark as safe
332
- ```
303
+ The engine automatically makes route helpers available in your application. You can use them directly:
333
304
 
334
- ### Host Application Routes (Required for Extended Features)
305
+ ```ruby
306
+ # In your views or controllers
307
+ admin_image_reports_path # => /moderation/admin/image_reports
308
+ admin_user_path(@user) # => /moderation/admin/users/:id
309
+ image_reports_path # => /moderation/image_reports
335
310
 
336
- The gem provides additional admin controllers in `app/controllers/admin/` that you can use in your host application. **You must add these routes to your host application's `config/routes.rb`** to use them:
311
+ # Or use the engine namespace explicitly
312
+ rails_image_post_solution.admin_image_reports_path
313
+ ```
337
314
 
338
- ```ruby
339
- namespace :admin do
340
- # User management
341
- resources :users, only: %i[index show] do
342
- member do
343
- post :suspend
344
- post :unsuspend
345
- post :ban
346
- post :unban
347
- end
348
- end
315
+ ### User-Facing Routes
349
316
 
350
- # Frozen posts management
351
- resources :frozen_posts, only: [:index] do
352
- collection do
353
- post "unfreeze_stage/:id", to: "frozen_posts#unfreeze_stage", as: :admin_unfreeze_stage
354
- post "unfreeze_comment/:id", to: "frozen_posts#unfreeze_comment", as: :admin_unfreeze_comment
355
- post "permanent_freeze_stage/:id", to: "frozen_posts#permanent_freeze_stage", as: :admin_permanent_freeze_stage
356
- post "permanent_freeze_comment/:id", to: "frozen_posts#permanent_freeze_comment", as: :admin_permanent_freeze_comment
357
- delete "destroy_stage/:id", to: "frozen_posts#destroy_stage", as: :admin_destroy_stage
358
- delete "destroy_comment/:id", to: "frozen_posts#destroy_comment", as: :admin_destroy_comment
359
- end
360
- end
361
- end
317
+ ```
318
+ POST /moderation/image_reports # Create report
362
319
  ```
363
320
 
364
- This provides these routes:
321
+ ### Admin Routes
365
322
 
366
323
  ```
367
- GET /admin/users # List all users
368
- GET /admin/users/:id # View user details
369
- POST /admin/users/:id/suspend # Suspend user
370
- POST /admin/users/:id/unsuspend # Unsuspend user
371
- POST /admin/users/:id/ban # Ban user
372
- POST /admin/users/:id/unban # Unban user
373
- GET /admin/frozen_posts # List frozen posts
374
- POST /admin/frozen_posts/unfreeze_stage/:id # Unfreeze a stage
375
- POST /admin/frozen_posts/unfreeze_comment/:id # Unfreeze a comment
376
- POST /admin/frozen_posts/permanent_freeze_stage/:id # Permanently freeze a stage
377
- POST /admin/frozen_posts/permanent_freeze_comment/:id # Permanently freeze a comment
378
- DELETE /admin/frozen_posts/destroy_stage/:id # Delete a frozen stage
379
- DELETE /admin/frozen_posts/destroy_comment/:id # Delete a frozen comment
324
+ GET /moderation/admin/image_reports # List all reports
325
+ GET /moderation/admin/image_reports/:id # View report details
326
+ PATCH /moderation/admin/image_reports/:id/confirm # Mark as inappropriate
327
+ PATCH /moderation/admin/image_reports/:id/dismiss # Mark as safe
328
+ GET /moderation/admin/users # List all users
329
+ GET /moderation/admin/users/:id # View user details
330
+ POST /moderation/admin/users/:id/suspend # Suspend user
331
+ POST /moderation/admin/users/:id/unsuspend # Unsuspend user
332
+ POST /moderation/admin/users/:id/ban # Ban user
333
+ POST /moderation/admin/users/:id/unban # Unban user
334
+ GET /moderation/admin/frozen_posts # List frozen posts
335
+ POST /moderation/admin/frozen_posts/unfreeze_stage/:id # Unfreeze a stage
336
+ POST /moderation/admin/frozen_posts/unfreeze_comment/:id # Unfreeze a comment
337
+ POST /moderation/admin/frozen_posts/permanent_freeze_stage/:id # Permanently freeze a stage
338
+ POST /moderation/admin/frozen_posts/permanent_freeze_comment/:id # Permanently freeze a comment
339
+ DELETE /moderation/admin/frozen_posts/destroy_stage/:id # Delete a frozen stage
340
+ DELETE /moderation/admin/frozen_posts/destroy_comment/:id # Delete a frozen comment
380
341
  ```
381
342
 
382
343
  ## Customization
@@ -1,7 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module Admin
4
- class FrozenPostsController < ApplicationController
3
+ module RailsImagePostSolution
4
+ module Admin
5
+ class FrozenPostsController < ApplicationController
5
6
  before_action :require_login
6
7
  before_action :require_admin
7
8
 
@@ -75,5 +76,6 @@ module Admin
75
76
 
76
77
  redirect_to root_path, alert: I18n.t("admin.flash.access_denied")
77
78
  end
79
+ end
78
80
  end
79
81
  end
@@ -1,7 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module Admin
4
- class UsersController < ApplicationController
3
+ module RailsImagePostSolution
4
+ module Admin
5
+ class UsersController < ApplicationController
5
6
  before_action :require_login
6
7
  before_action :require_admin
7
8
  before_action :set_user, only: %i[show suspend unsuspend ban unban]
@@ -96,5 +97,6 @@ module Admin
96
97
 
97
98
  redirect_to root_path, alert: I18n.t("admin.flash.admin_access_only")
98
99
  end
100
+ end
99
101
  end
100
102
  end
data/config/routes.rb CHANGED
@@ -6,11 +6,34 @@ RailsImagePostSolution::Engine.routes.draw do
6
6
 
7
7
  # Admin dashboard (engine controllers)
8
8
  namespace :admin do
9
+ # Image reports management
9
10
  resources :image_reports, only: %i[index show] do
10
11
  member do
11
12
  patch :confirm
12
13
  patch :dismiss
13
14
  end
14
15
  end
16
+
17
+ # User management
18
+ resources :users, only: %i[index show] do
19
+ member do
20
+ post :suspend
21
+ post :unsuspend
22
+ post :ban
23
+ post :unban
24
+ end
25
+ end
26
+
27
+ # Frozen posts management
28
+ resources :frozen_posts, only: [ :index ] do
29
+ collection do
30
+ post "unfreeze_stage/:id", to: "frozen_posts#unfreeze_stage", as: :unfreeze_stage
31
+ post "unfreeze_comment/:id", to: "frozen_posts#unfreeze_comment", as: :unfreeze_comment
32
+ post "permanent_freeze_stage/:id", to: "frozen_posts#permanent_freeze_stage", as: :permanent_freeze_stage
33
+ post "permanent_freeze_comment/:id", to: "frozen_posts#permanent_freeze_comment", as: :permanent_freeze_comment
34
+ delete "destroy_stage/:id", to: "frozen_posts#destroy_stage", as: :destroy_stage
35
+ delete "destroy_comment/:id", to: "frozen_posts#destroy_comment", as: :destroy_comment
36
+ end
37
+ end
15
38
  end
16
39
  end
@@ -18,5 +18,32 @@ module RailsImagePostSolution
18
18
  initializer "rails_image_post_solution.assets" do |app|
19
19
  app.config.assets.paths << root.join("app/assets")
20
20
  end
21
+
22
+ # Make engine route helpers available in the main application
23
+ initializer "rails_image_post_solution.route_helpers" do
24
+ config.after_initialize do
25
+ Rails.application.routes.url_helpers.class_eval do
26
+ # Delegate common route helpers to the engine
27
+ delegate :admin_image_reports_path, :admin_image_reports_url,
28
+ :admin_image_report_path, :admin_image_report_url,
29
+ :confirm_admin_image_report_path, :confirm_admin_image_report_url,
30
+ :dismiss_admin_image_report_path, :dismiss_admin_image_report_url,
31
+ :admin_users_path, :admin_users_url,
32
+ :admin_user_path, :admin_user_url,
33
+ :suspend_admin_user_path, :suspend_admin_user_url,
34
+ :unsuspend_admin_user_path, :unsuspend_admin_user_url,
35
+ :ban_admin_user_path, :ban_admin_user_url,
36
+ :unban_admin_user_path, :unban_admin_user_url,
37
+ :admin_frozen_posts_path, :admin_frozen_posts_url,
38
+ :image_reports_path, :image_reports_url,
39
+ to: RailsImagePostSolution::Engine.routes.url_helpers
40
+ end
41
+
42
+ # Also make helpers available in controllers and views
43
+ ActiveSupport.on_load(:action_controller_base) do
44
+ helper RailsImagePostSolution::Engine.routes.url_helpers
45
+ end
46
+ end
47
+ end
21
48
  end
22
49
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsImagePostSolution
4
- VERSION = "0.1.3"
4
+ VERSION = "0.1.5"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-image-post-solution
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - dhq_boiler
@@ -93,21 +93,19 @@ files:
93
93
  - LICENSE.txt
94
94
  - README.md
95
95
  - Rakefile
96
- - app/controllers/admin/frozen_posts_controller.rb
97
- - app/controllers/admin/image_reports_controller.rb
98
- - app/controllers/admin/users_controller.rb
96
+ - app/controllers/rails_image_post_solution/admin/frozen_posts_controller.rb
99
97
  - app/controllers/rails_image_post_solution/admin/image_reports_controller.rb
98
+ - app/controllers/rails_image_post_solution/admin/image_reports_controller.rb.bak
99
+ - app/controllers/rails_image_post_solution/admin/users_controller.rb
100
100
  - app/controllers/rails_image_post_solution/image_reports_controller.rb
101
101
  - app/jobs/rails_image_post_solution/image_moderation_job.rb
102
102
  - app/models/rails_image_post_solution/image_report.rb
103
103
  - app/services/rails_image_post_solution/openai_vision_service.rb
104
- - app/views/admin/frozen_posts/index.html.erb
105
- - app/views/admin/image_reports/index.html.erb
106
- - app/views/admin/image_reports/show.html.erb
107
- - app/views/admin/users/index.html.erb
108
- - app/views/admin/users/show.html.erb
104
+ - app/views/rails_image_post_solution/admin/frozen_posts/index.html.erb
109
105
  - app/views/rails_image_post_solution/admin/image_reports/index.html.erb
110
106
  - app/views/rails_image_post_solution/admin/image_reports/show.html.erb
107
+ - app/views/rails_image_post_solution/admin/users/index.html.erb
108
+ - app/views/rails_image_post_solution/admin/users/show.html.erb
111
109
  - app/views/shared/_image_report_button.html.erb
112
110
  - app/views/shared/_image_report_modal.html.erb
113
111
  - config/locales/en.yml
@@ -1,94 +0,0 @@
1
- <div class="admin-container">
2
- <h1 class="admin-header"><%= t('rails_image_post_solution.admin.index.title') %></h1>
3
-
4
- <!-- Statistics -->
5
- <div class="admin-stats">
6
- <div class="stat-card">
7
- <div class="stat-label"><%= t('rails_image_post_solution.admin.index.stats.total') %></div>
8
- <div class="stat-value"><%= @stats[:total] %></div>
9
- </div>
10
- <div class="stat-card pending">
11
- <div class="stat-label"><%= t('rails_image_post_solution.admin.index.stats.pending') %></div>
12
- <div class="stat-value"><%= @stats[:pending] %></div>
13
- </div>
14
- <div class="stat-card confirmed">
15
- <div class="stat-label"><%= t('rails_image_post_solution.admin.index.stats.confirmed') %></div>
16
- <div class="stat-value"><%= @stats[:confirmed] %></div>
17
- </div>
18
- <div class="stat-card dismissed">
19
- <div class="stat-label"><%= t('rails_image_post_solution.admin.index.stats.dismissed') %></div>
20
- <div class="stat-value"><%= @stats[:dismissed] %></div>
21
- </div>
22
- <div class="stat-card reviewed">
23
- <div class="stat-label"><%= t('rails_image_post_solution.admin.index.stats.reviewed') %></div>
24
- <div class="stat-value"><%= @stats[:reviewed] %></div>
25
- </div>
26
- </div>
27
-
28
- <!-- Filters -->
29
- <div class="admin-filters">
30
- <%= link_to t('rails_image_post_solution.admin.index.filters.all'), admin_image_reports_path, class: "filter-btn #{'active' if @status_filter == 'all'}" %>
31
- <%= link_to t('rails_image_post_solution.admin.index.filters.pending'), admin_image_reports_path(status: 'pending'), class: "filter-btn #{'active' if @status_filter == 'pending'}" %>
32
- <%= link_to t('rails_image_post_solution.admin.index.filters.confirmed'), admin_image_reports_path(status: 'confirmed'), class: "filter-btn #{'active' if @status_filter == 'confirmed'}" %>
33
- <%= link_to t('rails_image_post_solution.admin.index.filters.dismissed'), admin_image_reports_path(status: 'dismissed'), class: "filter-btn #{'active' if @status_filter == 'dismissed'}" %>
34
- <%= link_to t('rails_image_post_solution.admin.index.filters.reviewed'), admin_image_reports_path(status: 'reviewed'), class: "filter-btn #{'active' if @status_filter == 'reviewed'}" %>
35
- </div>
36
-
37
- <!-- Reports List -->
38
- <div class="admin-reports-list">
39
- <% if @reports.any? %>
40
- <table class="admin-table">
41
- <thead>
42
- <tr>
43
- <th><%= t('rails_image_post_solution.admin.index.table.image') %></th>
44
- <th><%= t('rails_image_post_solution.admin.index.table.reporter') %></th>
45
- <th><%= t('rails_image_post_solution.admin.index.table.reason') %></th>
46
- <th><%= t('rails_image_post_solution.admin.index.table.status') %></th>
47
- <th><%= t('rails_image_post_solution.admin.index.table.reported_at') %></th>
48
- <th><%= t('rails_image_post_solution.admin.index.table.reviewer') %></th>
49
- <th><%= t('rails_image_post_solution.admin.index.table.actions') %></th>
50
- </tr>
51
- </thead>
52
- <tbody>
53
- <% @reports.each do |report| %>
54
- <tr class="report-row status-<%= report.status %>">
55
- <td class="image-cell">
56
- <% if report.active_storage_attachment.present? %>
57
- <%= image_tag report.active_storage_attachment.blob, class: "admin-thumbnail", style: "max-width: 100px; max-height: 100px;" %>
58
- <% else %>
59
- <span class="text-muted"><%= t('rails_image_post_solution.admin.index.deleted') %></span>
60
- <% end %>
61
- </td>
62
- <td><%= link_to report.user.display_name, user_path(report.user), class: "user-link" %></td>
63
- <td class="reason-cell"><%= truncate(report.reason, length: 50) || t('rails_image_post_solution.admin.index.no_reason') %></td>
64
- <td>
65
- <span class="status-badge status-<%= report.status %>">
66
- <%= t("rails_image_post_solution.image_report.statuses.#{report.status}") %>
67
- </span>
68
- </td>
69
- <td><%= l(report.created_at, format: :long) %></td>
70
- <td>
71
- <% if report.reviewed_by %>
72
- <%= report.reviewed_by.display_name %>
73
- <% else %>
74
- <span class="text-muted">-</span>
75
- <% end %>
76
- </td>
77
- <td class="actions-cell">
78
- <%= link_to t('rails_image_post_solution.admin.index.detail'), admin_image_report_path(report), class: "btn-action btn-detail" %>
79
- </td>
80
- </tr>
81
- <% end %>
82
- </tbody>
83
- </table>
84
- <% else %>
85
- <div class="empty-state">
86
- <p><%= t('rails_image_post_solution.admin.index.no_reports') %></p>
87
- </div>
88
- <% end %>
89
- </div>
90
-
91
- <div class="admin-actions">
92
- <%= link_to t('rails_image_post_solution.admin.index.back'), root_path, class: "btn btn-secondary" %>
93
- </div>
94
- </div>
@@ -1,138 +0,0 @@
1
- <div class="admin-container">
2
- <h1 class="admin-header"><%= t('rails_image_post_solution.admin.show.title') %></h1>
3
-
4
- <div class="report-detail">
5
- <!-- Image Display -->
6
- <div class="detail-section">
7
- <h3><%= t('rails_image_post_solution.admin.show.reported_image') %></h3>
8
- <% if @attachment.present? %>
9
- <div class="reported-image-container">
10
- <%= image_tag @attachment.blob, class: "reported-image-large", style: "max-width: 800px; max-height: 600px;" %>
11
- </div>
12
- <% else %>
13
- <p class="text-muted"><%= t('rails_image_post_solution.admin.show.image_deleted') %></p>
14
- <% end %>
15
- </div>
16
-
17
- <!-- Report Information -->
18
- <div class="detail-section">
19
- <h3><%= t('rails_image_post_solution.admin.show.report_info') %></h3>
20
- <table class="detail-table">
21
- <tr>
22
- <th><%= t('rails_image_post_solution.admin.show.status') %></th>
23
- <td>
24
- <span class="status-badge status-<%= @report.status %>">
25
- <%= t("rails_image_post_solution.image_report.statuses.#{@report.status}") %>
26
- </span>
27
- </td>
28
- </tr>
29
- <tr>
30
- <th><%= t('rails_image_post_solution.admin.show.reporter') %></th>
31
- <td><%= link_to @report.user.display_name, user_path(@report.user), class: "user-link" %></td>
32
- </tr>
33
- <tr>
34
- <th><%= t('rails_image_post_solution.admin.show.reason') %></th>
35
- <td><%= simple_format(@report.reason) || t('rails_image_post_solution.admin.show.no_reason') %></td>
36
- </tr>
37
- <tr>
38
- <th><%= t('rails_image_post_solution.admin.show.reported_at') %></th>
39
- <td><%= l(@report.created_at, format: :long) %></td>
40
- </tr>
41
- <% if @report.reviewed_by %>
42
- <tr>
43
- <th><%= t('rails_image_post_solution.admin.show.reviewer') %></th>
44
- <td><%= @report.reviewed_by.display_name %></td>
45
- </tr>
46
- <tr>
47
- <th><%= t('rails_image_post_solution.admin.show.reviewed_at') %></th>
48
- <td><%= l(@report.reviewed_at, format: :long) %></td>
49
- </tr>
50
- <% end %>
51
- </table>
52
- </div>
53
-
54
- <!-- Image Poster Information -->
55
- <% if @reported_user %>
56
- <div class="detail-section">
57
- <h3><%= t('rails_image_post_solution.admin.show.image_poster') %></h3>
58
- <table class="detail-table">
59
- <tr>
60
- <th><%= t('rails_image_post_solution.admin.show.username') %></th>
61
- <td><%= link_to @reported_user.display_name, user_path(@reported_user), class: "user-link" %></td>
62
- </tr>
63
- <tr>
64
- <th><%= t('rails_image_post_solution.admin.show.user_status') %></th>
65
- <td>
66
- <% if @reported_user.banned? %>
67
- <span class="user-status-badge banned"><%= t('rails_image_post_solution.admin.show.banned') %></span>
68
- <% elsif @reported_user.suspended? %>
69
- <span class="user-status-badge suspended"><%= t('rails_image_post_solution.admin.show.suspended') %></span>
70
- <% else %>
71
- <span class="user-status-badge active"><%= t('rails_image_post_solution.admin.show.active') %></span>
72
- <% end %>
73
- </td>
74
- </tr>
75
- </table>
76
- </div>
77
- <% end %>
78
-
79
- <!-- Other Reports for Same Image -->
80
- <div class="detail-section">
81
- <h3><%= t('rails_image_post_solution.admin.show.all_reports_title', count: @all_reports.count) %></h3>
82
- <% if @all_reports.count > 1 %>
83
- <table class="admin-table">
84
- <thead>
85
- <tr>
86
- <th><%= t('rails_image_post_solution.admin.index.table.reporter') %></th>
87
- <th><%= t('rails_image_post_solution.admin.index.table.reason') %></th>
88
- <th><%= t('rails_image_post_solution.admin.index.table.status') %></th>
89
- <th><%= t('rails_image_post_solution.admin.index.table.reported_at') %></th>
90
- </tr>
91
- </thead>
92
- <tbody>
93
- <% @all_reports.each do |r| %>
94
- <tr class="<%= 'current-report' if r.id == @report.id %>">
95
- <td>
96
- <%= link_to r.user.display_name, user_path(r.user), class: "user-link" %>
97
- <% if r.id == @report.id %>
98
- <span class="badge-current"><%= t('rails_image_post_solution.admin.show.current') %></span>
99
- <% end %>
100
- </td>
101
- <td><%= truncate(r.reason, length: 50) || t('rails_image_post_solution.admin.index.no_reason') %></td>
102
- <td>
103
- <span class="status-badge status-<%= r.status %>">
104
- <%= t("rails_image_post_solution.image_report.statuses.#{r.status}") %>
105
- </span>
106
- </td>
107
- <td><%= l(r.created_at, format: :long) %></td>
108
- </tr>
109
- <% end %>
110
- </tbody>
111
- </table>
112
- <% else %>
113
- <p class="text-muted"><%= t('rails_image_post_solution.admin.show.single_report') %></p>
114
- <% end %>
115
- </div>
116
-
117
- <!-- Actions -->
118
- <div class="detail-actions">
119
- <% if @report.status == ImageReport::STATUSES[:pending] %>
120
- <%= button_to t('rails_image_post_solution.admin.show.confirm_button'), confirm_admin_image_report_path(@report), method: :patch, class: "btn btn-danger", data: { turbo_confirm: t('rails_image_post_solution.admin.show.confirm_action') } %>
121
- <%= button_to t('rails_image_post_solution.admin.show.dismiss_button'), dismiss_admin_image_report_path(@report), method: :patch, class: "btn btn-success", data: { turbo_confirm: t('rails_image_post_solution.admin.show.dismiss_action') } %>
122
- <% else %>
123
- <p class="text-muted"><%= t('rails_image_post_solution.admin.show.already_reviewed') %></p>
124
- <% end %>
125
-
126
- <% if @reported_user && @reported_user.active? %>
127
- <div class="user-actions">
128
- <h4><%= t('rails_image_post_solution.admin.show.user_actions') %></h4>
129
- <%= link_to t('rails_image_post_solution.admin.show.view_user_admin'), admin_user_path(@reported_user), class: "btn btn-secondary" %>
130
- </div>
131
- <% end %>
132
- </div>
133
- </div>
134
-
135
- <div class="admin-actions">
136
- <%= link_to t('rails_image_post_solution.admin.show.back_to_list'), admin_image_reports_path, class: "btn btn-default" %>
137
- </div>
138
- </div>