[Ovirt-devel] [PATCH] Fix for flexigrid popups. (resend)
Scott Seago
sseago at redhat.com
Thu Aug 21 19:20:14 UTC 2008
Jason Guiditta wrote:
> These popups were sometimes too wide, this patch cleans that up.
>
> Also removed some columns from the hosts popup, as this was an
> additional issue causing things to be too wide.
>
> Signed-off-by: Jason Guiditta <jguiditt at redhat.com>
> ---
> wui/src/app/views/hardware/show_hosts.rhtml | 3 ++-
> wui/src/app/views/hardware/show_storage.rhtml | 3 ++-
> wui/src/app/views/host/_grid.rhtml | 23 ++++++++++++++---------
> wui/src/app/views/host/addhost.html.erb | 9 ++++++---
> wui/src/app/views/storage/_grid.rhtml | 3 +++
> wui/src/app/views/storage/add.rhtml | 2 +-
> wui/src/public/stylesheets/facebox.css | 2 +-
> 7 files changed, 29 insertions(+), 16 deletions(-)
>
> diff --git a/wui/src/app/views/hardware/show_hosts.rhtml b/wui/src/app/views/hardware/show_hosts.rhtml
> index f2962cb..2981440 100644
> --- a/wui/src/app/views/hardware/show_hosts.rhtml
> +++ b/wui/src/app/views/hardware/show_hosts.rhtml
> @@ -67,7 +67,8 @@
> :on_select => "hosts_select",
> :on_deselect => "load_widget_deselect",
> :on_hover => "load_widget_hover",
> - :on_unhover => "load_widget_unhover" } %>
> + :on_unhover => "load_widget_unhover",
> + :is_popup => false} %>
> </div>
> <div class="selection_detail" id="hosts_selection">
> <div class="selection_left">
> diff --git a/wui/src/app/views/hardware/show_storage.rhtml b/wui/src/app/views/hardware/show_storage.rhtml
> index 3446280..37af1ce 100644
> --- a/wui/src/app/views/hardware/show_storage.rhtml
> +++ b/wui/src/app/views/hardware/show_storage.rhtml
> @@ -67,7 +67,8 @@
> <%= render :partial => "/storage/grid", :locals => { :table_id => "storage_grid",
> :hwpool => @pool,
> :exclude_pool => nil,
> - :on_select => "storage_select" } %>
> + :on_select => "storage_select",
> + :is_popup => false} %>
> </div>
>
> <div class="selection_detail" id="storage_selection">
> diff --git a/wui/src/app/views/host/_grid.rhtml b/wui/src/app/views/host/_grid.rhtml
> index d3db182..14204b5 100644
> --- a/wui/src/app/views/host/_grid.rhtml
> +++ b/wui/src/app/views/host/_grid.rhtml
> @@ -1,6 +1,6 @@
> <%= render :partial => 'graph/load_graph.rhtml' %>
>
> -<% hosts_per_page = 40 %>
> +<% hosts_per_page.nil? ? hosts_per_page = 40: hosts_per_page = hosts_per_page %>
> <div id="<%= table_id %>_div">
> <%= "<form id=\"#{table_id}_form\">" if checkboxes %>
> <table id="<%= table_id %>" style="display:none"></table>
> @@ -17,18 +17,23 @@
> :exclude_host => exclude_host,
> :checkboxes => checkboxes %>',
> dataType: 'json',
> + <% if is_popup%>
> + width: 700,
> + <% end %>
> colModel : [
> <%= "{display: '', width : 20, align: 'left', process: #{table_id}checkbox}," if checkboxes %>
> {display: 'Hostname', name : 'hostname', width : 60, align: 'left'},
> <%= "{display: 'Hardware Pool', name : 'pools.name', width : 100, align: 'left'}," if exclude_pool %>
> - {display: 'UUID', name : 'uuid', width : 180, align: 'left'},
> - {display: 'Hypervisor', name : 'hypervisor_type', width : 60, align: 'left'},
> - {display: 'CPUs', name : 'num_cpus', width : 30, align: 'left'},
> - {display: 'Speed (MHz)', name : 'cpu_speed', width : 70, align: 'right'},
> - {display: 'Arch', name : 'arch', width : 50, align: 'right'},
> - {display: 'RAM (MB)', name : 'memory', width : 60, align: 'right'},
> - {display: 'Status', name : 'is_disabled', width : 110, align: 'right'},
> - {display: 'Load', name : 'load', width: 180, sortable : false, align: 'left', process: <%= table_id %>_load_widget }
> + {display: 'UUID', name : 'uuid', width : 180, align: 'left'}<% if !is_popup %>,<% end %>
> + <% if !is_popup %>
> + {display: 'Hypervisor', name : 'hypervisor_type', width : 60, align: 'left'},
> + {display: 'CPUs', name : 'num_cpus', width : 30, align: 'left'},
> + {display: 'Speed (MHz)', name : 'cpu_speed', width : 70, align: 'right'},
> + {display: 'Arch', name : 'arch', width : 50, align: 'right'},
> + {display: 'RAM (MB)', name : 'memory', width : 60, align: 'right'},
> + {display: 'Status', name : 'is_disabled', width : 110, align: 'right'},
> + {display: 'Load', name : 'load', width: 180, sortable : false, align: 'left', process: <%= table_id %>_load_widget }
> + <% end %>
> ],
> sortname: "hostname",
> sortorder: "asc",
> diff --git a/wui/src/app/views/host/addhost.html.erb b/wui/src/app/views/host/addhost.html.erb
> index 41b6213..7edd4c5 100644
> --- a/wui/src/app/views/host/addhost.html.erb
> +++ b/wui/src/app/views/host/addhost.html.erb
> @@ -4,9 +4,9 @@
> <%- content_for :description do -%>
> Select hosts from the list below to add to the <%= @hardware_pool.name %> hardware pool. <a href="#">Learn how to manage hosts</a>
> <%- end -%>
> -
> +<div id="dialog-content-area">
> +<div class="dialog_body_small">
> <div class="panel_header"></div>
> -<div class="dialog_body">
> <%= render :partial => "/host/grid", :locals => { :table_id => "addhosts_grid",
> :hwpool => nil,
> :exclude_pool => @hardware_pool.id,
> @@ -15,10 +15,13 @@
> :on_select => "load_widget_select",
> :on_deselect => "load_widget_deselect",
> :on_hover => "load_widget_hover",
> - :on_unhover => "load_widget_unhover" } %>
> + :on_unhover => "load_widget_unhover",
> + :is_popup => true,
> + :hosts_per_page => 10} %>
> </div>
>
> <%= popup_footer("add_hosts('#{url_for :controller => "hardware",
> :action => "add_hosts",
> :id => @hardware_pool}')",
> "Add Hosts") %>
> +</div>
> \ No newline at end of file
> diff --git a/wui/src/app/views/storage/_grid.rhtml b/wui/src/app/views/storage/_grid.rhtml
> index 3bdf407..c36f4d3 100644
> --- a/wui/src/app/views/storage/_grid.rhtml
> +++ b/wui/src/app/views/storage/_grid.rhtml
> @@ -11,6 +11,9 @@
> {
> url: '<%= url_for :controller => "hardware", :action => "storage_pools_json", :id => (hwpool.nil? ? nil : hwpool.id), :exclude_pool => exclude_pool %>',
> dataType: 'json',
> + <% if is_popup %>
> + width: 700,
> + <% end %>
> colModel : [
> {display: '', width : 20, align: 'left', process: <%= table_id %>checkbox},
> {display: 'Alias', width : 180, align: 'left'},
> diff --git a/wui/src/app/views/storage/add.rhtml b/wui/src/app/views/storage/add.rhtml
> index 11cda06..60176a0 100644
> --- a/wui/src/app/views/storage/add.rhtml
> +++ b/wui/src/app/views/storage/add.rhtml
> @@ -4,7 +4,7 @@
> <div class="panel_header"></div>
> <%= render :partial => "/storage/grid", :locals => { :table_id => "addstorage_grid",
> :hwpool => nil, :exclude_pool => @hardware_pool.id,
> - :on_select => "false" } %>
> + :on_select => "false", :is_popup => true } %>
> </div>
> <%= popup_footer("add_storage('#{url_for :controller => 'hardware',
> :action => 'add_storage',
> diff --git a/wui/src/public/stylesheets/facebox.css b/wui/src/public/stylesheets/facebox.css
> index 9c120f9..e8268a0 100644
> --- a/wui/src/public/stylesheets/facebox.css
> +++ b/wui/src/public/stylesheets/facebox.css
> @@ -69,7 +69,7 @@
> #facebox .tl, #facebox .tr, #facebox .bl, #facebox .br {
> height: 10px;
> width: 10px;
> - overflow: hidden;
> + overflow: auto;
> padding: 0;
> }
>
>
Looks good to me.
ACK
Scott
More information about the ovirt-devel
mailing list