Sha256: b5baf5281852b0430f1c99c054dbb2738a7a45c6238b0b14786615ca335f5200

Contents?: true

Size: 861 Bytes

Versions: 15

Compression:

Stored size: 861 Bytes

Contents

module Plugins
  module Core
    class AssetInfoCell < Plugins::Core::Cell
      include ActionView::Helpers::NumberHelper

      property :data
      property :content_item

      def show
        render
      end

      def index
        render
      end

      private

      def config
        @options[:config] || {}
      end

      def asset
        data['asset']
      end

      def dimensions
        "#{asset['dimensions']['width']} x #{asset['dimensions']['width']}"
      end

      def creator
        content_item.creator
      end

      def created_at
        content_item.created_at.to_formatted_s(:long_ordinal)
      end

      def updated_at
        DateTime.parse(asset['updated_at']).to_formatted_s(:long_ordinal)
      end

      def link_to_asset
        link_to asset['url'], asset['url'], target: '_blank'
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
cortex-plugins-core-0.11.3 app/cells/plugins/core/asset_info_cell.rb
cortex-plugins-core-0.11.2 app/cells/plugins/core/asset_info_cell.rb
cortex-plugins-core-0.11.1 app/cells/plugins/core/asset_info_cell.rb
cortex-plugins-core-0.11.0 app/cells/plugins/core/asset_info_cell.rb
cortex-plugins-core-0.10.4 app/cells/plugins/core/asset_info_cell.rb
cortex-plugins-core-0.10.2 app/cells/plugins/core/asset_info_cell.rb
cortex-plugins-core-0.10.1 app/cells/plugins/core/asset_info_cell.rb
cortex-plugins-core-0.10.0 app/cells/plugins/core/asset_info_cell.rb
cortex-plugins-core-0.9.1 app/cells/plugins/core/asset_info_cell.rb
cortex-plugins-core-0.9.0 app/cells/plugins/core/asset_info_cell.rb
cortex-plugins-core-0.8.0 app/cells/plugins/core/asset_info_cell.rb
cortex-plugins-core-0.7.2 app/cells/plugins/core/asset_info_cell.rb
cortex-plugins-core-0.7.1 app/cells/plugins/core/asset_info_cell.rb
cortex-plugins-core-0.7.0 app/cells/plugins/core/asset_info_cell.rb
cortex-plugins-core-0.6.0 app/cells/plugins/core/asset_info_cell.rb