bjornblomqvist-breadcrumb_trail 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2008 [name of plugin creator]
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README ADDED
@@ -0,0 +1,33 @@
1
+ Breadcrumb Trail
2
+ ================
3
+
4
+ Adds a breadcrumb trail to your Rails application.
5
+
6
+ In your action:
7
+
8
+ add_crumb :label => 'Admin', :link => administrators_path
9
+ add_crumb :label => 'Users', :link => admin_users_path
10
+ add_crumb :label => @user.name
11
+
12
+ In your layout or view:
13
+
14
+ <%= crumbs %>
15
+
16
+ Generates something like:
17
+
18
+ <ol class="breadcrumb">
19
+ <li class="first"><a href="/">Home</a></li>
20
+ <li><a href="/administrators">Admin</a></li>
21
+ <li><a href="/admin/users">Users</a></li>
22
+ <li>Nigel Ramsay</li>
23
+ </ol>
24
+
25
+ Style
26
+ -----
27
+
28
+ You should use CSS to style the breadcrumb trail. See the example in public/stylesheets.
29
+
30
+ Copyright (c) 2008 Able Technology Limited (http://www.abletech.co.nz/blog), released under the MIT license
31
+
32
+
33
+ Gemified by Björn Blomqvist
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.1.8
@@ -0,0 +1,6 @@
1
+ module BreadcrumbTrail
2
+ def add_crumb(crumb)
3
+ @crumbs ||= [:link => root_path, :label => 'Home', :class => 'first']
4
+ @crumbs << crumb
5
+ end
6
+ end
@@ -0,0 +1,14 @@
1
+ module BreadcrumbTrailHelper
2
+ def crumbs
3
+ if @crumbs
4
+ list_items = String.new
5
+
6
+ @crumbs.each do |c|
7
+ list_items << content_tag(:li, link_to(h(c[:label]), c[:link]), :class => c[:class]) if c[:link]
8
+ list_items << content_tag(:li, h(c[:label]), :class => c[:class]) unless c[:link]
9
+ end
10
+
11
+ content_tag :ol, list_items, :class => 'breadcrumb'
12
+ end
13
+ end
14
+ end
Binary file
@@ -0,0 +1,16 @@
1
+ /* breadcrumb */
2
+
3
+ ol.breadcrumb {
4
+ margin: 0;
5
+ }
6
+
7
+ ol.breadcrumb li {
8
+ display: inline;
9
+ padding: 0 3px 0 15px;
10
+ background: transparent url(/images/greater_than.gif) left center no-repeat;
11
+ }
12
+
13
+ ol.breadcrumb li.first {
14
+ padding-left: 0;
15
+ background: none;
16
+ }
data/rails/init.rb ADDED
@@ -0,0 +1,2 @@
1
+ ActionController::Base.send :include, BreadcrumbTrail
2
+ ActionView::Base.send :include, BreadcrumbTrailHelper
@@ -0,0 +1,8 @@
1
+ require 'test/unit'
2
+
3
+ class BreadcrumbTrailTest < Test::Unit::TestCase
4
+ # Replace this with your real tests.
5
+ def test_this_plugin
6
+ assert(true, "Replace with actual test")
7
+ end
8
+ end
metadata ADDED
@@ -0,0 +1,62 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: bjornblomqvist-breadcrumb_trail
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.8
5
+ platform: ruby
6
+ authors:
7
+ - Able Technology Limited
8
+ - Darwin
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+
13
+ date: 2009-10-15 00:00:00 +02:00
14
+ default_executable:
15
+ dependencies: []
16
+
17
+ description: Adds a breadcrumb trail to your Rails application.
18
+ email: darwin.git@marianna.se
19
+ executables: []
20
+
21
+ extensions: []
22
+
23
+ extra_rdoc_files:
24
+ - README
25
+ files:
26
+ - MIT-LICENSE
27
+ - README
28
+ - VERSION
29
+ - lib/breadcrumb_trail.rb
30
+ - lib/breadcrumb_trail_helper.rb
31
+ - public/images/greater_than.gif
32
+ - public/stylesheets/breadcrumb_trail.css
33
+ - rails/init.rb
34
+ - test/breadcrumb_trail_test.rb
35
+ has_rdoc: true
36
+ homepage: http://github.com/bjornblomqvist/breadcrumb_trail
37
+ post_install_message:
38
+ rdoc_options:
39
+ - --charset=UTF-8
40
+ require_paths:
41
+ - lib
42
+ required_ruby_version: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: "0"
47
+ version:
48
+ required_rubygems_version: !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ version: "0"
53
+ version:
54
+ requirements: []
55
+
56
+ rubyforge_project:
57
+ rubygems_version: 1.3.1
58
+ signing_key:
59
+ specification_version: 2
60
+ summary: Breadcrumb Trail
61
+ test_files:
62
+ - test/breadcrumb_trail_test.rb