Sha256: 1981d3f174d02f6692693c53885e76fdfe0ba1093255324824e05719da236a44

Contents?: true

Size: 762 Bytes

Versions: 8

Compression:

Stored size: 762 Bytes

Contents

# frozen_string_literal: true

module Decidim
  class FollowingCell < Decidim::ViewModel
    include Decidim::CellsPaginateHelper
    include Decidim::ApplicationHelper
    include Decidim::Core::Engine.routes.url_helpers
    include Decidim::CardHelper

    def show
      render :show
    end

    def public_followings
      @public_followings ||= Kaminari.paginate_array(model.public_users_followings).page(params[:page]).per(20)
    end

    def non_public_followings?
      model.followings_blocked?
    end

    def validation_messages
      [].tap do |keys|
        keys << t("decidim.following.no_followings") if public_followings.blank?
        keys << t("decidim.following.non_public_followings") if non_public_followings?
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
decidim-core-0.28.5 app/cells/decidim/following_cell.rb
decidim-core-0.28.4 app/cells/decidim/following_cell.rb
decidim-core-0.28.3 app/cells/decidim/following_cell.rb
decidim-core-0.28.2 app/cells/decidim/following_cell.rb
decidim-core-0.28.1 app/cells/decidim/following_cell.rb
decidim-core-0.28.0 app/cells/decidim/following_cell.rb
decidim-core-0.28.0.rc5 app/cells/decidim/following_cell.rb
decidim-core-0.28.0.rc4 app/cells/decidim/following_cell.rb