fl 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 +7 -0
- data/.gitignore +44 -0
- data/Gemfile +5 -0
- data/Gemfile.lock +173 -0
- data/README.md +30 -0
- data/Rakefile +2 -0
- data/app/admin/options.rb +46 -0
- data/app/admin/pages.rb +55 -0
- data/app/admin/users.rb +34 -0
- data/app/assets/javascripts/active_admin.coffee.erb +20 -0
- data/app/assets/javascripts/application.coffee.erb +40 -0
- data/app/assets/javascripts/ckeditor/basepath.coffee.erb +21 -0
- data/app/assets/javascripts/ckeditor/config.coffee.erb +146 -0
- data/app/assets/javascripts/ckeditor/plugins/autogrow/plugin.js +232 -0
- data/app/assets/javascripts/ckeditor/plugins/autogrow/samples/autogrow.html +102 -0
- data/app/assets/javascripts/ckeditor/plugins/stylesheetparser/plugin.js +158 -0
- data/app/assets/javascripts/ckeditor/plugins/stylesheetparser/samples/assets/sample.css +70 -0
- data/app/assets/javascripts/ckeditor/plugins/stylesheetparser/samples/stylesheetparser.html +85 -0
- data/app/assets/javascripts/ckeditor/skins/minimalist/dialog.css +5 -0
- data/app/assets/javascripts/ckeditor/skins/minimalist/dialog_ie.css +5 -0
- data/app/assets/javascripts/ckeditor/skins/minimalist/dialog_ie7.css +5 -0
- data/app/assets/javascripts/ckeditor/skins/minimalist/dialog_ie8.css +5 -0
- data/app/assets/javascripts/ckeditor/skins/minimalist/dialog_iequirks.css +5 -0
- data/app/assets/javascripts/ckeditor/skins/minimalist/editor.css +5 -0
- data/app/assets/javascripts/ckeditor/skins/minimalist/editor_gecko.css +5 -0
- data/app/assets/javascripts/ckeditor/skins/minimalist/editor_ie.css +5 -0
- data/app/assets/javascripts/ckeditor/skins/minimalist/editor_ie7.css +5 -0
- data/app/assets/javascripts/ckeditor/skins/minimalist/editor_ie8.css +5 -0
- data/app/assets/javascripts/ckeditor/skins/minimalist/editor_iequirks.css +5 -0
- data/app/assets/javascripts/ckeditor/skins/minimalist/icons.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/minimalist/icons_hidpi.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/minimalist/images/arrow.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/minimalist/images/close.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/minimalist/images/hidpi/close.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/minimalist/images/hidpi/lock-open.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/minimalist/images/hidpi/lock.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/minimalist/images/hidpi/refresh.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/minimalist/images/lock-open.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/minimalist/images/lock.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/minimalist/images/refresh.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/minimalist/readme.md +7 -0
- data/app/assets/javascripts/ckeditor/skins/minimalist/skin.js +10 -0
- data/app/assets/javascripts/ckeditor/skins/moonocolor/dialog.css +5 -0
- data/app/assets/javascripts/ckeditor/skins/moonocolor/dialog_ie.css +5 -0
- data/app/assets/javascripts/ckeditor/skins/moonocolor/dialog_ie7.css +5 -0
- data/app/assets/javascripts/ckeditor/skins/moonocolor/dialog_ie8.css +5 -0
- data/app/assets/javascripts/ckeditor/skins/moonocolor/dialog_iequirks.css +5 -0
- data/app/assets/javascripts/ckeditor/skins/moonocolor/editor.css +5 -0
- data/app/assets/javascripts/ckeditor/skins/moonocolor/editor_gecko.css +5 -0
- data/app/assets/javascripts/ckeditor/skins/moonocolor/editor_ie.css +5 -0
- data/app/assets/javascripts/ckeditor/skins/moonocolor/editor_ie7.css +5 -0
- data/app/assets/javascripts/ckeditor/skins/moonocolor/editor_ie8.css +5 -0
- data/app/assets/javascripts/ckeditor/skins/moonocolor/editor_iequirks.css +5 -0
- data/app/assets/javascripts/ckeditor/skins/moonocolor/icons.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/moonocolor/icons_hidpi.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/moonocolor/images/arrow.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/moonocolor/images/close.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/moonocolor/images/hidpi/close.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/moonocolor/images/hidpi/lock-open.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/moonocolor/images/hidpi/lock.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/moonocolor/images/hidpi/refresh.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/moonocolor/images/lock-open.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/moonocolor/images/lock.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/moonocolor/images/refresh.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/moonocolor/images/spinner.gif +0 -0
- data/app/assets/javascripts/ckeditor/skins/moonocolor/readme.md +51 -0
- data/app/assets/javascripts/ckeditor/skins/moonocolor/skin.js +10 -0
- data/app/assets/javascripts/components/confirm.coffee +51 -0
- data/app/assets/javascripts/components/modals.coffee +29 -0
- data/app/assets/stylesheets/_defaults.yml +106 -0
- data/app/assets/stylesheets/_functions.sass.erb +75 -0
- data/app/assets/stylesheets/active_admin.sass +117 -0
- data/app/assets/stylesheets/application.sass.erb +46 -0
- data/app/assets/stylesheets/styles/reset.sass +139 -0
- data/app/assets/stylesheets/styles/structure.sass +69 -0
- data/app/assets/stylesheets/styles/ui/flash.sass +128 -0
- data/app/assets/stylesheets/styles/ui/fonts.sass +32 -0
- data/app/assets/stylesheets/styles/ui/modals.sass +61 -0
- data/app/assets/stylesheets/styles/ui/tooltips.sass +139 -0
- data/app/controllers/application_controller.rb +87 -0
- data/app/helpers/fl/application_helper.rb +53 -0
- data/app/helpers/fl/asset_helper.rb +50 -0
- data/app/helpers/fl/liquid_helper.rb +29 -0
- data/app/helpers/fl/meta_helper.rb +118 -0
- data/app/lib/active_record/concerns/base.rb +55 -0
- data/app/lib/active_record/concerns/seeds.rb +78 -0
- data/app/liquid/filters/meta_filter.rb +6 -0
- data/app/liquid/tags/google_analytics_tag.rb +32 -0
- data/app/liquid/tags/icon_tag.rb +37 -0
- data/app/liquid/tags/meta_tag.rb +120 -0
- data/app/mailers/application_mailer.rb +28 -0
- data/app/models/application_record.rb +3 -0
- data/app/models/asset.rb +95 -0
- data/app/models/association.rb +21 -0
- data/app/models/meta.rb +27 -0
- data/app/models/node.rb +59 -0
- data/app/models/profile.rb +49 -0
- data/app/models/user.rb +49 -0
- data/app/service/flash.rb +8 -0
- data/app/views/layouts/_admin.haml +6 -0
- data/app/views/layouts/_application.haml +17 -0
- data/app/views/layouts/base.haml +26 -0
- data/app/views/mailers/layouts/mailer.haml +8 -0
- data/app/views/mailers/layouts/mailer.text.erb +1 -0
- data/app/views/mailers/new_user.erb +4 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/config/initializers/active_admin.rb +266 -0
- data/config/initializers/ckeditor.rb +63 -0
- data/config/initializers/devise.rb +279 -0
- data/config/initializers/friendly_id.rb +92 -0
- data/config/initializers/inflections.rb +20 -0
- data/config/initializers/liquid.rb +87 -0
- data/config/initializers/sass.rb +45 -0
- data/config/locales/devise.en.yml +62 -0
- data/config/locales/en.yml +13 -0
- data/config/puma.rb +59 -0
- data/config/routes.rb +56 -0
- data/db/migrate/20160616060637_create_nodes.rb +26 -0
- data/db/migrate/20160707080248_create_users.rb +52 -0
- data/db/migrate/20160707094704_create_slugs.rb +33 -0
- data/db/migrate/20160710095916_create_associations.rb +20 -0
- data/db/migrate/20160713061948_create_profiles.rb +27 -0
- data/db/migrate/20161115101221_create_assets.rb +25 -0
- data/db/migrate/20170725060408_create_active_admin_comments.rb +22 -0
- data/db/seeds.rb +81 -0
- data/fl.gemspec +73 -0
- data/lib/fl.rb +28 -0
- data/lib/fl/constants.rb +52 -0
- data/lib/fl/engine.rb +160 -0
- data/lib/fl/hash.rb +34 -0
- data/lib/generators/fl/sass_vars_generator.rb +16 -0
- data/lib/generators/fl/templates/sass.yml +56 -0
- data/lib/tasks/ckeditor.rake +37 -0
- data/lib/tasks/favicon.rake +37 -0
- data/readme/fl.jpg +0 -0
- metadata +416 -0
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# => Loaded?
|
|
2
|
+
if Gem.loaded_specs.has_key? "liquid"
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
###################################################
|
|
6
|
+
###################################################
|
|
7
|
+
|
|
8
|
+
## http://code.runnable.com/Up0qFjHu834vAABr/how-to-use-for-loops-in-liquid-templates-for-ruby-on-rails ##
|
|
9
|
+
class LiquidTemplateHandler
|
|
10
|
+
def self.call(template)
|
|
11
|
+
"sanitize LiquidTemplateHandler.new(self).render(#{template.source.inspect}, local_assigns)"
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
###################################################
|
|
15
|
+
###################################################
|
|
16
|
+
|
|
17
|
+
def initialize(view)
|
|
18
|
+
@view = view
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def render(template, local_assigns = {})
|
|
22
|
+
@view.controller.headers["Content-Type"] ||= 'text/html; charset=utf-8'
|
|
23
|
+
|
|
24
|
+
assigns = @view.assigns
|
|
25
|
+
|
|
26
|
+
if @view.content_for?(:layout)
|
|
27
|
+
assigns["content_for_layout"] = @view.content_for(:layout)
|
|
28
|
+
end
|
|
29
|
+
assigns.merge!(local_assigns.stringify_keys)
|
|
30
|
+
|
|
31
|
+
controller = @view.controller
|
|
32
|
+
filters = if controller.respond_to?(:liquid_filters, true)
|
|
33
|
+
controller.send(:liquid_filters)
|
|
34
|
+
elsif controller.respond_to?(:master_helper_module)
|
|
35
|
+
[controller.master_helper_module]
|
|
36
|
+
else
|
|
37
|
+
[controller._helpers]
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
liquid = Liquid::Template.parse(template)
|
|
42
|
+
liquid.render(assigns, :filters => filters, :registers => {:action_view => @view, :controller => @view.controller})
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def compilable?
|
|
46
|
+
false
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
#ActionView::Template.register_template_handler :liquid, LiquidTemplateHandler
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
###############################
|
|
54
|
+
###############################
|
|
55
|
+
|
|
56
|
+
# => Shortcodes
|
|
57
|
+
# => Should be extracted into own class / module
|
|
58
|
+
cache = ActiveSupport::Cache::MemoryStore.new
|
|
59
|
+
cache.write "shortcodes", { "CSS" => "TEST" }
|
|
60
|
+
|
|
61
|
+
###############################
|
|
62
|
+
###############################
|
|
63
|
+
|
|
64
|
+
## Filters ##
|
|
65
|
+
## these are meant to provide simple "transations" for code ##
|
|
66
|
+
## Treat as shortcuts ##
|
|
67
|
+
## {{ expression | call | call | call }}
|
|
68
|
+
#Liquid::Template.register_filter 'meta', MetaFilter
|
|
69
|
+
|
|
70
|
+
## Tags ##
|
|
71
|
+
## These are meant to be programmatic - if loops etc ##
|
|
72
|
+
## Treat as small widget / app ##
|
|
73
|
+
## {% title new title %}
|
|
74
|
+
## {% icon database %}
|
|
75
|
+
%w(meta title csrf robots favicon js viewport stylesheet).each do |meta|
|
|
76
|
+
Liquid::Template.register_tag meta, Tags::MetaTag
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
Liquid::Template.register_tag 'icon', Tags::IconTag
|
|
80
|
+
Liquid::Template.register_tag 'ga', Tags::GoogleAnalyticsTag
|
|
81
|
+
|
|
82
|
+
## Drops ##
|
|
83
|
+
## Provide access to backend data (User / Node / etc) ##
|
|
84
|
+
## Treat as object -- user.name etc ##
|
|
85
|
+
## {{ user.name }} {{ options.analytics }}
|
|
86
|
+
|
|
87
|
+
end
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
##############################
|
|
2
|
+
##############################
|
|
3
|
+
#https://gist.github.com/unixmonkey/323198
|
|
4
|
+
#https://gist.github.com/evandrodutra/177372
|
|
5
|
+
##############################
|
|
6
|
+
##############################
|
|
7
|
+
#
|
|
8
|
+
# production:
|
|
9
|
+
# color: 'blue' #result: !color = blue
|
|
10
|
+
# host: 'http://example.com' #result: !host = http://example.com
|
|
11
|
+
# development:
|
|
12
|
+
# color: 'red'
|
|
13
|
+
# host: 'http://localhost:3000'
|
|
14
|
+
# test:
|
|
15
|
+
# color: 'gray' #result: !color = gray
|
|
16
|
+
# host: 'http://localhost:3000'
|
|
17
|
+
#
|
|
18
|
+
##############################
|
|
19
|
+
##############################
|
|
20
|
+
#
|
|
21
|
+
# Notes
|
|
22
|
+
# -> If you include several instances of the same variable, only the last one will be saved
|
|
23
|
+
# -> Whilst you can use the environment-based defintiions as above, you can also define variables on their own
|
|
24
|
+
# -> You can also include "groups" which allow you to create variables based on the grouped identity for them all
|
|
25
|
+
#
|
|
26
|
+
##############################
|
|
27
|
+
##############################
|
|
28
|
+
|
|
29
|
+
# Declarations
|
|
30
|
+
INPUT = File.join(Rails.root, "config", "sass.yml")
|
|
31
|
+
OUTPUT = File.join(Rails.root, "vendor", "assets", "stylesheets", "_variables.sass")
|
|
32
|
+
|
|
33
|
+
##############################
|
|
34
|
+
##############################
|
|
35
|
+
|
|
36
|
+
begin
|
|
37
|
+
File.open(OUTPUT, 'w+') do |file|
|
|
38
|
+
file.write FL::AssetHelper.sass INPUT
|
|
39
|
+
end
|
|
40
|
+
rescue => e
|
|
41
|
+
puts e
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
##############################
|
|
45
|
+
##############################
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Additional translations at https://github.com/plataformatec/devise/wiki/I18n
|
|
2
|
+
|
|
3
|
+
en:
|
|
4
|
+
devise:
|
|
5
|
+
confirmations:
|
|
6
|
+
confirmed: "Your email address has been successfully confirmed."
|
|
7
|
+
send_instructions: "You will receive an email with instructions for how to confirm your email address in a few minutes."
|
|
8
|
+
send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions for how to confirm your email address in a few minutes."
|
|
9
|
+
failure:
|
|
10
|
+
already_authenticated: "You are already signed in."
|
|
11
|
+
inactive: "Your account is not activated yet."
|
|
12
|
+
invalid: "Invalid %{authentication_keys} or password."
|
|
13
|
+
locked: "Your account is locked."
|
|
14
|
+
last_attempt: "You have one more attempt before your account is locked."
|
|
15
|
+
not_found_in_database: "Invalid %{authentication_keys} or password."
|
|
16
|
+
timeout: "Your session expired. Please sign in again to continue."
|
|
17
|
+
unauthenticated: "You need to sign in or sign up before continuing."
|
|
18
|
+
unconfirmed: "You have to confirm your email address before continuing."
|
|
19
|
+
mailer:
|
|
20
|
+
confirmation_instructions:
|
|
21
|
+
subject: "Confirmation instructions"
|
|
22
|
+
reset_password_instructions:
|
|
23
|
+
subject: "Reset password instructions"
|
|
24
|
+
unlock_instructions:
|
|
25
|
+
subject: "Unlock instructions"
|
|
26
|
+
password_change:
|
|
27
|
+
subject: "Password Changed"
|
|
28
|
+
omniauth_callbacks:
|
|
29
|
+
failure: "Could not authenticate you from %{kind} because \"%{reason}\"."
|
|
30
|
+
success: "Successfully authenticated from %{kind} account."
|
|
31
|
+
passwords:
|
|
32
|
+
no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided."
|
|
33
|
+
send_instructions: "You will receive an email with instructions on how to reset your password in a few minutes."
|
|
34
|
+
send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes."
|
|
35
|
+
updated: "Your password has been changed successfully. You are now signed in."
|
|
36
|
+
updated_not_active: "Your password has been changed successfully."
|
|
37
|
+
registrations:
|
|
38
|
+
destroyed: "Bye! Your account has been successfully cancelled. We hope to see you again soon."
|
|
39
|
+
signed_up: "Welcome! You have signed up successfully."
|
|
40
|
+
signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated."
|
|
41
|
+
signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked."
|
|
42
|
+
signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please follow the link to activate your account."
|
|
43
|
+
update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and follow the confirm link to confirm your new email address."
|
|
44
|
+
updated: "Your account has been updated successfully."
|
|
45
|
+
sessions:
|
|
46
|
+
signed_in: "Signed in successfully."
|
|
47
|
+
signed_out: "Signed out successfully."
|
|
48
|
+
already_signed_out: "Signed out successfully."
|
|
49
|
+
unlocks:
|
|
50
|
+
send_instructions: "You will receive an email with instructions for how to unlock your account in a few minutes."
|
|
51
|
+
send_paranoid_instructions: "If your account exists, you will receive an email with instructions for how to unlock it in a few minutes."
|
|
52
|
+
unlocked: "Your account has been unlocked successfully. Please sign in to continue."
|
|
53
|
+
errors:
|
|
54
|
+
messages:
|
|
55
|
+
already_confirmed: "was already confirmed, please try signing in"
|
|
56
|
+
confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one"
|
|
57
|
+
expired: "has expired, please request a new one"
|
|
58
|
+
not_found: "not found"
|
|
59
|
+
not_locked: "was not locked"
|
|
60
|
+
not_saved:
|
|
61
|
+
one: "1 error prohibited this %{resource} from being saved:"
|
|
62
|
+
other: "%{count} errors prohibited this %{resource} from being saved:"
|
data/config/puma.rb
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
########################################
|
|
2
|
+
########################################
|
|
3
|
+
## _____ ##
|
|
4
|
+
## | ___ \ ##
|
|
5
|
+
## | |_/ / _ _ __ ___ __ _ ##
|
|
6
|
+
## | __/ | | | '_ ` _ \ / _` | ##
|
|
7
|
+
## | | | |_| | | | | | | (_| | ##
|
|
8
|
+
## \_| \__,_|_| |_| |_|\__,_| ##
|
|
9
|
+
## ##
|
|
10
|
+
########################################
|
|
11
|
+
########################################
|
|
12
|
+
|
|
13
|
+
# Puma can serve each request in a thread from an internal thread pool.
|
|
14
|
+
# The `threads` method setting takes two numbers a minimum and maximum.
|
|
15
|
+
# Any libraries that use thread pools should be configured to match
|
|
16
|
+
# the maximum value specified for Puma. Default is set to 5 threads for minimum
|
|
17
|
+
# and maximum, this matches the default thread size of Active Record.
|
|
18
|
+
#
|
|
19
|
+
threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }.to_i
|
|
20
|
+
threads threads_count, threads_count
|
|
21
|
+
|
|
22
|
+
# Specifies the `port` that Puma will listen on to receive requests, default is 3000.
|
|
23
|
+
# => https://github.com/puma/puma/issues/1200
|
|
24
|
+
port ENV.fetch("PORT") { 4200 }
|
|
25
|
+
|
|
26
|
+
# Specifies the `environment` that Puma will run in.
|
|
27
|
+
#
|
|
28
|
+
environment ENV.fetch("RAILS_ENV") { "development" }
|
|
29
|
+
|
|
30
|
+
# Specifies the number of `workers` to boot in clustered mode.
|
|
31
|
+
# Workers are forked webserver processes. If using threads and workers together
|
|
32
|
+
# the concurrency of the application would be max `threads` * `workers`.
|
|
33
|
+
# Workers do not work on JRuby or Windows (both of which do not support
|
|
34
|
+
# processes).
|
|
35
|
+
#
|
|
36
|
+
# workers ENV.fetch("WEB_CONCURRENCY") { 2 }
|
|
37
|
+
|
|
38
|
+
# Use the `preload_app!` method when specifying a `workers` number.
|
|
39
|
+
# This directive tells Puma to first boot the application and load code
|
|
40
|
+
# before forking the application. This takes advantage of Copy On Write
|
|
41
|
+
# process behavior so workers use less memory. If you use this option
|
|
42
|
+
# you need to make sure to reconnect any threads in the `on_worker_boot`
|
|
43
|
+
# block.
|
|
44
|
+
#
|
|
45
|
+
# preload_app!
|
|
46
|
+
|
|
47
|
+
# The code in the `on_worker_boot` will be called if you are using
|
|
48
|
+
# clustered mode by specifying a number of `workers`. After each worker
|
|
49
|
+
# process is booted this block will be run, if you are using `preload_app!`
|
|
50
|
+
# option you will want to use this block to reconnect to any threads
|
|
51
|
+
# or connections that may have been created at application boot, Ruby
|
|
52
|
+
# cannot share connections between processes.
|
|
53
|
+
#
|
|
54
|
+
# on_worker_boot do
|
|
55
|
+
# ActiveRecord::Base.establish_connection if defined?(ActiveRecord)
|
|
56
|
+
# end
|
|
57
|
+
|
|
58
|
+
# Allow puma to be restarted by `rails restart` command.
|
|
59
|
+
plugin :tmp_restart
|
data/config/routes.rb
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
########################################
|
|
2
|
+
########################################
|
|
3
|
+
## _____ _ ##
|
|
4
|
+
## | ___ \ | | ##
|
|
5
|
+
## | |_/ /___ _ _| |_ ___ ___ ##
|
|
6
|
+
## | // _ \| | | | __/ _ \/ __| ##
|
|
7
|
+
## | |\ \ (_) | |_| | || __/\__ \ ##
|
|
8
|
+
## \_| \_\___/ \__,_|\__\___||___/ ##
|
|
9
|
+
## ##
|
|
10
|
+
########################################
|
|
11
|
+
########################################
|
|
12
|
+
|
|
13
|
+
## Good resource
|
|
14
|
+
## https://gist.github.com/maxivak/5d428ade54828836e6b6#merge-engine-and-app-routes
|
|
15
|
+
|
|
16
|
+
########################################
|
|
17
|
+
########################################
|
|
18
|
+
|
|
19
|
+
## Routes ##
|
|
20
|
+
Rails.application.routes.draw do
|
|
21
|
+
|
|
22
|
+
########################################
|
|
23
|
+
########################################
|
|
24
|
+
|
|
25
|
+
# => CKEditor
|
|
26
|
+
mount Ckeditor::Engine => '/ckeditor' if Gem.loaded_specs.has_key? "ckeditor"
|
|
27
|
+
|
|
28
|
+
# => Admin
|
|
29
|
+
devise_for :users, ActiveAdmin::Devise.config
|
|
30
|
+
ActiveAdmin.routes(self)
|
|
31
|
+
|
|
32
|
+
########################################
|
|
33
|
+
########################################
|
|
34
|
+
|
|
35
|
+
# Index
|
|
36
|
+
# => Shows index of app
|
|
37
|
+
root "application#show"
|
|
38
|
+
|
|
39
|
+
########################################
|
|
40
|
+
########################################
|
|
41
|
+
|
|
42
|
+
# Robots.txt
|
|
43
|
+
# => https://blog.ragnarson.com/2013/11/15/hide-your-staging-environment-from-google.html
|
|
44
|
+
get "robots.txt" => "application#robots", as: :robots
|
|
45
|
+
|
|
46
|
+
########################################
|
|
47
|
+
########################################
|
|
48
|
+
|
|
49
|
+
# => Everything else
|
|
50
|
+
# => Nodes shown through system
|
|
51
|
+
resources :application, only: :show, path: "" # => url.com/:id
|
|
52
|
+
|
|
53
|
+
########################################
|
|
54
|
+
########################################
|
|
55
|
+
|
|
56
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
class CreateNodes < ActiveRecord::Migration::Current
|
|
2
|
+
include ActiveRecord::Concerns::Base
|
|
3
|
+
|
|
4
|
+
#########################################
|
|
5
|
+
#########################################
|
|
6
|
+
|
|
7
|
+
# => Up
|
|
8
|
+
# => enable_extension for Ruby 2.4.0 on Heroku
|
|
9
|
+
def up
|
|
10
|
+
enable_extension 'uuid-ossp' if adapter == "postgresql" # => http://theworkaround.com/2015/06/12/using-uuids-in-rails.html#postgresql
|
|
11
|
+
|
|
12
|
+
# => Table
|
|
13
|
+
create_table table, uuid do |t| # => users stored through "associations"
|
|
14
|
+
t.references :user
|
|
15
|
+
t.string :type
|
|
16
|
+
t.string :slug
|
|
17
|
+
t.string :ref
|
|
18
|
+
t.text :val, length: 4294967295
|
|
19
|
+
t.timestamps
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
#########################################
|
|
24
|
+
#########################################
|
|
25
|
+
|
|
26
|
+
end
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
class CreateUsers < ActiveRecord::Migration::Current
|
|
2
|
+
include ActiveRecord::Concerns::Base
|
|
3
|
+
|
|
4
|
+
#########################################
|
|
5
|
+
#########################################
|
|
6
|
+
|
|
7
|
+
# Up
|
|
8
|
+
def up
|
|
9
|
+
create_table table do |t|
|
|
10
|
+
|
|
11
|
+
## Database authenticatable
|
|
12
|
+
t.string :email, null: false, default: ""
|
|
13
|
+
t.string :encrypted_password, null: false, default: ""
|
|
14
|
+
|
|
15
|
+
## Recoverable
|
|
16
|
+
t.string :reset_password_token
|
|
17
|
+
t.datetime :reset_password_sent_at
|
|
18
|
+
|
|
19
|
+
## Rememberable
|
|
20
|
+
t.datetime :remember_created_at
|
|
21
|
+
|
|
22
|
+
## Trackable
|
|
23
|
+
t.integer :sign_in_count, default: 0, null: false
|
|
24
|
+
t.datetime :current_sign_in_at
|
|
25
|
+
t.datetime :last_sign_in_at
|
|
26
|
+
t.string :current_sign_in_ip
|
|
27
|
+
t.string :last_sign_in_ip
|
|
28
|
+
|
|
29
|
+
## Confirmable
|
|
30
|
+
#t.string :confirmation_token
|
|
31
|
+
#t.datetime :confirmed_at
|
|
32
|
+
#t.datetime :confirmation_sent_at
|
|
33
|
+
#t.string :unconfirmed_email # Only if using reconfirmable
|
|
34
|
+
|
|
35
|
+
## Lockable
|
|
36
|
+
#t.integer :failed_attempts, default: 0, null: false # Only if lock strategy is :failed_attempts
|
|
37
|
+
#t.string :unlock_token # Only if unlock strategy is :email or :both
|
|
38
|
+
#t.datetime :locked_at
|
|
39
|
+
|
|
40
|
+
t.timestamps null: false
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
add_index table, :email, unique: true
|
|
44
|
+
add_index table, :reset_password_token, unique: true
|
|
45
|
+
# add_index table, :confirmation_token, unique: true
|
|
46
|
+
# add_index table, :unlock_token, unique: true
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
#########################################
|
|
50
|
+
#########################################
|
|
51
|
+
|
|
52
|
+
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
class CreateSlugs < ActiveRecord::Migration::Current
|
|
2
|
+
include ActiveRecord::Concerns::Base
|
|
3
|
+
|
|
4
|
+
#########################################
|
|
5
|
+
#########################################
|
|
6
|
+
|
|
7
|
+
# Table
|
|
8
|
+
def table
|
|
9
|
+
FriendlyId::Slug.table_name
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
#########################################
|
|
13
|
+
#########################################
|
|
14
|
+
|
|
15
|
+
# Up
|
|
16
|
+
def up
|
|
17
|
+
create_table table do |t|
|
|
18
|
+
t.string :slug, :null => false
|
|
19
|
+
t.integer :sluggable_id, :null => false
|
|
20
|
+
t.string :sluggable_type, :limit => 50
|
|
21
|
+
t.string :scope
|
|
22
|
+
t.datetime :created_at
|
|
23
|
+
end
|
|
24
|
+
add_index table, :sluggable_id
|
|
25
|
+
add_index table, [:slug, :sluggable_type]
|
|
26
|
+
add_index table, [:slug, :sluggable_type, :scope], unique: true
|
|
27
|
+
add_index table, :sluggable_type
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
#########################################
|
|
31
|
+
#########################################
|
|
32
|
+
|
|
33
|
+
end
|