diff --git a/Gemfile.lock b/Gemfile.lock index d4428fbef..c3ba06e12 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -5,6 +5,19 @@ GIT awesome_nested_set (3.1.2) activerecord (>= 4.0.0, < 5.1) +GIT + remote: https://github.com/cortex-cms/cortex-plugins-core.git + revision: 889b620a1260f9b4412293812017c1f07e69f7cc + branch: topic/COR-526-Popup-Button + specs: + cortex-plugins-core (0.4.6) + cells (~> 4.1) + cells-haml (~> 0.0.10) + cells-rails (~> 0.0.6) + ckeditor (~> 4.2.0) + mimemagic (~> 0.3.2) + rails (>= 4) + GIT remote: https://github.com/samstickland/cells.git revision: e5634e25b472d41913030eb82463b015f429f2ca @@ -127,7 +140,7 @@ GEM childprocess (0.5.9) ffi (~> 1.0, >= 1.0.11) choice (0.2.0) - ckeditor (4.2.0) + ckeditor (4.2.1) cocaine orm_adapter (~> 0.5.0) climate_control (0.0.3) @@ -143,13 +156,6 @@ GEM concurrent-ruby (1.0.2) connection_pool (2.2.0) cortex-exceptions (0.0.4) - cortex-plugins-core (0.4.6) - cells (~> 4.1) - cells-haml (~> 0.0.10) - cells-rails (~> 0.0.6) - ckeditor (~> 4.2.0) - mimemagic (~> 0.3.2) - rails (>= 4) database_cleaner (1.5.3) debug_inspector (0.0.2) descendants_tracker (0.0.4) @@ -710,7 +716,7 @@ DEPENDENCIES cells-rails (~> 0.0.6) codeclimate-test-reporter (~> 0.6) cortex-exceptions (= 0.0.4) - cortex-plugins-core (= 0.4.6) + cortex-plugins-core! database_cleaner (~> 1.5) devise (~> 4.2.0) doorkeeper (~> 4.2) diff --git a/app/assets/javascripts/media_popups.js b/app/assets/javascripts/media_popups.js index d8331552f..99a3289ae 100644 --- a/app/assets/javascripts/media_popups.js +++ b/app/assets/javascripts/media_popups.js @@ -42,3 +42,8 @@ window.setModals = function () { window.onload = function(){ window.setModals() } + +$(".popup--open").on("click", function(ev){ + ev.preventDefault(); + window.MODALS.featured.open(); +}) diff --git a/app/assets/stylesheets/components/dialog.scss b/app/assets/stylesheets/components/dialog.scss index f83fc47f3..42be5874f 100644 --- a/app/assets/stylesheets/components/dialog.scss +++ b/app/assets/stylesheets/components/dialog.scss @@ -1,6 +1,6 @@ .dialog-div { position: fixed; - background: #fff; + background: $color-white; } .dialog-backdrop { @@ -37,9 +37,36 @@ bottom: 0; right: 0; left: 0; - background: white; + background: $color-white; } .mdl-dialog__content { padding: 0; } + +.content_item_button { + border: 1px solid $color-grey; + margin-top: 10px; + margin-bottom: 10px; + width: 100%; + background-color: $color-white; + color: $color-anchor-blue-light; + text-align: center; + + &:active { + background-color: $color-grey-lightest; + } + + &:hover { + cursor: pointer; + } +} + +.button_content { + padding-top: 30px; + padding-bottom: 20px; +} + +.content_item_button-text { + @extend .text-style-7; +} diff --git a/app/cells/wizard/field/show.haml b/app/cells/wizard/field/show.haml index f158c96bd..2e280b96b 100644 --- a/app/cells/wizard/field/show.haml +++ b/app/cells/wizard/field/show.haml @@ -22,3 +22,6 @@ - if field_item.field.field_type_instance.class == AssetFieldType = cell(Plugins::Core::AssetCell, field_item, form: field_item_form, input_options: input, label_options: label).(:input) + + - if field_item.field.field_type_instance.class == ContentItemFieldType + = cell(Plugins::Core::ContentItemCell, field_item, form: field_item_form).(:popup) diff --git a/lib/tasks/employer/blog.rake b/lib/tasks/employer/blog.rake index ac1463723..866978e91 100644 --- a/lib/tasks/employer/blog.rake +++ b/lib/tasks/employer/blog.rake @@ -85,6 +85,7 @@ namespace :employer do blog.fields.new(name: 'Categories', field_type: 'tree_field_type', metadata: {allowed_values: category_tree}, validations: {maximum: 2, minimum: 1}) blog.fields.new(name: 'Research', field_type: 'tree_field_type', metadata: {allowed_values: research_tree}, validations: {minimum: 1}) blog.fields.new(name: 'Persona', field_type: 'tree_field_type', metadata: {allowed_values: persona_tree}) + blog.fields.new(name: 'Featured Image', field_type: 'content_item_field_type') puts "Saving Employer Blog..." blog.save @@ -137,9 +138,6 @@ namespace :employer do { "id": blog.fields.find_by_name('Tags').id }, - # { - # "id": blog.fields.find_by_name('Expiration Date').id - # }, { "id": blog.fields.find_by_name('Publish Date').id } @@ -196,6 +194,22 @@ namespace :employer do } ] }, + { + "name": "Add Featured Image", + "description": "Add an image to feature with this Blog Post.", + "columns": [ + { + "heading": "Image (Optional Heading)", + "grid_width": 12, + "elements": [ + { + "id": blog.fields.find_by_name('Featured Image').id, + "render_method": "popup" + } + ] + } + ] + }, { "name": "Search", "heading": "How can others find your post..",