pageflow-sitemap 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +25 -0
- data/.jshintrc +18 -0
- data/Gemfile +24 -0
- data/LICENSE.md +20 -0
- data/README.md +47 -0
- data/Rakefile +32 -0
- data/app/assets/images/pageflow/sitemap/.keep +0 -0
- data/app/assets/javascripts/pageflow/sitemap/.keep +0 -0
- data/app/assets/javascripts/pageflow/sitemap/editor/controllers/abstract_controller.js +68 -0
- data/app/assets/javascripts/pageflow/sitemap/editor/controllers/editor_mode_controller.js +301 -0
- data/app/assets/javascripts/pageflow/sitemap/editor/controllers/fragment_parser.js +31 -0
- data/app/assets/javascripts/pageflow/sitemap/editor/controllers/selection_mode_controller.js +37 -0
- data/app/assets/javascripts/pageflow/sitemap/editor/controllers/selection_navigator.js +43 -0
- data/app/assets/javascripts/pageflow/sitemap/editor/d3/behaviors/mouse_wheel.js +43 -0
- data/app/assets/javascripts/pageflow/sitemap/editor/d3/behaviors/multi_drag.js +73 -0
- data/app/assets/javascripts/pageflow/sitemap/editor/d3/behaviors/scroll_and_zoom.js +286 -0
- data/app/assets/javascripts/pageflow/sitemap/editor/d3/behaviors/selection_rect.js +104 -0
- data/app/assets/javascripts/pageflow/sitemap/editor/d3/behaviors/tooltip_target.js +24 -0
- data/app/assets/javascripts/pageflow/sitemap/editor/d3/graph_view.js +277 -0
- data/app/assets/javascripts/pageflow/sitemap/editor/d3/layout/chapter_collision.js +33 -0
- data/app/assets/javascripts/pageflow/sitemap/editor/d3/layout/collision.js +116 -0
- data/app/assets/javascripts/pageflow/sitemap/editor/d3/layout/dragging_decorator.js +58 -0
- data/app/assets/javascripts/pageflow/sitemap/editor/d3/layout/grid.js +238 -0
- data/app/assets/javascripts/pageflow/sitemap/editor/d3/layout/link_dragging_decorator.js +42 -0
- data/app/assets/javascripts/pageflow/sitemap/editor/d3/layout.js +94 -0
- data/app/assets/javascripts/pageflow/sitemap/editor/d3/options.js +25 -0
- data/app/assets/javascripts/pageflow/sitemap/editor/d3/paths/follow_path.js +36 -0
- data/app/assets/javascripts/pageflow/sitemap/editor/d3/paths/linkpath.js +64 -0
- data/app/assets/javascripts/pageflow/sitemap/editor/d3/paths/successor_path.js +49 -0
- data/app/assets/javascripts/pageflow/sitemap/editor/d3/utils.js +33 -0
- data/app/assets/javascripts/pageflow/sitemap/editor/d3/view_model.js +202 -0
- data/app/assets/javascripts/pageflow/sitemap/editor/d3/views/add_button_view.js +28 -0
- data/app/assets/javascripts/pageflow/sitemap/editor/d3/views/chapter_placeholders_view.js +22 -0
- data/app/assets/javascripts/pageflow/sitemap/editor/d3/views/chapters_view.js +89 -0
- data/app/assets/javascripts/pageflow/sitemap/editor/d3/views/group_view.js +104 -0
- data/app/assets/javascripts/pageflow/sitemap/editor/d3/views/page_links_view.js +7 -0
- data/app/assets/javascripts/pageflow/sitemap/editor/d3/views/pages_view.js +112 -0
- data/app/assets/javascripts/pageflow/sitemap/editor/d3/views/selectable_links_view.js +104 -0
- data/app/assets/javascripts/pageflow/sitemap/editor/d3/views/storylines_view.js +86 -0
- data/app/assets/javascripts/pageflow/sitemap/editor/d3/views/successor_links_view.js +7 -0
- data/app/assets/javascripts/pageflow/sitemap/editor/d3/views/text_label_view.js +45 -0
- data/app/assets/javascripts/pageflow/sitemap/editor/d3.js +20 -0
- data/app/assets/javascripts/pageflow/sitemap/editor/feature.js +126 -0
- data/app/assets/javascripts/pageflow/sitemap/editor/models/selection.js +41 -0
- data/app/assets/javascripts/pageflow/sitemap/editor/templates/scroll_bar.jst.ejs +2 -0
- data/app/assets/javascripts/pageflow/sitemap/editor/templates/sitemap.jst.ejs +85 -0
- data/app/assets/javascripts/pageflow/sitemap/editor/views/scroll_bar_view.js +130 -0
- data/app/assets/javascripts/pageflow/sitemap/editor/views/scroll_pane_view.js +73 -0
- data/app/assets/javascripts/pageflow/sitemap/editor/views/sitemap_view.js +137 -0
- data/app/assets/javascripts/pageflow/sitemap/editor.js +14 -0
- data/app/assets/javascripts/pageflow/sitemap/feature.js +3 -0
- data/app/assets/javascripts/pageflow/sitemap/scroll_navigator.js +112 -0
- data/app/assets/javascripts/pageflow/sitemap.js +5 -0
- data/app/assets/stylesheets/pageflow/sitemap/.keep +0 -0
- data/app/assets/stylesheets/pageflow/sitemap/editor/add_button.scss +29 -0
- data/app/assets/stylesheets/pageflow/sitemap/editor/chapter_placeholders.scss +14 -0
- data/app/assets/stylesheets/pageflow/sitemap/editor/chapters.scss +62 -0
- data/app/assets/stylesheets/pageflow/sitemap/editor/page_links.scss +19 -0
- data/app/assets/stylesheets/pageflow/sitemap/editor/pages.scss +78 -0
- data/app/assets/stylesheets/pageflow/sitemap/editor/scroll_bar.css.scss +33 -0
- data/app/assets/stylesheets/pageflow/sitemap/editor/scroll_pane.scss +15 -0
- data/app/assets/stylesheets/pageflow/sitemap/editor/selectable_links.scss +88 -0
- data/app/assets/stylesheets/pageflow/sitemap/editor/selection_rect.scss +12 -0
- data/app/assets/stylesheets/pageflow/sitemap/editor/storylines.scss +59 -0
- data/app/assets/stylesheets/pageflow/sitemap/editor/successor_links.scss +42 -0
- data/app/assets/stylesheets/pageflow/sitemap/editor/text_label.scss +23 -0
- data/app/assets/stylesheets/pageflow/sitemap/editor/toolbar.css.scss +45 -0
- data/app/assets/stylesheets/pageflow/sitemap/editor.css.scss +96 -0
- data/config/locales/de.yml +16 -0
- data/config/locales/en.yml +48 -0
- data/config/locales/new/help_button.de.yml +7 -0
- data/config/locales/new/help_button.en.yml +7 -0
- data/config/locales/new/tooltips.de.yml +11 -0
- data/config/locales/new/tooltips.en.yml +11 -0
- data/config/routes.rb +7 -0
- data/config/spring.rb +1 -0
- data/exec/rails +12 -0
- data/exec/spring +18 -0
- data/exec/teaspoon +17 -0
- data/lib/pageflow/sitemap/engine.rb +10 -0
- data/lib/pageflow/sitemap/plugin.rb +11 -0
- data/lib/pageflow/sitemap/version.rb +5 -0
- data/lib/pageflow-sitemap.rb +9 -0
- data/pageflow-sitemap.gemspec +29 -0
- data/spec/d/r/.gitignore +16 -0
- data/spec/d/r/README.rdoc +28 -0
- data/spec/d/r/Rakefile +6 -0
- data/spec/d/r/app/admin/dashboard.rb +33 -0
- data/spec/d/r/app/assets/images/.keep +0 -0
- data/spec/d/r/app/assets/javascripts/active_admin.js.coffee +2 -0
- data/spec/d/r/app/assets/javascripts/application.js +16 -0
- data/spec/d/r/app/assets/javascripts/pageflow/application.js +1 -0
- data/spec/d/r/app/assets/javascripts/pageflow/editor.js +4 -0
- data/spec/d/r/app/assets/stylesheets/active_admin.css.scss +18 -0
- data/spec/d/r/app/assets/stylesheets/application.css +13 -0
- data/spec/d/r/app/assets/stylesheets/pageflow/application.css.scss +1 -0
- data/spec/d/r/app/assets/stylesheets/pageflow/editor.css.scss +1 -0
- data/spec/d/r/app/controllers/application_controller.rb +5 -0
- data/spec/d/r/app/controllers/concerns/.keep +0 -0
- data/spec/d/r/app/helpers/application_helper.rb +2 -0
- data/spec/d/r/app/mailers/.keep +0 -0
- data/spec/d/r/app/models/.keep +0 -0
- data/spec/d/r/app/models/ability.rb +12 -0
- data/spec/d/r/app/models/concerns/.keep +0 -0
- data/spec/d/r/app/models/user.rb +9 -0
- data/spec/d/r/app/views/layouts/application.html.erb +14 -0
- data/spec/d/r/bin/bundle +3 -0
- data/spec/d/r/bin/rails +4 -0
- data/spec/d/r/bin/rake +4 -0
- data/spec/d/r/config/application.rb +31 -0
- data/spec/d/r/config/boot.rb +4 -0
- data/spec/d/r/config/database.yml +39 -0
- data/spec/d/r/config/environment.rb +5 -0
- data/spec/d/r/config/environments/development.rb +29 -0
- data/spec/d/r/config/environments/production.rb +80 -0
- data/spec/d/r/config/environments/test.rb +37 -0
- data/spec/d/r/config/initializers/active_admin.rb +225 -0
- data/spec/d/r/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/d/r/config/initializers/devise.rb +252 -0
- data/spec/d/r/config/initializers/devise_async.rb +6 -0
- data/spec/d/r/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/d/r/config/initializers/friendly_id.rb +88 -0
- data/spec/d/r/config/initializers/inflections.rb +16 -0
- data/spec/d/r/config/initializers/mime_types.rb +5 -0
- data/spec/d/r/config/initializers/pageflow.rb +76 -0
- data/spec/d/r/config/initializers/resque.rb +4 -0
- data/spec/d/r/config/initializers/resque_enqueue_after_commit_patch.rb +25 -0
- data/spec/d/r/config/initializers/resque_logger.rb +16 -0
- data/spec/d/r/config/initializers/resque_mailer.rb +4 -0
- data/spec/d/r/config/initializers/secret_token.rb +12 -0
- data/spec/d/r/config/initializers/session_store.rb +3 -0
- data/spec/d/r/config/initializers/wrap_parameters.rb +14 -0
- data/spec/d/r/config/locales/devise.en.yml +59 -0
- data/spec/d/r/config/locales/en.yml +23 -0
- data/spec/d/r/config/routes.rb +59 -0
- data/spec/d/r/config.ru +4 -0
- data/spec/d/r/db/migrate/00000000000000_create_test_hosted_file.rb +7 -0
- data/spec/d/r/db/migrate/00000000000001_create_test_revision_component.rb +10 -0
- data/spec/d/r/db/migrate/20150209101518_create_active_admin_comments.rb +19 -0
- data/spec/d/r/db/migrate/20150209101524_devise_create_users.rb +46 -0
- data/spec/d/r/db/migrate/20150209101530_create_friendly_id_slugs.rb +15 -0
- data/spec/d/r/db/migrate/20150209101540_setup_schema.pageflow.rb +208 -0
- data/spec/d/r/db/migrate/20150209101541_add_attributes_to_users.pageflow.rb +16 -0
- data/spec/d/r/db/migrate/20150209101542_create_themings.pageflow.rb +16 -0
- data/spec/d/r/db/migrate/20150209101543_create_themings_for_existing_accounts.pageflow.rb +27 -0
- data/spec/d/r/db/migrate/20150209101544_change_theme_references_to_theming_references.pageflow.rb +46 -0
- data/spec/d/r/db/migrate/20150209101545_remove_attributes_from_themes.pageflow.rb +11 -0
- data/spec/d/r/db/migrate/20150209101546_create_accounts_themes_join_table.pageflow.rb +9 -0
- data/spec/d/r/db/migrate/20150209101547_move_cname_from_account_to_theming.pageflow.rb +22 -0
- data/spec/d/r/db/migrate/20150209101548_drop_themes.pageflow.rb +15 -0
- data/spec/d/r/db/migrate/20150209101549_add_confirmed_by_to_encoded_files.pageflow.rb +7 -0
- data/spec/d/r/db/migrate/20150209101550_add_home_url_attributes_to_themings_and_revisions.pageflow.rb +10 -0
- data/spec/d/r/db/migrate/20150209101551_create_widgets.pageflow.rb +12 -0
- data/spec/d/r/db/migrate/20150209101552_add_emphasize_chapter_beginning_to_revisions.pageflow.rb +6 -0
- data/spec/d/r/db/migrate/20150209101553_add_emphasize_new_pages_to_revisions.pageflow.rb +6 -0
- data/spec/d/r/db/migrate/20150209101554_add_sharing_image_to_revisions.pageflow.rb +8 -0
- data/spec/d/r/db/schema.rb +316 -0
- data/spec/d/r/db/seeds.rb +30 -0
- data/spec/d/r/lib/assets/.keep +0 -0
- data/spec/d/r/lib/tasks/.keep +0 -0
- data/spec/d/r/lib/tasks/resque.rake +7 -0
- data/spec/d/r/public/404.html +58 -0
- data/spec/d/r/public/422.html +58 -0
- data/spec/d/r/public/500.html +57 -0
- data/spec/d/r/public/favicon.ico +0 -0
- data/spec/d/r/public/javascripts/translations.js +2 -0
- data/spec/d/r/public/robots.txt +5 -0
- data/spec/d/r/vendor/assets/javascripts/.keep +0 -0
- data/spec/d/r/vendor/assets/stylesheets/.keep +0 -0
- data/spec/javascripts/.jshintrc +26 -0
- data/spec/javascripts/pageflow/sitemap/editor/controllers/selection_navigator_spec.js +52 -0
- data/spec/javascripts/pageflow/sitemap/editor/d3/layout/collision_spec.js +99 -0
- data/spec/javascripts/pageflow/sitemap/editor/d3/layout/dragging_decorator_spec.js +114 -0
- data/spec/javascripts/pageflow/sitemap/editor/d3/layout/grid_spec.js +183 -0
- data/spec/javascripts/pageflow/sitemap/editor/d3/layout_spec.js +31 -0
- data/spec/javascripts/pageflow/sitemap/editor/d3/view_model_spec.js +56 -0
- data/spec/javascripts/pageflow/sitemap/editor/models/selection_spec.js +62 -0
- data/spec/javascripts/pageflow/sitemap/scroll_navigator_spec.js +5 -0
- data/spec/javascripts/spec_helper.js +13 -0
- data/spec/javascripts/support/factories.js +81 -0
- data/spec/teaspoon_env.rb +182 -0
- data/vendor/assets/javascripts/d3.v3.js +9215 -0
- metadata +379 -0
@@ -0,0 +1,252 @@
|
|
1
|
+
# Use this hook to configure devise mailer, warden hooks and so forth.
|
2
|
+
# Many of these configuration options can be set straight in your model.
|
3
|
+
Devise.setup do |config|
|
4
|
+
# ==> Mailer Configuration
|
5
|
+
# Configure the e-mail address which will be shown in Devise::Mailer,
|
6
|
+
# note that it will be overwritten if you use your own mailer class with default "from" parameter.
|
7
|
+
config.mailer_sender = "please-change-me-at-config-initializers-devise@example.com"
|
8
|
+
|
9
|
+
# Configure the class responsible to send e-mails.
|
10
|
+
# config.mailer = "Devise::Mailer"
|
11
|
+
|
12
|
+
# ==> ORM configuration
|
13
|
+
# Load and configure the ORM. Supports :active_record (default) and
|
14
|
+
# :mongoid (bson_ext recommended) by default. Other ORMs may be
|
15
|
+
# available as additional gems.
|
16
|
+
require 'devise/orm/active_record'
|
17
|
+
|
18
|
+
# ==> Configuration for any authentication mechanism
|
19
|
+
# Configure which keys are used when authenticating a user. The default is
|
20
|
+
# just :email. You can configure it to use [:username, :subdomain], so for
|
21
|
+
# authenticating a user, both parameters are required. Remember that those
|
22
|
+
# parameters are used only when authenticating and not when retrieving from
|
23
|
+
# session. If you need permissions, you should implement that in a before filter.
|
24
|
+
# You can also supply a hash where the value is a boolean determining whether
|
25
|
+
# or not authentication should be aborted when the value is not present.
|
26
|
+
# config.authentication_keys = [ :email ]
|
27
|
+
|
28
|
+
# Configure parameters from the request object used for authentication. Each entry
|
29
|
+
# given should be a request method and it will automatically be passed to the
|
30
|
+
# find_for_authentication method and considered in your model lookup. For instance,
|
31
|
+
# if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
|
32
|
+
# The same considerations mentioned for authentication_keys also apply to request_keys.
|
33
|
+
# config.request_keys = []
|
34
|
+
|
35
|
+
# Configure which authentication keys should be case-insensitive.
|
36
|
+
# These keys will be downcased upon creating or modifying a user and when used
|
37
|
+
# to authenticate or find a user. Default is :email.
|
38
|
+
config.case_insensitive_keys = [ :email ]
|
39
|
+
|
40
|
+
# Configure which authentication keys should have whitespace stripped.
|
41
|
+
# These keys will have whitespace before and after removed upon creating or
|
42
|
+
# modifying a user and when used to authenticate or find a user. Default is :email.
|
43
|
+
config.strip_whitespace_keys = [ :email ]
|
44
|
+
|
45
|
+
# Tell if authentication through request.params is enabled. True by default.
|
46
|
+
# It can be set to an array that will enable params authentication only for the
|
47
|
+
# given strategies, for example, `config.params_authenticatable = [:database]` will
|
48
|
+
# enable it only for database (email + password) authentication.
|
49
|
+
# config.params_authenticatable = true
|
50
|
+
|
51
|
+
# Tell if authentication through HTTP Auth is enabled. False by default.
|
52
|
+
# It can be set to an array that will enable http authentication only for the
|
53
|
+
# given strategies, for example, `config.http_authenticatable = [:token]` will
|
54
|
+
# enable it only for token authentication. The supported strategies are:
|
55
|
+
# :database = Support basic authentication with authentication key + password
|
56
|
+
# :token = Support basic authentication with token authentication key
|
57
|
+
# :token_options = Support token authentication with options as defined in
|
58
|
+
# http://api.rubyonrails.org/classes/ActionController/HttpAuthentication/Token.html
|
59
|
+
# config.http_authenticatable = false
|
60
|
+
|
61
|
+
# If http headers should be returned for AJAX requests. True by default.
|
62
|
+
# config.http_authenticatable_on_xhr = true
|
63
|
+
|
64
|
+
# The realm used in Http Basic Authentication. "Application" by default.
|
65
|
+
# config.http_authentication_realm = "Application"
|
66
|
+
|
67
|
+
# It will change confirmation, password recovery and other workflows
|
68
|
+
# to behave the same regardless if the e-mail provided was right or wrong.
|
69
|
+
# Does not affect registerable.
|
70
|
+
# config.paranoid = true
|
71
|
+
|
72
|
+
# By default Devise will store the user in session. You can skip storage for
|
73
|
+
# :http_auth and :token_auth by adding those symbols to the array below.
|
74
|
+
# Notice that if you are skipping storage for all authentication paths, you
|
75
|
+
# may want to disable generating routes to Devise's sessions controller by
|
76
|
+
# passing :skip => :sessions to `devise_for` in your config/routes.rb
|
77
|
+
config.skip_session_storage = [:http_auth]
|
78
|
+
|
79
|
+
# By default, Devise cleans up the CSRF token on authentication to
|
80
|
+
# avoid CSRF token fixation attacks. This means that, when using AJAX
|
81
|
+
# requests for sign in and sign up, you need to get a new CSRF token
|
82
|
+
# from the server. You can disable this option at your own risk.
|
83
|
+
# config.clean_up_csrf_token_on_authentication = true
|
84
|
+
|
85
|
+
# ==> Configuration for :database_authenticatable
|
86
|
+
# For bcrypt, this is the cost for hashing the password and defaults to 10. If
|
87
|
+
# using other encryptors, it sets how many times you want the password re-encrypted.
|
88
|
+
#
|
89
|
+
# Limiting the stretches to just one in testing will increase the performance of
|
90
|
+
# your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
|
91
|
+
# a value less than 10 in other environments.
|
92
|
+
config.stretches = Rails.env.test? ? 1 : 10
|
93
|
+
|
94
|
+
# Setup a pepper to generate the encrypted password.
|
95
|
+
# config.pepper = "c7282799f3d21de7402a062e9d51996ec7ff599687f8e2df2b5288fd37260a67e162c765d3c3486cafde55d0c84ca07b64252a325910394a2cea89f9fd0eb0e8"
|
96
|
+
|
97
|
+
# ==> Configuration for :confirmable
|
98
|
+
# A period that the user is allowed to access the website even without
|
99
|
+
# confirming his account. For instance, if set to 2.days, the user will be
|
100
|
+
# able to access the website for two days without confirming his account,
|
101
|
+
# access will be blocked just in the third day. Default is 0.days, meaning
|
102
|
+
# the user cannot access the website without confirming his account.
|
103
|
+
# config.allow_unconfirmed_access_for = 2.days
|
104
|
+
|
105
|
+
# A period that the user is allowed to confirm their account before their
|
106
|
+
# token becomes invalid. For example, if set to 3.days, the user can confirm
|
107
|
+
# their account within 3 days after the mail was sent, but on the fourth day
|
108
|
+
# their account can't be confirmed with the token any more.
|
109
|
+
# Default is nil, meaning there is no restriction on how long a user can take
|
110
|
+
# before confirming their account.
|
111
|
+
# config.confirm_within = 3.days
|
112
|
+
|
113
|
+
# If true, requires any email changes to be confirmed (exactly the same way as
|
114
|
+
# initial account confirmation) to be applied. Requires additional unconfirmed_email
|
115
|
+
# db field (see migrations). Until confirmed new email is stored in
|
116
|
+
# unconfirmed email column, and copied to email column on successful confirmation.
|
117
|
+
config.reconfirmable = true
|
118
|
+
|
119
|
+
# Defines which key will be used when confirming an account
|
120
|
+
# config.confirmation_keys = [ :email ]
|
121
|
+
|
122
|
+
# ==> Configuration for :rememberable
|
123
|
+
# The time the user will be remembered without asking for credentials again.
|
124
|
+
# config.remember_for = 2.weeks
|
125
|
+
|
126
|
+
# If true, extends the user's remember period when remembered via cookie.
|
127
|
+
# config.extend_remember_period = false
|
128
|
+
|
129
|
+
# Options to be passed to the created cookie. For instance, you can set
|
130
|
+
# :secure => true in order to force SSL only cookies.
|
131
|
+
# config.rememberable_options = {}
|
132
|
+
|
133
|
+
# ==> Configuration for :validatable
|
134
|
+
# Range for password length. Default is 8..128.
|
135
|
+
config.password_length = 8..128
|
136
|
+
|
137
|
+
# Email regex used to validate email formats. It simply asserts that
|
138
|
+
# one (and only one) @ exists in the given string. This is mainly
|
139
|
+
# to give user feedback and not to assert the e-mail validity.
|
140
|
+
# config.email_regexp = /\A[^@]+@[^@]+\z/
|
141
|
+
|
142
|
+
# ==> Configuration for :timeoutable
|
143
|
+
# The time you want to timeout the user session without activity. After this
|
144
|
+
# time the user will be asked for credentials again. Default is 30 minutes.
|
145
|
+
# config.timeout_in = 30.minutes
|
146
|
+
|
147
|
+
# If true, expires auth token on session timeout.
|
148
|
+
# config.expire_auth_token_on_timeout = false
|
149
|
+
|
150
|
+
# ==> Configuration for :lockable
|
151
|
+
# Defines which strategy will be used to lock an account.
|
152
|
+
# :failed_attempts = Locks an account after a number of failed attempts to sign in.
|
153
|
+
# :none = No lock strategy. You should handle locking by yourself.
|
154
|
+
# config.lock_strategy = :failed_attempts
|
155
|
+
|
156
|
+
# Defines which key will be used when locking and unlocking an account
|
157
|
+
# config.unlock_keys = [ :email ]
|
158
|
+
|
159
|
+
# Defines which strategy will be used to unlock an account.
|
160
|
+
# :email = Sends an unlock link to the user email
|
161
|
+
# :time = Re-enables login after a certain amount of time (see :unlock_in below)
|
162
|
+
# :both = Enables both strategies
|
163
|
+
# :none = No unlock strategy. You should handle unlocking by yourself.
|
164
|
+
# config.unlock_strategy = :both
|
165
|
+
|
166
|
+
# Number of authentication tries before locking an account if lock_strategy
|
167
|
+
# is failed attempts.
|
168
|
+
# config.maximum_attempts = 20
|
169
|
+
|
170
|
+
# Time interval to unlock the account if :time is enabled as unlock_strategy.
|
171
|
+
# config.unlock_in = 1.hour
|
172
|
+
|
173
|
+
# ==> Configuration for :recoverable
|
174
|
+
#
|
175
|
+
# Defines which key will be used when recovering the password for an account
|
176
|
+
# config.reset_password_keys = [ :email ]
|
177
|
+
|
178
|
+
# Time interval you can reset your password with a reset password key.
|
179
|
+
# Don't put a too small interval or your users won't have the time to
|
180
|
+
# change their passwords.
|
181
|
+
config.reset_password_within = 6.hours
|
182
|
+
|
183
|
+
# ==> Configuration for :encryptable
|
184
|
+
# Allow you to use another encryption algorithm besides bcrypt (default). You can use
|
185
|
+
# :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1,
|
186
|
+
# :authlogic_sha512 (then you should set stretches above to 20 for default behavior)
|
187
|
+
# and :restful_authentication_sha1 (then you should set stretches to 10, and copy
|
188
|
+
# REST_AUTH_SITE_KEY to pepper).
|
189
|
+
#
|
190
|
+
# Require the `devise-encryptable` gem when using anything other than bcrypt
|
191
|
+
# config.encryptor = :sha512
|
192
|
+
|
193
|
+
# ==> Configuration for :token_authenticatable
|
194
|
+
# Defines name of the authentication token params key
|
195
|
+
# config.token_authentication_key = :auth_token
|
196
|
+
|
197
|
+
# ==> Scopes configuration
|
198
|
+
# Turn scoped views on. Before rendering "sessions/new", it will first check for
|
199
|
+
# "users/sessions/new". It's turned off by default because it's slower if you
|
200
|
+
# are using only default views.
|
201
|
+
# config.scoped_views = false
|
202
|
+
|
203
|
+
# Configure the default scope given to Warden. By default it's the first
|
204
|
+
# devise role declared in your routes (usually :user).
|
205
|
+
# config.default_scope = :user
|
206
|
+
|
207
|
+
# Set this configuration to false if you want /users/sign_out to sign out
|
208
|
+
# only the current scope. By default, Devise signs out all scopes.
|
209
|
+
# config.sign_out_all_scopes = true
|
210
|
+
|
211
|
+
# ==> Navigation configuration
|
212
|
+
# Lists the formats that should be treated as navigational. Formats like
|
213
|
+
# :html, should redirect to the sign in page when the user does not have
|
214
|
+
# access, but formats like :xml or :json, should return 401.
|
215
|
+
#
|
216
|
+
# If you have any extra navigational formats, like :iphone or :mobile, you
|
217
|
+
# should add them to the navigational formats lists.
|
218
|
+
#
|
219
|
+
# The "*/*" below is required to match Internet Explorer requests.
|
220
|
+
# config.navigational_formats = ["*/*", :html]
|
221
|
+
|
222
|
+
# The default HTTP method used to sign out a resource. Default is :delete.
|
223
|
+
config.sign_out_via = :delete
|
224
|
+
|
225
|
+
# ==> OmniAuth
|
226
|
+
# Add a new OmniAuth provider. Check the wiki for more information on setting
|
227
|
+
# up on your models and hooks.
|
228
|
+
# config.omniauth :github, 'APP_ID', 'APP_SECRET', :scope => 'user,public_repo'
|
229
|
+
|
230
|
+
# ==> Warden configuration
|
231
|
+
# If you want to use other strategies, that are not supported by Devise, or
|
232
|
+
# change the failure app, you can configure them inside the config.warden block.
|
233
|
+
#
|
234
|
+
# config.warden do |manager|
|
235
|
+
# manager.intercept_401 = false
|
236
|
+
# manager.default_strategies(:scope => :user).unshift :some_external_strategy
|
237
|
+
# end
|
238
|
+
|
239
|
+
# ==> Mountable engine configurations
|
240
|
+
# When using Devise inside an engine, let's call it `MyEngine`, and this engine
|
241
|
+
# is mountable, there are some extra configurations to be taken into account.
|
242
|
+
# The following options are available, assuming the engine is mounted as:
|
243
|
+
#
|
244
|
+
# mount MyEngine, at: "/my_engine"
|
245
|
+
#
|
246
|
+
# The router that invoked `devise_for`, in the example above, would be:
|
247
|
+
# config.router_name = :my_engine
|
248
|
+
#
|
249
|
+
# When using omniauth, Devise cannot automatically set Omniauth path,
|
250
|
+
# so you need to do it manually. For the users scope, it would be:
|
251
|
+
# config.omniauth_path_prefix = "/my_engine/users/auth"
|
252
|
+
end
|
@@ -0,0 +1,88 @@
|
|
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 index session login logout users admin
|
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
|
+
# ## Tips and Tricks
|
63
|
+
#
|
64
|
+
# ### Controlling when slugs are generated
|
65
|
+
#
|
66
|
+
# As of FriendlyId 5.0, new slugs are generated only when the slug field is
|
67
|
+
# nil, but if you're using a column as your base method can change this
|
68
|
+
# behavior by overriding the `should_generate_new_friendly_id` method that
|
69
|
+
# FriendlyId adds to your model. The change below makes FriendlyId 5.0 behave
|
70
|
+
# more like 4.0.
|
71
|
+
#
|
72
|
+
# config.use Module.new {
|
73
|
+
# def should_generate_new_friendly_id?
|
74
|
+
# slug.blank? || <your_column_name_here>_changed?
|
75
|
+
# end
|
76
|
+
# }
|
77
|
+
#
|
78
|
+
# FriendlyId uses Rails's `parameterize` method to generate slugs, but for
|
79
|
+
# languages that don't use the Roman alphabet, that's not usually suffient. Here
|
80
|
+
# we use the Babosa library to transliterate Russian Cyrillic slugs to ASCII. If
|
81
|
+
# you use this, don't forget to add "babosa" to your Gemfile.
|
82
|
+
#
|
83
|
+
# config.use Module.new {
|
84
|
+
# def normalize_friendly_id(text)
|
85
|
+
# text.to_slug.normalize! :transliterations => [:russian, :latin]
|
86
|
+
# end
|
87
|
+
# }
|
88
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Add new inflection rules using the following format. Inflections
|
4
|
+
# are locale specific, and you may define rules for as many different
|
5
|
+
# locales as you wish. All of these examples are active by default:
|
6
|
+
# ActiveSupport::Inflector.inflections(:en) do |inflect|
|
7
|
+
# inflect.plural /^(ox)$/i, '\1en'
|
8
|
+
# inflect.singular /^(ox)en/i, '\1'
|
9
|
+
# inflect.irregular 'person', 'people'
|
10
|
+
# inflect.uncountable %w( fish sheep )
|
11
|
+
# end
|
12
|
+
|
13
|
+
# These inflection rules are supported but not enabled by default:
|
14
|
+
# ActiveSupport::Inflector.inflections(:en) do |inflect|
|
15
|
+
# inflect.acronym 'RESTful'
|
16
|
+
# end
|
@@ -0,0 +1,76 @@
|
|
1
|
+
ActiveAdmin.application.load_paths.unshift(Dir[Rails.root.join('app/admin')])
|
2
|
+
# Register admins for pageflow models with active admin.
|
3
|
+
ActiveAdmin.application.load_paths.unshift(Dir[Pageflow::Engine.root.join('admins')])
|
4
|
+
|
5
|
+
Pageflow.configure do |config|
|
6
|
+
# The email address to use as from header in invitation mails to new
|
7
|
+
# users.
|
8
|
+
config.mailer_sender = 'change-me-at-config-initializers-pageflow@example.com'
|
9
|
+
|
10
|
+
# Page types available in the editor. Add futher page types from
|
11
|
+
# page type engines below.
|
12
|
+
config.register_page_type(Pageflow::BuiltInPageType.background_image)
|
13
|
+
config.register_page_type(Pageflow::BuiltInPageType.background_video)
|
14
|
+
config.register_page_type(Pageflow::BuiltInPageType.video)
|
15
|
+
config.register_page_type(Pageflow::BuiltInPageType.audio)
|
16
|
+
config.register_page_type(Pageflow::BuiltInPageType.audio_loop)
|
17
|
+
# config.register_page_type(Pageflow::Rainbow::PageType.new)
|
18
|
+
|
19
|
+
# Add custom themes by invoking the pageflow:theme generator and
|
20
|
+
# registering the theme here.
|
21
|
+
#
|
22
|
+
# $ rails generate pageflow:theme my_custom_theme
|
23
|
+
# => creates app/assets/stylesheets/pageflow/themes/my_custom_theme.css.scss
|
24
|
+
#
|
25
|
+
config.themes.register(:default)
|
26
|
+
# config.themes.register(:my_custom_theme)
|
27
|
+
|
28
|
+
# String to interpolate into paths of files generated by paperclip
|
29
|
+
# preprocessors. This allows to refresh cdn caches after
|
30
|
+
# reprocessing attachments.
|
31
|
+
config.paperclip_attachments_version = 'v1'
|
32
|
+
|
33
|
+
# Path to the location in the filesystem where attachments shall
|
34
|
+
# be stored. The value of this option is available via the
|
35
|
+
# pageflow_filesystem_root paperclip interpolation.
|
36
|
+
config.paperclip_filesystem_root = 'tmp/attachments/production'
|
37
|
+
|
38
|
+
# Rewrite the below section to use your favorite configuration
|
39
|
+
# method: ENV variables, secrets.yml, custom yml files. If you use
|
40
|
+
# environment variables consider the dotenv gem to configure your
|
41
|
+
# application via a single .env file.
|
42
|
+
#
|
43
|
+
# Whatever you choose, do NOT hard code values below. That makes it
|
44
|
+
# hard to switch environments and risks leaking secrects.
|
45
|
+
|
46
|
+
# Default options for paperclip attachments which are supposed to
|
47
|
+
# use s3 storage. All options allowed in paperclip has_attached_file
|
48
|
+
# calls are allowed.
|
49
|
+
config.paperclip_s3_default_options.merge!(
|
50
|
+
:s3_credentials => {
|
51
|
+
:bucket => 'com-example-pageflow-development',
|
52
|
+
:access_key_id => 'xxx',
|
53
|
+
:secret_access_key => 'xxx',
|
54
|
+
:s3_host_name => 's3-eu-west-1.amazonaws.com'
|
55
|
+
},
|
56
|
+
:s3_host_alias => 'com-example-pageflow.s3-website-eu-west-1.amazonaws.com',
|
57
|
+
:s3_protocol => 'http'
|
58
|
+
)
|
59
|
+
|
60
|
+
# Default options for paperclip attachments which are supposed to
|
61
|
+
# use filesystem storage. All options allowed in paperclip has_attached_file
|
62
|
+
# calls are allowed.
|
63
|
+
config.zencoder_options.merge!(
|
64
|
+
:api_key => 'xxx',
|
65
|
+
:output_bucket => 'com-example-pageflow-out',
|
66
|
+
:s3_host_alias => 'com-example-pageflow-out.s3-website-eu-west-1.amazonaws.com',
|
67
|
+
:s3_protocol => 'http',
|
68
|
+
:attachments_version => 'v1'
|
69
|
+
)
|
70
|
+
end
|
71
|
+
|
72
|
+
# Comment out this call if you wish to run rails generators or rake
|
73
|
+
# tasks while the Pageflow configuration is in an invalid
|
74
|
+
# state. Otherwise Pageflow configuration errors might prevent you
|
75
|
+
# from initializing the environment. Required for Pageflow to run.
|
76
|
+
Pageflow.finalize!
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# Make sure no jobs are enqueued from a rolled back
|
2
|
+
# transaction. Pageflow mainly triggers jobs in conjunction with state
|
3
|
+
# machine transitions. So this patch ensures state db state and
|
4
|
+
# enqueued jobs stay in sync.
|
5
|
+
#
|
6
|
+
# Note the after_transaction yields immediately if there is no open
|
7
|
+
# transcation.
|
8
|
+
|
9
|
+
require 'ar_after_transaction'
|
10
|
+
require 'resque'
|
11
|
+
|
12
|
+
Resque.class_eval do
|
13
|
+
class << self
|
14
|
+
alias_method :enqueue_without_transaction, :enqueue
|
15
|
+
def enqueue(*args)
|
16
|
+
if Resque.inline?
|
17
|
+
enqueue_without_transaction(*args)
|
18
|
+
else
|
19
|
+
ActiveRecord::Base.after_transaction do
|
20
|
+
enqueue_without_transaction(*args)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# resque-logger is required by the state_machine_job gem to write
|
2
|
+
# debug output to logs files. Each queue has its own log file in the
|
3
|
+
# directory specified below.
|
4
|
+
|
5
|
+
require 'fileutils'
|
6
|
+
|
7
|
+
log_dir = Rails.root.join('log', 'jobs', Rails.env)
|
8
|
+
FileUtils.mkdir_p(log_dir)
|
9
|
+
|
10
|
+
Resque.logger_config = {
|
11
|
+
folder: log_dir,
|
12
|
+
class_name: Logger,
|
13
|
+
class_args: [ 'daily', 1.kilobyte ],
|
14
|
+
level: Logger::INFO,
|
15
|
+
formatter: Logger::Formatter.new
|
16
|
+
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Your secret key is used for verifying the integrity of signed cookies.
|
4
|
+
# If you change this key, all old signed cookies will become invalid!
|
5
|
+
|
6
|
+
# Make sure the secret is at least 30 characters and all random,
|
7
|
+
# no regular words or you'll be exposed to dictionary attacks.
|
8
|
+
# You can use `rake secret` to generate a secure secret key.
|
9
|
+
|
10
|
+
# Make sure your secret_key_base is kept private
|
11
|
+
# if you're sharing your code publicly.
|
12
|
+
Rails405::Application.config.secret_key_base = 'fb3393e13d5e4d33f79a1d1089f2548f8b8923b3b46a6a4ece286b1db6b875ca5778c00cfd30e801515bf3c60d76656738f58b759b407a7820d65d5b8f868934'
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# This file contains settings for ActionController::ParamsWrapper which
|
4
|
+
# is enabled by default.
|
5
|
+
|
6
|
+
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
|
7
|
+
ActiveSupport.on_load(:action_controller) do
|
8
|
+
wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
|
9
|
+
end
|
10
|
+
|
11
|
+
# To enable root element in JSON for ActiveRecord objects.
|
12
|
+
# ActiveSupport.on_load(:active_record) do
|
13
|
+
# self.include_root_in_json = true
|
14
|
+
# end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
# Additional translations at https://github.com/plataformatec/devise/wiki/I18n
|
2
|
+
|
3
|
+
en:
|
4
|
+
devise:
|
5
|
+
confirmations:
|
6
|
+
confirmed: "Your account was successfully confirmed. You are now signed in."
|
7
|
+
send_instructions: "You will receive an email with instructions about how to confirm your account in a few minutes."
|
8
|
+
send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions about how to confirm your account in a few minutes."
|
9
|
+
failure:
|
10
|
+
already_authenticated: "You are already signed in."
|
11
|
+
inactive: "Your account was not activated yet."
|
12
|
+
invalid: "Invalid email or password."
|
13
|
+
invalid_token: "Invalid authentication token."
|
14
|
+
locked: "Your account is locked."
|
15
|
+
not_found_in_database: "Invalid email 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 account 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
|
+
omniauth_callbacks:
|
27
|
+
failure: "Could not authenticate you from %{kind} because \"%{reason}\"."
|
28
|
+
success: "Successfully authenticated from %{kind} account."
|
29
|
+
passwords:
|
30
|
+
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."
|
31
|
+
send_instructions: "You will receive an email with instructions about how to reset your password in a few minutes."
|
32
|
+
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."
|
33
|
+
updated: "Your password was changed successfully. You are now signed in."
|
34
|
+
updated_not_active: "Your password was changed successfully."
|
35
|
+
registrations:
|
36
|
+
destroyed: "Bye! Your account was successfully cancelled. We hope to see you again soon."
|
37
|
+
signed_up: "Welcome! You have signed up successfully."
|
38
|
+
signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated."
|
39
|
+
signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked."
|
40
|
+
signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please open the link to activate your account."
|
41
|
+
update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and click on the confirm link to finalize confirming your new email address."
|
42
|
+
updated: "You updated your account successfully."
|
43
|
+
sessions:
|
44
|
+
signed_in: "Signed in successfully."
|
45
|
+
signed_out: "Signed out successfully."
|
46
|
+
unlocks:
|
47
|
+
send_instructions: "You will receive an email with instructions about how to unlock your account in a few minutes."
|
48
|
+
send_paranoid_instructions: "If your account exists, you will receive an email with instructions about how to unlock it in a few minutes."
|
49
|
+
unlocked: "Your account has been unlocked successfully. Please sign in to continue."
|
50
|
+
errors:
|
51
|
+
messages:
|
52
|
+
already_confirmed: "was already confirmed, please try signing in"
|
53
|
+
confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one"
|
54
|
+
expired: "has expired, please request a new one"
|
55
|
+
not_found: "not found"
|
56
|
+
not_locked: "was not locked"
|
57
|
+
not_saved:
|
58
|
+
one: "1 error prohibited this %{resource} from being saved:"
|
59
|
+
other: "%{count} errors prohibited this %{resource} from being saved:"
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# Files in the config/locales directory are used for internationalization
|
2
|
+
# and are automatically loaded by Rails. If you want to use locales other
|
3
|
+
# than English, add the necessary files in this directory.
|
4
|
+
#
|
5
|
+
# To use the locales, use `I18n.t`:
|
6
|
+
#
|
7
|
+
# I18n.t 'hello'
|
8
|
+
#
|
9
|
+
# In views, this is aliased to just `t`:
|
10
|
+
#
|
11
|
+
# <%= t('hello') %>
|
12
|
+
#
|
13
|
+
# To use a different locale, set it with `I18n.locale`:
|
14
|
+
#
|
15
|
+
# I18n.locale = :es
|
16
|
+
#
|
17
|
+
# This would use the information in config/locales/es.yml.
|
18
|
+
#
|
19
|
+
# To learn more, please read the Rails Internationalization guide
|
20
|
+
# available at http://guides.rubyonrails.org/i18n.html.
|
21
|
+
|
22
|
+
en:
|
23
|
+
hello: "Hello world"
|