diff --git a/app/views/chameleon/widgets/list.xml.erb b/app/views/chameleon/widgets/list.xml.erb new file mode 100644 index 0000000..9c901dd --- /dev/null +++ b/app/views/chameleon/widgets/list.xml.erb @@ -0,0 +1,16 @@ + + + <% @data.each do |entry| %> + + + + <text><![CDATA[<%=raw entry[:text] %>]]></text> + <highlight><%=entry[:highlight] %></highlight> + + ]]> + + <% end %> + diff --git a/doc/list_sample.rb b/doc/list_sample.rb new file mode 100644 index 0000000..96dac50 --- /dev/null +++ b/doc/list_sample.rb @@ -0,0 +1,18 @@ +widget :somethings do + #key some_key + type "list" + a = [] + data do + Somethings.scope_of_interest.each do |s| + a << { + :name => s.suitable_field_for_name + :color => 'red', # or whichever + :text => s.suitable_field_for_text, + :highlight => true, # or not + :description => s.suitable_field_for_description + } + end + a + end +end +