# CytoTable Helper def CytoTable(options={}) if block_given? options = Cytoplasm::addClass(options,"cytoTable") content_tag("table",options) do yield CytoTableHelper.new end else end end class CytoTableHelper include ActionView::Helpers::TagHelper def tr(html="",options={}) if html.is_a? Hash options = html html = "" end html = yield if block_given? content_tag("tr",html,options) end def td(html="",type=nil,options={}) html = yield if block_given? if html.is_a? Hash options = html html = "" elsif type.is_a? Hash options = type type = nil end if type.is_a? String options[:data] ||= {} options[:data][:type] ||= type end content_tag("td",html,options) end def fullsize_row(html="",options={}) html = yield if block_given? tr(options){td(html,nil,{:colspan => "100"})} end def header_row(html="Title",tag="h3",options={}) options[:data] ||= {} options[:data][:type] ||= "header" fullsize_row content_tag(tag,html) end def button_row(html="Submit",options={}) fullsize_row CytoButton(html,options) end end