cortex 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.babelrc +18 -0
- data/.codeclimate.yml +43 -0
- data/.csslintrc +2 -0
- data/.editorconfig +9 -0
- data/.eslintignore +1 -0
- data/.eslintrc.yml +277 -0
- data/.github/PULL_REQUEST_TEMPLATE.md +47 -0
- data/.gitignore +82 -0
- data/.npmignore +34 -0
- data/.postcssrc.yml +3 -0
- data/.rspec +3 -0
- data/.rubocop.yml +1156 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/CONTRIBUTING.md +58 -0
- data/Gemfile +101 -0
- data/Gemfile.lock +604 -0
- data/Guardfile +23 -0
- data/LICENSE.md +201 -0
- data/README.md +239 -0
- data/Rakefile +22 -0
- data/app/assets/config/cortex_manifest.js +4 -0
- data/app/assets/fonts/cortex/Montserrat-Light.otf +0 -0
- data/app/assets/fonts/cortex/Montserrat-Medium.otf +0 -0
- data/app/assets/fonts/cortex/Montserrat-Regular.otf +0 -0
- data/app/assets/fonts/cortex/Montserrat-SemiBold.otf +0 -0
- data/app/assets/images/cortex/favicon.ico +0 -0
- data/app/assets/images/cortex/icons/add.svg +59 -0
- data/app/assets/images/cortex/icons/blog.png +0 -0
- data/app/assets/images/cortex/icons/media.png +0 -0
- data/app/assets/images/cortex/logo.svg +43 -0
- data/app/assets/javascripts/cortex/application.js +17 -0
- data/app/assets/javascripts/cortex/authentication.js +6 -0
- data/app/assets/javascripts/cortex/base.js +6 -0
- data/app/assets/javascripts/cortex/datepicker_init.js +29 -0
- data/app/assets/javascripts/cortex/flash.js +7 -0
- data/app/assets/javascripts/cortex/form.js +6 -0
- data/app/assets/javascripts/cortex/media_dialogs.js +40 -0
- data/app/assets/javascripts/cortex/quick_links.js +13 -0
- data/app/assets/stylesheets/cortex/application.scss +34 -0
- data/app/assets/stylesheets/cortex/authentication.scss +34 -0
- data/app/assets/stylesheets/cortex/base.scss +4 -0
- data/app/assets/stylesheets/cortex/bootstrap-namespaced.scss +57 -0
- data/app/assets/stylesheets/cortex/components/card.scss +9 -0
- data/app/assets/stylesheets/cortex/components/dialog.scss +67 -0
- data/app/assets/stylesheets/cortex/components/flash.scss +60 -0
- data/app/assets/stylesheets/cortex/components/form.scss +45 -0
- data/app/assets/stylesheets/cortex/components/header.scss +53 -0
- data/app/assets/stylesheets/cortex/components/index.scss +28 -0
- data/app/assets/stylesheets/cortex/components/jumbo-button.scss +41 -0
- data/app/assets/stylesheets/cortex/components/loaders.scss +76 -0
- data/app/assets/stylesheets/cortex/components/notes.scss +26 -0
- data/app/assets/stylesheets/cortex/components/sidebar.scss +120 -0
- data/app/assets/stylesheets/cortex/components/table.scss +7 -0
- data/app/assets/stylesheets/cortex/components/tenant-switcher.scss +209 -0
- data/app/assets/stylesheets/cortex/components/ui.scss +119 -0
- data/app/assets/stylesheets/cortex/demo.scss +140 -0
- data/app/assets/stylesheets/cortex/directives/aspect-ratio.scss +9 -0
- data/app/assets/stylesheets/cortex/helpers.scss +1701 -0
- data/app/assets/stylesheets/cortex/layout.scss +21 -0
- data/app/assets/stylesheets/cortex/material-icons.scss +13 -0
- data/app/assets/stylesheets/cortex/variables/_colors.scss +46 -0
- data/app/assets/stylesheets/cortex/variables/_material-overrides.scss +1 -0
- data/app/assets/stylesheets/cortex/variables/_typography.scss +114 -0
- data/app/cells/cortex/application_cell.rb +8 -0
- data/app/cells/cortex/content_type/nav.haml +5 -0
- data/app/cells/cortex/content_type_cell.rb +10 -0
- data/app/cells/cortex/field_cell.rb +35 -0
- data/app/cells/cortex/index/content_item/column.haml +4 -0
- data/app/cells/cortex/index/content_item_cell.rb +37 -0
- data/app/cells/cortex/index/index.haml +5 -0
- data/app/cells/cortex/index/table_body.haml +11 -0
- data/app/cells/cortex/index/table_headers.haml +5 -0
- data/app/cells/cortex/index_cell.rb +53 -0
- data/app/cells/cortex/wizard/column/show.haml +10 -0
- data/app/cells/cortex/wizard/column_cell.rb +21 -0
- data/app/cells/cortex/wizard/field/show.haml +30 -0
- data/app/cells/cortex/wizard/field_cell.rb +29 -0
- data/app/cells/cortex/wizard/plugin/show.haml +1 -0
- data/app/cells/cortex/wizard/plugin_cell.rb +28 -0
- data/app/cells/cortex/wizard/show.haml +1 -0
- data/app/cells/cortex/wizard/step/show.haml +2 -0
- data/app/cells/cortex/wizard/step_cell.rb +17 -0
- data/app/cells/cortex/wizard_cell.rb +15 -0
- data/app/containers/cortex/transaction_container.rb +23 -0
- data/app/controllers/concerns/cortex/decoratable.rb +16 -0
- data/app/controllers/cortex/admin_controller.rb +7 -0
- data/app/controllers/cortex/application_controller.rb +19 -0
- data/app/controllers/cortex/authentication/passwords_controller.rb +3 -0
- data/app/controllers/cortex/authentication/sessions_controller.rb +3 -0
- data/app/controllers/cortex/content_items_controller.rb +75 -0
- data/app/controllers/cortex/content_types_controller.rb +19 -0
- data/app/controllers/cortex/dashboards_controller.rb +7 -0
- data/app/controllers/cortex/graphql_controller.rb +40 -0
- data/app/controllers/cortex/tenants_controller.rb +12 -0
- data/app/devise/cortex/authentication_failure.rb +12 -0
- data/app/graphql/cortex/cortex_schema.rb +8 -0
- data/app/graphql/cortex/interfaces/.keep +0 -0
- data/app/graphql/cortex/mutations/.keep +0 -0
- data/app/graphql/cortex/types/content_item_type.rb +31 -0
- data/app/graphql/cortex/types/content_type_type.rb +23 -0
- data/app/graphql/cortex/types/contract_type.rb +10 -0
- data/app/graphql/cortex/types/date_time_type.rb +8 -0
- data/app/graphql/cortex/types/field_item_type.rb +15 -0
- data/app/graphql/cortex/types/field_type.rb +18 -0
- data/app/graphql/cortex/types/mutation_type.rb +5 -0
- data/app/graphql/cortex/types/query_type.rb +45 -0
- data/app/graphql/cortex/types/tenant_type.rb +19 -0
- data/app/graphql/cortex/types/user_type.rb +20 -0
- data/app/helpers/cortex/application_helper.rb +75 -0
- data/app/helpers/cortex/cells/association_helper.rb +25 -0
- data/app/helpers/cortex/content_item_helper.rb +106 -0
- data/app/helpers/cortex/dashboard_helper.rb +19 -0
- data/app/helpers/cortex/popup_helper.rb +27 -0
- data/app/jobs/cortex/application_job.rb +4 -0
- data/app/mailers/cortex/application_mailer.rb +6 -0
- data/app/mailers/cortex/password_reset_mailer.rb +13 -0
- data/app/models/concerns/cortex/belongs_to_tenant.rb +13 -0
- data/app/models/concerns/cortex/has_firstname_lastname.rb +11 -0
- data/app/models/concerns/cortex/has_gravatar.rb +18 -0
- data/app/models/concerns/cortex/searchable.rb +11 -0
- data/app/models/concerns/cortex/searchable_content_item.rb +31 -0
- data/app/models/concerns/cortex/searchable_content_item_for_content_type.rb +52 -0
- data/app/models/concerns/cortex/searchable_content_type.rb +11 -0
- data/app/models/cortex/application_record.rb +17 -0
- data/app/models/cortex/content_item.rb +71 -0
- data/app/models/cortex/content_type.rb +27 -0
- data/app/models/cortex/contentable_decorator.rb +8 -0
- data/app/models/cortex/contract.rb +12 -0
- data/app/models/cortex/decorator.rb +13 -0
- data/app/models/cortex/field.rb +36 -0
- data/app/models/cortex/field_item.rb +54 -0
- data/app/models/cortex/field_type.rb +44 -0
- data/app/models/cortex/permission.rb +11 -0
- data/app/models/cortex/role.rb +12 -0
- data/app/models/cortex/tenant.rb +41 -0
- data/app/models/cortex/user.rb +77 -0
- data/app/operations/cortex/database_transact_operation.rb +17 -0
- data/app/operations/cortex/execute_content_item_state_change_operation.rb +16 -0
- data/app/operations/cortex/parse_content_item_field_items_operation.rb +18 -0
- data/app/operations/cortex/persist_content_item_operation.rb +12 -0
- data/app/policies/cortex/application_policy.rb +55 -0
- data/app/policies/cortex/content_item_policy.rb +49 -0
- data/app/policies/cortex/content_type_policy.rb +38 -0
- data/app/transactions/concerns/cortex/content_itemable.rb +15 -0
- data/app/transactions/concerns/cortex/field_item_transactor.rb +28 -0
- data/app/transactions/concerns/cortex/widget_parsable.rb +19 -0
- data/app/transactions/cortex/application_transaction.rb +5 -0
- data/app/transactions/cortex/create_content_item_transaction.rb +35 -0
- data/app/transactions/cortex/get_content_item_transaction.rb +4 -0
- data/app/transactions/cortex/get_content_items_for_content_type_transaction.rb +34 -0
- data/app/transactions/cortex/get_publish_state_transaction.rb +28 -0
- data/app/transactions/cortex/new_field_item_transaction.rb +16 -0
- data/app/transactions/cortex/update_content_item_transaction.rb +45 -0
- data/app/transactions/cortex/update_field_item_transaction.rb +23 -0
- data/app/types/cortex/application_types.rb +21 -0
- data/app/types/cortex/content_item_transaction_type.rb +10 -0
- data/app/types/cortex/core_types.rb +5 -0
- data/app/types/cortex/transaction_type.rb +5 -0
- data/app/views/cortex/authentication/passwords/new.html.haml +13 -0
- data/app/views/cortex/authentication/sessions/new.html.haml +20 -0
- data/app/views/cortex/authentication/shared/_links.html.haml +19 -0
- data/app/views/cortex/content_items/_form.html.haml +13 -0
- data/app/views/cortex/content_items/_grid.html.haml +1 -0
- data/app/views/cortex/content_items/edit.html.haml +2 -0
- data/app/views/cortex/content_items/index.html.haml +4 -0
- data/app/views/cortex/content_items/new.html.haml +2 -0
- data/app/views/cortex/content_types/index.html.haml +2 -0
- data/app/views/cortex/content_types/new.html.haml +0 -0
- data/app/views/cortex/dashboards/index.html.haml +6 -0
- data/app/views/cortex/graphql/ide.haml +1 -0
- data/app/views/cortex/partials/_breadcrumb.html.haml +2 -0
- data/app/views/cortex/partials/_cortex_redux_state.html.haml +1 -0
- data/app/views/cortex/partials/_flash.html.haml +25 -0
- data/app/views/cortex/partials/_media_dialogs.html.haml +13 -0
- data/app/views/cortex/partials/_navigation.html.haml +15 -0
- data/app/views/cortex/partials/_notes.html.haml +17 -0
- data/app/views/cortex/partials/_quick_links.html.haml +22 -0
- data/app/views/cortex/partials/_sidebar.html.haml +7 -0
- data/app/views/cortex/partials/_topbar.html.haml +5 -0
- data/app/views/cortex/partials/_user_control.html.haml +7 -0
- data/app/views/cortex/partials/authentication/_header.html.haml +4 -0
- data/app/views/cortex/partials/trackers/_google_analytics.html.haml +10 -0
- data/app/views/cortex/partials/trackers/_qualtrics.html.haml +10 -0
- data/app/views/cortex/password_reset_mailer/send_password_reset.html.erb +5 -0
- data/app/views/cortex/password_reset_mailer/send_password_reset.text.erb +5 -0
- data/app/views/layouts/cortex/application.html.haml +30 -0
- data/app/views/layouts/cortex/devise.html.haml +19 -0
- data/app/views/layouts/cortex/mailer.html.erb +13 -0
- data/app/views/layouts/cortex/mailer.text.erb +1 -0
- data/bin/rails +25 -0
- data/config/config.yml +22 -0
- data/config/initializers/devise.rb +35 -0
- data/config/initializers/elasticsearch.rb +3 -0
- data/config/initializers/filter_parameter_logging.rb +4 -0
- data/config/initializers/flipper.rb +16 -0
- data/config/initializers/graphiql.rb +51 -0
- data/config/initializers/inflections.rb +16 -0
- data/config/initializers/load_config.rb +16 -0
- data/config/initializers/mime_types.rb +5 -0
- data/config/initializers/plugins.rb +17 -0
- data/config/initializers/react_on_rails.rb +15 -0
- data/config/initializers/rolify.rb +9 -0
- data/config/initializers/tag_parsers.rb +5 -0
- data/config/locales/devise.en.yml +64 -0
- data/config/routes.rb +41 -0
- data/cortex.gemspec +84 -0
- data/db/migrate/0_enable_pgcrypto_extension.rb +5 -0
- data/db/migrate/10_create_fields.rb +15 -0
- data/db/migrate/11_create_content_items.rb +14 -0
- data/db/migrate/12_create_field_items.rb +12 -0
- data/db/migrate/13_create_field_types.rb +5 -0
- data/db/migrate/1_create_users.rb +14 -0
- data/db/migrate/2_create_tenants.rb +26 -0
- data/db/migrate/3_add_devise_to_users.rb +49 -0
- data/db/migrate/4_create_roles.rb +15 -0
- data/db/migrate/5_create_permissions.rb +16 -0
- data/db/migrate/6_create_flipper_tables.rb +20 -0
- data/db/migrate/7_create_contracts.rb +11 -0
- data/db/migrate/8_create_decorators.rb +21 -0
- data/db/migrate/9_create_content_types.rb +17 -0
- data/db/seeds.rb +40 -0
- data/db/seeds.yml +33 -0
- data/lib/assets/.keep +0 -0
- data/lib/breadcrumbs/title_builder.rb +12 -0
- data/lib/cortex.rb +4 -0
- data/lib/cortex/engine.rb +41 -0
- data/lib/cortex/version.rb +3 -0
- data/lib/helpers/utility_helper.rb +7 -0
- data/lib/tasks/cortex_tasks.rake +13 -0
- data/lib/tasks/elasticsearch_tasks.rake +1 -0
- data/node_package/.babelrc +26 -0
- data/node_package/src/components/side_bar/environment_flag.jsx +21 -0
- data/node_package/src/components/side_bar/tenant_list.jsx +65 -0
- data/node_package/src/components/wizard/column.jsx +29 -0
- data/node_package/src/components/wizard/field.jsx +22 -0
- data/node_package/src/components/wizard/step.jsx +20 -0
- data/node_package/src/constants/tenant_switcher.jsx +17 -0
- data/node_package/src/constants/type_constants.jsx +12 -0
- data/node_package/src/constants/wizard.jsx +9 -0
- data/node_package/src/containers/layout.jsx +33 -0
- data/node_package/src/containers/tenant_switcher_container.jsx +115 -0
- data/node_package/src/containers/wizard_container.jsx +28 -0
- data/node_package/src/elements/loaders.jsx +7 -0
- data/node_package/src/helpers/formatting.jsx +5 -0
- data/node_package/src/helpers/tenant_ancestry.jsx +14 -0
- data/node_package/src/helpers/tenant_lookup.jsx +23 -0
- data/node_package/src/index.jsx +21 -0
- data/node_package/src/reducers/index.jsx +13 -0
- data/node_package/src/reducers/rails_context_reducer.jsx +5 -0
- data/node_package/src/reducers/tenant_switcher_reducer.jsx +74 -0
- data/node_package/src/reducers/wizard_reducer.jsx +32 -0
- data/node_package/src/services/rails_api_service.jsx +13 -0
- data/node_package/src/store/store.jsx +15 -0
- data/package.json +66 -0
- data/spec/dummy/Rakefile +7 -0
- data/spec/dummy/app/assets/config/manifest.js +4 -0
- data/spec/dummy/app/assets/javascripts/application.js +2 -0
- data/spec/dummy/app/assets/stylesheets/application.scss +2 -0
- data/spec/dummy/app/controllers/application_controller.rb +3 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/javascript/packs/application.js +8 -0
- data/spec/dummy/app/javascript/packs/cortex.jsx +1 -0
- data/spec/dummy/app/jobs/application_job.rb +2 -0
- data/spec/dummy/app/mailers/application_mailer.rb +4 -0
- data/spec/dummy/app/views/layouts/application.html.haml +11 -0
- data/spec/dummy/app/views/layouts/mailer.html.erb +13 -0
- data/spec/dummy/app/views/layouts/mailer.text.erb +1 -0
- data/spec/dummy/bin/bundle +105 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/bin/rspec +17 -0
- data/spec/dummy/bin/setup +38 -0
- data/spec/dummy/bin/update +29 -0
- data/spec/dummy/bin/webpack +29 -0
- data/spec/dummy/bin/webpack-dev-server +29 -0
- data/spec/dummy/bin/yarn +11 -0
- data/spec/dummy/config.ru +7 -0
- data/spec/dummy/config/apollo_engine_proxy.yml +23 -0
- data/spec/dummy/config/application.rb +21 -0
- data/spec/dummy/config/boot.rb +11 -0
- data/spec/dummy/config/cable.yml +9 -0
- data/spec/dummy/config/config.yml +22 -0
- data/spec/dummy/config/database.yml +22 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +74 -0
- data/spec/dummy/config/environments/production.rb +103 -0
- data/spec/dummy/config/environments/staging.rb +103 -0
- data/spec/dummy/config/environments/test.rb +65 -0
- data/spec/dummy/config/initializers/application_controller_renderer.rb +6 -0
- data/spec/dummy/config/initializers/assets.rb +14 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +5 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +16 -0
- data/spec/dummy/config/initializers/load_config.rb +9 -0
- data/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/spec/dummy/config/initializers/react_on_rails.rb +41 -0
- data/spec/dummy/config/initializers/secret_token.rb +12 -0
- data/spec/dummy/config/initializers/sentry.rb +6 -0
- data/spec/dummy/config/initializers/session_store.rb +7 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +8 -0
- data/spec/dummy/config/newrelic.yml +224 -0
- data/spec/dummy/config/puma.rb +47 -0
- data/spec/dummy/config/routes.rb +5 -0
- data/spec/dummy/config/secrets.yml +32 -0
- data/spec/dummy/config/sidekiq.yml +9 -0
- data/spec/dummy/config/webpack/development.js +3 -0
- data/spec/dummy/config/webpack/environment.js +3 -0
- data/spec/dummy/config/webpack/production.js +3 -0
- data/spec/dummy/config/webpack/test.js +3 -0
- data/spec/dummy/config/webpacker.yml +66 -0
- data/spec/dummy/db/migrate/20180118233001_enable_pgcrypto_extension.cortex.rb +6 -0
- data/spec/dummy/db/migrate/20180118233002_create_users.cortex.rb +15 -0
- data/spec/dummy/db/migrate/20180118233003_create_tenants.cortex.rb +27 -0
- data/spec/dummy/db/migrate/20180118233004_add_devise_to_users.cortex.rb +50 -0
- data/spec/dummy/db/migrate/20180118233005_create_roles.cortex.rb +16 -0
- data/spec/dummy/db/migrate/20180118233006_create_permissions.cortex.rb +17 -0
- data/spec/dummy/db/migrate/20180118233007_create_flipper_tables.cortex.rb +21 -0
- data/spec/dummy/db/migrate/20180118233008_create_contracts.cortex.rb +12 -0
- data/spec/dummy/db/migrate/20180118233009_create_decorators.cortex.rb +22 -0
- data/spec/dummy/db/migrate/20180118233010_create_content_types.cortex.rb +18 -0
- data/spec/dummy/db/migrate/20180118233011_create_fields.cortex.rb +16 -0
- data/spec/dummy/db/migrate/20180118233012_create_content_items.cortex.rb +15 -0
- data/spec/dummy/db/migrate/20180118233013_create_field_items.cortex.rb +13 -0
- data/spec/dummy/db/migrate/20180118233014_create_field_types.cortex.rb +6 -0
- data/spec/dummy/db/schema.rb +258 -0
- data/spec/dummy/db/seeds.rb +1 -0
- data/spec/dummy/lib/tasks/content_types_tasks.rake +31 -0
- data/spec/dummy/lib/tasks/employer/blog_tasks.rake +345 -0
- data/spec/dummy/package.json +28 -0
- data/spec/dummy/public/404.html +67 -0
- data/spec/dummy/public/422.html +67 -0
- data/spec/dummy/public/500.html +66 -0
- data/spec/dummy/public/robots.txt +5 -0
- data/spec/dummy/spec/javascripts/support/jasmine.yml +50 -0
- data/spec/dummy/yarn.lock +6615 -0
- data/spec/rails_helper.rb +57 -0
- data/spec/spec_helper.rb +96 -0
- data/yarn.lock +6032 -0
- metadata +1061 -0
@@ -0,0 +1,10 @@
|
|
1
|
+
:javascript
|
2
|
+
var _gaq = _gaq || [];
|
3
|
+
_gaq.push(['_setAccount', '#{extra_config[:google_analytics_id]}']);
|
4
|
+
_gaq.push(['_trackPageview']);
|
5
|
+
|
6
|
+
(function() {
|
7
|
+
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
|
8
|
+
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
|
9
|
+
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
|
10
|
+
})();
|
@@ -0,0 +1,10 @@
|
|
1
|
+
:javascript
|
2
|
+
(function(){var g=function(e,h,f,g){
|
3
|
+
this.get=function(a){for(var a=a+"=",c=document.cookie.split(";"),b=0,e=c.length;b<e;b++){for(var d=c[b];" "==d.charAt(0);)d=d.substring(1,d.length);if(0==d.indexOf(a))return d.substring(a.length,d.length)}return null};
|
4
|
+
this.set=function(a,c){var b="",b=new Date;b.setTime(b.getTime()+6048E5);b="; expires="+b.toGMTString();document.cookie=a+"="+c+b+"; path=/; "};
|
5
|
+
this.check=function(){var a=this.get(f);if(a)a=a.split(":");else if(100!=e)"v"==h&&(e=Math.random()>=e/100?0:100),a=[h,e,0],this.set(f,a.join(":"));else return!0;var c=a[1];if(100==c)return!0;switch(a[0]){case "v":return!1;case "r":return c=a[2]%Math.floor(100/c),a[2]++,this.set(f,a.join(":")),!c}return!0};
|
6
|
+
this.go=function(){if(this.check()){var a=document.createElement("script");a.type="text/javascript";a.src=g+ "&t=" + (new Date()).getTime();document.body&&document.body.appendChild(a)}};
|
7
|
+
this.start=function(){var a=this;window.addEventListener?window.addEventListener("load",function(){a.go()},!1):window.attachEvent&&window.attachEvent("onload",function(){a.go()})}};
|
8
|
+
try{(new g(100,"r","QSI_S_#{extra_config[:qualtrics_id]}","//#{qualtrics_domain}-careerbuilder.siteintercept.qualtrics.com/WRSiteInterceptEngine/?Q_ZID=#{extra_config[:qualtrics_id]}&Q_LOC="+encodeURIComponent(window.location.href))).start()}catch(i){}})();
|
9
|
+
|
10
|
+
%div{ id: "#{extra_config[:qualtrics_id]}" }
|
@@ -0,0 +1,30 @@
|
|
1
|
+
!!! 5
|
2
|
+
%html
|
3
|
+
%head
|
4
|
+
%meta{content: 'IE=edge', 'http-equiv' => 'X-UA-Compatible'}
|
5
|
+
%meta{charset: 'utf-8'}
|
6
|
+
%meta{name: 'viewport', content: 'width=device-width, initial-scale=1.0, minimum-scale=1.0'}
|
7
|
+
%title
|
8
|
+
= title
|
9
|
+
= favicon_link_tag 'cortex/favicon.ico'
|
10
|
+
= stylesheet_link_tag :application, {media: 'all'}
|
11
|
+
// = stylesheet_pack_tag 'cortex-bundle', {media: 'all'} # Enable once assets migrated
|
12
|
+
= stylesheet_link_tag 'https://fonts.googleapis.com/icon?family=Material+Icons'
|
13
|
+
= csrf_meta_tags
|
14
|
+
%body
|
15
|
+
= render 'cortex/partials/media_dialogs'
|
16
|
+
= render 'cortex/partials/cortex_redux_state'
|
17
|
+
#layout_wrapper{class: ('sidebar--collapsed' unless current_page? cortex.root_path)}
|
18
|
+
.layout__container.mdl-js-layout.mdl-layout--fixed-drawer
|
19
|
+
= render 'cortex/partials/sidebar'
|
20
|
+
.layout__topbar-content__container.mdl-layout--fixed-header
|
21
|
+
= render 'cortex/partials/topbar'
|
22
|
+
%main.mdl-layout__content.layout__main-content
|
23
|
+
= yield
|
24
|
+
= render 'cortex/partials/flash'
|
25
|
+
|
26
|
+
%script{src: '//cdn.ckeditor.com/4.8.0/standard-all/ckeditor.js', type: 'text/javascript'}
|
27
|
+
= javascript_include_tag :application
|
28
|
+
= javascript_pack_tag 'cortex'
|
29
|
+
= render 'cortex/partials/trackers/google_analytics' if extra_config[:google_analytics_id?]
|
30
|
+
= render 'cortex/partials/trackers/qualtrics' if extra_config[:qualtrics_id?]
|
@@ -0,0 +1,19 @@
|
|
1
|
+
!!! 5
|
2
|
+
%html
|
3
|
+
%head
|
4
|
+
%meta{content: 'IE=edge', 'http-equiv' => 'X-UA-Compatible'}
|
5
|
+
%meta{charset: 'utf-8'}
|
6
|
+
%meta{name: 'viewport', content: 'width=device-width, initial-scale=1.0, minimum-scale=1.0'}
|
7
|
+
%title Cortex Administration | Login
|
8
|
+
= favicon_link_tag 'cortex/favicon.ico'
|
9
|
+
= stylesheet_link_tag 'cortex/authentication', {media: 'all'}
|
10
|
+
= csrf_meta_tags
|
11
|
+
%body.mdl-base
|
12
|
+
.mdl-layout.mdl-js-layout.authentication
|
13
|
+
%main.mdl-layout__content.mdl-layout__content--authentication
|
14
|
+
= render 'cortex/partials/authentication/header'
|
15
|
+
.mdl-grid.authentication__content
|
16
|
+
= yield
|
17
|
+
= javascript_include_tag 'cortex/authentication'
|
18
|
+
%span.flash--invert
|
19
|
+
= render 'cortex/partials/flash'
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= yield %>
|
data/bin/rails
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# This command will automatically be run when you run "rails" with Rails gems
|
3
|
+
# installed from the root of your application.
|
4
|
+
|
5
|
+
ENGINE_ROOT = File.expand_path('..', __dir__)
|
6
|
+
ENGINE_PATH = File.expand_path('../lib/cortex/engine', __dir__)
|
7
|
+
APP_PATH = File.expand_path('../spec/dummy/config/application', __dir__)
|
8
|
+
|
9
|
+
# Set up gems listed in the Gemfile.
|
10
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
|
11
|
+
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
|
12
|
+
|
13
|
+
require "rails"
|
14
|
+
# Pick the frameworks you want:
|
15
|
+
require "active_model/railtie"
|
16
|
+
require "active_job/railtie"
|
17
|
+
require "active_record/railtie"
|
18
|
+
require "action_controller/railtie"
|
19
|
+
require "action_mailer/railtie"
|
20
|
+
require "action_view/railtie"
|
21
|
+
#require "active_storage/engine"
|
22
|
+
#require "action_cable/engine"
|
23
|
+
require "sprockets/railtie"
|
24
|
+
# require "rails/test_unit/railtie"
|
25
|
+
require 'rails/engine/commands'
|
data/config/config.yml
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
defaults: &defaults
|
2
|
+
cortex:
|
3
|
+
news_feed:
|
4
|
+
tenant: <%= ENV['CORTEX_NEWS_FEED_TENANT'] %>
|
5
|
+
extra:
|
6
|
+
google_analytics_id: <%= ENV['GOOGLE_ANALYTICS_ID'] %>
|
7
|
+
qualtrics_id: <%= ENV['QUALTRICS_ID'] %>
|
8
|
+
cors:
|
9
|
+
allowed_origins: <%= ENV['CORS_ALLOWED_ORIGINS'] %>
|
10
|
+
allowed_origins_regex: <%= ENV['CORS_ALLOWED_ORIGINS_REGEX'] %>
|
11
|
+
|
12
|
+
development:
|
13
|
+
<<: *defaults
|
14
|
+
|
15
|
+
test:
|
16
|
+
<<: *defaults
|
17
|
+
|
18
|
+
staging:
|
19
|
+
<<: *defaults
|
20
|
+
|
21
|
+
production:
|
22
|
+
<<: *defaults
|
@@ -0,0 +1,35 @@
|
|
1
|
+
Devise.setup do |config|
|
2
|
+
config.secret_key = ENV['DEVISE_SECRET']
|
3
|
+
require 'devise/orm/active_record'
|
4
|
+
|
5
|
+
config.case_insensitive_keys = [:email]
|
6
|
+
config.strip_whitespace_keys = [:email]
|
7
|
+
config.http_authenticatable = true
|
8
|
+
config.skip_session_storage = [:http_auth]
|
9
|
+
config.stretches = Rails.env.test? ? 1 : 10
|
10
|
+
config.reconfirmable = true
|
11
|
+
config.reconfirmable = true
|
12
|
+
config.expire_all_remember_me_on_sign_out = true
|
13
|
+
config.password_length = 8..128
|
14
|
+
|
15
|
+
config.lock_strategy = :failed_attempts
|
16
|
+
config.unlock_keys = [:email]
|
17
|
+
config.unlock_strategy = :both
|
18
|
+
config.maximum_attempts = 10
|
19
|
+
config.unlock_in = 1.hour
|
20
|
+
config.last_attempt_warning = true
|
21
|
+
|
22
|
+
config.reset_password_within = 6.hours
|
23
|
+
|
24
|
+
config.sign_out_via = :delete
|
25
|
+
|
26
|
+
config.warden do |manager|
|
27
|
+
manager.failure_app = Cortex::AuthenticationFailure
|
28
|
+
end
|
29
|
+
|
30
|
+
# Engine-specific config
|
31
|
+
config.router_name = :cortex
|
32
|
+
Devise.setup do |config|
|
33
|
+
config.parent_controller = 'Cortex::ApplicationController'
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'flipper/middleware/memoizer'
|
2
|
+
|
3
|
+
Flipper.configure do |config|
|
4
|
+
config.default do
|
5
|
+
adapter = Flipper::Adapters::ActiveRecord.new
|
6
|
+
Flipper.new(adapter)
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
Cortex::Engine.config.middleware.use Flipper::Middleware::Memoizer
|
11
|
+
|
12
|
+
Flipper.register(:internal) { |request| request.internal? }
|
13
|
+
Flipper.register(:authenticated) { |request| request.session[:current_user].present? && request.session[:current_user][:authenticated] }
|
14
|
+
Flipper.register(:cortex) { |request| request.host == 'admin.cbcortex.com' }
|
15
|
+
Flipper.register(:dev) { |request| request.host == 'dev.admin.cbcortex.com' || request.host == 'localhost' }
|
16
|
+
Flipper.register(:staging) { |request| request.host == 'stg.admin.cbcortex.com' }
|
@@ -0,0 +1,51 @@
|
|
1
|
+
require 'graphiql/rails'
|
2
|
+
|
3
|
+
GraphiQL::Rails.config.initial_query = <<~HEREDOC
|
4
|
+
# Welcome to Cortex CMS's GraphiQL IDE
|
5
|
+
#
|
6
|
+
# GraphiQL is an in-browser tool for writing, validating, and
|
7
|
+
# testing GraphQL queries.
|
8
|
+
#
|
9
|
+
# Type queries into this side of the screen, and you will see intelligent
|
10
|
+
# typeaheads aware of the current GraphQL type schema and live syntax and
|
11
|
+
# validation errors highlighted within the text.
|
12
|
+
#
|
13
|
+
# GraphQL queries typically start with a "{" character. Lines that starts
|
14
|
+
# with a # are ignored.
|
15
|
+
#
|
16
|
+
# An example GraphQL query might look like:
|
17
|
+
#
|
18
|
+
# {
|
19
|
+
# currentUser {
|
20
|
+
# firstname
|
21
|
+
# lastname
|
22
|
+
# }
|
23
|
+
#
|
24
|
+
# allEmployerBlogs {
|
25
|
+
# id
|
26
|
+
# updated_by {
|
27
|
+
# lastname
|
28
|
+
# }
|
29
|
+
# content_type {
|
30
|
+
# name
|
31
|
+
# publishable
|
32
|
+
# }
|
33
|
+
# allFieldItems {
|
34
|
+
# id
|
35
|
+
# data
|
36
|
+
# }
|
37
|
+
# }
|
38
|
+
# }
|
39
|
+
#
|
40
|
+
# Keyboard shortcuts:
|
41
|
+
#
|
42
|
+
# Prettify Query: Shift-Ctrl-P (or press the prettify button above)
|
43
|
+
#
|
44
|
+
# Run Query: Ctrl-Enter (or press the play button above)
|
45
|
+
#
|
46
|
+
# Auto Complete: Ctrl-Space (or just start typing)
|
47
|
+
#
|
48
|
+
# For more detailed information and tutorials, visit https://docs.cortexcms.org
|
49
|
+
#
|
50
|
+
|
51
|
+
HEREDOC
|
@@ -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,16 @@
|
|
1
|
+
module Cortex
|
2
|
+
def self.config
|
3
|
+
@config ||= self.load_yaml("#{Cortex::Engine.root}/config/config.yml")
|
4
|
+
end
|
5
|
+
|
6
|
+
def self.seed_data
|
7
|
+
@seed_data ||= self.load_yaml("#{Cortex::Engine.root}/db/seeds.yml")
|
8
|
+
end
|
9
|
+
|
10
|
+
private
|
11
|
+
|
12
|
+
def self.load_yaml(file)
|
13
|
+
# interpolate file with ERB to allow templating (<%= ENV['...'] %>)
|
14
|
+
YAML.load(ERB.new(File.new(file).read).result)[Rails.env].deep_symbolize_keys
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Cortex
|
2
|
+
def self.plugins
|
3
|
+
@plugins ||= Cortex::Plugins.constants.map(&Cortex::Plugins.method(:const_get))
|
4
|
+
end
|
5
|
+
|
6
|
+
def self.plugin_library_names
|
7
|
+
@plugin_library_names ||= @plugins.map do |plugin|
|
8
|
+
plugin.to_s.parameterize
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.plugin_paths
|
13
|
+
@plugin_paths ||= @plugins.map do |plugin|
|
14
|
+
plugin::Engine.root
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
ActiveSupport.on_load(:action_view) do
|
2
|
+
include ReactOnRailsHelper
|
3
|
+
end
|
4
|
+
|
5
|
+
module RenderingExtension
|
6
|
+
def self.custom_context(_view_context)
|
7
|
+
{
|
8
|
+
environment: Rails.env
|
9
|
+
}
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
ReactOnRails.configure do |config|
|
14
|
+
config.rendering_extension = RenderingExtension
|
15
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
require 'rolify'
|
2
|
+
|
3
|
+
Rolify.configure do |config|
|
4
|
+
# By default ORM adapter is ActiveRecord. uncomment to use mongoid
|
5
|
+
# config.use_mongoid
|
6
|
+
|
7
|
+
# Dynamic shortcuts for User class (user.is_admin? like methods). Default is: false
|
8
|
+
config.use_dynamic_shortcuts
|
9
|
+
end
|
@@ -0,0 +1,64 @@
|
|
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
|
+
email_changed:
|
27
|
+
subject: "Email Changed"
|
28
|
+
password_change:
|
29
|
+
subject: "Password Changed"
|
30
|
+
omniauth_callbacks:
|
31
|
+
failure: "Could not authenticate you from %{kind} because \"%{reason}\"."
|
32
|
+
success: "Successfully authenticated from %{kind} account."
|
33
|
+
passwords:
|
34
|
+
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."
|
35
|
+
send_instructions: "You will receive an email with instructions on how to reset your password in a few minutes."
|
36
|
+
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."
|
37
|
+
updated: "Your password has been changed successfully. You are now signed in."
|
38
|
+
updated_not_active: "Your password has been changed successfully."
|
39
|
+
registrations:
|
40
|
+
destroyed: "Bye! Your account has been successfully cancelled. We hope to see you again soon."
|
41
|
+
signed_up: "Welcome! You have signed up successfully."
|
42
|
+
signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated."
|
43
|
+
signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked."
|
44
|
+
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."
|
45
|
+
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."
|
46
|
+
updated: "Your account has been updated successfully."
|
47
|
+
sessions:
|
48
|
+
signed_in: "Signed in successfully."
|
49
|
+
signed_out: "Signed out successfully."
|
50
|
+
already_signed_out: "Signed out successfully."
|
51
|
+
unlocks:
|
52
|
+
send_instructions: "You will receive an email with instructions for how to unlock your account in a few minutes."
|
53
|
+
send_paranoid_instructions: "If your account exists, you will receive an email with instructions for how to unlock it in a few minutes."
|
54
|
+
unlocked: "Your account has been unlocked successfully. Please sign in to continue."
|
55
|
+
errors:
|
56
|
+
messages:
|
57
|
+
already_confirmed: "was already confirmed, please try signing in"
|
58
|
+
confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one"
|
59
|
+
expired: "has expired, please request a new one"
|
60
|
+
not_found: "not found"
|
61
|
+
not_locked: "was not locked"
|
62
|
+
not_saved:
|
63
|
+
one: "1 error prohibited this %{resource} from being saved:"
|
64
|
+
other: "%{count} errors prohibited this %{resource} from being saved:"
|