Sha256: 1e17c87daf1051e23fdacf375dff04156cd7ab2245b0554b39dacd12ce61fff5

Contents?: true

Size: 800 Bytes

Versions: 6

Compression:

Stored size: 800 Bytes

Contents

# frozen_string_literal: true

module Decidim
  class VersionsListItemCell < Decidim::ViewModel
    def version
      model
    end

    def versioned_resource
      options[:versioned_resource]
    end

    def index
      total - options[:index]
    end

    def total
      options[:total]
    end

    def version_path
      options[:version_path].call(index)
    end

    def i18n_version_index
      i18n("version_index", index:, total:)
    end

    def i18n(string, **)
      t(string, **, scope: i18n_scope, default: t(string, **, scope: default_i18n_scope))
    end

    def i18n_scope
      options[:i18n_scope]
    end

    def default_i18n_scope
      "decidim.versions_list_item.show"
    end

    def html_options
      @html_options ||= options[:html_options] || {}
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
decidim-core-0.29.1 app/cells/decidim/versions_list_item_cell.rb
decidim-core-0.29.0 app/cells/decidim/versions_list_item_cell.rb
decidim-core-0.29.0.rc4 app/cells/decidim/versions_list_item_cell.rb
decidim-core-0.29.0.rc3 app/cells/decidim/versions_list_item_cell.rb
decidim-core-0.29.0.rc2 app/cells/decidim/versions_list_item_cell.rb
decidim-core-0.29.0.rc1 app/cells/decidim/versions_list_item_cell.rb