Sha256: 5626528f53cf9a67871cadd5172d1872ae47a885f7fc5cb09e811380fddd40c0

Contents?: true

Size: 542 Bytes

Versions: 5

Compression:

Stored size: 542 Bytes

Contents

# * George Moschovitis  <gm@navel.gr>
# (c) 2004-2005 Navel, all rights reserved.
# $Id: tabs.rb 1 2005-04-11 11:04:30Z gmosx $

module Nitro

	# Render a tabs bar

	def self.tabs(request, options, param)
		tabs = []
	
		selected = request.get(param, 0)
		
		options.each_with_index { |opt, idx|
			if idx == selected
				tabs << %|<strong>#{opt}</strong>|
			else
				tabs << %|<a href="#{request.expand_uri(param => idx)}">#{opt}</a>|
			end
		}
		
		return %|<div class="tabs">#{tabs.join('<span class="sep">|</span>')}</div>| 
	end
	
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
nitro-0.16.0 lib/nitro/ui/tabs.rb
nitro-0.17.0 lib/nitro/ui/tabs.rb
nitro-0.18.0 lib/nitro/ui/tabs.rb
nitro-0.18.1 lib/nitro/ui/tabs.rb
nitro-0.19.0 lib/nitro/ui/tabs.rb