Sha256: 6b1d09e3061db46bd257a0b9adc11d6fe8d45c53a011065f12a4fb58ec2f95bb
Contents?: true
Size: 1 KB
Versions: 10
Compression:
Stored size: 1 KB
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 context[:controller].try(: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
10 entries across 10 versions & 1 rubygems