Skip to content
Snippets Groups Projects
Commit 477f89c2 authored by Arnaud Levy's avatar Arnaud Levy
Browse files

preview style

parent 8c60943a
No related branches found
No related tags found
No related merge requests found
......@@ -2,11 +2,15 @@ module Communication::Website::WithStyle
extend ActiveSupport::Concern
def preview_style
return '' if url.blank?
return '' unless has_style?
load_style if style_outdated?
style
end
def has_style?
!url.blank?
end
protected
def load_style
......
......@@ -4,7 +4,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title><%= yield :title %></title>
<% if @website %>
<% if @website && @website.has_style? %>
<link rel="stylesheet" media="all" href="<%= style_admin_communication_website_path @website.id, website_id: nil %>" />
<% else %>
<%= stylesheet_link_tag 'admin', media: 'all' %>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment