<div class="control-group input-content">
  <label class="control-label muted"><%= t("default_widget.select_widget_style") %></label>
  <div class="controls">
    <%= select 'page_part', 'widget_style', @frontend_styles, {:selected => (@part && @part[:widget_style])}, class: "input-xlarge" %>
  </div>
</div>

<div class="control-group input-content">
<% @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%>
            <div class="controls">
            <%= 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" %>
            </div>
           <% else%>
            <div class="controls">
            <%= select_tag "page_part[widget_options][#{key}]", options_for_select(options,(@part.widget_options[key] rescue nil)), class: "input-xlarge" %>
          <% end %>
          </div>
        <% end %>
   <% } %>
<% } %>
</div>