Sha256: d40cac414678626be186f2ab4d841c00477078051063fc07da54340904c53c49

Contents?: true

Size: 652 Bytes

Versions: 5

Compression:

Stored size: 652 Bytes

Contents

module RailsConnector

  module EditingHelper

    def include_editing_stylesheet
      if inplace_editing_allowed?
        stylesheet_link_tag :infopark_editing
      end
    end

    def include_editing_javascript
      render 'rails_connector/editing_javascript' if inplace_editing_allowed?
    end

    def inplace_editing_allowed?
      Configuration.editing_auth_callback.call(request.env)
    end

    def current_page_has_edit_view?
      @obj && lookup_context.find(@obj.edit_view_path).present?
    rescue ActionView::MissingTemplate
      false
    end

    def current_page_has_children?
      @obj && @obj.children.any?
    end
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
infopark_cloud_connector-7.1.0 app/helpers/rails_connector/editing_helper.rb
infopark_cloud_connector-7.0.2 app/helpers/rails_connector/editing_helper.rb
infopark_cloud_connector-7.0.1 app/helpers/rails_connector/editing_helper.rb
infopark_cloud_connector-7.0.0 app/helpers/rails_connector/editing_helper.rb
infopark_cloud_connector-6.9.5 app/helpers/rails_connector/editing_helper.rb