Sha256: a95f2f140cb4bf2d6818d694743ce58ddfbee96660a7a85cc4b9e6da8454b1eb
Contents?: true
Size: 828 Bytes
Versions: 14
Compression:
Stored size: 828 Bytes
Contents
require 'omf-web/theme/bright/layout_renderer' module OMF::Web::Theme class FlowRenderer < LayoutRenderer def initialize(layout_widget, widgets, opts) super opts @layout_widget = layout_widget @widgets = widgets || [] @opts = opts end def content # This is a very simple way of determining the width settings. width = (100 / @widgets.size).to_i div :class => 'flow_layout' do @widgets.each do |w| div :class => 'flow_layout_single', :style => "width:#{width}%; float:left" do render_widget w end end end end def render_widget(w) r = w.content unless w.layout? r = WidgetChrome.new(w, r, @opts) end rawtext r.to_html end end end
Version data entries
14 entries across 14 versions & 1 rubygems