Sha256: df110f9cbfd8d84f1906f715de89c9c07bd07555d8b2804ef007251e80849eed
Contents?: true
Size: 980 Bytes
Versions: 18
Compression:
Stored size: 980 Bytes
Contents
# frozen_string_literal: true module Decidim module CellsHelper def from_context options[:from].presence || context[:from].presence end def index_action? context[:controller].action_name == "index" end def show_action? context[:controller].action_name == "show" end def current_component from_context.component end def withdrawable? return unless from_context return unless context[:controller].try(:withdrawable_controller?) return if index_action? from_context.withdrawable_by?(current_user) end def flaggable? return unless from_context return unless context[:controller].try(:flaggable_controller?) return if index_action? true end def user_flaggable? return if (try(:profile_holder) || try(:profile_user) || try(:model)).try(:blocked) return unless context[:controller].try(:flaggable_controller?) true end end end
Version data entries
18 entries across 18 versions & 1 rubygems