fix: Allow Iframes requests on portal controller (#7858)

This commit is contained in:
Nithin David Thomas
2023-09-06 14:25:03 +05:30
committed by GitHub
parent 99bb074656
commit a8009c7b39
2 changed files with 7 additions and 2 deletions

View File

@@ -1,6 +1,7 @@
class Public::Api::V1::Portals::BaseController < PublicController
before_action :show_plain_layout
around_action :set_locale
after_action :allow_iframe_requests
private
@@ -39,4 +40,8 @@ class Public::Api::V1::Portals::BaseController < PublicController
I18n.with_locale(@locale, &)
end
def allow_iframe_requests
response.headers.delete('X-Frame-Options') if @is_plain_layout_enabled
end
end

View File

@@ -37,13 +37,13 @@
</div>
</div>
<% else %>
<div class="max-w-6xl p-8 mx-auto space-y-4 w-full">
<div class="max-w-6xl p-8 mx-auto space-y-4 w-full <%= @is_plain_layout_enabled ? 'px-8 py-4' : 'p-8' %>">
<%= render "public/api/v1/portals/articles/article_header", article: @article %>
</div>
<% end %>
<div class="flex max-w-6xl w-full px-8 mx-auto">
<article id="cw-article-content" class="flex-grow flex-2 py-12 mx-auto text-slate-800 text-lg max-w-3xl prose break-words">
<article id="cw-article-content" class="flex-grow flex-2 mx-auto text-slate-800 text-lg max-w-3xl prose break-words w-full <%= @is_plain_layout_enabled ? 'py-4' : 'py-12' %>">
<%= @parsed_content %>
</article>
<div class="flex-1" id="cw-hc-toc"></div>