Sha256: 1ae231261bb53d97bf28e7cf7b263bce17675ca7fc5f9121ad6b8296cb9c3251

Contents?: true

Size: 611 Bytes

Versions: 33

Compression:

Stored size: 611 Bytes

Contents

module PushType
  module NodesHelper

    def nodes_array(nodes)
      nodes.map { |n| node_hash(n) }
    end

    def node_hash(asset)
      hash = [ :type, :title, :slug, :status, :published_at, :published_to, :new_record?, :published? ].inject({}) do |h, att|
        h.update att => asset.send(att)
      end
    end

    def node_back_link(node)
      if node.trashed?
        push_type.trash_nodes_path
      elsif node.root?
        push_type.nodes_path
      else
        push_type.node_nodes_path(node.parent)
      end
    end

    def sortable?(node)
      !node || node.sortable?
    end

  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
push_type_admin-0.9.5 app/helpers/push_type/nodes_helper.rb
push_type_admin-0.9.3 app/helpers/push_type/nodes_helper.rb
push_type_admin-0.9.2 app/helpers/push_type/nodes_helper.rb
push_type_admin-0.9.1 app/helpers/push_type/nodes_helper.rb
push_type_admin-0.9.0 app/helpers/push_type/nodes_helper.rb
push_type_admin-0.9.0.beta.4 app/helpers/push_type/nodes_helper.rb
push_type_admin-0.9.0.beta.3 app/helpers/push_type/nodes_helper.rb
push_type_admin-0.9.0.beta.2 app/helpers/push_type/nodes_helper.rb
push_type_admin-0.8.2 app/helpers/push_type/nodes_helper.rb
push_type_admin-0.8.1 app/helpers/push_type/nodes_helper.rb
push_type_admin-0.8.0 app/helpers/push_type/nodes_helper.rb
push_type_admin-0.8.0.beta.3 app/helpers/push_type/nodes_helper.rb
push_type_admin-0.8.0.beta.2 app/helpers/push_type/nodes_helper.rb
push_type_admin-0.8.0.beta.1 app/helpers/push_type/nodes_helper.rb
push_type_admin-0.7.0 app/helpers/push_type/nodes_helper.rb
push_type_admin-0.7.0.beta.1 app/helpers/push_type/nodes_helper.rb
push_type_admin-0.6.0 app/helpers/push_type/nodes_helper.rb
push_type_admin-0.6.0.beta.4 app/helpers/push_type/nodes_helper.rb
push_type_admin-0.6.0.beta.3 app/helpers/push_type/nodes_helper.rb
push_type_admin-0.6.0.beta.2 app/helpers/push_type/nodes_helper.rb