Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load css for domain #49

Closed
wants to merge 2 commits into from

Conversation

gfedorenko
Copy link
Contributor

No description provided.


def domain_stylesheet
website = Website.find_by_domain(request.domain)
@styles = website.nil? || website.stylesheet.empty? ? nil : website.stylesheet
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unless @stylesheet_url.nil?
  website = Website.find_by_domain(request.domain)
  if(website.nil? || website.stylesheet.empty?)
    @stylesheet_url = :default
  else
    @stylesheet_url = website.stylesheet
  end
  
end
return @stylesheet_url

@@ -5,6 +5,7 @@
<title>Barong Admin</title>
<%= csrf_meta_tags %>
<%= stylesheet_link_tag 'admin', media: 'all' %>
<%= stylesheet_link_tag @styles unless @styles.nil? %>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make a helper:
domain_stylesheet_tag(domain_stylesheet())

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants