Sha256: 6c73f15358d35e6818e61771fd4d28ce5b051f4c5a5c649bbf7435fe5ede7b0e

Contents?: true

Size: 1.32 KB

Versions: 23

Compression:

Stored size: 1.32 KB

Contents

=begin
  Camaleon CMS is a content management system
  Copyright (C) 2015 by Owen Peredo Diaz
  Email: owenperedo@gmail.com
  This program is free software: you can redistribute it and/or modify   it under the terms of the GNU Affero General Public License as  published by the Free Software Foundation, either version 3 of the  License, or (at your option) any later version.
  This program is distributed in the hope that it will be useful,  but WITHOUT ANY WARRANTY; without even the implied warranty of  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  See the  GNU Affero General Public License (GPLv3) for more details.
=end
module Admin::BreadcrumbHelper
# draw html admin breadcrumb
  def admin_breadcrumb_draw
    res = []
    @_admin_breadcrumb.each_with_index do |item, index|
      if @_admin_breadcrumb.size == (index+1) #last menu
        res << "<li class='active'>#{item[0]}</li>"
      else
        res << "<li><a href='#{item[1]}'>#{item[0]}</a></li>"
      end
    end
    res.join("")
  end

  def admin_title_draw
    res = []
    @_admin_breadcrumb.each_with_index do |item, index|
      res << item[0]
    end
    res.join(" &raquo; ")
  end

  # add breadcrumb item at the end
  # label => label of the link
  # url: url for the link
  def admin_breadcrumb_add(label, url = "")
    @_admin_breadcrumb << [label, url]
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
camaleon_cms-1.1.0 app/helpers/admin/breadcrumb_helper.rb
camaleon_cms-1.0.9 app/helpers/admin/breadcrumb_helper.rb
camaleon_cms-1.0.8 app/helpers/admin/breadcrumb_helper.rb
camaleon_cms-1.0.7 app/helpers/admin/breadcrumb_helper.rb
camaleon_cms-1.0.6 app/helpers/admin/breadcrumb_helper.rb
camaleon_cms-1.0.5 app/helpers/admin/breadcrumb_helper.rb
camaleon_cms-1.0.4 app/helpers/admin/breadcrumb_helper.rb
camaleon_cms-1.0.3 app/helpers/admin/breadcrumb_helper.rb
camaleon_cms-1.0.2 app/helpers/admin/breadcrumb_helper.rb
camaleon_cms-1.0.1 app/helpers/admin/breadcrumb_helper.rb
camaleon_cms-1.0 app/helpers/admin/breadcrumb_helper.rb
camaleon_cms-0.2.1 app/helpers/admin/breadcrumb_helper.rb
camaleon_cms-0.2.0 app/helpers/admin/breadcrumb_helper.rb
camaleon_cms-0.1.9 app/helpers/admin/breadcrumb_helper.rb
camaleon_cms-0.1.8 app/helpers/admin/breadcrumb_helper.rb
camaleon_cms-0.1.7 app/helpers/admin/breadcrumb_helper.rb
camaleon_cms-0.1.6 app/helpers/admin/breadcrumb_helper.rb
camaleon_cms-0.1.5 app/helpers/admin/breadcrumb_helper.rb
camaleon_cms-0.1.4 app/helpers/admin/breadcrumb_helper.rb
camaleon_cms-0.1.3 app/helpers/admin/breadcrumb_helper.rb