dashboard.cannot_render_widget_x=Can not render widget {0}: {1}
dashboard.back_to_dashboard=Back to dashboard
dashboard.configure_widgets=Configure widgets
-dashboard.edit_layout=Edit layout
dashboard.manage_dashboards=Manage dashboards
dashboard.add_widget=Add widget
dashboard.please_configure_the_widget_x=Please configure the widget <b>{0}</b>.
end
end
- def edit_layout
- load_resource()
- load_dashboard()
- load_widget_definitions(@dashboard)
- unless @dashboard
- redirect_to home_path
- end
- end
-
def set_layout
dashboard=Dashboard.find(params[:did])
if dashboard.editable_by?(current_user)
widget.save
end
end
- redirect_to :action => 'edit_layout', :did => dashboard.id, :id => params[:id]
+ redirect_to :action => 'configure', :did => dashboard.id, :id => params[:id]
end
def set_dashboard
<% else %>
<% if @dashboard.editable_by?(current_user) %>
<li><%= link_to message('dashboard.configure_widgets'), dashboard_action(:configure) -%></li>
- <li><%= link_to message('dashboard.edit_layout'), dashboard_action(:edit_layout) -%></li>
<% end %>
<li class="last"><%= link_to message('dashboard.manage_dashboards'), {:controller => :dashboards, :action => :index, :resource => (@resource.id if @resource)} -%></li>
<% end %>
+++ /dev/null
-<script type="text/javascript">
- <!--
- var options = {
- editorEnabled:true,
- portal:'dashboard',
- column:'dashboard-column',
- columnhandle:'column-handle',
- block:'block',
- hoverclass:'block-hover',
- handleClass:'widget-handle',
- dashboardstate:'dashboardstate',
- toggle:'block-toggle',
- blocklist:'widget_defs',
- highlight_duration:2,
- highlight_startcolor:'#cae3f2',
- highlight_endcolor:'#ffffff',
- saveurl:'<%= url_for dashboard_action(:set_dashboard) -%>'
- };
- var portal;
- function init_dashboard() {
- portal = new Portal(options);
- <% if params[:highlight] %>
- portal.highlightWidget(<%= params[:highlight] -%>);
- <% end %>
- }
- Event.observe(window, 'load', init_dashboard, false);
-
- function filterWidgets(category) {
- new Ajax.Updater(
- 'widget_defs',
- '<%= add_category_to_url(url_for dashboard_action(:widget_definitions)) -%>' + encodeURIComponent(category),
- {asynchronous:true, evalScripts:true});
- $('filter-widgets-loading').show();
- return false;
- }
- //-->
-</script>
-<%= render :partial => 'script_configure' %>
-
<div id="dashboard">
<%= render :partial => 'header', :locals => {:back => true} %>
- <div id="widget_defs">
- <%= render :partial => 'widget_definitions', :locals => {:category => @category} -%>
+ <div id="configure">
+ <div id="widget_defs">
+ <%= render :partial => 'widget_definitions', :locals => {:category => @category} -%>
+ </div>
+
+ <div id="edit-layout">
+ <p><%= message('dashboard.click_to_choose_layout') -%>: </p>
+
+ <% {'100%', 'layout100.png',
+ '50%-50%', 'layout5050.png',
+ '30%-70%', 'layout3070.png',
+ '70%-30%', 'layout7030.png',
+ '33%-33%-33%', 'layout333333.png'
+ }.each_pair do |layout, picto| %>
+ <div class="select-layout <%= 'selected' if @dashboard.layout==layout -%>">
+ <%= link_to image_tag(picto), dashboard_action(:set_layout, :layout => layout), :method => :post %>
+ </div>
+ <% end %>
+ </div>
</div>
<%
</div>
</div>
<% end %>
- <div style="clear: both;"></div>
</div>
+
+<script type="text/javascript">
+ <!--
+ var options = {
+ editorEnabled:true,
+ portal:'dashboard',
+ column:'dashboard-column',
+ columnhandle:'column-handle',
+ block:'block',
+ hoverclass:'block-hover',
+ handleClass:'widget-handle',
+ dashboardstate:'dashboardstate',
+ toggle:'block-toggle',
+ blocklist:'widget_defs',
+ highlight_duration:2,
+ highlight_startcolor:'#cae3f2',
+ highlight_endcolor:'#ffffff',
+ saveurl:'<%= url_for dashboard_action(:set_dashboard) -%>'
+ };
+ var portal;
+ function init_dashboard() {
+ portal = new Portal(options);
+ <% if params[:highlight] %>
+ portal.highlightWidget(<%= params[:highlight] -%>);
+ <% end %>
+ }
+ Event.observe(window, 'load', init_dashboard, false);
+
+ function filterWidgets(category) {
+ new Ajax.Updater(
+ 'widget_defs',
+ '<%= add_category_to_url(url_for dashboard_action(:widget_definitions)) -%>' + encodeURIComponent(category),
+ {asynchronous:true, evalScripts:true});
+ $('filter-widgets-loading').show();
+ return false;
+ }
+ //-->
+</script>
+++ /dev/null
-<%= render :partial => 'script_configure' %>
-
-<div id="dashboard">
- <%= render :partial => 'header', :locals => {:back => true} %>
-
- <div id="edit-layout" class="admin">
- <p class="note"><%= message('dashboard.click_to_choose_layout') -%>: </p><br/>
-
- <% {'100%', 'layout100.png',
- '50%-50%', 'layout5050.png',
- '30%-70%', 'layout3070.png',
- '70%-30%', 'layout7030.png',
- '33%-33%-33%', 'layout333333.png'
- }.each_pair do |layout, picto| %>
- <div class="select-layout <%= 'selected' if @dashboard.layout==layout -%>" style="text-align:center;width: 20%;">
- <%= link_to image_tag(picto), dashboard_action(:set_layout, :layout => layout), :method => :post %>
- </div>
- <% end %>
-
- <div style="clear:both;"></div>
- </div>
-
- <div id="widget_defs" style="display: none;"></div>
-
- <%
- columns=@dashboard.column_layout.split('-')
- for index in 1..columns.size()
- %>
- <div class="dashboard-column-wrapper" style="width: <%= columns[index-1] -%>;margin: 0 -1px 0 0;">
- <div class="dashboard-column" id="dashboard-column-<%= index -%>" style="margin: 0 <%= index<columns.size() ? "5px" : "0px" -%> 0 <%= index>1 ? "5px" : "0px" -%>;">
- <div class="column-handle" style="display: none"></div>
-
- <%
- @dashboard.widgets.select { |widget| widget.column_index==index && widget.java_definition }.sort_by { |widget| widget.row_index }.each do |widget|
- %>
- <div class="block" id="block_<%= widget.id -%>">
- <%= render :partial => 'configure_widget', :locals => {:widget => widget} %>
- </div>
- <%
- end
- %>
- </div>
- </div>
- <% end %>
- <div style="clear: both;"></div>
-</div>
z-index: 1000;
}
-/* CONFIGURE LAYOUT */
-#dashboard .select-layout {
- text-align: center;
- float: left;
- margin: 0;
- padding: 0;
-}
-
-#dashboard .select-layout.selected img {
- border: 3px solid #4B9FD5;
-}
-
/* WIDGETS */
#dashboard .widget {
position: relative;
}
/*CONFIGURATION*/
+#dashboard #configure {
+ position: relative;
+ height: 260px;
+ margin: 5px 0 10px 0;
+}
+
+#dashboard #widget_defs, #dashboard #edit-layout {
+ height: 250px;
+ background-color: #FFF6BF;
+ border: 2px solid #FFD324;
+ padding: 3px;
+ -moz-border-radius: 3px;
+ -webkit-border-radius: 3px;
+}
+
#dashboard #widget_defs {
- height: 250px;
- overflow-y: auto;
- background-color: #FFF6BF;
- border: 2px solid #FFD324;
- padding: 3px;
- -moz-border-radius: 3px;
- -webkit-border-radius: 3px;
- margin: 5px 0 10px 0;
+ margin-right: 190px;
+ overflow-y: auto;
+}
+
+#dashboard #edit-layout {
+ width: 172px;
+ position: absolute;
+ right: 0;
+ top: 0;
+}
+
+#dashboard #edit-layout p {
+ margin-bottom: 5px;
}
#dashboard #widget_defs td {
text-decoration: none;
}
+#dashboard .select-layout {
+ float: left;
+}
+
+#dashboard .select-layout img {
+ border: 3px solid #FFF6BF;
+}
+
+#dashboard .select-layout.selected img {
+ border: 3px solid #4B9FD5;
+}
+
/*OPERATIONS*/
#dashboard #dashboard-operations {
position: relative;
box-shadow: 8px 8px 8px #ddd;
-moz-box-shadow: 8px 8px 8px #ddd;
-webkit-box-shadow: 8px 8px 8px #ddd;
-}
\ No newline at end of file
+}