<%= select 'page_part', 'widget_style', @frontend_styles, {:selected => (@part && @part[:widget_style])}, class: "input-xlarge" %>
<% @module_app.widget_options.tap { |widget|%>
<% widget.each { |w|%>
<% w.get_options.each do |key, settings| %>
<% options = settings[:opts] %>
<%= label_tag(t(settings[:label_i18n], :class=>"control-label muted"))%>
<% case options%>
<% when Hash%>
<%= select_tag "page_part[widget_options][#{key}]", options_from_collection_for_select(eval(options["query"]), options["value"], options["label"].to_s, :selected => (@part.widget_options[key] rescue nil)), class: "input-xlarge" %>
<% else%>
<%= select_tag "page_part[widget_options][#{key}]", options_for_select(options,(@part.widget_options[key] rescue nil)), class: "input-xlarge" %>
<% end %>
<% end %>
<% } %>
<% } %>