app/views/module_projects/_module_project_view_configurations.html.erb
<%= simple_form_for(@module_project) do |f| %>
<% if @module_project.errors.any? %>
<div id="error_explanation" xmlns="http://www.w3.org/1999/html" xmlns="http://www.w3.org/1999/html">
<h2><%= pluralize(@module_project.errors.count, 'error') %> prohibited this module_project from being saved:</h2>
<ul>
<% @module_project.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>
<%= f.input :color, label: I18n.t(:status_color), input_html: {class: "basic pull-left", type: 'color', value: @module_project.color || '#D3D3D3'} %> <br>
<div class="row" style="margin-top: 20px; margin-bottom: 20px;">
<div class="span-8"><%= "#{I18n.t(:current_view)} : " %> <%= @module_project.view.nil? ? "-" : @module_project.view %></div>
<% is_default_view = @module_project.view.nil? ? false : @module_project.view.is_default_view %>
<div class="span-4"><%= check_box_tag "is_default_view", is_default_view, is_default_view, disabled: is_default_view %> <%= I18n.t(:define_as_default_view) %> </div>
</div>
<div style="margin-bottom: 10px;">
<%= link_to "#{I18n.t(:change_current_view)} >>", "#", id: "show_table_module_view_list", remote: true %>
<%= link_to "#{I18n.t(:save_as_another_view)} >>", "#", id: "save_current_view_as", class:"pull-right", remote: true %>
</div>
<div id="show_div_for_save_as">
<table>
<tr>
<td><label><%= I18n.t(:view_name) %></label></td>
<td> <%= text_field_tag "view_name", "" %></td>
</tr>
<tr>
<td><%= I18n.t(:view_description) %></td>
<td><%= text_area_tag "view_description", "", rows: 5, class: "input-xxlarge" %></td>
</tr>
</table>
</div>
<div id="table_module_view_list">
<table class="table table-striped table-bordered table-condensed">
<tr>
<th><%= I18n.t(:selected_view) %></th>
<th><%= I18n.t(:name) %></th>
<th><%= I18n.t(:description) %></th>
<th><%= I18n.t(:widgets) %></th>
</tr>
<% @corresponding_views.each do |view| %>
<tr class="">
<td class="center"><%= f.radio_button :view_id, view.id, :checked => @module_project.view == view %></td>
<td><%= view.name %></td>
<td><%= view.description %></td>
<td><%= view.views_widgets.join('; ') %></td>
</tr>
<% end %>
</table>
</div>
<div style="margin-top: 30px;">
<%= f.submit I18n.t('label_save'), name: 'save', class: 'btn', id: 'save_view_button' %>
<%= f.submit I18n.t('save_as'), name: 'save_as', class: 'btn', id: 'save_as_view_button' %>
<button class="btn" data-dismiss="modal" aria-hidden="true"><%= I18n.t(:close) %></button>
</div>
<% end %>