megatron 0.2.36 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/LICENSE.txt +21 -0
- data/{README.rdoc → README.md} +3 -3
- data/app/assets/images/{400.svg → megatron/400.svg} +0 -0
- data/app/assets/images/{403.svg → megatron/403.svg} +0 -0
- data/app/assets/images/{404.svg → megatron/404.svg} +0 -0
- data/app/assets/images/{408.svg → megatron/408.svg} +0 -0
- data/app/assets/images/{422.svg → megatron/422.svg} +0 -0
- data/app/assets/images/{500.svg → megatron/500.svg} +0 -0
- data/app/assets/images/{502.svg → megatron/502.svg} +0 -0
- data/app/assets/images/{503.svg → megatron/503.svg} +0 -0
- data/app/assets/images/{504.svg → megatron/504.svg} +0 -0
- data/app/assets/images/{888.svg → megatron/888.svg} +0 -0
- data/{public/assets → app/assets/images}/megatron/favicon.ico +0 -0
- data/{public/assets → app/assets/images}/megatron/logo.svg +0 -0
- data/app/assets/javascripts/megatron/_svg.js +55 -0
- data/app/assets/javascripts/megatron/{index.js → megatron.js} +4 -2
- data/app/assets/javascripts/megatron/vendor/bugsnag.js +1256 -0
- data/app/assets/{esvg → svgs}/megatron/account-circle-fill.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/account-circle.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/alerts.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/api.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/arrow_left_circle.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/arrow_left_circle_fill.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/arrow_right_circle.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/arrow_right_circle_fill.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/backups.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/bell.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/bubble.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/bubble_fill.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/check.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/check_circle.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/check_circle_fill.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/check_thin.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/chevron.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/chevron_thin.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/circle-fill.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/circle.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/cli.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/clock_fill.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/clock_line.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/cluster-hosts.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/cluster.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/collections.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/copy.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/dash_circle.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/dash_circle_fill.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/dash_circle_fill_thin.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/dash_circle_thin.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/database_small.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/databases.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/databases_line.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/deployment-beta-line.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/deployment-cassandra.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/deployment-disque.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/deployment-elasticsearch.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/deployment-etcd.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/deployment-influxdb.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/deployment-mongodb-classic.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/deployment-mongodb.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/deployment-mysql.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/deployment-postgresql.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/deployment-rabbitmq.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/deployment-redis.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/deployment-rethinkdb.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/deployment-scylladb.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/deployment.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/deployments.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/download.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/eye.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/eye_closed.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/face-disappointed.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/face-happy.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/gear.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/gear_line.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/gear_round.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/globe.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/help.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/home.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/hourglass.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/info.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/jobs.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/keys.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/lock.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/locked.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/logs.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/minus.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/monitoring.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/payment.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/plus.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/plus_circle.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/plus_circle_fill.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/power.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/processing.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/puzzle.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/question-line.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/question_full.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/restore.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/rocket.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/sandbox.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/scale.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/star.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/tools.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/transporter.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/unlocked.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/users-circle-fill.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/users-circle.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/users.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/warning-circle-fill-thin.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/warning.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/warning_circle.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/warning_circle_fill.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/warning_circle_thin.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/watch.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/x.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/x_circle.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/x_circle_fill.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/x_circle_fill_thin.svg +0 -0
- data/app/assets/{esvg → svgs}/megatron/x_circle_thin.svg +0 -0
- data/app/controllers/megatron/errors_controller.rb +3 -0
- data/app/helpers/megatron/application_helper.rb +0 -95
- data/app/helpers/megatron/icon_helper.rb +11 -7
- data/app/helpers/megatron/layout_helper.rb +2 -10
- data/app/views/layouts/megatron/default.html.slim +76 -0
- data/app/views/layouts/megatron/errors.html.slim +8 -8
- data/app/views/megatron/shared/_flash_messages.html.slim +6 -0
- data/app/views/megatron/shared/_head.html.slim +23 -0
- data/app/views/megatron/shared/_main_content.html.slim +6 -3
- data/lib/megatron/engine.rb +0 -7
- data/lib/megatron/slim_code_filter.rb +21 -0
- data/lib/megatron/version.rb +1 -1
- data/lib/megatron.rb +10 -6
- data/public/{assets/megatron/megatron-0.2.36.css → megatron-0.3.0.css} +1825 -1879
- data/public/megatron-0.3.0.css.gz +0 -0
- data/public/{assets/megatron/megatron-0.2.36.js → megatron-0.3.0.js} +7 -7
- data/public/megatron-0.3.0.js.gz +0 -0
- data/public/megatron-0.3.0.map.json +1 -0
- data/public/megatron-error-pages-0.3.0.css +901 -0
- data/public/megatron-error-pages-0.3.0.css.gz +0 -0
- metadata +149 -135
- data/MIT-LICENSE +0 -20
- data/Rakefile +0 -209
- data/app/assets/javascripts/megatron/esvg.js +0 -55
- data/app/views/layouts/megatron/application.html.slim +0 -67
- data/config/esvg.yml +0 -8
- data/config/routes.rb +0 -2
- data/public/assets/megatron/megatron-0.2.36.css.gz +0 -0
- data/public/assets/megatron/megatron-0.2.36.css.map +0 -7
- data/public/assets/megatron/megatron-0.2.36.js.gz +0 -0
- data/public/assets/megatron/megatron-0.2.36.map.json +0 -1
- data/public/assets/megatron/megatron-error-pages-0.2.36.css +0 -1
- data/public/assets/megatron/megatron-error-pages-0.2.36.css.gz +0 -0
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,25 +1,5 @@
|
|
|
1
1
|
module Megatron
|
|
2
2
|
module ApplicationHelper
|
|
3
|
-
|
|
4
|
-
# Mounted from dev-kit
|
|
5
|
-
def dev?
|
|
6
|
-
__dir__.start_with?("/megatron") || ENV['DEVKIT']
|
|
7
|
-
end
|
|
8
|
-
|
|
9
|
-
def megatron_asset_path(asset)
|
|
10
|
-
|
|
11
|
-
if ENV['LOCAL_DEV']
|
|
12
|
-
alt_host = "http://localhost:5000"
|
|
13
|
-
elsif dev?
|
|
14
|
-
alt_host = "https://megatron.compose.devkit"
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
alt_host ||= ENV['MEGATRON_ASSET_HOST']
|
|
18
|
-
return "#{alt_host}/assets/megatron/#{asset}" if alt_host
|
|
19
|
-
return "https://d11f55tj5eo9e5.cloudfront.net/assets/megatron/#{asset}" if Rails.env.production?
|
|
20
|
-
return "/assets/megatron/#{asset}"
|
|
21
|
-
end
|
|
22
|
-
|
|
23
3
|
def link_up(href = nil, options = {}, html_options = nil, &block)
|
|
24
4
|
here_if = options.delete(:here_if) || {}
|
|
25
5
|
here_if[:path] = href if here_if.blank?
|
|
@@ -28,53 +8,6 @@ module Megatron
|
|
|
28
8
|
link_to(href, options, &block)
|
|
29
9
|
end
|
|
30
10
|
|
|
31
|
-
def megatron_assets_tags
|
|
32
|
-
version = "-#{Megatron::VERSION}"
|
|
33
|
-
|
|
34
|
-
ext_suffix = Rails.env.production? ? '.gz' : ''
|
|
35
|
-
|
|
36
|
-
pin_tab_icon(
|
|
37
|
-
megatron_asset_path('logo.svg')
|
|
38
|
-
) +
|
|
39
|
-
favicon_link_tag(
|
|
40
|
-
megatron_asset_path('favicon.ico'), sizes: "32x32"
|
|
41
|
-
) +
|
|
42
|
-
stylesheet_link_tag(
|
|
43
|
-
megatron_asset_path("megatron#{version}.css#{ext_suffix}")
|
|
44
|
-
) +
|
|
45
|
-
javascript_include_tag(
|
|
46
|
-
megatron_asset_path("megatron#{version}.js#{ext_suffix}")
|
|
47
|
-
)
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
def pin_tab_icon(path)
|
|
51
|
-
%Q{<link rel="mask-icon" mask href="#{path}" color="black">}.html_safe
|
|
52
|
-
end
|
|
53
|
-
|
|
54
|
-
def favicon_link_tag(source='favicon.ico', options={})
|
|
55
|
-
tag('link', {
|
|
56
|
-
:rel => 'shortcut icon',
|
|
57
|
-
:type => 'image/x-icon',
|
|
58
|
-
:href => source
|
|
59
|
-
}.merge!(options.symbolize_keys))
|
|
60
|
-
end
|
|
61
|
-
|
|
62
|
-
def megatron_error_asset_tag
|
|
63
|
-
version = Megatron::VERSION
|
|
64
|
-
ext_suffix = Rails.env.production? ? '.gz' : ''
|
|
65
|
-
|
|
66
|
-
# Embed styles directly for these error codes since they are served from haproxy
|
|
67
|
-
# and are likely to be served when the stylesheet server cannot be reached
|
|
68
|
-
#
|
|
69
|
-
if [408, 502, 503, 504].include?(@status_code)
|
|
70
|
-
style== File.read("../public/assets/megatron/megatron-error-pages-#{version}.css")
|
|
71
|
-
else
|
|
72
|
-
stylesheet_link_tag(
|
|
73
|
-
megatron_asset_path("megatron-error-pages-#{version}.css#{ext_suffix}")
|
|
74
|
-
)
|
|
75
|
-
end
|
|
76
|
-
end
|
|
77
|
-
|
|
78
11
|
def options_from_args(args)
|
|
79
12
|
if args.last.is_a? Hash
|
|
80
13
|
args.pop
|
|
@@ -83,34 +16,6 @@ module Megatron
|
|
|
83
16
|
end
|
|
84
17
|
end
|
|
85
18
|
|
|
86
|
-
def embed_svg(filename, options = {})
|
|
87
|
-
group = 0
|
|
88
|
-
file = File.read(Engine.root.join('app', 'assets', 'images', filename))
|
|
89
|
-
.gsub(/<!--.+-->/, '')
|
|
90
|
-
.gsub(/^\t{2,}\s*<\/?g>/, '')
|
|
91
|
-
.gsub(/width=".+?"/, 'width="312"')
|
|
92
|
-
.gsub(/\sheight.+$/, '')
|
|
93
|
-
.gsub(/\t/, ' ')
|
|
94
|
-
.gsub(/\n{3,}/m, "\n")
|
|
95
|
-
.gsub(/^\s{2}<g>.+?^\s{2}<\/g>/m) { |g|
|
|
96
|
-
g.gsub(/^\s{4,}\s+/, ' ')
|
|
97
|
-
}
|
|
98
|
-
.gsub(/^<g>.+?^<\/g>/m) { |g|
|
|
99
|
-
group += 1
|
|
100
|
-
count = 0
|
|
101
|
-
g.gsub(/^\s{2}<g>/) { |g|
|
|
102
|
-
count += 1
|
|
103
|
-
%Q{ <g id="group-#{group}-cube-#{count}">}
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
# doc = Nokogiri::HTML::DocumentFragment.parse file
|
|
107
|
-
# svg = doc.at_css 'svg'
|
|
108
|
-
# if options[:class].present?
|
|
109
|
-
# svg['class'] = options[:class]
|
|
110
|
-
# end
|
|
111
|
-
file.html_safe
|
|
112
|
-
end
|
|
113
|
-
|
|
114
19
|
def add_class(string, *classes)
|
|
115
20
|
string ||= ''
|
|
116
21
|
string << " #{classes.join(' ')}"
|
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
module Megatron
|
|
2
2
|
module IconHelper
|
|
3
|
-
ICON_OPTIONS = {
|
|
4
|
-
config_file: File.expand_path('../../../config/esvg.yml', File.dirname(__FILE__)),
|
|
5
|
-
path: File.expand_path('../../assets/esvg/megatron', File.dirname(__FILE__))
|
|
6
|
-
}
|
|
7
|
-
|
|
8
3
|
def iconset
|
|
9
|
-
|
|
4
|
+
Esvg.svgs
|
|
10
5
|
end
|
|
11
6
|
|
|
12
7
|
def icon(name, options={}, &block)
|
|
13
|
-
i = iconset.
|
|
8
|
+
i = iconset.svg_icon(name, options).html_safe
|
|
14
9
|
|
|
15
10
|
if options[:wrapper]
|
|
16
11
|
i = content_tag(:span, class: options[:wrapper].strip) do
|
|
@@ -29,6 +24,15 @@ module Megatron
|
|
|
29
24
|
i
|
|
30
25
|
end
|
|
31
26
|
|
|
27
|
+
def pin_tab_icon(path, color='black')
|
|
28
|
+
%Q{<link rel="mask-icon" mask href="#{path}" color="#{color}">}.html_safe
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def font_icon(name, options={})
|
|
32
|
+
options[:class] = default_class(options[:class], "#{name}_icon")
|
|
33
|
+
content_tag(:span, class: options[:class], 'aria-hidden' => true) { }
|
|
34
|
+
end
|
|
35
|
+
|
|
32
36
|
def text_icon(name, options={}, &block)
|
|
33
37
|
options = set_icon_classes(options, class: 'text-icon', wrapper: 'icon-wrapper')
|
|
34
38
|
icon(name.to_s, options, &block)
|
|
@@ -4,9 +4,9 @@ module Megatron
|
|
|
4
4
|
def megatron_layout(options={}, &block)
|
|
5
5
|
@custom_nav = options[:custom_nav]
|
|
6
6
|
@primary_nav_here = options[:primary_nav]
|
|
7
|
-
layout = options.delete(:layout) || '
|
|
7
|
+
layout = options.delete(:layout) || 'default'
|
|
8
8
|
yield
|
|
9
|
-
|
|
9
|
+
render_layout "megatron/#{layout}"
|
|
10
10
|
end
|
|
11
11
|
|
|
12
12
|
def page_header(title = nil, &block)
|
|
@@ -34,14 +34,6 @@ module Megatron
|
|
|
34
34
|
content_for :sidebar, &block
|
|
35
35
|
end
|
|
36
36
|
|
|
37
|
-
def javascripts(&block)
|
|
38
|
-
content_for :javascripts, &block
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
def stylesheets(&block)
|
|
42
|
-
content_for :stylesheets, &block
|
|
43
|
-
end
|
|
44
|
-
|
|
45
37
|
def size(*args, &block)
|
|
46
38
|
options = options_from_args(args)
|
|
47
39
|
tag = options[:tag] || :div
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
doctype html
|
|
2
|
+
|
|
3
|
+
html lang="en"
|
|
4
|
+
|
|
5
|
+
- content_for :head do
|
|
6
|
+
= stylesheet_tag "megatron"
|
|
7
|
+
= yield :stylesheets
|
|
8
|
+
|
|
9
|
+
= javascript_tag "megatron"
|
|
10
|
+
= yield :javascripts
|
|
11
|
+
|
|
12
|
+
= render "megatron/shared/head"
|
|
13
|
+
|
|
14
|
+
body
|
|
15
|
+
- if content_for?(:blank)
|
|
16
|
+
|
|
17
|
+
= yield :blank
|
|
18
|
+
|
|
19
|
+
- else
|
|
20
|
+
|
|
21
|
+
= render "megatron/shared/flash_messages"
|
|
22
|
+
|
|
23
|
+
.site
|
|
24
|
+
|
|
25
|
+
header.site-header role="banner" data-no-turbolink=true
|
|
26
|
+
button.nav_toggle data-toggle-class="active-nav; body"
|
|
27
|
+
span.icon
|
|
28
|
+
span.hidden_label View Navigation
|
|
29
|
+
a.header_logo.logo_icon href="/"
|
|
30
|
+
span.hidden_label Compose
|
|
31
|
+
|
|
32
|
+
.site-content
|
|
33
|
+
|
|
34
|
+
- if !@custom_nav
|
|
35
|
+
|
|
36
|
+
= render partial: 'megatron/shared/primary_nav'
|
|
37
|
+
|
|
38
|
+
- if content_for?(:primary_nav)
|
|
39
|
+
nav.primary_nav role="navigation" data-no-turbolink=true
|
|
40
|
+
= yield :primary_nav
|
|
41
|
+
|
|
42
|
+
.page
|
|
43
|
+
= yield
|
|
44
|
+
|
|
45
|
+
/ Render wrapper divs if main content
|
|
46
|
+
|
|
47
|
+
- if content_for?(:main)
|
|
48
|
+
|
|
49
|
+
header.page-header
|
|
50
|
+
= yield :page_header
|
|
51
|
+
|
|
52
|
+
.page-content
|
|
53
|
+
|
|
54
|
+
/ Secondary Navigation
|
|
55
|
+
|
|
56
|
+
- if content_for?(:secondary_nav)
|
|
57
|
+
nav.secondary_nav
|
|
58
|
+
= yield :secondary_nav
|
|
59
|
+
|
|
60
|
+
/ Main with Sidebar
|
|
61
|
+
|
|
62
|
+
- if content_for?(:sidebar)
|
|
63
|
+
|
|
64
|
+
.main.with-sidebar
|
|
65
|
+
.main-content
|
|
66
|
+
= render 'megatron/shared/main_content'
|
|
67
|
+
|
|
68
|
+
.main-sidebar
|
|
69
|
+
= yield :sidebar
|
|
70
|
+
|
|
71
|
+
/ Main without Sidebar
|
|
72
|
+
|
|
73
|
+
- else
|
|
74
|
+
|
|
75
|
+
.main
|
|
76
|
+
= render 'megatron/shared/main_content'
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
html.error-layout
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
doctype html
|
|
2
|
+
html.error-layout lang='en'
|
|
3
|
+
- @title = "Error #{@status_code}: #{@rescue_response.to_s.humanize} - Compose"
|
|
4
|
+
|
|
5
|
+
- content_for :head do
|
|
6
|
+
= stylesheet_tag "megatron-error-pages"
|
|
7
|
+
|
|
8
|
+
= render "megatron/shared/head"
|
|
9
9
|
|
|
10
10
|
body
|
|
11
11
|
.error-page class="error-#{@status_code} #{('reverse-stack' if @status_code == 404)}"
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
head
|
|
2
|
+
|
|
3
|
+
/ Document Settings
|
|
4
|
+
meta charset="utf-8"
|
|
5
|
+
meta http-equiv="X-UA-Compatible" content="IE=edge"
|
|
6
|
+
= csrf_meta_tags
|
|
7
|
+
|
|
8
|
+
/ Referrer
|
|
9
|
+
meta name="referrer" content="origin"
|
|
10
|
+
|
|
11
|
+
/ Mobile
|
|
12
|
+
meta name="HandheldFriendly" content="True"
|
|
13
|
+
meta name="viewport" content="width=device-width, initial-scale=1.0"
|
|
14
|
+
|
|
15
|
+
- if @title.present?
|
|
16
|
+
title #{@title} | Compose
|
|
17
|
+
- else
|
|
18
|
+
title Compose
|
|
19
|
+
|
|
20
|
+
= favicon_tag 'favicon.ico'
|
|
21
|
+
= pin_tab_icon_tag "logo.svg"
|
|
22
|
+
|
|
23
|
+
= yield :head
|
data/lib/megatron/engine.rb
CHANGED
|
@@ -18,12 +18,5 @@ module Megatron
|
|
|
18
18
|
initializer "megatron.static_assets" do |app|
|
|
19
19
|
app.middleware.insert_before(::ActionDispatch::Static, ::ActionDispatch::Static, "#{root}/public")
|
|
20
20
|
end
|
|
21
|
-
|
|
22
|
-
initializer "megatron.errors" do |app|
|
|
23
|
-
Gaffe.configure do |config|
|
|
24
|
-
config.errors_controller = 'Megatron::ErrorsController'
|
|
25
|
-
end
|
|
26
|
-
Gaffe.enable!
|
|
27
|
-
end
|
|
28
21
|
end
|
|
29
22
|
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
require 'slim'
|
|
2
|
+
|
|
3
|
+
module Slim
|
|
4
|
+
class CodeEngine < Slim::Embedded::TagEngine
|
|
5
|
+
disable_option_validator!
|
|
6
|
+
|
|
7
|
+
set_options tag: :pre, attributes: { class: "" }
|
|
8
|
+
|
|
9
|
+
def on_slim_embedded(engine, body)
|
|
10
|
+
|
|
11
|
+
lang = body[1].last
|
|
12
|
+
body.slice!(1,2)
|
|
13
|
+
|
|
14
|
+
code = super(engine, body)
|
|
15
|
+
code[3][2][3][1] = "lang-#{lang}"
|
|
16
|
+
code
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
Slim::Embedded.register :code, Slim::CodeEngine
|
data/lib/megatron/version.rb
CHANGED