Skip to content

Commit

Permalink
Merge pull request #3779 from 3scale/revert_essential_assets_removal
Browse files Browse the repository at this point in the history
Revert "[dev portal] ⚰️ removes essential_assets template"
  • Loading branch information
josemigallas committed May 8, 2024
2 parents 0f621cc + 49d9a37 commit 810e96e
Show file tree
Hide file tree
Showing 5 changed files with 1,151 additions and 7 deletions.
2 changes: 2 additions & 0 deletions app/assets/javascripts/vendor/jquery-migrate-1.2.1.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions lib/developer_portal/app/views/shared/_essential_assets.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<%= csrf_meta_tag %>
<%= javascript_include_tag "vendor/jquery-#{defined?(jquery) ? jquery : '2.1.4'}.min.js" %>
<%= javascript_include_tag 'vendor/jquery-migrate-1.2.1.min.js' %>
<%= javascript_include_tag 'vendor/colorbox/jquery.colorbox-min.js' %>
<%= stylesheet_link_tag 'colorbox/colorbox.css' %>
<%= javascript_include_tag 'highlight/highlight.pack.js' %>
<%= javascript_include_tag 'flash', 'remote', 'switch', 'ajax_upload', 'extra_fields' %>
<%= javascript_include_tag 'application' %>
<%= yield :javascripts %>
4 changes: 3 additions & 1 deletion lib/developer_portal/lib/liquid/tags/container.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ class Container < Base

example "Using container tag in liquid", %{
<html>
<head></head>
<head>
{% essential_assets %}
</head>
<body>
{% container main %}
<p class="notice">If a CMS page uses this layout you will have a container at your disposal to add content to.</p>
Expand Down
17 changes: 11 additions & 6 deletions lib/developer_portal/lib/liquid/tags/essential_assets.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
# frozen_string_literal: true

module Liquid
module Tags
class EssentialAssets < Liquid::Tags::Base
deprecated 'This is outdated and should not be use anymore.'
include Liquid::Tags::ContentFor::ContentFor
nodoc!

# this makes versioning harder, delete it

# This exists for backwards compatibility. Some very old dev portals may still be using tag
# {% essential_assets %} and thus loading old libraries and overriding our updates.
def render(context); end
def render(context)
[
stylesheets.render(context),
render_erb(context, "shared/essential_assets"),
javascripts.render(context)
].join.html_safe
end
end
end
end
Loading

0 comments on commit 810e96e

Please sign in to comment.