Sha256: 3a4302f76790937da75a35521112c6955c5042894307388610c12d430bc3c12d

Contents?: true

Size: 929 Bytes

Versions: 22

Compression:

Stored size: 929 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Conferences
    # This cell renders the media link card for an instance of a MediaLink
    class PhotoCell < Decidim::ViewModel
      include Decidim::ApplicationHelper
      include Decidim::SanitizeHelper

      def show
        render
      end

      private

      def index
        @options[:index]
      end

      def image_thumb
        image_tag model.thumbnail_url, alt: t("alt", scope: "decidim.conferences.photo.image.attributes")
      end

      def image_big
        image_tag model.big_url, alt: t("alt", scope: "decidim.conferences.photo.image.attributes")
      end

      def title
        translated_attribute model.title
      end

      def short_description
        decidim_sanitize html_truncate(description, length: 100, separator: "...")
      end

      def description
        translated_attribute(model.description)
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
decidim-conferences-0.25.2 app/cells/decidim/conferences/photo_cell.rb
decidim-conferences-0.25.1 app/cells/decidim/conferences/photo_cell.rb
decidim-conferences-0.25.0 app/cells/decidim/conferences/photo_cell.rb
decidim-conferences-0.25.0.rc4 app/cells/decidim/conferences/photo_cell.rb
decidim-conferences-0.25.0.rc3 app/cells/decidim/conferences/photo_cell.rb
decidim-conferences-0.25.0.rc2 app/cells/decidim/conferences/photo_cell.rb
decidim-conferences-0.25.0.rc1 app/cells/decidim/conferences/photo_cell.rb
decidim-conferences-0.24.3 app/cells/decidim/conferences/photo_cell.rb
decidim-conferences-0.23.6 app/cells/decidim/conferences/photo_cell.rb
decidim-conferences-0.24.2 app/cells/decidim/conferences/photo_cell.rb
decidim-conferences-0.23.5 app/cells/decidim/conferences/photo_cell.rb
decidim-conferences-0.24.1 app/cells/decidim/conferences/photo_cell.rb
decidim-conferences-0.24.0 app/cells/decidim/conferences/photo_cell.rb
decidim-conferences-0.24.0.rc2 app/cells/decidim/conferences/photo_cell.rb
decidim-conferences-0.23.4 app/cells/decidim/conferences/photo_cell.rb
decidim-conferences-0.24.0.rc1 app/cells/decidim/conferences/photo_cell.rb
decidim-conferences-0.23.3 app/cells/decidim/conferences/photo_cell.rb
decidim-conferences-0.23.2 app/cells/decidim/conferences/photo_cell.rb
decidim-conferences-0.23.1 app/cells/decidim/conferences/photo_cell.rb
decidim-conferences-0.23.1.rc1 app/cells/decidim/conferences/photo_cell.rb