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,21 @@
|
|
1
|
+
.layout__container {
|
2
|
+
display: flex;
|
3
|
+
flex-wrap: nowrap;
|
4
|
+
align-content: stretch;
|
5
|
+
width: 100%;
|
6
|
+
height: 100%;
|
7
|
+
}
|
8
|
+
|
9
|
+
.layout__topbar-content__container {
|
10
|
+
flex-grow: 1;
|
11
|
+
flex-shrink: 1;
|
12
|
+
flex-basis: 100%;
|
13
|
+
display: flex;
|
14
|
+
flex-direction: column;
|
15
|
+
}
|
16
|
+
|
17
|
+
.layout__main-content {
|
18
|
+
flex-grow: 1;
|
19
|
+
flex-shrink: 1;
|
20
|
+
flex-basis: auto;
|
21
|
+
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
/* Rules for sizing the icon. */
|
2
|
+
.material-icons.md-18 { font-size: 18px; }
|
3
|
+
.material-icons.md-24 { font-size: 24px; }
|
4
|
+
.material-icons.md-36 { font-size: 36px; }
|
5
|
+
.material-icons.md-48 { font-size: 48px; }
|
6
|
+
|
7
|
+
/* Rules for using icons as black on a light background. */
|
8
|
+
.material-icons.md-dark { color: rgba(0, 0, 0, 0.54); }
|
9
|
+
.material-icons.md-dark.md-inactive { color: rgba(0, 0, 0, 0.26); }
|
10
|
+
|
11
|
+
/* Rules for using icons as white on a dark background. */
|
12
|
+
.material-icons.md-light { color: rgba(255, 255, 255, 1); }
|
13
|
+
.material-icons.md-light.md-inactive { color: rgba(255, 255, 255, 0.3); }
|
@@ -0,0 +1,46 @@
|
|
1
|
+
// Color Definitions
|
2
|
+
|
3
|
+
$color-teal: #63C0B9;
|
4
|
+
$color-teal-dark: #54A1A1;
|
5
|
+
$color-teal-light: #A1D9D5;
|
6
|
+
|
7
|
+
$color-orange: #F79C25;
|
8
|
+
$color-orange-dark: #E78523;
|
9
|
+
$color-orange-light: #FED473;
|
10
|
+
|
11
|
+
$color-anchor-blue-light: #747D8E;
|
12
|
+
|
13
|
+
$color-green: #009b74;
|
14
|
+
|
15
|
+
$color-slate-grey: #6E788F;
|
16
|
+
$color-grey: #BBB; // Type
|
17
|
+
$color-grey-dark: #333; // Type, Sidebar background, Login page background
|
18
|
+
$color-grey-light: #D4D4D4; // Content background color
|
19
|
+
$color-grey-lightest: #DDD; // Disabled and flat button background color
|
20
|
+
$color-grey-evenlighter: #E4E4E4;
|
21
|
+
$color-grey-reallylight: #F2F2F2;
|
22
|
+
$color-grey-extralight: #F4F4F4; // Wizard Instruction Panel background color
|
23
|
+
|
24
|
+
$color-red: #d85252;
|
25
|
+
|
26
|
+
$color-white: white; // Header
|
27
|
+
$color-black: #000000;
|
28
|
+
|
29
|
+
// Color Semantics
|
30
|
+
|
31
|
+
$employer-color: $color-teal;
|
32
|
+
$employer-color-dark: $color-teal-dark;
|
33
|
+
$employer-color-light: $color-teal-light;
|
34
|
+
|
35
|
+
$flash-error-background: $color-red;
|
36
|
+
$flash-success-background: $color-green;
|
37
|
+
|
38
|
+
$ar-color: $color-orange;
|
39
|
+
$ar-color-dark: $color-orange-dark;
|
40
|
+
$ar-color-light: $color-orange-light;
|
41
|
+
|
42
|
+
$notes-text: #6E788F;
|
43
|
+
|
44
|
+
$jumbo-button-text: #6E788F;
|
45
|
+
$jumbo-button-hover-background: $color-grey-evenlighter;
|
46
|
+
$jumbo-button-active-background: $color-grey-reallylight;
|
@@ -0,0 +1 @@
|
|
1
|
+
$grid-desktop-gutter: 50px;
|
@@ -0,0 +1,114 @@
|
|
1
|
+
@font-face {
|
2
|
+
font-family: Montserrat;
|
3
|
+
font-style: normal;
|
4
|
+
font-weight: normal;
|
5
|
+
src: url(asset_path('cortex/Montserrat-Regular.otf')) format("opentype");
|
6
|
+
}
|
7
|
+
|
8
|
+
@font-face {
|
9
|
+
font-family: Montserrat;
|
10
|
+
font-style: normal;
|
11
|
+
font-weight: bold;
|
12
|
+
src: url(asset_path('cortex/Montserrat-Medium.otf')) format("opentype");
|
13
|
+
}
|
14
|
+
|
15
|
+
@font-face {
|
16
|
+
font-family: Montserrat;
|
17
|
+
font-style: normal;
|
18
|
+
font-weight: bolder;
|
19
|
+
src: url(asset_path('cortex/Montserrat-SemiBold.otf')) format("opentype");
|
20
|
+
}
|
21
|
+
|
22
|
+
@font-face {
|
23
|
+
font-family: Montserrat;
|
24
|
+
font-style: normal;
|
25
|
+
font-weight: lighter;
|
26
|
+
src: url(asset_path('cortex/Montserrat-Light.otf')) format("opentype");
|
27
|
+
}
|
28
|
+
|
29
|
+
$cortex-font-stack: Montserrat, sans-serif;
|
30
|
+
$base-font-size: 1rem;
|
31
|
+
|
32
|
+
@mixin display-text { // Cortex Logo
|
33
|
+
color: $color-grey-dark;
|
34
|
+
font-family: $cortex-font-stack;
|
35
|
+
font-weight: normal;
|
36
|
+
font-size: 2.1775rem;
|
37
|
+
}
|
38
|
+
|
39
|
+
h1, h2, h3, h4, h5, h6 {
|
40
|
+
line-height: 1.5;
|
41
|
+
}
|
42
|
+
|
43
|
+
h1,
|
44
|
+
.text-style-1 { // Bread Crumbs and Page Headers
|
45
|
+
color: $color-teal;
|
46
|
+
font-family: $cortex-font-stack;
|
47
|
+
font-weight: bold;
|
48
|
+
font-size: 1.17rem;
|
49
|
+
text-decoration: none;
|
50
|
+
}
|
51
|
+
|
52
|
+
h2,
|
53
|
+
.text-style-2 {
|
54
|
+
color: $color-grey;
|
55
|
+
font-family: $cortex-font-stack;
|
56
|
+
font-weight: lighter;
|
57
|
+
font-size: 1.17rem;
|
58
|
+
}
|
59
|
+
|
60
|
+
h3,
|
61
|
+
.text-style-3 {
|
62
|
+
color: $color-grey;
|
63
|
+
font-family: $cortex-font-stack;
|
64
|
+
font-weight: bold;
|
65
|
+
font-size: 1.17rem;
|
66
|
+
}
|
67
|
+
|
68
|
+
h4,
|
69
|
+
.text-style-4 { // Section Headers, Dropdowns, Button Text
|
70
|
+
color: $color-grey-dark;
|
71
|
+
font-family: $cortex-font-stack;
|
72
|
+
font-size: 0.83rem;
|
73
|
+
}
|
74
|
+
|
75
|
+
h5,
|
76
|
+
.text-style-5 { // Field Text
|
77
|
+
color: $color-grey;
|
78
|
+
font-family: $cortex-font-stack;
|
79
|
+
font-weight: lighter;
|
80
|
+
font-size: $base-font-size;
|
81
|
+
}
|
82
|
+
|
83
|
+
h6,
|
84
|
+
.text-style-6 { // Field Text Filled
|
85
|
+
color: $color-anchor-blue-light;
|
86
|
+
font-family: $cortex-font-stack;
|
87
|
+
font-size: $base-font-size;
|
88
|
+
}
|
89
|
+
|
90
|
+
.text-style-7 { // Help Notes
|
91
|
+
color: $color-anchor-blue-light;
|
92
|
+
font-family: $cortex-font-stack;
|
93
|
+
font-weight: lighter;
|
94
|
+
font-size: 0.67rem;
|
95
|
+
}
|
96
|
+
|
97
|
+
%sidebar-nav { // Side Nav
|
98
|
+
color: $color-grey;
|
99
|
+
font-family: $cortex-font-stack;
|
100
|
+
font-weight: lighter;
|
101
|
+
font-size: 0.875rem;
|
102
|
+
text-transform: uppercase;
|
103
|
+
|
104
|
+
&.active { // Side Nav Selected
|
105
|
+
font-weight: bold;
|
106
|
+
color: $color-teal;
|
107
|
+
}
|
108
|
+
}
|
109
|
+
|
110
|
+
p {
|
111
|
+
color: $color-anchor-blue-light;
|
112
|
+
font-family: $cortex-font-stack;
|
113
|
+
font-size: $base-font-size;
|
114
|
+
}
|
@@ -0,0 +1,35 @@
|
|
1
|
+
module Cortex
|
2
|
+
class FieldCell < Cortex::ApplicationCell
|
3
|
+
property :id
|
4
|
+
property :data
|
5
|
+
property :field
|
6
|
+
property :content_item
|
7
|
+
property :created_at
|
8
|
+
property :updated_at
|
9
|
+
property :deleted_at
|
10
|
+
|
11
|
+
def association
|
12
|
+
raise 'association renderer not implemented'
|
13
|
+
end
|
14
|
+
|
15
|
+
private
|
16
|
+
|
17
|
+
def render_nested_label(data_property)
|
18
|
+
@options[:form].label "data[#{data_property}]", field.name do
|
19
|
+
yield + field.name
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def render_label
|
24
|
+
@options[:form].label :data, field.name
|
25
|
+
end
|
26
|
+
|
27
|
+
def render_tooltip
|
28
|
+
cell(::Plugins::Core::TooltipCell, nil, tooltip: @options[:tooltip], id: SecureRandom.base64(4))
|
29
|
+
end
|
30
|
+
|
31
|
+
def render_field_id
|
32
|
+
@options[:form].hidden_field :field_id, value: field.id
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
module Cortex
|
2
|
+
module Index
|
3
|
+
class ContentItemCell < Cortex::ApplicationCell
|
4
|
+
def column
|
5
|
+
render
|
6
|
+
end
|
7
|
+
|
8
|
+
def edit
|
9
|
+
render
|
10
|
+
end
|
11
|
+
|
12
|
+
private
|
13
|
+
|
14
|
+
def render_table_data(field)
|
15
|
+
# TODO: DRY - this logic appears in other classes
|
16
|
+
if field.has_key?(:id)
|
17
|
+
@options[:content_item].field_items.find { |fi| fi.field_id == field[:id] }.data.values[0]
|
18
|
+
elsif field.has_key?(:method)
|
19
|
+
field[:method].split('.').inject(@options[:content_item], :send)
|
20
|
+
elsif field.has_key?(:plugin)
|
21
|
+
cell(field[:plugin][:class_name], plugin_field_item(field), display: field[:plugin][:display], config: field[:plugin][:config]).(field[:plugin][:render_method])
|
22
|
+
else
|
23
|
+
""
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
def display_classes(display)
|
28
|
+
display[:classes].join(" ") unless display.nil?
|
29
|
+
end
|
30
|
+
|
31
|
+
def plugin_field_item(field)
|
32
|
+
field_id = field[:plugin][:data][:field_id]
|
33
|
+
@options[:content_item].field_items.find { |field_item| field_item.field_id == field_id } || {}
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
%tbody
|
2
|
+
- context[:content_items].each do |content_item|
|
3
|
+
%tr
|
4
|
+
- @options[:data][:columns].each do |column|
|
5
|
+
%td.mdl-data-table__cell--non-numeric.content_item-link
|
6
|
+
- if context[:popup]
|
7
|
+
= link_to '#', data: { id: content_item.id, title: content_item_title(content_item), thumb: content_item_thumb_url(content_item), url: content_item_asset_url(content_item), alt: content_item_asset_alt_text(content_item), asset_type: content_item_asset_type(content_item) }, class: "media-select--#{context[:popup]}" do
|
8
|
+
= cell(Cortex::Index::ContentItemCell, nil, { cells: column[:cells], content_item: content_item }).(:column)
|
9
|
+
- else
|
10
|
+
= link_to edit_content_type_content_item_path(context[:content_type].id, content_item.id) do
|
11
|
+
= cell(Cortex::Index::ContentItemCell, nil, { cells: column[:cells], content_item: content_item }).(:column)
|
@@ -0,0 +1,53 @@
|
|
1
|
+
module Cortex
|
2
|
+
class IndexCell < Cortex::ApplicationCell
|
3
|
+
property :data
|
4
|
+
|
5
|
+
def index
|
6
|
+
render
|
7
|
+
end
|
8
|
+
|
9
|
+
def table_headers
|
10
|
+
render
|
11
|
+
end
|
12
|
+
|
13
|
+
def table_body
|
14
|
+
render
|
15
|
+
end
|
16
|
+
|
17
|
+
private
|
18
|
+
|
19
|
+
def render_table_header(column_data)
|
20
|
+
column_data[:name]
|
21
|
+
end
|
22
|
+
|
23
|
+
def asset_field_item(content_item)
|
24
|
+
# TODO: This needs to be generic functionality
|
25
|
+
content_item.field_items.find { |field_item| field_item.field.name == 'Asset' }
|
26
|
+
end
|
27
|
+
|
28
|
+
def content_item_title(content_item)
|
29
|
+
# TODO: This needs to be generic functionality
|
30
|
+
content_item.field_items.find { |field_item| field_item.field.name == 'Title' }.data['text']
|
31
|
+
end
|
32
|
+
|
33
|
+
def content_item_thumb_url(content_item)
|
34
|
+
# TODO: The thumb version needs to be configurable, and this needs to be in a plugin
|
35
|
+
asset_field_item(content_item).data['asset']&.[]('versions')&.[]('mini')&.[]('url')
|
36
|
+
end
|
37
|
+
|
38
|
+
def content_item_asset_url(content_item)
|
39
|
+
# TODO: This needs to be in a plugin
|
40
|
+
asset_field_item(content_item).data['asset']['versions']['original']['url']
|
41
|
+
end
|
42
|
+
|
43
|
+
def content_item_asset_type(content_item)
|
44
|
+
# TODO: This needs to be in a plugin
|
45
|
+
MimeMagic.new(asset_field_item(content_item).data['asset']['versions']['original']['mime_type']).mediatype
|
46
|
+
end
|
47
|
+
|
48
|
+
def content_item_asset_alt_text(content_item)
|
49
|
+
# TODO: This needs to be in a plugin
|
50
|
+
content_item.field_items.find { |field_item| field_item.field.name == 'Alt Tag' }.data['text']
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
%div{class: ['mdl-cell', grid_class]}
|
2
|
+
%p
|
3
|
+
= description
|
4
|
+
- elements.each do |element|
|
5
|
+
- if element.keys.include?("id")
|
6
|
+
= cell(Cortex::Wizard::FieldCell, element).()
|
7
|
+
- elsif element.keys.include?("plugin")
|
8
|
+
= cell(Cortex::Wizard::PluginCell, nil, plugin_info: element[:plugin]).()
|
9
|
+
- elsif element.keys.include?("method")
|
10
|
+
= "Method is currently unimplemented"
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Cortex
|
2
|
+
module Wizard
|
3
|
+
class ColumnCell < Cortex::ApplicationCell
|
4
|
+
property :heading
|
5
|
+
property :grid_width
|
6
|
+
property :display
|
7
|
+
property :elements
|
8
|
+
property :description
|
9
|
+
|
10
|
+
def show
|
11
|
+
render
|
12
|
+
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def grid_class
|
17
|
+
"mdl-cell--#{grid_width}-col"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
= context[:form].fields_for 'field_items', field_item do |field_item_form|
|
2
|
+
- if field_item.field.field_type_instance.class == TextFieldType
|
3
|
+
- if render_method
|
4
|
+
= cell(Plugins::Core::TextCell, field_item, form: field_item_form, input_options: input, label_options: label, tooltip: tooltip).(render_method)
|
5
|
+
- else
|
6
|
+
= cell(Plugins::Core::TextCell, field_item, form: field_item_form, input_options: input, label_options: label, tooltip: tooltip).(:input)
|
7
|
+
|
8
|
+
- if field_item.field.field_type_instance.class == BooleanFieldType
|
9
|
+
= cell(Plugins::Core::BooleanCell, field_item, form: field_item_form, field_name: field_item.field.name, default_value: false, input_options: input, label_options: label, tooltip: tooltip).(:checkbox)
|
10
|
+
|
11
|
+
- if field_item.field.field_type_instance.class == TreeFieldType
|
12
|
+
= cell(Plugins::Core::TreeCell, field_item, form: field_item_form, metadata: field_item.field.metadata["allowed_values"], field: field, input_options: input, label_options: label, tooltip: tooltip).(render_method)
|
13
|
+
|
14
|
+
- if field_item.field.field_type_instance.class == DateTimeFieldType
|
15
|
+
= cell(Plugins::Core::DateTimeCell, field_item, form: field_item_form, default_value: '', input_options: input, label_options: label, tooltip: tooltip).(:datepicker)
|
16
|
+
|
17
|
+
- if field_item.field.field_type_instance.class == TagFieldType
|
18
|
+
= cell(Plugins::Core::TagCell, field_item, form: field_item_form, default_value: [], input_options: input, label_options: label, tooltip: tooltip).(:tag_picker)
|
19
|
+
|
20
|
+
- if field_item.field.field_type_instance.class == UserFieldType
|
21
|
+
= cell(Plugins::Core::UserCell, field_item, form: field_item_form, user_data: User.all, input_options: input, label_options: label, tooltip: tooltip).(:dropdown)
|
22
|
+
|
23
|
+
- if field_item.field.field_type_instance.class == AssetFieldType
|
24
|
+
= cell(Plugins::Core::AssetCell, field_item, form: field_item_form, input_options: input, label_options: label, tooltip: tooltip).(:input)
|
25
|
+
|
26
|
+
- if field_item.field.field_type_instance.class == ContentItemFieldType
|
27
|
+
= cell(Plugins::Core::ContentItemCell, field_item, form: field_item_form, tooltip: tooltip).(:popup)
|
28
|
+
|
29
|
+
- if field_item.field.field_type_instance.class == AuthorFieldType
|
30
|
+
= cell(Plugins::Core::AuthorCell, field_item, form: field_item_form, tooltip: tooltip).(:input)
|