Sha256: d33a2faec3598f8b2fc33c9a2340de728cfd5180149d1add3edca2842005266d
Contents?: true
Size: 890 Bytes
Versions: 26
Compression:
Stored size: 890 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 unless context[:controller].try(:flaggable_controller?) true end end end
Version data entries
26 entries across 26 versions & 1 rubygems