mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 07:34:18 +08:00
8e3691d537
Before this change, calling `StyleSheet::Manager.stylesheet_details` for the first time resulted in multiple queries to the database. This is because the code was modelled in a way where each `Theme` was loaded from the database one at a time. This PR restructures the code such that it allows us to load all the theme records in a single query. It also allows us to eager load the required associations upfront. In order to achieve this, I removed the support of loading multiple themes per request. It was initially added to support user selectable theme components but the feature was never completed and abandoned because it wasn't a feature that we thought was worth building.
78 lines
3.2 KiB
Plaintext
78 lines
3.2 KiB
Plaintext
<!DOCTYPE html>
|
|
<html lang="<%= html_lang %>">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title><%= content_for?(:title) ? yield(:title) : SiteSetting.title %></title>
|
|
<meta name="description" content="<%= @description_meta || SiteSetting.site_description %>">
|
|
<%= render partial: "layouts/head" %>
|
|
<%- if rtl? %>
|
|
<%= discourse_stylesheet_link_tag(mobile_view? ? :mobile_rtl : :desktop_rtl) %>
|
|
<%- else %>
|
|
<%= discourse_stylesheet_link_tag(mobile_view? ? :mobile : :desktop) %>
|
|
<%- end %>
|
|
<%- if theme_id.present? %>
|
|
<%= discourse_stylesheet_link_tag(mobile_view? ? :mobile_theme : :desktop_theme) %>
|
|
<%- end %>
|
|
<%= theme_lookup("head_tag") %>
|
|
<%= render_google_universal_analytics_code %>
|
|
<%= yield :head %>
|
|
<% if show_browser_update? %>
|
|
<style>.buorg {position:absolute; z-index:111111; width:100%; top:0px; left:0px; background:#FDF2AB; text-align:left; font-family: sans-serif; color:#000; font-size: 14px;} .buorg div {padding: 8px;} .buorg a, .buorg a:visited {color:#E25600; text-decoration: underline;} @media print { .buorg { display: none !important; } }</style>
|
|
<% end %>
|
|
<%= build_plugin_html 'server:before-head-close-crawler' %>
|
|
</head>
|
|
<body class="crawler">
|
|
<%= theme_lookup("header") %>
|
|
<header>
|
|
<a href="<%= path "/" %>">
|
|
<%- if SiteSetting.site_logo_url.present? %>
|
|
<img src="<%=SiteSetting.site_logo_url%>" alt="<%=SiteSetting.title%>" id="site-logo" style="max-width: 150px;">
|
|
<%- else %>
|
|
<h1><%=SiteSetting.title%></h1>
|
|
<% end %>
|
|
</a>
|
|
</header>
|
|
<div id="main-outlet" class="wrap">
|
|
<%= yield %>
|
|
</div>
|
|
<footer class="container wrap">
|
|
<nav class='crawler-nav'>
|
|
<ul>
|
|
<li itemscope itemtype='http://schema.org/SiteNavigationElement'>
|
|
<span itemprop='name'>
|
|
<a href='<%= path "/" %>' itemprop="url"><%= t 'home_title' %> </a>
|
|
</span>
|
|
</li>
|
|
<li itemscope itemtype='http://schema.org/SiteNavigationElement'>
|
|
<span itemprop='name'>
|
|
<a href='<%= path "/categories" %>' itemprop="url"><%= t 'js.filters.categories.title' %> </a>
|
|
</span>
|
|
</li>
|
|
<li itemscope itemtype='http://schema.org/SiteNavigationElement'>
|
|
<span itemprop='name'>
|
|
<a href='<%= path "/guidelines" %>' itemprop="url"><%= t 'guidelines_topic.title' %> </a>
|
|
</span>
|
|
</li>
|
|
<li itemscope itemtype='http://schema.org/SiteNavigationElement'>
|
|
<span itemprop='name'>
|
|
<a href='<%= path "/tos" %>' itemprop="url"><%= t 'tos_topic.title' %> </a>
|
|
</span>
|
|
</li>
|
|
<li itemscope itemtype='http://schema.org/SiteNavigationElement'>
|
|
<span itemprop='name'>
|
|
<a href='<%= path "/privacy" %>' itemprop="url"><%= t 'privacy_topic.title' %> </a>
|
|
</span>
|
|
</li>
|
|
</ul>
|
|
</nav>
|
|
<p class='powered-by-link'><%= t 'powered_by_html' %></p>
|
|
</footer>
|
|
<%= theme_lookup("footer") %>
|
|
<%= theme_lookup("body_tag") %>
|
|
<% if show_browser_update? %>
|
|
<div class="buorg"><div><%= I18n.t("js.browser_update").html_safe %></div></div>
|
|
<% end %>
|
|
</body>
|
|
<%= yield :after_body %>
|
|
</html>
|