Sha256: 089851ee73bbbcf358b1b3a811f26bc410daf310bff08555d787f5b6d739d5d2

Contents?: true

Size: 643 Bytes

Versions: 35

Compression:

Stored size: 643 Bytes

Contents

class Caboose::PostPlugin < Caboose::CaboosePlugin

  def self.admin_nav(nav, user, page)    
    return nav if user.nil? || !user.is_allowed('pages', 'view')
    
    item = {
      'id' => 'posts', 
      'text' => 'Posts',
      'children' => []      
      #'show_children_default' => true
    }
    item['children'] << { 
      'href' => "/admin/posts",
      'text' => 'New Post',
      'modal' => true 
    }
    if (user.is_allowed('posts', 'add'))
      item['children'] << { 
        'href' => "/admin/posts/new",
        'text' => 'New Post',
        'modal' => true 
      }
    end    
    nav << item
    return nav
  end
  
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
caboose-cms-0.2.66 app/models/caboose/post_plugin.rb
caboose-cms-0.2.65 app/models/caboose/post_plugin.rb
caboose-cms-0.2.64 app/models/caboose/post_plugin.rb
caboose-cms-0.2.62 app/models/caboose/post_plugin.rb
caboose-cms-0.2.57 app/models/caboose/post_plugin.rb
caboose-cms-0.2.55 app/models/caboose/post_plugin.rb
caboose-cms-0.2.54 app/models/caboose/post_plugin.rb
caboose-cms-0.2.52 app/models/caboose/post_plugin.rb
caboose-cms-0.2.50 app/models/caboose/post_plugin.rb
caboose-cms-0.2.49 app/models/caboose/post_plugin.rb
caboose-cms-0.2.48 app/models/caboose/post_plugin.rb
caboose-cms-0.2.47 app/models/caboose/post_plugin.rb
caboose-cms-0.2.46 app/models/caboose/post_plugin.rb
caboose-cms-0.2.45 app/models/caboose/post_plugin.rb
caboose-cms-0.2.44 app/models/caboose/post_plugin.rb
caboose-cms-0.2.43 app/models/caboose/post_plugin.rb
caboose-cms-0.2.42 app/models/caboose/post_plugin.rb
caboose-cms-0.2.41 app/models/caboose/post_plugin.rb
caboose-cms-0.2.40 app/models/caboose/post_plugin.rb
caboose-cms-0.2.39 app/models/caboose/post_plugin.rb