Sha256: 33cfadef19f85a5684d5eeffdc28d75ff8f18d6b246b09e90989962d4c1f2ce0

Contents?: true

Size: 609 Bytes

Versions: 16

Compression:

Stored size: 609 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Plans
    module CellsHelper
      def plans_controller?
        context[:controller].class.to_s == "Decidim::Plans::PlansController"
      end

      def withdrawable?
        return unless from_context
        return unless plans_controller?
        return if index_action?
        from_context.withdrawable_by?(current_user)
      end

      def flagable?
        return unless from_context
        return unless plans_controller?
        return if index_action?
        return if from_context.try(:official?)
        true
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
decidim-plans-0.18.2 app/helpers/decidim/plans/cells_helper.rb
decidim-plans-0.18.1 app/helpers/decidim/plans/cells_helper.rb
decidim-plans-0.18.0 app/helpers/decidim/plans/cells_helper.rb
decidim-plans-0.17.0 app/helpers/decidim/plans/cells_helper.rb
decidim-plans-0.16.9 app/helpers/decidim/plans/cells_helper.rb
decidim-plans-0.16.8 app/helpers/decidim/plans/cells_helper.rb
decidim-plans-0.16.7 app/helpers/decidim/plans/cells_helper.rb
decidim-plans-0.16.6 app/helpers/decidim/plans/cells_helper.rb
decidim-plans-0.16.5 app/helpers/decidim/plans/cells_helper.rb
decidim-plans-0.16.4 app/helpers/decidim/plans/cells_helper.rb
decidim-plans-0.16.3 app/helpers/decidim/plans/cells_helper.rb
decidim-plans-0.16.2 app/helpers/decidim/plans/cells_helper.rb
decidim-plans-0.16.1 app/helpers/decidim/plans/cells_helper.rb
decidim-plans-0.16.0 app/helpers/decidim/plans/cells_helper.rb
decidim-plans-0.15.1 app/helpers/decidim/plans/cells_helper.rb
decidim-plans-0.15.0 app/helpers/decidim/plans/cells_helper.rb