yarii-editor 0.4.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 +7 -0
- data/LICENSE +21 -0
- data/README.md +31 -0
- data/Rakefile +32 -0
- data/app/assets/images/yarii_editor/butterfly-small.png +0 -0
- data/app/controllers/concerns/yarii_editor/controller_authorization.rb +22 -0
- data/app/controllers/concerns/yarii_editor/repository_pullable.rb +11 -0
- data/app/controllers/yarii_editor/application_controller.rb +22 -0
- data/app/controllers/yarii_editor/dashboard_controller.rb +17 -0
- data/app/controllers/yarii_editor/documents_controller.rb +147 -0
- data/app/controllers/yarii_editor/publish_controller.rb +24 -0
- data/app/helpers/yarii_editor/application_helper.rb +9 -0
- data/app/helpers/yarii_editor/document_helper.rb +15 -0
- data/app/helpers/yarii_editor/editor_helper.rb +19 -0
- data/app/javascript/controllers/building_controller.js +28 -0
- data/app/javascript/controllers/card_controller.js +49 -0
- data/app/javascript/controllers/commit_modal_controller.js +55 -0
- data/app/javascript/controllers/editor_modal_controller.js +76 -0
- data/app/javascript/controllers/index.js +85 -0
- data/app/javascript/controllers/list_loading_controller.js +33 -0
- data/app/javascript/controllers/markdown_editor_controller.js +157 -0
- data/app/javascript/controllers/new_document_controller.js +16 -0
- data/app/javascript/controllers/push_to_public_controller.js +17 -0
- data/app/javascript/controllers/testengine_controller.js +7 -0
- data/app/javascript/lib/utils.js +45 -0
- data/app/javascript/packs/application.js +4 -0
- data/app/jobs/yarii/application_job.rb +4 -0
- data/app/mailers/yarii/application_mailer.rb +6 -0
- data/app/models/concerns/yarii_editor/model_callbacks.rb +26 -0
- data/app/models/concerns/yarii_editor/previewing.rb +18 -0
- data/app/models/page.rb +13 -0
- data/app/models/post.rb +29 -0
- data/app/models/yarii/application_record.rb +5 -0
- data/app/models/yarii/repository.rb +50 -0
- data/app/models/yarii/site.rb +107 -0
- data/app/styles/FiraGO/FiraGO-Bold.woff +0 -0
- data/app/styles/FiraGO/FiraGO-BoldItalic.woff +0 -0
- data/app/styles/FiraGO/FiraGO-Book.woff +0 -0
- data/app/styles/FiraGO/FiraGO-BookItalic.woff +0 -0
- data/app/styles/FiraGO/FiraGO-HeavyItalic.woff +0 -0
- data/app/styles/FiraGO/FiraGO-SemiBold.woff +0 -0
- data/app/styles/FiraGO/FiraGO-SemiBoldItalic.woff +0 -0
- data/app/styles/FiraGO/FiraGO.scss +48 -0
- data/app/styles/Vidaloka/Vidaloka-Regular.woff +0 -0
- data/app/styles/Vidaloka/Vidaloka.scss +6 -0
- data/app/styles/application.scss +141 -0
- data/app/styles/dashboard.scss +139 -0
- data/app/styles/editor.scss +70 -0
- data/app/styles/helpers.scss +45 -0
- data/app/views/application/yarii_extra_head.html.erb +3 -0
- data/app/views/layouts/yarii_editor/application.html.erb +21 -0
- data/app/views/yarii_editor/application/render_engine_stylesheet_tag.html.erb +1 -0
- data/app/views/yarii_editor/dashboard/_card.html.erb +3 -0
- data/app/views/yarii_editor/dashboard/_extras.html.erb +1 -0
- data/app/views/yarii_editor/dashboard/_inner_list.html.erb +42 -0
- data/app/views/yarii_editor/dashboard/_list.html.erb +34 -0
- data/app/views/yarii_editor/dashboard/index.html.erb +18 -0
- data/app/views/yarii_editor/documents/modal.html.erb +78 -0
- data/app/views/yarii_editor/editor/_dropdown.html.erb +14 -0
- data/app/views/yarii_editor/editor/_markdown.html.erb +13 -0
- data/app/views/yarii_editor/editor/_text.html.erb +13 -0
- data/app/views/yarii_editor/editor/_textarea.html.erb +13 -0
- data/app/views/yarii_editor/model_cards/_hashtags.html.erb +5 -0
- data/app/views/yarii_editor/model_cards/_page.html.erb +18 -0
- data/app/views/yarii_editor/model_cards/_post.html.erb +17 -0
- data/app/views/yarii_editor/model_cards/_standard_footer_buttons.html.erb +20 -0
- data/app/views/yarii_editor/publish/commit.html.erb +45 -0
- data/app/views/yarii_editor/shared/_navbar.html.erb +38 -0
- data/app/views/yarii_editor/shared/_publishing_menu.html.erb +42 -0
- data/config/initializers/assets.rb +1 -0
- data/config/routes.rb +16 -0
- data/config/webpack/development.js +5 -0
- data/config/webpack/environment.js +3 -0
- data/config/webpack/production.js +5 -0
- data/config/webpack/staging.js +5 -0
- data/config/webpack/test.js +5 -0
- data/config/webpacker.yml +109 -0
- data/db/migrate/20190923000809_create_yarii_sites.rb +12 -0
- data/db/migrate/20191014203116_add_git_repo_path_to_yarii_sites.rb +5 -0
- data/db/migrate/20200420221048_add_preview_build_command_to_yarii_sites.rb +5 -0
- data/lib/tasks/yarii_editor_tasks.rake +66 -0
- data/lib/yarii-editor.rb +24 -0
- data/lib/yarii-editor/engine.rb +22 -0
- data/lib/yarii-editor/setup_current_site.rb +20 -0
- data/lib/yarii-editor/setup_current_user.rb +13 -0
- data/lib/yarii-editor/version.rb +3 -0
- metadata +172 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# desc "Explaining what the task does"
|
|
2
|
+
# task :yarii_editor do
|
|
3
|
+
# # Task goes here
|
|
4
|
+
# end
|
|
5
|
+
|
|
6
|
+
def ensure_log_goes_to_stdout
|
|
7
|
+
old_logger = Webpacker.logger
|
|
8
|
+
Webpacker.logger = ActiveSupport::Logger.new(STDOUT)
|
|
9
|
+
yield
|
|
10
|
+
ensure
|
|
11
|
+
Webpacker.logger = old_logger
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
namespace :yarii_editor do
|
|
16
|
+
namespace :webpacker do
|
|
17
|
+
desc "Install deps with yarn"
|
|
18
|
+
task :yarn_install do
|
|
19
|
+
Dir.chdir(File.join(__dir__, "../..")) do
|
|
20
|
+
system "yarn install --no-progress --production"
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
desc "Compile JavaScript packs using webpack for production with digests"
|
|
25
|
+
task compile: [:yarn_install, :environment] do
|
|
26
|
+
Webpacker.with_node_env("production") do
|
|
27
|
+
ensure_log_goes_to_stdout do
|
|
28
|
+
if YariiEditor.webpacker.commands.compile
|
|
29
|
+
# Successful compilation!
|
|
30
|
+
puts "🎉 Yarii::Editor Webpack compilation succeeded!"
|
|
31
|
+
else
|
|
32
|
+
# Failed compilation
|
|
33
|
+
puts "😟 Something went wrong with the Yarii::Editor Webpack compilation…"
|
|
34
|
+
exit!
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def yarn_install_available?
|
|
43
|
+
rails_major = Rails::VERSION::MAJOR
|
|
44
|
+
rails_minor = Rails::VERSION::MINOR
|
|
45
|
+
|
|
46
|
+
rails_major > 5 || (rails_major == 5 && rails_minor >= 1)
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def enhance_assets_precompile
|
|
50
|
+
# yarn:install was added in Rails 5.1
|
|
51
|
+
deps = yarn_install_available? ? [] : ["yarii_editor:webpacker:yarn_install"]
|
|
52
|
+
Rake::Task["assets:precompile"].enhance(deps) do
|
|
53
|
+
Rake::Task["yarii_editor:webpacker:compile"].invoke
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# Compile packs after we've compiled all other assets during precompilation
|
|
58
|
+
skip_webpacker_precompile = %w(no false n f).include?(ENV["WEBPACKER_PRECOMPILE"])
|
|
59
|
+
|
|
60
|
+
unless skip_webpacker_precompile
|
|
61
|
+
if Rake::Task.task_defined?("assets:precompile")
|
|
62
|
+
enhance_assets_precompile
|
|
63
|
+
else
|
|
64
|
+
Rake::Task.define_task("assets:precompile" => "yarii_editor:webpacker:compile")
|
|
65
|
+
end
|
|
66
|
+
end
|
data/lib/yarii-editor.rb
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
require "yarii-editor/engine"
|
|
2
|
+
require "yarii-editor/setup_current_site"
|
|
3
|
+
require "yarii-editor/setup_current_user"
|
|
4
|
+
|
|
5
|
+
class YariiEditor::Error < StandardError; end
|
|
6
|
+
|
|
7
|
+
module YariiEditor
|
|
8
|
+
ROOT_PATH = Pathname.new(File.join(__dir__, ".."))
|
|
9
|
+
|
|
10
|
+
class << self
|
|
11
|
+
def webpacker
|
|
12
|
+
@webpacker ||= ::Webpacker::Instance.new(
|
|
13
|
+
root_path: ROOT_PATH,
|
|
14
|
+
config_path: ROOT_PATH.join("config/webpacker.yml")
|
|
15
|
+
)
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
class NotAuthorizedError < Error
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
module Yarii
|
|
24
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
module YariiEditor
|
|
2
|
+
class Engine < ::Rails::Engine
|
|
3
|
+
isolate_namespace YariiEditor
|
|
4
|
+
|
|
5
|
+
ROOT_PATH = Pathname.new(File.join(__dir__, "..", ".."))
|
|
6
|
+
|
|
7
|
+
config.to_prepare do
|
|
8
|
+
Dir.glob(Rails.root.join('app', 'decorators', '**', '*_decorator*.rb')).each do |c|
|
|
9
|
+
require_dependency(c)
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
config.app_middleware.use(
|
|
14
|
+
Rack::Static,
|
|
15
|
+
urls: ["/yarii-editor-packs"], root: ROOT_PATH.join("public")
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
initializer "yarii_editor.assets.precompile" do |app|
|
|
19
|
+
app.config.assets.precompile += %w( butterfly-small.png )
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
module CurrentSite
|
|
2
|
+
thread_mattr_accessor :site
|
|
3
|
+
|
|
4
|
+
def self.setup(newSite=nil)
|
|
5
|
+
if newSite.nil?
|
|
6
|
+
newSite = Yarii::Site.first
|
|
7
|
+
end
|
|
8
|
+
self.site = newSite
|
|
9
|
+
self.site.setup_content_model_variables
|
|
10
|
+
Yarii::ContentModel.base_path = site.content_base_path
|
|
11
|
+
Yarii::DatafileModel.base_path = site.content_base_path
|
|
12
|
+
self.site
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def self.reset
|
|
16
|
+
self.site = nil
|
|
17
|
+
Yarii::ContentModel.base_path = nil
|
|
18
|
+
Yarii::DatafileModel.base_path = nil
|
|
19
|
+
end
|
|
20
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: yarii-editor
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.4.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Jared White
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2020-04-21 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: rails
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - "~>"
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: 6.0.0
|
|
20
|
+
type: :runtime
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - "~>"
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: 6.0.0
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: webpacker
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - "~>"
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '4.0'
|
|
34
|
+
type: :runtime
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - "~>"
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '4.0'
|
|
41
|
+
- !ruby/object:Gem::Dependency
|
|
42
|
+
name: git
|
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
|
44
|
+
requirements:
|
|
45
|
+
- - "~>"
|
|
46
|
+
- !ruby/object:Gem::Version
|
|
47
|
+
version: '1.5'
|
|
48
|
+
type: :runtime
|
|
49
|
+
prerelease: false
|
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
+
requirements:
|
|
52
|
+
- - "~>"
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: '1.5'
|
|
55
|
+
description: Provides a editing admin interface to any Rails app for handling static
|
|
56
|
+
content (aka Jekyll)
|
|
57
|
+
email:
|
|
58
|
+
- jared@jaredwhite.com
|
|
59
|
+
executables: []
|
|
60
|
+
extensions: []
|
|
61
|
+
extra_rdoc_files: []
|
|
62
|
+
files:
|
|
63
|
+
- LICENSE
|
|
64
|
+
- README.md
|
|
65
|
+
- Rakefile
|
|
66
|
+
- app/assets/images/yarii_editor/butterfly-small.png
|
|
67
|
+
- app/controllers/concerns/yarii_editor/controller_authorization.rb
|
|
68
|
+
- app/controllers/concerns/yarii_editor/repository_pullable.rb
|
|
69
|
+
- app/controllers/yarii_editor/application_controller.rb
|
|
70
|
+
- app/controllers/yarii_editor/dashboard_controller.rb
|
|
71
|
+
- app/controllers/yarii_editor/documents_controller.rb
|
|
72
|
+
- app/controllers/yarii_editor/publish_controller.rb
|
|
73
|
+
- app/helpers/yarii_editor/application_helper.rb
|
|
74
|
+
- app/helpers/yarii_editor/document_helper.rb
|
|
75
|
+
- app/helpers/yarii_editor/editor_helper.rb
|
|
76
|
+
- app/javascript/controllers/building_controller.js
|
|
77
|
+
- app/javascript/controllers/card_controller.js
|
|
78
|
+
- app/javascript/controllers/commit_modal_controller.js
|
|
79
|
+
- app/javascript/controllers/editor_modal_controller.js
|
|
80
|
+
- app/javascript/controllers/index.js
|
|
81
|
+
- app/javascript/controllers/list_loading_controller.js
|
|
82
|
+
- app/javascript/controllers/markdown_editor_controller.js
|
|
83
|
+
- app/javascript/controllers/new_document_controller.js
|
|
84
|
+
- app/javascript/controllers/push_to_public_controller.js
|
|
85
|
+
- app/javascript/controllers/testengine_controller.js
|
|
86
|
+
- app/javascript/lib/utils.js
|
|
87
|
+
- app/javascript/packs/application.js
|
|
88
|
+
- app/jobs/yarii/application_job.rb
|
|
89
|
+
- app/mailers/yarii/application_mailer.rb
|
|
90
|
+
- app/models/concerns/yarii_editor/model_callbacks.rb
|
|
91
|
+
- app/models/concerns/yarii_editor/previewing.rb
|
|
92
|
+
- app/models/page.rb
|
|
93
|
+
- app/models/post.rb
|
|
94
|
+
- app/models/yarii/application_record.rb
|
|
95
|
+
- app/models/yarii/repository.rb
|
|
96
|
+
- app/models/yarii/site.rb
|
|
97
|
+
- app/styles/FiraGO/FiraGO-Bold.woff
|
|
98
|
+
- app/styles/FiraGO/FiraGO-BoldItalic.woff
|
|
99
|
+
- app/styles/FiraGO/FiraGO-Book.woff
|
|
100
|
+
- app/styles/FiraGO/FiraGO-BookItalic.woff
|
|
101
|
+
- app/styles/FiraGO/FiraGO-HeavyItalic.woff
|
|
102
|
+
- app/styles/FiraGO/FiraGO-SemiBold.woff
|
|
103
|
+
- app/styles/FiraGO/FiraGO-SemiBoldItalic.woff
|
|
104
|
+
- app/styles/FiraGO/FiraGO.scss
|
|
105
|
+
- app/styles/Vidaloka/Vidaloka-Regular.woff
|
|
106
|
+
- app/styles/Vidaloka/Vidaloka.scss
|
|
107
|
+
- app/styles/application.scss
|
|
108
|
+
- app/styles/dashboard.scss
|
|
109
|
+
- app/styles/editor.scss
|
|
110
|
+
- app/styles/helpers.scss
|
|
111
|
+
- app/views/application/yarii_extra_head.html.erb
|
|
112
|
+
- app/views/layouts/yarii_editor/application.html.erb
|
|
113
|
+
- app/views/yarii_editor/application/render_engine_stylesheet_tag.html.erb
|
|
114
|
+
- app/views/yarii_editor/dashboard/_card.html.erb
|
|
115
|
+
- app/views/yarii_editor/dashboard/_extras.html.erb
|
|
116
|
+
- app/views/yarii_editor/dashboard/_inner_list.html.erb
|
|
117
|
+
- app/views/yarii_editor/dashboard/_list.html.erb
|
|
118
|
+
- app/views/yarii_editor/dashboard/index.html.erb
|
|
119
|
+
- app/views/yarii_editor/documents/modal.html.erb
|
|
120
|
+
- app/views/yarii_editor/editor/_dropdown.html.erb
|
|
121
|
+
- app/views/yarii_editor/editor/_markdown.html.erb
|
|
122
|
+
- app/views/yarii_editor/editor/_text.html.erb
|
|
123
|
+
- app/views/yarii_editor/editor/_textarea.html.erb
|
|
124
|
+
- app/views/yarii_editor/model_cards/_hashtags.html.erb
|
|
125
|
+
- app/views/yarii_editor/model_cards/_page.html.erb
|
|
126
|
+
- app/views/yarii_editor/model_cards/_post.html.erb
|
|
127
|
+
- app/views/yarii_editor/model_cards/_standard_footer_buttons.html.erb
|
|
128
|
+
- app/views/yarii_editor/publish/commit.html.erb
|
|
129
|
+
- app/views/yarii_editor/shared/_navbar.html.erb
|
|
130
|
+
- app/views/yarii_editor/shared/_publishing_menu.html.erb
|
|
131
|
+
- config/initializers/assets.rb
|
|
132
|
+
- config/routes.rb
|
|
133
|
+
- config/webpack/development.js
|
|
134
|
+
- config/webpack/environment.js
|
|
135
|
+
- config/webpack/production.js
|
|
136
|
+
- config/webpack/staging.js
|
|
137
|
+
- config/webpack/test.js
|
|
138
|
+
- config/webpacker.yml
|
|
139
|
+
- db/migrate/20190923000809_create_yarii_sites.rb
|
|
140
|
+
- db/migrate/20191014203116_add_git_repo_path_to_yarii_sites.rb
|
|
141
|
+
- db/migrate/20200420221048_add_preview_build_command_to_yarii_sites.rb
|
|
142
|
+
- lib/tasks/yarii_editor_tasks.rake
|
|
143
|
+
- lib/yarii-editor.rb
|
|
144
|
+
- lib/yarii-editor/engine.rb
|
|
145
|
+
- lib/yarii-editor/setup_current_site.rb
|
|
146
|
+
- lib/yarii-editor/setup_current_user.rb
|
|
147
|
+
- lib/yarii-editor/version.rb
|
|
148
|
+
homepage: https://whitefusion.io
|
|
149
|
+
licenses:
|
|
150
|
+
- MIT
|
|
151
|
+
metadata: {}
|
|
152
|
+
post_install_message:
|
|
153
|
+
rdoc_options: []
|
|
154
|
+
require_paths:
|
|
155
|
+
- lib
|
|
156
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
157
|
+
requirements:
|
|
158
|
+
- - ">="
|
|
159
|
+
- !ruby/object:Gem::Version
|
|
160
|
+
version: '0'
|
|
161
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
162
|
+
requirements:
|
|
163
|
+
- - ">="
|
|
164
|
+
- !ruby/object:Gem::Version
|
|
165
|
+
version: '0'
|
|
166
|
+
requirements: []
|
|
167
|
+
rubygems_version: 3.0.8
|
|
168
|
+
signing_key:
|
|
169
|
+
specification_version: 4
|
|
170
|
+
summary: Provides a editing admin interface to any Rails app for handling static content
|
|
171
|
+
(aka Jekyll)
|
|
172
|
+
test_files: []
|