Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions app/views/chameleon/widgets/list.xml.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<root>
<% @data.each do |entry| %>
<item>
<label>
<name><![CDATA[<%=raw entry[:name] %>]]></name>
<color><%=entry[:color] %></color>
</label>
<title>
<text><![CDATA[<%=raw entry[:text] %>]]></text>
<highlight><%=entry[:highlight] %></highlight>
</title>
<description><![CDATA[<%=raw entry[:description] %>]]></description>
</item>
<% end %>
</root>
18 changes: 18 additions & 0 deletions doc/list_sample.rb
Original file line number Diff line number Diff line change
@@ -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