mirror of
https://github.com/discourse/discourse.git
synced 2024-11-27 09:23:43 +08:00
FEATURE: allow for custom HTML inside the <head> tags
This commit is contained in:
parent
02ea23a4ad
commit
abf910d210
|
@ -1,32 +1,26 @@
|
|||
<h3>{{model.title}}</h3>
|
||||
<p class='description'>{{model.description}}</p>
|
||||
|
||||
<h3>{{model.title}}</h3>
|
||||
<p class='description'>{{model.description}}</p>
|
||||
{{#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}}
|
||||
|
||||
|
||||
|
||||
<div class='controls'>
|
||||
<button class='btn' {{action saveChanges}} {{bindAttr disabled="saveDisabled"}}>
|
||||
{{#if saving}}
|
||||
{{i18n saving}}
|
||||
{{else}}
|
||||
{{i18n save}}
|
||||
{{/if}}
|
||||
</button>
|
||||
{{#if saved}}{{i18n saved}}{{/if}}
|
||||
</div>
|
||||
<div class='controls'>
|
||||
<button class='btn' {{action saveChanges}} {{bindAttr disabled="saveDisabled"}}>
|
||||
{{#if saving}}
|
||||
{{i18n saving}}
|
||||
{{else}}
|
||||
{{i18n save}}
|
||||
{{/if}}
|
||||
</button>
|
||||
{{#if saved}}{{i18n saved}}{{/if}}
|
||||
</div>
|
||||
|
|
|
@ -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%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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}
|
||||
|
|
|
@ -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
|
||||
end
|
||||
|
|
|
@ -25,6 +25,8 @@
|
|||
|
||||
<%= discourse_csrf_tags %>
|
||||
|
||||
<%= raw SiteContent.content_for(:head) %>
|
||||
|
||||
<%= yield :head %>
|
||||
</head>
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
<%= render :partial => "common/special_font_face" %>
|
||||
<%= render :partial => "common/discourse_stylesheet" %>
|
||||
<%= discourse_csrf_tags %>
|
||||
<%= raw SiteContent.content_for(:head) %>
|
||||
</head>
|
||||
<body>
|
||||
<%- unless customization_disabled? %>
|
||||
|
|
|
@ -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 <head></head> 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"
|
||||
|
|
Loading…
Reference in New Issue
Block a user