Sha256: fe8d7be6ce52229d7ac8c03b417c1d6de7e76d40ae143a578f4b45f6ff7a0236

Contents?: true

Size: 888 Bytes

Versions: 34

Compression:

Stored size: 888 Bytes

Contents

# frozen_string_literal: true

module Decidim
  class VersionsListItemCell < Decidim::ViewModel
    include Decidim::TraceabilityHelper
    include Decidim::LayoutHelper

    def version
      model
    end

    def versioned_resource
      options[:versioned_resource]
    end

    def index
      options[:index] + 1
    end

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

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

    def i18n(string, params = {})
      t(
        string,
        params.merge(
          scope: i18n_scope,
          default: t(
            string,
            params.merge(
              scope: default_i18n_scope
            )
          )
        )
      )
    end

    def i18n_scope
      options[:i18n_scope]
    end

    def default_i18n_scope
      "decidim.versions_list_item.show"
    end
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
decidim-core-0.26.10 app/cells/decidim/versions_list_item_cell.rb
decidim-core-0.26.9 app/cells/decidim/versions_list_item_cell.rb
decidim-core-0.26.8 app/cells/decidim/versions_list_item_cell.rb
decidim-core-0.26.7 app/cells/decidim/versions_list_item_cell.rb
decidim-core-0.26.5 app/cells/decidim/versions_list_item_cell.rb
decidim-core-0.26.4 app/cells/decidim/versions_list_item_cell.rb
decidim-core-0.26.3 app/cells/decidim/versions_list_item_cell.rb
decidim-core-0.26.2 app/cells/decidim/versions_list_item_cell.rb
decidim-core-0.26.1 app/cells/decidim/versions_list_item_cell.rb
decidim-core-0.26.0 app/cells/decidim/versions_list_item_cell.rb
decidim-core-0.26.0.rc2 app/cells/decidim/versions_list_item_cell.rb
decidim-core-0.26.0.rc1 app/cells/decidim/versions_list_item_cell.rb
decidim-core-0.25.2 app/cells/decidim/versions_list_item_cell.rb
decidim-core-0.25.1 app/cells/decidim/versions_list_item_cell.rb
decidim-core-0.25.0 app/cells/decidim/versions_list_item_cell.rb
decidim-core-0.25.0.rc4 app/cells/decidim/versions_list_item_cell.rb
decidim-core-0.25.0.rc3 app/cells/decidim/versions_list_item_cell.rb
decidim-core-0.25.0.rc2 app/cells/decidim/versions_list_item_cell.rb
decidim-core-0.25.0.rc1 app/cells/decidim/versions_list_item_cell.rb
decidim-core-0.24.3 app/cells/decidim/versions_list_item_cell.rb