rails-image-post-solution 0.1.24 → 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: f32f75fd07e37c7c16a35a6dd5208b35d38d21e386105ae67d49a716c986e1d7
4
- data.tar.gz: b96305b583f3b91320c3bd1b59f821f291ab6760dccab9a462bd5a7a36ac3488
3
+ metadata.gz: ef4a85e5ef75747bf39bdc2672b0b33c78dd4cb0609bfdf50cae3fe8c4d847fc
4
+ data.tar.gz: f9036730ffdb7d397fc02f960df46a083c2b763d038cd4c8435f1688093e9f9a
5
5
  SHA512:
6
- metadata.gz: add145b850e52bfc3299b9b4c1ffb4f2b565fbc5d8ba62d318ff7bd2b1bfaa742da0fdd7d2c421fdbc9bbedea35b58f469fac6d7d1ccc5d01da253590b019cbe
7
- data.tar.gz: 39bcaf22938556e816ab652f4aceec203d0670a03bc8ad11a0bbf0d4db1c600247f7d135f06337bc2cb355c1ee021c26cde0cbdb2701f2800e95054aa633b995
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
@@ -2,7 +2,8 @@
2
2
 
3
3
  RailsImagePostSolution::Engine.routes.draw do
4
4
  # Support optional locale parameter to match host application's routing
5
- scope "(:locale)", locale: /#{I18n.available_locales.join("|")}/ do
5
+ # Accept any 2-letter locale code to be flexible with host app's locales
6
+ scope "(:locale)", locale: /[a-z]{2}/ do
6
7
  # User-facing report API
7
8
  resources :image_reports, only: [ :create ]
8
9
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsImagePostSolution
4
- VERSION = "0.1.24"
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.24
4
+ version: 0.1.25
5
5
  platform: ruby
6
6
  authors:
7
7
  - dhq_boiler