rails-image-post-solution 0.1.19 → 0.1.21
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 +4 -4
- data/app/controllers/rails_image_post_solution/application_controller.rb +15 -2
- data/app/views/rails_image_post_solution/admin/image_reports/index.html.erb +1 -1
- data/app/views/rails_image_post_solution/admin/image_reports/show.html.erb +1 -1
- data/lib/rails_image_post_solution/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 35594d5a6f9cda075e583af74f9ff17aafdf598bc0eb815adbfd86c7c164f66e
|
|
4
|
+
data.tar.gz: 33b5f597cea3c34477866d350e3d405ee3c69194ee020e118575585684010fc7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bfcad48d82a46e37f13acf454b04de447a2992e765e9eed4714ba3231a84b7b118ddc0d3cbca2b99e73463d50aae210d65a6c0437309d2cc6d23ac036982a14a
|
|
7
|
+
data.tar.gz: 9bf67e931816a16d3b402b4ab810f4f811e2f9b2bb857336e416a40fcd55f3038345664e3d531e75a47f708a9df43e3f38299309a60275530ec2c53e781148b6
|
|
@@ -5,8 +5,8 @@ module RailsImagePostSolution
|
|
|
5
5
|
# Engine's base controller inherits from host application's ApplicationController
|
|
6
6
|
# This allows the engine to use the host app's authentication methods
|
|
7
7
|
|
|
8
|
-
#
|
|
9
|
-
|
|
8
|
+
# Add engine view path before rendering
|
|
9
|
+
before_action :add_engine_view_path
|
|
10
10
|
|
|
11
11
|
# Override require_login to use main_app routes
|
|
12
12
|
def require_login
|
|
@@ -26,5 +26,18 @@ module RailsImagePostSolution
|
|
|
26
26
|
redirect_to main_app.root_path, alert: I18n.t("errors.messages.admin_required")
|
|
27
27
|
end
|
|
28
28
|
end
|
|
29
|
+
|
|
30
|
+
private
|
|
31
|
+
|
|
32
|
+
def add_engine_view_path
|
|
33
|
+
prepend_view_path Engine.root.join("app", "views")
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Make main_app available as a helper
|
|
37
|
+
helper_method :main_app
|
|
38
|
+
|
|
39
|
+
def main_app
|
|
40
|
+
Rails.application.routes.url_helpers
|
|
41
|
+
end
|
|
29
42
|
end
|
|
30
43
|
end
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
<tr class="report-row status-<%= report.status %>">
|
|
55
55
|
<td class="image-cell">
|
|
56
56
|
<% if report.active_storage_attachment.present? %>
|
|
57
|
-
<%= image_tag
|
|
57
|
+
<%= image_tag main_app.rails_blob_path(report.active_storage_attachment, only_path: true), class: "admin-thumbnail", style: "max-width: 100px; max-height: 100px;" %>
|
|
58
58
|
<% else %>
|
|
59
59
|
<span class="text-muted"><%= t('rails_image_post_solution.admin.index.deleted') %></span>
|
|
60
60
|
<% end %>
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
<h3><%= t('rails_image_post_solution.admin.show.reported_image') %></h3>
|
|
8
8
|
<% if @attachment.present? %>
|
|
9
9
|
<div class="reported-image-container">
|
|
10
|
-
<%= image_tag
|
|
10
|
+
<%= image_tag main_app.rails_blob_path(@attachment, only_path: true), class: "reported-image-large", style: "max-width: 800px; max-height: 600px;" %>
|
|
11
11
|
</div>
|
|
12
12
|
<% else %>
|
|
13
13
|
<p class="text-muted"><%= t('rails_image_post_solution.admin.show.image_deleted') %></p>
|