<div id="edit-layout" class="admin">
<p class="note">Click to choose the layout: </p><br/>
- <!--100%-->
- <div class="select-layout <%= 'selected' if @dashboard.layout=='100' -%>" style="text-align:center;width: 20%;">
- <%= link_to image_tag('layout100.png'), {:action => 'set_layout', :did => @dashboard.id, :id => @resource.id, :layout => "100"}, :method => :post %>
+
+ <div class="select-layout <%= 'selected' if @dashboard.layout=='100%' -%>" style="text-align:center;width: 20%;">
+ <%= link_to image_tag('layout100.png'), {:action => 'set_layout', :did => @dashboard.id, :id => @resource.id, :layout => "100%"}, :method => :post %>
</div>
- <!--50%-50%-->
- <div class="select-layout <%= 'selected' if @dashboard.layout=="50-50" -%>" style="text-align:center;width: 20%;">
- <%= link_to image_tag('layout5050.png'), {:action => 'set_layout', :did => @dashboard.id, :id => @resource.id, :layout => "50-50"}, :method => :post %>
+
+ <div class="select-layout <%= 'selected' if @dashboard.layout=="50%-50%" -%>" style="text-align:center;width: 20%;">
+ <%= link_to image_tag('layout5050.png'), {:action => 'set_layout', :did => @dashboard.id, :id => @resource.id, :layout => "50%-50%"}, :method => :post %>
</div>
- <!--30%-70%-->
- <div class="select-layout <%= 'selected' if @dashboard.layout=="30-70" -%>" style="text-align:center;width: 20%;">
- <%= link_to image_tag('layout3070.png'), {:action => 'set_layout', :did => @dashboard.id, :id => @resource.id, :layout => "30-70"}, :method => :post %>
+
+ <div class="select-layout <%= 'selected' if @dashboard.layout=="30%-70%" -%>" style="text-align:center;width: 20%;">
+ <%= link_to image_tag('layout3070.png'), {:action => 'set_layout', :did => @dashboard.id, :id => @resource.id, :layout => "30%-70%"}, :method => :post %>
</div>
- <!--70%-30%-->
- <div class="select-layout <%= 'selected' if @dashboard.layout=="70-30" -%>" style="text-align:center;width: 20%;">
- <%= link_to image_tag('layout7030.png'), {:action => 'set_layout', :did => @dashboard.id, :id => @resource.id, :layout => "70-30"}, :method => :post %>
+
+ <div class="select-layout <%= 'selected' if @dashboard.layout=="70%-30%" -%>" style="text-align:center;width: 20%;">
+ <%= link_to image_tag('layout7030.png'), {:action => 'set_layout', :did => @dashboard.id, :id => @resource.id, :layout => "70%-30%"}, :method => :post %>
</div>
- <!--33%-33%-33%-->
- <div class="select-layout <%= 'selected' if @dashboard.layout=="33-33-33" -%>" style="text-align:center;width: 19%;">
- <%= link_to image_tag('layout333333.png'), {:action => 'set_layout', :did => @dashboard.id, :id => @resource.id, :layout => "33-33-33"}, :method => :post %>
+
+ <div class="select-layout <%= 'selected' if @dashboard.layout=="33%-33%-33%" -%>" style="text-align:center;width: 19%;">
+ <%= link_to image_tag('layout333333.png'), {:action => 'set_layout', :did => @dashboard.id, :id => @resource.id, :layout => "33%-33%-33%"}, :method => :post %>
</div>
<div style="clear:both;"></div>
</div>
columns=@dashboard.column_layout.split('-')
for index in 1..columns.size()
%>
- <div class="dashboard-column-wrapper" style="width: <%= (columns.size()>0) ? columns[index-1].to_i : 100 %>%; clear: right;">
- <div class="dashboard-column" id="dashboard-column-<%= index -%>" style="margin: 0px <%= index<columns.size() ? "5px" : "0px" %> 0px <%= index>1 ? "5px" : "0px" %>;">
+ <div class="dashboard-column-wrapper" style="width: <%= columns[index-1] -%>; ">
+ <div class="dashboard-column" id="dashboard-column-<%= index -%>" style="margin: 0px <%= index<columns.size() ? "5px" : "0px" -%> 0px <%= index>1 ? "5px" : "0px" -%>;">
<%
@dashboard.widgets.select{|widget| widget.column_index==index}.sort_by{|widget| widget.row_index}.each do |widget|
widget_definition=@widget_definitions.find{|wd| wd.getId()==widget.widget_key }
private
def self.create_dashboard
- dashboard=::Dashboard.new(:name => 'Dashboard', :shared => true, :description => 'Default dashboard', :column_layout => "50-50")
+ dashboard=::Dashboard.new(:name => 'Dashboard', :shared => true, :description => 'Default dashboard', :column_layout => Dashboard::DEFAULT_LAYOUT)
dashboard.widgets.build(:widget_key => 'static_analysis', :name => 'Static analysis', :column_index => 1, :row_index => 1, :configured => true)
dashboard.widgets.build(:widget_key => 'comments_duplications', :name => 'Comments duplications', :column_index => 1, :row_index => 2, :configured => true)
dashboard.widgets.build(:widget_key => 'extended_analysis', :name => 'Extended analysis', :column_index => 1, :row_index => 3, :configured => true)