Sha256: 9fe9c611da4b8af4871a4d4eb635a943a5ceac5b4e6cfa82500a0b0d53d641d6

Contents?: true

Size: 656 Bytes

Versions: 13

Compression:

Stored size: 656 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Blogs
    # This cell renders metadata for an instance of a Proposal
    class PostMetadataCell < Decidim::CardMetadataCell
      def initialize(*)
        super

        @items.prepend(*post_items)
      end

      private

      def post_items
        [author_item, creation_date, comments_count_item, endorsements_count_item]
      end

      def creation_date
        date_at = model.try(:published_at) || model.try(:created_at)

        {
          text: l(date_at.to_date, format: :decidim_short_with_month_name_short),
          icon: "calendar-todo-line"
        }
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
decidim-blogs-0.29.1 app/cells/decidim/blogs/post_metadata_cell.rb
decidim-blogs-0.28.4 app/cells/decidim/blogs/post_metadata_cell.rb
decidim-blogs-0.29.0 app/cells/decidim/blogs/post_metadata_cell.rb
decidim-blogs-0.28.3 app/cells/decidim/blogs/post_metadata_cell.rb
decidim-blogs-0.29.0.rc4 app/cells/decidim/blogs/post_metadata_cell.rb
decidim-blogs-0.29.0.rc3 app/cells/decidim/blogs/post_metadata_cell.rb
decidim-blogs-0.29.0.rc2 app/cells/decidim/blogs/post_metadata_cell.rb
decidim-blogs-0.29.0.rc1 app/cells/decidim/blogs/post_metadata_cell.rb
decidim-blogs-0.28.2 app/cells/decidim/blogs/post_metadata_cell.rb
decidim-blogs-0.28.1 app/cells/decidim/blogs/post_metadata_cell.rb
decidim-blogs-0.28.0 app/cells/decidim/blogs/post_metadata_cell.rb
decidim-blogs-0.28.0.rc5 app/cells/decidim/blogs/post_metadata_cell.rb
decidim-blogs-0.28.0.rc4 app/cells/decidim/blogs/post_metadata_cell.rb