Sha256: a76cf2d753400b2aea68890d1cbdd6bcbfd7c53009125e113a61640dc47ae950

Contents?: true

Size: 1.38 KB

Versions: 24

Compression:

Stored size: 1.38 KB

Contents

module Pageflow
  module Editor
    class EntriesController < Pageflow::ApplicationController
      layout 'pageflow/editor'

      respond_to :json

      before_action :authenticate_user!

      def index
        @entries = DraftEntry.accessible_by(current_ability, :use_files)
        respond_with(@entries)
      end

      def seed
        @entry = DraftEntry.find(params[:id])
        authorize!(:edit, @entry.to_model)

        @entry_config = Pageflow.config_for(@entry)
      end

      def show
        @entry = DraftEntry.find(params[:id])
        authorize!(:edit, @entry.to_model)

        @entry_config = Pageflow.config_for(@entry)

        respond_to do |format|
          format.html
          format.json
        end
      end

      def update
        @entry = DraftEntry.find(params[:id])

        authorize!(:update, @entry.to_model)
        @entry.update_meta_data!(entry_params)

        head(:no_content)
      end

      private

      def entry_params
        configuration = params.require(:entry)[:configuration].try(:permit!) || {}
        params
          .require(:entry)
          .permit(:title, :summary, :credits,
                  :share_url, :share_image_id, :share_image_x, :share_image_y,
                  :locale, :author, :publisher, :keywords, :theme_name,
                  share_providers: {})
          .merge(configuration: configuration)
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
pageflow-17.0.4 app/controllers/pageflow/editor/entries_controller.rb
pageflow-17.0.3 app/controllers/pageflow/editor/entries_controller.rb
pageflow-17.0.2 app/controllers/pageflow/editor/entries_controller.rb
pageflow-17.0.1 app/controllers/pageflow/editor/entries_controller.rb
pageflow-17.0.0 app/controllers/pageflow/editor/entries_controller.rb
pageflow-16.2.0 app/controllers/pageflow/editor/entries_controller.rb
pageflow-16.1.0 app/controllers/pageflow/editor/entries_controller.rb
pageflow-16.0.0 app/controllers/pageflow/editor/entries_controller.rb
pageflow-15.8.0 app/controllers/pageflow/editor/entries_controller.rb
pageflow-15.7.1 app/controllers/pageflow/editor/entries_controller.rb
pageflow-15.7.0 app/controllers/pageflow/editor/entries_controller.rb
pageflow-15.6.1 app/controllers/pageflow/editor/entries_controller.rb
pageflow-15.6.0 app/controllers/pageflow/editor/entries_controller.rb
pageflow-15.5.0 app/controllers/pageflow/editor/entries_controller.rb
pageflow-15.4.0 app/controllers/pageflow/editor/entries_controller.rb
pageflow-15.3.0 app/controllers/pageflow/editor/entries_controller.rb
pageflow-15.2.2 app/controllers/pageflow/editor/entries_controller.rb
pageflow-15.2.1 app/controllers/pageflow/editor/entries_controller.rb
pageflow-15.2.0 app/controllers/pageflow/editor/entries_controller.rb
pageflow-15.1.2 app/controllers/pageflow/editor/entries_controller.rb