diff --git a/app/assets/stylesheets/georgia/components/_assets.scss b/app/assets/stylesheets/georgia/components/_assets.scss new file mode 100644 index 0000000..673a342 --- /dev/null +++ b/app/assets/stylesheets/georgia/components/_assets.scss @@ -0,0 +1,11 @@ +.js-replace-asset{ + // Overriding file input transform which translates view outside + position: static; + height: 10px; + padding: 0; + width: 30px; + margin: 0; + display: inline-block; + vertical-align: top; + @include transform(none); +} \ No newline at end of file diff --git a/app/controllers/georgia/dashboard_controller.rb b/app/controllers/georgia/dashboard_controller.rb index 8fdc6c5..0577967 100644 --- a/app/controllers/georgia/dashboard_controller.rb +++ b/app/controllers/georgia/dashboard_controller.rb @@ -3,7 +3,7 @@ class DashboardController < Georgia::ApplicationController def show if can?(:approve, Georgia::Revision) or can?(:review, Georgia::Revision) - @awaiting_revisions = Georgia::Revision.reviews.select{|r| r.revisionable.present?} + @awaiting_revisions = Georgia::Revision.reviews.includes([:revisionable, :contents]).select { |r| r.revisionable.present? } end if defined? GeorgiaMailer::Message if can?(:index, GeorgiaMailer::Message) diff --git a/app/controllers/georgia/widgets_controller.rb b/app/controllers/georgia/widgets_controller.rb index 1c04888..3a4def4 100644 --- a/app/controllers/georgia/widgets_controller.rb +++ b/app/controllers/georgia/widgets_controller.rb @@ -4,7 +4,7 @@ class WidgetsController < ApplicationController load_and_authorize_resource class: Georgia::Widget def index - @widgets = Widget.order(:created_at).page(params[:page]).in_groups_of(4, false) + @widgets = Widget.order(:created_at).includes(:contents).page(params[:page]).in_groups_of(4, false) @widget = Widget.new @widget.contents.build(locale: current_locale) end diff --git a/app/helpers/georgia/forms_helper.rb b/app/helpers/georgia/forms_helper.rb index 8b85942..ea1e345 100644 --- a/app/helpers/georgia/forms_helper.rb +++ b/app/helpers/georgia/forms_helper.rb @@ -46,7 +46,7 @@ def parent_page_collection end def widgets_collection - @widgets_collection ||= options_from_collection_for_select(Georgia::Widget.all, :id, :title) + @widgets_collection ||= options_from_collection_for_select(Georgia::Widget.includes(:contents).all, :id, :title) end def extra_fields? diff --git a/app/services/georgia/update_revision.rb b/app/services/georgia/update_revision.rb index e69a863..7d67370 100644 --- a/app/services/georgia/update_revision.rb +++ b/app/services/georgia/update_revision.rb @@ -13,9 +13,7 @@ def initialize controller, page, revision, attributes end def call - if can? :manage, revision - admin_update_attributes - elsif can? :review, revision + if can? :review, revision contributor_update_attributes else false diff --git a/lib/georgia/indexer/extensions/solr_adapter/ckeditor/asset.rb b/lib/georgia/indexer/extensions/solr_adapter/ckeditor/asset.rb index 100e56e..f8e2b4d 100644 --- a/lib/georgia/indexer/extensions/solr_adapter/ckeditor/asset.rb +++ b/lib/georgia/indexer/extensions/solr_adapter/ckeditor/asset.rb @@ -27,7 +27,7 @@ module CkeditorAssetExtension end def self.search_index model, params - model.search do + model.search(:include => [{contents: :contentable}]) do fulltext params[:query] do fields(:filename, :tags) end diff --git a/lib/georgia/indexer/extensions/solr_adapter/georgia/page.rb b/lib/georgia/indexer/extensions/solr_adapter/georgia/page.rb index 848586a..09f82c8 100644 --- a/lib/georgia/indexer/extensions/solr_adapter/georgia/page.rb +++ b/lib/georgia/indexer/extensions/solr_adapter/georgia/page.rb @@ -51,7 +51,7 @@ module GeorgiaPageExtension end def self.search_index model, params - model.search do + model.search(:include => [current_revision: :contents]) do fulltext params[:query] do fields(:title, :excerpt, :text, :keywords, :tags, :url, :template) end