From: Tomas Sedovic <tsedovic(a)redhat.com>
https://bugzilla.redhat.com/show_bug.cgi?id=720426
Since the styling for the filter table widgets is not done yet, they're hidden
by default.
The filter_table helper has been modified to make it more configurable so that
it can be used for tables with no checkboxes.
---
src/app/helpers/application_helper.rb | 6 +++++-
src/app/stylesheets/custom.scss | 8 ++++++++
src/app/views/deployments/_new.haml | 27 +++++++++++++--------------
src/app/views/layouts/_filter_table.haml | 25 ++++++++++++++-----------
4 files changed, 40 insertions(+), 26 deletions(-)
diff --git a/src/app/helpers/application_helper.rb
b/src/app/helpers/application_helper.rb
index 023e705..c6b3f73 100644
--- a/src/app/helpers/application_helper.rb
+++ b/src/app/helpers/application_helper.rb
@@ -116,6 +116,8 @@ module ApplicationHelper
def filter_table(columns, rows, options={}, &block)
_class = rows.first.try(:class) || Object
+ filter_widgets_opts = options[:show_filter_widgets]
+ select_togle_opts = options[:show_select_toggle]
render :partial => 'layouts/filter_table', :locals => {
# TODO - Right now saved_searches are not functional; this will need to be
expanded
:form_header => options[:form_header] ? options[:form_header] : '',
@@ -127,7 +129,9 @@ module ApplicationHelper
:columns => columns,
:lower_class => _class.to_s.tableize,
:block => block,
- :rows => rows
+ :rows => rows,
+ :show_filter_widgets => filter_widgets_opts.nil? ? false :
filter_widgets_opts,
+ :show_select_toggle => select_togle_opts.nil? ? true : select_togle_opts,
}
end
diff --git a/src/app/stylesheets/custom.scss b/src/app/stylesheets/custom.scss
index 67de91b..d6dab6a 100644
--- a/src/app/stylesheets/custom.scss
+++ b/src/app/stylesheets/custom.scss
@@ -59,3 +59,11 @@ footer.standard{
padding: 14px 14px 13px 14px;
}
}
+
+.deployable_details .content li {
+ list-style-type: none;
+}
+
+#deployable-xml-link {
+ color: #666;
+}
diff --git a/src/app/views/deployments/_new.haml b/src/app/views/deployments/_new.haml
index dbfffb8..8b36a9a 100644
--- a/src/app/views/deployments/_new.haml
+++ b/src/app/views/deployments/_new.haml
@@ -4,6 +4,13 @@
Deployment
= @deployment.name
#obj_actions.button-container
+ - form_for @deployment do
+ = hidden_field :deployment, :name
+ = hidden_field :deployment, :pool_id
+ = hidden_field :deployment, :frontend_realm_id
+ -# FIXME: Passing chunks of XML around in hidden form fields doesn't feel
right
+ = hidden_field :deployment, :deployable_xml
+ = submit_tag 'Launch this deployment', :class => 'button
primary', :id => 'launch_deployment'
= link_to 'Cancel', pool_path(@pool), :class => 'button danger',
:id => 'cancel_deployment_button'
.corner
@@ -20,6 +27,7 @@
%dt deployable definition
%dd= link_to('view', '#', :id =>
'deployable-xml-link')
+
%section.content-section.deployable_details
%header
%h2
@@ -35,18 +43,17 @@
Description:
= @deployment.deployable_xml.description
-%section.content-section.deployable_details
+%section.content-section.assemblies
%header
%h2
Assemblies
.content
- = filter_table([{:name => 'Assembly Name'},
- {:name => 'Hardware Profile'},
- {:name => 'Image ID'},
- {:name => 'Build ID'}],
- @deployment.deployable_xml.assemblies) do |assembly|
+ = filter_table([{:name => 'Assembly Name'}, {:name => 'Hardware
Profile'},
+ {:name => 'Image ID'}, {:name => 'Build ID'}],
+ @deployment.deployable_xml.assemblies,
+ :show_select_toggle => false) do |assembly|
%tr
%td
= assembly.name
@@ -57,12 +64,4 @@
%td
= assembly.image_build
- - form_for @deployment do
- = hidden_field :deployment, :name
- = hidden_field :deployment, :pool_id
- = hidden_field :deployment, :frontend_realm_id
- -# FIXME: Passing chunks of XML around in hidden form fields doesn't feel
right
- = hidden_field :deployment, :deployable_xml
- = submit_tag 'Launch', :class => 'button'
-
-# Quota checking to go here as well, once I understand how it works with new code
diff --git a/src/app/views/layouts/_filter_table.haml
b/src/app/views/layouts/_filter_table.haml
index b2d6d1c..f4c885c 100644
--- a/src/app/views/layouts/_filter_table.haml
+++ b/src/app/views/layouts/_filter_table.haml
@@ -1,21 +1,24 @@
- form_tag do
- if form_header
= form_header
- %p
- Viewing
- = select_tag("select_#{lower_class}",
saved_searches.join.html_safe,:disabled => true)
- = object_count.to_s + " results"
- = text_field_tag :q, search_term || "Search result for...", :disabled =>
true
- = link_to('Filters', '#')
- %p
- = link_to('Share this view', '#')
- = link_to('Add/Remove Columns', '#')
+ - if show_filter_widgets
+ %p
+ Viewing
+ = select_tag("select_#{lower_class}",
saved_searches.join.html_safe,:disabled => true)
+ = object_count.to_s + " results"
+ = text_field_tag :q, search_term || "Search result for...", :disabled
=> true
+ = link_to('Filters', '#')
+ %p
+ = link_to('Share this view', '#')
+ = link_to('Add/Remove Columns', '#')
- = render :partial => 'layouts/select_all_none'
+ -if show_select_toggle
+ = render :partial => 'layouts/select_all_none'
%table.flat.checkbox_table
%thead
- %tr
+ -if show_filter_widgets or show_select_toggle
+ %tr
- columns.each do |column|
%th
= column[:name]
--
1.7.4.4