diff --git a/app/assets/javascripts/admin/templates/site_content_edit.js.handlebars b/app/assets/javascripts/admin/templates/site_content_edit.js.handlebars
index 491019ca67..5d3cdae712 100644
--- a/app/assets/javascripts/admin/templates/site_content_edit.js.handlebars
+++ b/app/assets/javascripts/admin/templates/site_content_edit.js.handlebars
@@ -1,32 +1,26 @@
+
{{model.title}}
+{{model.description}}
- {{model.title}}
- {{model.description}}
+{{#if model.markdown}}
+ {{pagedown value=model.content}}
+{{/if}}
+{{#if model.plainText}}
+ {{textarea value=model.content class="plain"}}
+{{/if}}
+{{#if model.html}}
+ {{aceEditor content=model.content mode="html"}}
+{{/if}}
+{{#if model.css}}
+ {{aceEditor content=model.content mode="css"}}
+{{/if}}
- {{#if model.markdown}}
- {{pagedown value=model.content}}
- {{/if}}
-
- {{#if model.plainText}}
- {{textarea value=model.content class="plain"}}
- {{/if}}
-
- {{#if model.html}}
- {{aceEditor content=model.content mode="html"}}
- {{/if}}
-
- {{#if model.css}}
- {{aceEditor content=model.content mode="css"}}
- {{/if}}
-
-
-
-
-
- {{#if saved}}{{i18n saved}}{{/if}}
-
+
+
+ {{#if saved}}{{i18n saved}}{{/if}}
+
diff --git a/app/assets/stylesheets/common/admin/admin_base.scss b/app/assets/stylesheets/common/admin/admin_base.scss
index 836a9e23ec..27cc5f56df 100644
--- a/app/assets/stylesheets/common/admin/admin_base.scss
+++ b/app/assets/stylesheets/common/admin/admin_base.scss
@@ -32,6 +32,10 @@ td {border-bottom: 1px solid #ddd; border-top: 1px solid #ddd;}
p {
margin-left: 6px;
}
+
+ .ace-wrapper {
+ height: 400px;
+ }
}
table.report {
@@ -957,4 +961,4 @@ table.api-keys {
.modal-tab {
width: 95%;
}
-}
\ No newline at end of file
+}
diff --git a/app/models/site_content.rb b/app/models/site_content.rb
index e8aa741a4f..71d899ea50 100644
--- a/app/models/site_content.rb
+++ b/app/models/site_content.rb
@@ -20,9 +20,9 @@ class SiteContent < ActiveRecord::Base
add_content_type :login_required_welcome_message, default_18n_key: 'login_required.welcome_message'
add_content_type :privacy_policy, allow_blank: true
add_content_type :faq, allow_blank: true
- add_content_type :top, allow_blank: true
- add_content_type :bottom, allow_blank: true
-
+ add_content_type :top, allow_blank: true, format: :html
+ add_content_type :bottom, allow_blank: true, format: :html
+ add_content_type :head, allow_blank: true, format: :html
def site_content_type
@site_content_type ||= SiteContent.content_types.find {|t| t.content_type == content_type.to_sym}
diff --git a/app/models/site_content_type.rb b/app/models/site_content_type.rb
index 5ba91888c8..1b825accce 100644
--- a/app/models/site_content_type.rb
+++ b/app/models/site_content_type.rb
@@ -21,10 +21,7 @@ class SiteContentType
end
def default_content
- if @opts[:default_18n_key].present?
- return I18n.t(@opts[:default_18n_key])
- end
- ""
+ @opts[:default_18n_key].present? ? I18n.t(@opts[:default_18n_key]) : ""
end
-end
\ No newline at end of file
+end
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb
index 6568a400cd..a2aeb8553e 100644
--- a/app/views/layouts/application.html.erb
+++ b/app/views/layouts/application.html.erb
@@ -25,6 +25,8 @@
<%= discourse_csrf_tags %>
+ <%= raw SiteContent.content_for(:head) %>
+
<%= yield :head %>
diff --git a/app/views/layouts/no_js.html.erb b/app/views/layouts/no_js.html.erb
index bd9da09fc1..871230b50f 100644
--- a/app/views/layouts/no_js.html.erb
+++ b/app/views/layouts/no_js.html.erb
@@ -10,6 +10,7 @@
<%= render :partial => "common/special_font_face" %>
<%= render :partial => "common/discourse_stylesheet" %>
<%= discourse_csrf_tags %>
+ <%= raw SiteContent.content_for(:head) %>
<%- unless customization_disabled? %>
diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml
index d4372debbb..d87eba7b1a 100644
--- a/config/locales/server.en.yml
+++ b/config/locales/server.en.yml
@@ -499,9 +499,12 @@ en:
login_required:
title: "Login Required: Homepage"
description: "The text displayed for unauthorized users when login is required on the site."
+ head:
+ title: "HTML head"
+ description: "HTML that will be inserted inside the tags"
top:
title: "Top of the pages"
- description: "HTML that will be added at the top of every pages (after the header, before the navigation or the topic title)"
+ description: "HTML that will be added at the top of every pages (after the header, before the navigation or the topic title)."
bottom:
title: "Bottom of the pages"
description: "HTML that will be added at the bottom of every pages"