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.
Files changed (137) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +44 -0
  3. data/Gemfile +5 -0
  4. data/Gemfile.lock +173 -0
  5. data/README.md +30 -0
  6. data/Rakefile +2 -0
  7. data/app/admin/options.rb +46 -0
  8. data/app/admin/pages.rb +55 -0
  9. data/app/admin/users.rb +34 -0
  10. data/app/assets/javascripts/active_admin.coffee.erb +20 -0
  11. data/app/assets/javascripts/application.coffee.erb +40 -0
  12. data/app/assets/javascripts/ckeditor/basepath.coffee.erb +21 -0
  13. data/app/assets/javascripts/ckeditor/config.coffee.erb +146 -0
  14. data/app/assets/javascripts/ckeditor/plugins/autogrow/plugin.js +232 -0
  15. data/app/assets/javascripts/ckeditor/plugins/autogrow/samples/autogrow.html +102 -0
  16. data/app/assets/javascripts/ckeditor/plugins/stylesheetparser/plugin.js +158 -0
  17. data/app/assets/javascripts/ckeditor/plugins/stylesheetparser/samples/assets/sample.css +70 -0
  18. data/app/assets/javascripts/ckeditor/plugins/stylesheetparser/samples/stylesheetparser.html +85 -0
  19. data/app/assets/javascripts/ckeditor/skins/minimalist/dialog.css +5 -0
  20. data/app/assets/javascripts/ckeditor/skins/minimalist/dialog_ie.css +5 -0
  21. data/app/assets/javascripts/ckeditor/skins/minimalist/dialog_ie7.css +5 -0
  22. data/app/assets/javascripts/ckeditor/skins/minimalist/dialog_ie8.css +5 -0
  23. data/app/assets/javascripts/ckeditor/skins/minimalist/dialog_iequirks.css +5 -0
  24. data/app/assets/javascripts/ckeditor/skins/minimalist/editor.css +5 -0
  25. data/app/assets/javascripts/ckeditor/skins/minimalist/editor_gecko.css +5 -0
  26. data/app/assets/javascripts/ckeditor/skins/minimalist/editor_ie.css +5 -0
  27. data/app/assets/javascripts/ckeditor/skins/minimalist/editor_ie7.css +5 -0
  28. data/app/assets/javascripts/ckeditor/skins/minimalist/editor_ie8.css +5 -0
  29. data/app/assets/javascripts/ckeditor/skins/minimalist/editor_iequirks.css +5 -0
  30. data/app/assets/javascripts/ckeditor/skins/minimalist/icons.png +0 -0
  31. data/app/assets/javascripts/ckeditor/skins/minimalist/icons_hidpi.png +0 -0
  32. data/app/assets/javascripts/ckeditor/skins/minimalist/images/arrow.png +0 -0
  33. data/app/assets/javascripts/ckeditor/skins/minimalist/images/close.png +0 -0
  34. data/app/assets/javascripts/ckeditor/skins/minimalist/images/hidpi/close.png +0 -0
  35. data/app/assets/javascripts/ckeditor/skins/minimalist/images/hidpi/lock-open.png +0 -0
  36. data/app/assets/javascripts/ckeditor/skins/minimalist/images/hidpi/lock.png +0 -0
  37. data/app/assets/javascripts/ckeditor/skins/minimalist/images/hidpi/refresh.png +0 -0
  38. data/app/assets/javascripts/ckeditor/skins/minimalist/images/lock-open.png +0 -0
  39. data/app/assets/javascripts/ckeditor/skins/minimalist/images/lock.png +0 -0
  40. data/app/assets/javascripts/ckeditor/skins/minimalist/images/refresh.png +0 -0
  41. data/app/assets/javascripts/ckeditor/skins/minimalist/readme.md +7 -0
  42. data/app/assets/javascripts/ckeditor/skins/minimalist/skin.js +10 -0
  43. data/app/assets/javascripts/ckeditor/skins/moonocolor/dialog.css +5 -0
  44. data/app/assets/javascripts/ckeditor/skins/moonocolor/dialog_ie.css +5 -0
  45. data/app/assets/javascripts/ckeditor/skins/moonocolor/dialog_ie7.css +5 -0
  46. data/app/assets/javascripts/ckeditor/skins/moonocolor/dialog_ie8.css +5 -0
  47. data/app/assets/javascripts/ckeditor/skins/moonocolor/dialog_iequirks.css +5 -0
  48. data/app/assets/javascripts/ckeditor/skins/moonocolor/editor.css +5 -0
  49. data/app/assets/javascripts/ckeditor/skins/moonocolor/editor_gecko.css +5 -0
  50. data/app/assets/javascripts/ckeditor/skins/moonocolor/editor_ie.css +5 -0
  51. data/app/assets/javascripts/ckeditor/skins/moonocolor/editor_ie7.css +5 -0
  52. data/app/assets/javascripts/ckeditor/skins/moonocolor/editor_ie8.css +5 -0
  53. data/app/assets/javascripts/ckeditor/skins/moonocolor/editor_iequirks.css +5 -0
  54. data/app/assets/javascripts/ckeditor/skins/moonocolor/icons.png +0 -0
  55. data/app/assets/javascripts/ckeditor/skins/moonocolor/icons_hidpi.png +0 -0
  56. data/app/assets/javascripts/ckeditor/skins/moonocolor/images/arrow.png +0 -0
  57. data/app/assets/javascripts/ckeditor/skins/moonocolor/images/close.png +0 -0
  58. data/app/assets/javascripts/ckeditor/skins/moonocolor/images/hidpi/close.png +0 -0
  59. data/app/assets/javascripts/ckeditor/skins/moonocolor/images/hidpi/lock-open.png +0 -0
  60. data/app/assets/javascripts/ckeditor/skins/moonocolor/images/hidpi/lock.png +0 -0
  61. data/app/assets/javascripts/ckeditor/skins/moonocolor/images/hidpi/refresh.png +0 -0
  62. data/app/assets/javascripts/ckeditor/skins/moonocolor/images/lock-open.png +0 -0
  63. data/app/assets/javascripts/ckeditor/skins/moonocolor/images/lock.png +0 -0
  64. data/app/assets/javascripts/ckeditor/skins/moonocolor/images/refresh.png +0 -0
  65. data/app/assets/javascripts/ckeditor/skins/moonocolor/images/spinner.gif +0 -0
  66. data/app/assets/javascripts/ckeditor/skins/moonocolor/readme.md +51 -0
  67. data/app/assets/javascripts/ckeditor/skins/moonocolor/skin.js +10 -0
  68. data/app/assets/javascripts/components/confirm.coffee +51 -0
  69. data/app/assets/javascripts/components/modals.coffee +29 -0
  70. data/app/assets/stylesheets/_defaults.yml +106 -0
  71. data/app/assets/stylesheets/_functions.sass.erb +75 -0
  72. data/app/assets/stylesheets/active_admin.sass +117 -0
  73. data/app/assets/stylesheets/application.sass.erb +46 -0
  74. data/app/assets/stylesheets/styles/reset.sass +139 -0
  75. data/app/assets/stylesheets/styles/structure.sass +69 -0
  76. data/app/assets/stylesheets/styles/ui/flash.sass +128 -0
  77. data/app/assets/stylesheets/styles/ui/fonts.sass +32 -0
  78. data/app/assets/stylesheets/styles/ui/modals.sass +61 -0
  79. data/app/assets/stylesheets/styles/ui/tooltips.sass +139 -0
  80. data/app/controllers/application_controller.rb +87 -0
  81. data/app/helpers/fl/application_helper.rb +53 -0
  82. data/app/helpers/fl/asset_helper.rb +50 -0
  83. data/app/helpers/fl/liquid_helper.rb +29 -0
  84. data/app/helpers/fl/meta_helper.rb +118 -0
  85. data/app/lib/active_record/concerns/base.rb +55 -0
  86. data/app/lib/active_record/concerns/seeds.rb +78 -0
  87. data/app/liquid/filters/meta_filter.rb +6 -0
  88. data/app/liquid/tags/google_analytics_tag.rb +32 -0
  89. data/app/liquid/tags/icon_tag.rb +37 -0
  90. data/app/liquid/tags/meta_tag.rb +120 -0
  91. data/app/mailers/application_mailer.rb +28 -0
  92. data/app/models/application_record.rb +3 -0
  93. data/app/models/asset.rb +95 -0
  94. data/app/models/association.rb +21 -0
  95. data/app/models/meta.rb +27 -0
  96. data/app/models/node.rb +59 -0
  97. data/app/models/profile.rb +49 -0
  98. data/app/models/user.rb +49 -0
  99. data/app/service/flash.rb +8 -0
  100. data/app/views/layouts/_admin.haml +6 -0
  101. data/app/views/layouts/_application.haml +17 -0
  102. data/app/views/layouts/base.haml +26 -0
  103. data/app/views/mailers/layouts/mailer.haml +8 -0
  104. data/app/views/mailers/layouts/mailer.text.erb +1 -0
  105. data/app/views/mailers/new_user.erb +4 -0
  106. data/bin/console +14 -0
  107. data/bin/setup +8 -0
  108. data/config/initializers/active_admin.rb +266 -0
  109. data/config/initializers/ckeditor.rb +63 -0
  110. data/config/initializers/devise.rb +279 -0
  111. data/config/initializers/friendly_id.rb +92 -0
  112. data/config/initializers/inflections.rb +20 -0
  113. data/config/initializers/liquid.rb +87 -0
  114. data/config/initializers/sass.rb +45 -0
  115. data/config/locales/devise.en.yml +62 -0
  116. data/config/locales/en.yml +13 -0
  117. data/config/puma.rb +59 -0
  118. data/config/routes.rb +56 -0
  119. data/db/migrate/20160616060637_create_nodes.rb +26 -0
  120. data/db/migrate/20160707080248_create_users.rb +52 -0
  121. data/db/migrate/20160707094704_create_slugs.rb +33 -0
  122. data/db/migrate/20160710095916_create_associations.rb +20 -0
  123. data/db/migrate/20160713061948_create_profiles.rb +27 -0
  124. data/db/migrate/20161115101221_create_assets.rb +25 -0
  125. data/db/migrate/20170725060408_create_active_admin_comments.rb +22 -0
  126. data/db/seeds.rb +81 -0
  127. data/fl.gemspec +73 -0
  128. data/lib/fl.rb +28 -0
  129. data/lib/fl/constants.rb +52 -0
  130. data/lib/fl/engine.rb +160 -0
  131. data/lib/fl/hash.rb +34 -0
  132. data/lib/generators/fl/sass_vars_generator.rb +16 -0
  133. data/lib/generators/fl/templates/sass.yml +56 -0
  134. data/lib/tasks/ckeditor.rake +37 -0
  135. data/lib/tasks/favicon.rake +37 -0
  136. data/readme/fl.jpg +0 -0
  137. metadata +416 -0
@@ -0,0 +1,63 @@
1
+ # => Check if CKEditor loaded
2
+ if Gem.loaded_specs.has_key? "ckeditor"
3
+
4
+ # => Use this hook to configure ckeditor
5
+ Ckeditor.setup do |config|
6
+ # ==> ORM configuration
7
+ # Load and configure the ORM. Supports :active_record (default), :mongo_mapper and
8
+ # :mongoid (bson_ext recommended) by default. Other ORMs may be
9
+ # available as additional gems.
10
+ require "ckeditor/orm/active_record"
11
+
12
+ # Allowed image file types for upload.
13
+ # Set to nil or [] (empty array) for all file types
14
+ # By default: %w(jpg jpeg png gif tiff)
15
+ # config.image_file_types = %w(jpg jpeg png gif tiff)
16
+
17
+ # Allowed flash file types for upload.
18
+ # Set to nil or [] (empty array) for all file types
19
+ # By default: %w(jpg jpeg png gif tiff)
20
+ # config.flash_file_types = %w(swf)
21
+
22
+ # Allowed attachment file types for upload.
23
+ # Set to nil or [] (empty array) for all file types
24
+ # By default: %w(doc docx xls odt ods pdf rar zip tar tar.gz swf)
25
+ # config.attachment_file_types = %w(doc docx xls odt ods pdf rar zip tar tar.gz swf)
26
+
27
+ # Setup authorization to be run as a before filter
28
+ # By default: there is no authorization.
29
+ # config.authorize_with :cancan
30
+
31
+ # Override parent controller CKEditor inherits from
32
+ # By default: 'ApplicationController'
33
+ # config.parent_controller = 'MyController'
34
+
35
+ # Asset model classes
36
+ config.picture_model { Asset }
37
+ config.attachment_file_model { Asset }
38
+
39
+ # Paginate assets
40
+ # By default: 24
41
+ # config.default_per_page = 24
42
+
43
+ # Customize ckeditor assets path
44
+ # By default: nil
45
+ #config.asset_path = Rails.application.config.assets.prefix # "http://www.example.com/assets/ckeditor/"
46
+
47
+ # To reduce the asset precompilation time, you can limit plugins and/or languages to those you need:
48
+ # By default: nil (no limit)
49
+ config.assets_languages = ['en', 'uk']
50
+ # config.assets_plugins = ['image', 'smiley']
51
+
52
+ # CKEditor CDN
53
+ # More info here http://cdn.ckeditor.com/
54
+ # By default: nil (CDN disabled)
55
+ # config.cdn_url = "//cdn.ckeditor.com/4.5.6/standard/ckeditor.js"
56
+
57
+ # JS config url
58
+ # Used when CKEditor CDN enabled
59
+ # By default: "/assets/ckeditor/config.js"
60
+ # config.js_config_url = "/assets/ckeditor/config.js"
61
+ end
62
+
63
+ end
@@ -0,0 +1,279 @@
1
+ # => Check if Devise loaded
2
+ if Gem.loaded_specs.has_key? 'devise'
3
+
4
+ # Use this hook to configure devise mailer, warden hooks and so forth.
5
+ # Many of these configuration options can be set straight in your model.
6
+ Devise.setup do |config|
7
+ # The secret key used by Devise. Devise uses this key to generate
8
+ # random tokens. Changing this key will render invalid all existing
9
+ # confirmation, reset password and unlock tokens in the database.
10
+ # Devise will use the `secret_key_base` as its `secret_key`
11
+ # by default. You can change it below and use your own secret key.
12
+ config.secret_key = Rails.application.secrets[:secret_key_base]
13
+
14
+ # ==> Mailer Configuration
15
+ # Configure the e-mail address which will be shown in Devise::Mailer,
16
+ # note that it will be overwritten if you use your own mailer class
17
+ # with default "from" parameter.
18
+ config.mailer_sender = Rails.application.secrets[:app][:email]
19
+
20
+ # Configure the class responsible to send e-mails.
21
+ # config.mailer = 'Devise::Mailer'
22
+
23
+ # Configure the parent class responsible to send e-mails.
24
+ config.parent_mailer = 'ActionMailer::Base'
25
+
26
+ # ==> ORM configuration
27
+ # Load and configure the ORM. Supports :active_record (default) and
28
+ # :mongoid (bson_ext recommended) by default. Other ORMs may be
29
+ # available as additional gems.
30
+ require 'devise/orm/active_record'
31
+
32
+ # ==> Configuration for any authentication mechanism
33
+ # Configure which keys are used when authenticating a user. The default is
34
+ # just :email. You can configure it to use [:username, :subdomain], so for
35
+ # authenticating a user, both parameters are required. Remember that those
36
+ # parameters are used only when authenticating and not when retrieving from
37
+ # session. If you need permissions, you should implement that in a before filter.
38
+ # You can also supply a hash where the value is a boolean determining whether
39
+ # or not authentication should be aborted when the value is not present.
40
+ # config.authentication_keys = [:email]
41
+
42
+ # Configure parameters from the request object used for authentication. Each entry
43
+ # given should be a request method and it will automatically be passed to the
44
+ # find_for_authentication method and considered in your model lookup. For instance,
45
+ # if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
46
+ # The same considerations mentioned for authentication_keys also apply to request_keys.
47
+ # config.request_keys = []
48
+
49
+ # Configure which authentication keys should be case-insensitive.
50
+ # These keys will be downcased upon creating or modifying a user and when used
51
+ # to authenticate or find a user. Default is :email.
52
+ config.case_insensitive_keys = [:email]
53
+
54
+ # Configure which authentication keys should have whitespace stripped.
55
+ # These keys will have whitespace before and after removed upon creating or
56
+ # modifying a user and when used to authenticate or find a user. Default is :email.
57
+ config.strip_whitespace_keys = [:email]
58
+
59
+ # Tell if authentication through request.params is enabled. True by default.
60
+ # It can be set to an array that will enable params authentication only for the
61
+ # given strategies, for example, `config.params_authenticatable = [:database]` will
62
+ # enable it only for database (email + password) authentication.
63
+ # config.params_authenticatable = true
64
+
65
+ # Tell if authentication through HTTP Auth is enabled. False by default.
66
+ # It can be set to an array that will enable http authentication only for the
67
+ # given strategies, for example, `config.http_authenticatable = [:database]` will
68
+ # enable it only for database authentication. The supported strategies are:
69
+ # :database = Support basic authentication with authentication key + password
70
+ # config.http_authenticatable = false
71
+
72
+ # If 401 status code should be returned for AJAX requests. True by default.
73
+ # config.http_authenticatable_on_xhr = true
74
+
75
+ # The realm used in Http Basic Authentication. 'Application' by default.
76
+ # config.http_authentication_realm = 'Application'
77
+
78
+ # It will change confirmation, password recovery and other workflows
79
+ # to behave the same regardless if the e-mail provided was right or wrong.
80
+ # Does not affect registerable.
81
+ # config.paranoid = true
82
+
83
+ # By default Devise will store the user in session. You can skip storage for
84
+ # particular strategies by setting this option.
85
+ # Notice that if you are skipping storage for all authentication paths, you
86
+ # may want to disable generating routes to Devise's sessions controller by
87
+ # passing skip: :sessions to `devise_for` in your config/routes.rb
88
+ config.skip_session_storage = [:http_auth]
89
+
90
+ # By default, Devise cleans up the CSRF token on authentication to
91
+ # avoid CSRF token fixation attacks. This means that, when using AJAX
92
+ # requests for sign in and sign up, you need to get a new CSRF token
93
+ # from the server. You can disable this option at your own risk.
94
+ # config.clean_up_csrf_token_on_authentication = true
95
+
96
+ # When false, Devise will not attempt to reload routes on eager load.
97
+ # This can reduce the time taken to boot the app but if your application
98
+ # requires the Devise mappings to be loaded during boot time the application
99
+ # won't boot properly.
100
+ # config.reload_routes = true
101
+
102
+ # ==> Configuration for :database_authenticatable
103
+ # For bcrypt, this is the cost for hashing the password and defaults to 11. If
104
+ # using other algorithms, it sets how many times you want the password to be hashed.
105
+ #
106
+ # Limiting the stretches to just one in testing will increase the performance of
107
+ # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
108
+ # a value less than 10 in other environments. Note that, for bcrypt (the default
109
+ # algorithm), the cost increases exponentially with the number of stretches (e.g.
110
+ # a value of 20 is already extremely slow: approx. 60 seconds for 1 calculation).
111
+ config.stretches = Rails.env.test? ? 1 : 11
112
+
113
+ # Set up a pepper to generate the hashed password.
114
+ # config.pepper = 'e8bfa64c54f5e6ca812224ece89c73d622c5ad451f201e1b47d6b7a4a7f625ebbf18e36e05a3e461a1a5cddbf36328d492229b725ef5f0d23672f4d61c3dcacf'
115
+
116
+ # Send a notification email when the user's password is changed
117
+ # config.send_password_change_notification = false
118
+
119
+ # ==> Configuration for :confirmable
120
+ # A period that the user is allowed to access the website even without
121
+ # confirming their account. For instance, if set to 2.days, the user will be
122
+ # able to access the website for two days without confirming their account,
123
+ # access will be blocked just in the third day. Default is 0.days, meaning
124
+ # the user cannot access the website without confirming their account.
125
+ # config.allow_unconfirmed_access_for = 2.days
126
+
127
+ # A period that the user is allowed to confirm their account before their
128
+ # token becomes invalid. For example, if set to 3.days, the user can confirm
129
+ # their account within 3 days after the mail was sent, but on the fourth day
130
+ # their account can't be confirmed with the token any more.
131
+ # Default is nil, meaning there is no restriction on how long a user can take
132
+ # before confirming their account.
133
+ # config.confirm_within = 3.days
134
+
135
+ # If true, requires any email changes to be confirmed (exactly the same way as
136
+ # initial account confirmation) to be applied. Requires additional unconfirmed_email
137
+ # db field (see migrations). Until confirmed, new email is stored in
138
+ # unconfirmed_email column, and copied to email column on successful confirmation.
139
+ config.reconfirmable = true
140
+
141
+ # Defines which key will be used when confirming an account
142
+ # config.confirmation_keys = [:email]
143
+
144
+ # ==> Configuration for :rememberable
145
+ # The time the user will be remembered without asking for credentials again.
146
+ config.remember_for = 2.weeks
147
+
148
+ # Invalidates all the remember me tokens when the user signs out.
149
+ config.expire_all_remember_me_on_sign_out = true
150
+
151
+ # If true, extends the user's remember period when remembered via cookie.
152
+ # config.extend_remember_period = false
153
+
154
+ # Options to be passed to the created cookie. For instance, you can set
155
+ # secure: true in order to force SSL only cookies.
156
+ # config.rememberable_options = {}
157
+
158
+ # ==> Configuration for :validatable
159
+ # Range for password length.
160
+ config.password_length = 6..128
161
+
162
+ # Email regex used to validate email formats. It simply asserts that
163
+ # one (and only one) @ exists in the given string. This is mainly
164
+ # to give user feedback and not to assert the e-mail validity.
165
+ config.email_regexp = /\A[^@\s]+@[^@\s]+\z/
166
+
167
+ # ==> Configuration for :timeoutable
168
+ # The time you want to timeout the user session without activity. After this
169
+ # time the user will be asked for credentials again. Default is 30 minutes.
170
+ # config.timeout_in = 30.minutes
171
+
172
+ # ==> Configuration for :lockable
173
+ # Defines which strategy will be used to lock an account.
174
+ # :failed_attempts = Locks an account after a number of failed attempts to sign in.
175
+ # :none = No lock strategy. You should handle locking by yourself.
176
+ # config.lock_strategy = :failed_attempts
177
+
178
+ # Defines which key will be used when locking and unlocking an account
179
+ # config.unlock_keys = [:email]
180
+
181
+ # Defines which strategy will be used to unlock an account.
182
+ # :email = Sends an unlock link to the user email
183
+ # :time = Re-enables login after a certain amount of time (see :unlock_in below)
184
+ # :both = Enables both strategies
185
+ # :none = No unlock strategy. You should handle unlocking by yourself.
186
+ # config.unlock_strategy = :both
187
+
188
+ # Number of authentication tries before locking an account if lock_strategy
189
+ # is failed attempts.
190
+ # config.maximum_attempts = 20
191
+
192
+ # Time interval to unlock the account if :time is enabled as unlock_strategy.
193
+ # config.unlock_in = 1.hour
194
+
195
+ # Warn on the last attempt before the account is locked.
196
+ # config.last_attempt_warning = true
197
+
198
+ # ==> Configuration for :recoverable
199
+ #
200
+ # Defines which key will be used when recovering the password for an account
201
+ # config.reset_password_keys = [:email]
202
+
203
+ # Time interval you can reset your password with a reset password key.
204
+ # Don't put a too small interval or your users won't have the time to
205
+ # change their passwords.
206
+ config.reset_password_within = 6.hours
207
+
208
+ # When set to false, does not sign a user in automatically after their password is
209
+ # reset. Defaults to true, so a user is signed in automatically after a reset.
210
+ # config.sign_in_after_reset_password = true
211
+
212
+ # ==> Configuration for :encryptable
213
+ # Allow you to use another hashing or encryption algorithm besides bcrypt (default).
214
+ # You can use :sha1, :sha512 or algorithms from others authentication tools as
215
+ # :clearance_sha1, :authlogic_sha512 (then you should set stretches above to 20
216
+ # for default behavior) and :restful_authentication_sha1 (then you should set
217
+ # stretches to 10, and copy REST_AUTH_SITE_KEY to pepper).
218
+ #
219
+ # Require the `devise-encryptable` gem when using anything other than bcrypt
220
+ # config.encryptor = :sha512
221
+
222
+ # ==> Scopes configuration
223
+ # Turn scoped views on. Before rendering "sessions/new", it will first check for
224
+ # "users/sessions/new". It's turned off by default because it's slower if you
225
+ # are using only default views.
226
+ # config.scoped_views = false
227
+
228
+ # Configure the default scope given to Warden. By default it's the first
229
+ # devise role declared in your routes (usually :user).
230
+ # config.default_scope = :user
231
+
232
+ # Set this configuration to false if you want /users/sign_out to sign out
233
+ # only the current scope. By default, Devise signs out all scopes.
234
+ # config.sign_out_all_scopes = true
235
+
236
+ # ==> Navigation configuration
237
+ # Lists the formats that should be treated as navigational. Formats like
238
+ # :html, should redirect to the sign in page when the user does not have
239
+ # access, but formats like :xml or :json, should return 401.
240
+ #
241
+ # If you have any extra navigational formats, like :iphone or :mobile, you
242
+ # should add them to the navigational formats lists.
243
+ #
244
+ # The "*/*" below is required to match Internet Explorer requests.
245
+ # config.navigational_formats = ['*/*', :html]
246
+
247
+ # The default HTTP method used to sign out a resource. Default is :delete.
248
+ config.sign_out_via = :delete
249
+
250
+ # ==> OmniAuth
251
+ # Add a new OmniAuth provider. Check the wiki for more information on setting
252
+ # up on your models and hooks.
253
+ # config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo'
254
+
255
+ # ==> Warden configuration
256
+ # If you want to use other strategies, that are not supported by Devise, or
257
+ # change the failure app, you can configure them inside the config.warden block.
258
+ #
259
+ # config.warden do |manager|
260
+ # manager.intercept_401 = false
261
+ # manager.default_strategies(scope: :user).unshift :some_external_strategy
262
+ # end
263
+
264
+ # ==> Mountable engine configurations
265
+ # When using Devise inside an engine, let's call it `MyEngine`, and this engine
266
+ # is mountable, there are some extra configurations to be taken into account.
267
+ # The following options are available, assuming the engine is mounted as:
268
+ #
269
+ # mount MyEngine, at: '/my_engine'
270
+ #
271
+ # The router that invoked `devise_for`, in the example above, would be:
272
+ # config.router_name = :my_engine
273
+ #
274
+ # When using OmniAuth, Devise cannot automatically set OmniAuth path,
275
+ # so you need to do it manually. For the users scope, it would be:
276
+ # config.omniauth_path_prefix = '/my_engine/users/auth'
277
+ end
278
+
279
+ end
@@ -0,0 +1,92 @@
1
+ # FriendlyId Global Configuration
2
+ #
3
+ # Use this to set up shared configuration options for your entire application.
4
+ # Any of the configuration options shown here can also be applied to single
5
+ # models by passing arguments to the `friendly_id` class method or defining
6
+ # methods in your model.
7
+ #
8
+ # To learn more, check out the guide:
9
+ #
10
+ # http://norman.github.io/friendly_id/file.Guide.html
11
+
12
+ FriendlyId.defaults do |config|
13
+ # ## Reserved Words
14
+ #
15
+ # Some words could conflict with Rails's routes when used as slugs, or are
16
+ # undesirable to allow as slugs. Edit this list as needed for your app.
17
+ config.use :reserved
18
+
19
+ config.reserved_words = %w(new edit session login logout users
20
+ stylesheets assets javascripts images)
21
+
22
+ # ## Friendly Finders
23
+ #
24
+ # Uncomment this to use friendly finders in all models. By default, if
25
+ # you wish to find a record by its friendly id, you must do:
26
+ #
27
+ # MyModel.friendly.find('foo')
28
+ #
29
+ # If you uncomment this, you can do:
30
+ #
31
+ # MyModel.find('foo')
32
+ #
33
+ # This is significantly more convenient but may not be appropriate for
34
+ # all applications, so you must explicity opt-in to this behavior. You can
35
+ # always also configure it on a per-model basis if you prefer.
36
+ #
37
+ # Something else to consider is that using the :finders addon boosts
38
+ # performance because it will avoid Rails-internal code that makes runtime
39
+ # calls to `Module.extend`.
40
+ #
41
+ config.use :finders
42
+ #
43
+ # ## Slugs
44
+ #
45
+ # Most applications will use the :slugged module everywhere. If you wish
46
+ # to do so, uncomment the following line.
47
+ #
48
+ config.use :slugged
49
+ #
50
+ # By default, FriendlyId's :slugged addon expects the slug column to be named
51
+ # 'slug', but you can change it if you wish.
52
+ #
53
+ # config.slug_column = 'slug'
54
+ #
55
+ # When FriendlyId can not generate a unique ID from your base method, it appends
56
+ # a UUID, separated by a single dash. You can configure the character used as the
57
+ # separator. If you're upgrading from FriendlyId 4, you may wish to replace this
58
+ # with two dashes.
59
+ #
60
+ # config.sequence_separator = '-'
61
+ #
62
+ # Note that you must use the :slugged addon **prior** to the line which
63
+ # configures the sequence separator, or else FriendlyId will raise an undefined
64
+ # method error.
65
+ #
66
+ # ## Tips and Tricks
67
+ #
68
+ # ### Controlling when slugs are generated
69
+ #
70
+ # As of FriendlyId 5.0, new slugs are generated only when the slug field is
71
+ # nil, but if you're using a column as your base method can change this
72
+ # behavior by overriding the `should_generate_new_friendly_id?` method that
73
+ # FriendlyId adds to your model. The change below makes FriendlyId 5.0 behave
74
+ # more like 4.0.
75
+ #
76
+ config.use Module.new {
77
+ def should_generate_new_friendly_id?
78
+ slug.blank? || ref_changed? unless slug.present?
79
+ end
80
+ }
81
+ #
82
+ # FriendlyId uses Rails's `parameterize` method to generate slugs, but for
83
+ # languages that don't use the Roman alphabet, that's not usually sufficient.
84
+ # Here we use the Babosa library to transliterate Russian Cyrillic slugs to
85
+ # ASCII. If you use this, don't forget to add "babosa" to your Gemfile.
86
+ #
87
+ # config.use Module.new {
88
+ # def normalize_friendly_id(text)
89
+ # text.to_slug.normalize! :transliterations => [:russian, :latin]
90
+ # end
91
+ # }
92
+ end
@@ -0,0 +1,20 @@
1
+ ########################################################
2
+ ########################################################
3
+ ## _____ __ _ _ _ ##
4
+ ## |_ _| / _| | | | (_) ##
5
+ ## | | _ __ | |_| | ___ ___| |_ _ ___ _ __ ___ ##
6
+ ## | || '_ \| _| |/ _ \/ __| __| |/ _ \| '_ \/ __| ##
7
+ ## _| || | | | | | | __/ (__| |_| | (_) | | | \__ \ ##
8
+ ## \___/_| |_|_| |_|\___|\___|\__|_|\___/|_| |_|___/ ##
9
+ ## ##
10
+ ########################################################
11
+ ########################################################
12
+
13
+ # => Module called "FL"
14
+ # => https://stackoverflow.com/a/28990943/1143732
15
+ ActiveSupport::Inflector.inflections(:en) do |inflect|
16
+ inflect.acronym 'FL'
17
+ end
18
+
19
+ ########################################################
20
+ ########################################################