Skip to content

Commit

Permalink
Remove custom header/footer/JS
Browse files Browse the repository at this point in the history
  • Loading branch information
elektronaut committed Nov 18, 2024
1 parent fef1eac commit 79ed00a
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 75 deletions.
3 changes: 0 additions & 3 deletions app/models/configuration/parameters.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ module Parameters

# Customization
parameter :code_of_conduct, :string
parameter :custom_header, :string
parameter :custom_footer, :string
parameter :custom_javascript, :string
parameter(
:emoticons,
:string,
Expand Down
48 changes: 6 additions & 42 deletions app/views/admin/configurations/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@
<%= t("configuration.documents") %>
</a>
</li>
<li class="tab">
<a href="#customization">
<%= t("configuration.customization") %>
</a>
</li>
</ul>


Expand Down Expand Up @@ -109,6 +104,12 @@
<%= f.labelled_select(:default_mobile_theme,
Theme.mobile.map { |t| [t.full_name, t.id] }) %>
</fieldset>
<fieldset>
<h2>
<%= t("configuration.emoticons") %>
</h2>
<%= f.labelled_text_field :emoticons, size: 48 %>
</fieldset>
</div>

<div id="integration">
Expand Down Expand Up @@ -145,43 +146,6 @@
</fieldset>
</div>

<div id="customization">
<fieldset>
<h2>
<%= t("configuration.emoticons") %>
</h2>
<%= f.labelled_text_field :emoticons, size: 48 %>
</fieldset>
<fieldset>
<h2>
<%= t("configuration.custom_html") %>
</h2>
<%= f.labelled_text_area(
:custom_header,
size: "40x15",
class: "code",
description: t("configuration.custom_header_description")
) %>
<%= f.labelled_text_area(
:custom_footer,
size: "40x15",
class: "code",
description: t("configuration.custom_footer_description")
) %>
</fieldset>
<fieldset>
<h2>
<%= t("configuration.custom_javascript") %>
</h2>
<p class="info">
<%= t("configuration.custom_javascript_html") %>
</p>
<%= f.labelled_text_area(:custom_javascript,
size: "40x15",
class: "code") %>
</fieldset>
</div>

<p>
<button type="submit">
<%= t("save") %>
Expand Down
18 changes: 0 additions & 18 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@
</head>
<body class="<%= body_class %>">

<%# Custom header %>
<% if Sugar.config.custom_header %>
<%= raw Sugar.config.custom_header %>
<% end %>

<div id="header">
<h1><%= Sugar.config.forum_title.html_safe %></h1>

Expand Down Expand Up @@ -118,11 +113,6 @@
</div>
</div>

<%# Custom footer %>
<% if Sugar.config.custom_footer %>
<%= raw Sugar.config.custom_footer %>
<% end %>

<%= javascript_include_tag "application" %>

<%# Sugar configuration %>
Expand All @@ -135,13 +125,6 @@
window.mutedUsers = <%= muted_user_ids(@exchange).to_json %>;
</script>

<%# Custom javascript %>
<% unless Sugar.config.custom_javascript.blank? %>
<script>
<%= raw Sugar.config.custom_javascript %>
</script>
<% end %>

<%# Google Analytics %>
<% if Sugar.config.google_analytics %>
<!-- Global site tag (gtag.js) - Google Analytics -->
Expand All @@ -154,6 +137,5 @@
gtag('config', '<%= Sugar.config.google_analytics %>', { 'anonymize_ip': true });
</script>
<% end %>

</body>
</html>
7 changes: 0 additions & 7 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,6 @@ en:
amazon_associates: Amazon Associates
amazon_associates_id_description: Enter to enable referals
flickr: Flickr
custom_html: Custom HTML
custom_javascript: Custom Javascript
custom_header_description: "Included right after <body>"
custom_footer_description: "Included just before <body>"
custom_javascript_html: >-
Custom JavaScript will be included at the end of the
&lt;head&gt; tag.
conversation:
invalid: >-
Could not save your conversation! Please make sure all required
Expand Down
5 changes: 0 additions & 5 deletions config/locales/zh-CN.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,6 @@ zh-CN:
amazon_associates: Amazon Associates
amazon_associates_id_description: 输入以激活推荐链接
flickr: Flickr
custom_html: 定制 HTML
custom_javascript: 定制 Javascript
custom_header_description: '在 <body> 之后包含'
custom_footer_description: '在 <body> 之前包含'
custom_javascript_html: '自定义 JavaScript 会被包含在 &lt;head&gt; 标记末尾,。'
user:
edit:
tabs:
Expand Down

0 comments on commit 79ed00a

Please sign in to comment.