rails-image-post-solution 0.1.23 → 0.1.25

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: a63ded42219e8889a07102f23cc347cd43e44e7464cbc9b611bebdf96d3484a9
4
- data.tar.gz: e1f35c63835147c647aae29b143b0b349d81ea7f53331270c7a915ef4463e50b
3
+ metadata.gz: ef4a85e5ef75747bf39bdc2672b0b33c78dd4cb0609bfdf50cae3fe8c4d847fc
4
+ data.tar.gz: f9036730ffdb7d397fc02f960df46a083c2b763d038cd4c8435f1688093e9f9a
5
5
  SHA512:
6
- metadata.gz: 2767f9d38c23053f231ab39dcd7af5b37c436c886e3c16ee4c1a5567b8d8819744ccf7d7a241566c93bdf5f059d0a2ba457fb73991e6a8a10791996e3aa02658
7
- data.tar.gz: 68f042ea40bfffe8e62b211081be779b2407409357ec82014cd7e784c53ed74b5d3cb8aef2da07fb69a24bc3a0d95f98ddc7f4d20742979278fd8d428c78adcc
6
+ metadata.gz: 016ecc588275f07277ad3399cb271a36017112557f62e574b28b92f0db403c30a3e849036c563d715bf55dbc6be2e002977398119be9b56abb915f6aca41e14a
7
+ data.tar.gz: bf2ed7e0c22a633dad7f4c91d86587c3cc1b9a1a6b69f813b95fa29b9e32737ba66192be1038caef99bfc75eed110f2d70bea164e703624fa003db82167aa54d
@@ -61,7 +61,7 @@
61
61
  <% end %>
62
62
  </td>
63
63
  <td>
64
- <%= link_to post.user.display_name, admin_user_path(post.user), class: "user-link" %>
64
+ <%= link_to post.user.display_name, admin_user_path(id: post.user.id), class: "user-link" %>
65
65
  </td>
66
66
  <td class="reason-cell">
67
67
  <%= truncate(post.frozen_reason, length: 100) %>
@@ -80,31 +80,31 @@
80
80
  <div class="action-buttons">
81
81
  <% if post.is_a?(Stage) %>
82
82
  <% unless post.permanently_frozen? %>
83
- <%= button_to t('admin.frozen_posts.index.actions.permanent_freeze'), admin_frozen_posts_permanent_freeze_stage_path(post),
83
+ <%= button_to t('admin.frozen_posts.index.actions.permanent_freeze'), admin_frozen_posts_permanent_freeze_stage_path(id: post.id),
84
84
  method: :patch,
85
85
  class: "btn-action btn-warning",
86
86
  data: { confirm: t('admin.frozen_posts.index.confirm.permanent_freeze') } %>
87
87
  <% end %>
88
- <%= button_to t('admin.frozen_posts.index.actions.unfreeze'), admin_frozen_posts_unfreeze_stage_path(post),
88
+ <%= button_to t('admin.frozen_posts.index.actions.unfreeze'), admin_frozen_posts_unfreeze_stage_path(id: post.id),
89
89
  method: :patch,
90
90
  class: "btn-action btn-success",
91
91
  data: { confirm: t('admin.frozen_posts.index.confirm.unfreeze') } %>
92
- <%= button_to t('admin.frozen_posts.index.actions.delete'), admin_frozen_posts_destroy_stage_path(post),
92
+ <%= button_to t('admin.frozen_posts.index.actions.delete'), admin_frozen_posts_destroy_stage_path(id: post.id),
93
93
  method: :delete,
94
94
  class: "btn-action btn-danger",
95
95
  data: { confirm: t('admin.frozen_posts.index.confirm.delete') } %>
96
96
  <% else %>
97
97
  <% unless post.permanently_frozen? %>
98
- <%= button_to t('admin.frozen_posts.index.actions.permanent_freeze'), admin_frozen_posts_permanent_freeze_comment_path(post),
98
+ <%= button_to t('admin.frozen_posts.index.actions.permanent_freeze'), admin_frozen_posts_permanent_freeze_comment_path(id: post.id),
99
99
  method: :patch,
100
100
  class: "btn-action btn-warning",
101
101
  data: { confirm: t('admin.frozen_posts.index.confirm.permanent_freeze') } %>
102
102
  <% end %>
103
- <%= button_to t('admin.frozen_posts.index.actions.unfreeze'), admin_frozen_posts_unfreeze_comment_path(post),
103
+ <%= button_to t('admin.frozen_posts.index.actions.unfreeze'), admin_frozen_posts_unfreeze_comment_path(id: post.id),
104
104
  method: :patch,
105
105
  class: "btn-action btn-success",
106
106
  data: { confirm: t('admin.frozen_posts.index.confirm.unfreeze') } %>
107
- <%= button_to t('admin.frozen_posts.index.actions.delete'), admin_frozen_posts_destroy_comment_path(post),
107
+ <%= button_to t('admin.frozen_posts.index.actions.delete'), admin_frozen_posts_destroy_comment_path(id: post.id),
108
108
  method: :delete,
109
109
  class: "btn-action btn-danger",
110
110
  data: { confirm: t('admin.frozen_posts.index.confirm.delete') } %>
@@ -81,7 +81,7 @@
81
81
  <% end %>
82
82
  </td>
83
83
  <td class="actions-cell">
84
- <%= link_to t('rails_image_post_solution.admin.index.detail'), rails_image_post_solution.admin_image_report_path(report), class: "btn-action btn-detail" %>
84
+ <%= link_to t('rails_image_post_solution.admin.index.detail'), rails_image_post_solution.admin_image_report_path(id: report.id), class: "btn-action btn-detail" %>
85
85
  </td>
86
86
  </tr>
87
87
  <% end %>
@@ -140,8 +140,8 @@
140
140
  <!-- Actions -->
141
141
  <div class="detail-actions">
142
142
  <% if @report.status == RailsImagePostSolution::ImageReport::STATUSES[:pending] %>
143
- <%= button_to t('rails_image_post_solution.admin.show.confirm_button'), rails_image_post_solution.confirm_admin_image_report_path(@report), method: :patch, class: "btn btn-danger", data: { turbo_confirm: t('rails_image_post_solution.admin.show.confirm_action') } %>
144
- <%= button_to t('rails_image_post_solution.admin.show.dismiss_button'), rails_image_post_solution.dismiss_admin_image_report_path(@report), method: :patch, class: "btn btn-success", data: { turbo_confirm: t('rails_image_post_solution.admin.show.dismiss_action') } %>
143
+ <%= button_to t('rails_image_post_solution.admin.show.confirm_button'), rails_image_post_solution.confirm_admin_image_report_path(id: @report.id), method: :patch, class: "btn btn-danger", data: { turbo_confirm: t('rails_image_post_solution.admin.show.confirm_action') } %>
144
+ <%= button_to t('rails_image_post_solution.admin.show.dismiss_button'), rails_image_post_solution.dismiss_admin_image_report_path(id: @report.id), method: :patch, class: "btn btn-success", data: { turbo_confirm: t('rails_image_post_solution.admin.show.dismiss_action') } %>
145
145
  <% else %>
146
146
  <p class="text-muted"><%= t('rails_image_post_solution.admin.show.already_reviewed') %></p>
147
147
  <% end %>
@@ -73,7 +73,7 @@
73
73
  <td><%= l(user.created_at, format: :short) %></td>
74
74
  <td><%= user.stages.count %></td>
75
75
  <td class="actions-cell">
76
- <%= link_to t('admin.users.index.detail'), admin_user_path(user), class: "btn-action btn-detail" %>
76
+ <%= link_to t('admin.users.index.detail'), admin_user_path(id: user.id), class: "btn-action btn-detail" %>
77
77
  </td>
78
78
  </tr>
79
79
  <% end %>
@@ -158,7 +158,7 @@
158
158
 
159
159
  <% if @user.active? %>
160
160
  <div class="action-group">
161
- <%= form_with url: suspend_admin_user_path(@user), method: :patch, class: "inline-form" do |f| %>
161
+ <%= form_with url: suspend_admin_user_path(id: @user.id), method: :patch, class: "inline-form" do |f| %>
162
162
  <div class="form-group-inline">
163
163
  <%= f.label :duration, "#{t('admin.users.show.suspend_duration')}:" %>
164
164
  <%= f.number_field :duration, value: 7, min: 1, max: 365, class: "form-control-small" %>
@@ -172,7 +172,7 @@
172
172
  </div>
173
173
 
174
174
  <div class="action-group">
175
- <%= form_with url: ban_admin_user_path(@user), method: :patch, class: "inline-form" do |f| %>
175
+ <%= form_with url: ban_admin_user_path(id: @user.id), method: :patch, class: "inline-form" do |f| %>
176
176
  <div class="form-group-inline">
177
177
  <%= f.label :reason, "#{t('admin.users.show.ban_reason')}:" %>
178
178
  <%= f.text_area :reason, rows: 2, class: "form-control", placeholder: t('admin.users.show.ban_reason_placeholder') %>
@@ -182,11 +182,11 @@
182
182
  </div>
183
183
  <% elsif @user.suspended? %>
184
184
  <div class="action-group">
185
- <%= button_to t('admin.users.show.unsuspend_button'), unsuspend_admin_user_path(@user), method: :patch, class: "btn btn-success", data: { turbo_confirm: t('admin.users.show.unsuspend_confirm') } %>
185
+ <%= button_to t('admin.users.show.unsuspend_button'), unsuspend_admin_user_path(id: @user.id), method: :patch, class: "btn btn-success", data: { turbo_confirm: t('admin.users.show.unsuspend_confirm') } %>
186
186
  </div>
187
187
  <% elsif @user.banned? %>
188
188
  <div class="action-group">
189
- <%= button_to t('admin.users.show.unban_button'), unban_admin_user_path(@user), method: :patch, class: "btn btn-success", data: { turbo_confirm: t('admin.users.show.unban_confirm') } %>
189
+ <%= button_to t('admin.users.show.unban_button'), unban_admin_user_path(id: @user.id), method: :patch, class: "btn btn-success", data: { turbo_confirm: t('admin.users.show.unban_confirm') } %>
190
190
  </div>
191
191
  <% end %>
192
192
  </div>
data/config/routes.rb CHANGED
@@ -1,38 +1,42 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  RailsImagePostSolution::Engine.routes.draw do
4
- # User-facing report API
5
- resources :image_reports, only: [ :create ]
4
+ # Support optional locale parameter to match host application's routing
5
+ # Accept any 2-letter locale code to be flexible with host app's locales
6
+ scope "(:locale)", locale: /[a-z]{2}/ do
7
+ # User-facing report API
8
+ resources :image_reports, only: [ :create ]
6
9
 
7
- # Admin dashboard (engine controllers)
8
- namespace :admin do
9
- # Image reports management
10
- resources :image_reports, only: %i[index show] do
11
- member do
12
- patch :confirm
13
- patch :dismiss
10
+ # Admin dashboard (engine controllers)
11
+ namespace :admin do
12
+ # Image reports management
13
+ resources :image_reports, only: %i[index show] do
14
+ member do
15
+ patch :confirm
16
+ patch :dismiss
17
+ end
14
18
  end
15
- end
16
19
 
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
20
+ # User management
21
+ resources :users, only: %i[index show] do
22
+ member do
23
+ post :suspend
24
+ post :unsuspend
25
+ post :ban
26
+ post :unban
27
+ end
24
28
  end
25
- end
26
29
 
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
30
+ # Frozen posts management
31
+ resources :frozen_posts, only: [ :index ] do
32
+ collection do
33
+ post "unfreeze_stage/:id", to: "frozen_posts#unfreeze_stage", as: :unfreeze_stage
34
+ post "unfreeze_comment/:id", to: "frozen_posts#unfreeze_comment", as: :unfreeze_comment
35
+ post "permanent_freeze_stage/:id", to: "frozen_posts#permanent_freeze_stage", as: :permanent_freeze_stage
36
+ post "permanent_freeze_comment/:id", to: "frozen_posts#permanent_freeze_comment", as: :permanent_freeze_comment
37
+ delete "destroy_stage/:id", to: "frozen_posts#destroy_stage", as: :destroy_stage
38
+ delete "destroy_comment/:id", to: "frozen_posts#destroy_comment", as: :destroy_comment
39
+ end
36
40
  end
37
41
  end
38
42
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsImagePostSolution
4
- VERSION = "0.1.23"
4
+ VERSION = "0.1.25"
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.23
4
+ version: 0.1.25
5
5
  platform: ruby
6
6
  authors:
7
7
  - dhq_boiler