Sha256: 059abe1ce1efb93ecdaa7ee552af4c185614f8dafc9dee3bedc6b35a7a5913e2

Contents?: true

Size: 730 Bytes

Versions: 17

Compression:

Stored size: 730 Bytes

Contents

module Plugins
  module Core
    class AuthorCell < Plugins::Core::Cell
      include Devise::Controllers::Helpers

      def input
        render
      end

      private

      def value
        data&.[]('author_name') || current_user.fullname
      end

      def render_label
        @options[:form].label 'data[author_name]', field.name, class: 'mdl-textfield__label'
      end

      def render_input
        @options[:form].text_field 'data[author_name]', value: value, placeholder: @options[:placeholder], class: 'mdl-textfield__input', required: required?
      end

      def render_default_value
        @options[:form].hidden_field 'data[default_author_name]', value: current_user.fullname
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
cortex-plugins-core-3.2.0 app/cells/plugins/core/author_cell.rb
cortex-plugins-core-3.1.0 app/cells/plugins/core/author_cell.rb
cortex-plugins-core-3.0.0 app/cells/plugins/core/author_cell.rb
cortex-plugins-core-2.1.1 app/cells/plugins/core/author_cell.rb
cortex-plugins-core-2.1.0 app/cells/plugins/core/author_cell.rb
cortex-plugins-core-2.0.1 app/cells/plugins/core/author_cell.rb
cortex-plugins-core-1.1.1 app/cells/plugins/core/author_cell.rb
cortex-plugins-core-1.1.0 app/cells/plugins/core/author_cell.rb
cortex-plugins-core-1.0.0 app/cells/plugins/core/author_cell.rb
cortex-plugins-core-0.12.4 app/cells/plugins/core/author_cell.rb
cortex-plugins-core-0.12.3 app/cells/plugins/core/author_cell.rb
cortex-plugins-core-0.12.2 app/cells/plugins/core/author_cell.rb
cortex-plugins-core-0.12.1 app/cells/plugins/core/author_cell.rb
cortex-plugins-core-0.12.0 app/cells/plugins/core/author_cell.rb
cortex-plugins-core-0.11.3 app/cells/plugins/core/author_cell.rb
cortex-plugins-core-0.11.2 app/cells/plugins/core/author_cell.rb
cortex-plugins-core-0.11.1 app/cells/plugins/core/author_cell.rb