Dne 20.7.2011 10:57, Jiří Tomášek napsal(a):
Dne 20.7.2011 09:35, kkeiter@redhat.com napsal(a):
From: Kenneth Keiter <kkeiter@redhat.com>

---
 src/app/stylesheets/layout.scss             |   42 ++++++++++++++++++++++++++-
 src/app/views/deployments/_list.haml        |   29 +++++++++---------
 src/app/views/instances/_list.haml          |    2 +-
 src/app/views/layouts/_filter_table.haml    |   42 +++++++++++++++-----------
 src/app/views/layouts/_select_all_none.haml |    8 ++---
 src/features/instance.feature               |    4 +-
 6 files changed, 85 insertions(+), 42 deletions(-)

diff --git a/src/app/stylesheets/layout.scss b/src/app/stylesheets/layout.scss
index 57c2fa7..6dd30bc 100644
--- a/src/app/stylesheets/layout.scss
+++ b/src/app/stylesheets/layout.scss
@@ -2317,8 +2317,48 @@ $cell_header_text_color: #666666;
   background-image: linear-gradient($from, $to);
 }
 
+/* Filterable Form */
+form.filterable-data{
+
+  ul.obj_actions{
+    padding: 6px 0px 6px 0px;
+
+    list-style: none;
+    li{ display: inline-block; }
+    li + li{ padding-left: 6px; }
+  }
+
+  div.controls{
+    display: block;
+    font-family: $font-family-primary;
+    font-size: 12px;
+    border: 1px solid #ccc;
+    padding: 10px;
+
+    ul{ list-style: none; display: inline-block; }
+    li{ display: inline; }
+    li + li{ padding-left: 6px; }
+    ul.view-contols{
+
+    }
+    ul.filter-controls{
+      float: right;
+    }
+
+  }
+
+  table{
+    width: 100%;
+    border-bottom: 1px solid #ccc;
+    border-left: 1px solid #ccc;
+    border-right: 1px solid #ccc;
+  }
+
+}
+
+
 /* Flat Table ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
-table.flat{
+table.flat, form.filterable-data table{
 
   border-collapse: separate;
   font-family: $font-family-primary;
diff --git a/src/app/views/deployments/_list.haml b/src/app/views/deployments/_list.haml
index 5305d49..d8a049e 100644
--- a/src/app/views/deployments/_list.haml
+++ b/src/app/views/deployments/_list.haml
@@ -1,25 +1,26 @@
 - if request.xhr?
   = render :partial => '/layouts/notification'
 
-- form_tag do
-  = restful_submit_tag "Stop", "multi_stop", multi_stop_deployments_path, 'POST', :id => 'stop_button', :class => 'button'
-  = label_tag "More actions"
-  = select_tag("more_actions",nil, :disabled => true)
+- form_tag({}, :class => 'filterable-data') do
+  %ul.obj_actions
+    %li= restful_submit_tag "Stop Selected Deployments", "multi_stop", multi_stop_deployments_path, 'POST', :id => 'stop_button', :class => 'button'
 
-  %p
-    Viewing
-    = select_tag("deployments_running", "<option>Deployments running</option>",:disabled => true)
-    = @deployments.count.to_s + " results"
-    = text_field_tag :q, @search_term || "Search result for...", :disabled => true
-  = render :partial => 'layouts/select_all_none'
+  %div.controls
+    %ul.filter-controls
+      %li= render :partial => 'layouts/select_all_none'
 
-  %table#deployments_table.flat.checkbox_table
+    %li
+      %label{:for => "deployments_running"} Viewing
+      = select_tag("deployments_running", "<option>Deployments running</option>",:disabled => true)
+    %li.object-count
+      %strong= @deployments.count.to_s
+      results
+
+  %table#deployments_table.checkbox_table
     %thead
       %tr
         %th.ignore
         %th
-          -#there will be icons (belongs to mockups)
-        %th
           = t("pools.index.deployment_name")
         %th
           = t("pools.index.deployed_on")
@@ -37,8 +38,6 @@
           - selected = params[:select] == 'all'
           = check_box_tag "deployments_selected[]", deployment.id, selected, :id => "deployment_checkbox_#{deployment.id}"
         %td
-          -#there will be icons (belongs to mockups)
-        %td
           = link_to deployment.name, deployment_path(deployment)
         %td
           = deployment.created_at
diff --git a/src/app/views/instances/_list.haml b/src/app/views/instances/_list.haml
index 4620d1e..8f27e36 100644
--- a/src/app/views/instances/_list.haml
+++ b/src/app/views/instances/_list.haml
@@ -1,5 +1,5 @@
 - form_header = capture_haml do
-  = restful_submit_tag 'Stop', 'stop', multi_stop_instances_path, 'GET', :class => 'button'
+  = restful_submit_tag 'Stop Selected Instances', 'stop', multi_stop_instances_path, 'GET', :class => 'button'
   = hidden_field_tag 'backlink', request.url
   - if @hide_stopped
     %b Stopped
diff --git a/src/app/views/layouts/_filter_table.haml b/src/app/views/layouts/_filter_table.haml
index f4c885c..a963634 100644
--- a/src/app/views/layouts/_filter_table.haml
+++ b/src/app/views/layouts/_filter_table.haml
@@ -1,24 +1,30 @@
-- form_tag do
-  - if form_header
-    = form_header
-  - 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', '#')
+- form_tag({}, :class => 'filterable-data') do
+
+  -if form_header
+    %ul.obj_actions
+      %li= form_header
 
-  -if show_select_toggle
-    = render :partial => 'layouts/select_all_none'
+  %div.controls
+    %ul.filter-controls
+      -if show_select_toggle
+        %li= render :partial => 'layouts/select_all_none'
+      - if show_filter_widgets
+        -# %li
+          -#%a.button.pill{:href => '#'} Filter
+        -# %li
+          -# %a.button.pill{:href => '#'} Add/Remove Columns
+
+    %li
+      %label{:for => "select_#{lower_class}"} Viewing
+      = select_tag("select_#{lower_class}", saved_searches.join.html_safe,:disabled => true)
+    %li.object-count
+      %strong= object_count.to_s
+      results
+    -# %li
+      -# %a.button.pill{:href => '#'} Save and Share
 
-  %table.flat.checkbox_table
+  %table.checkbox_table
     %thead
-      -if show_filter_widgets or show_select_toggle
-        %tr
       - columns.each do |column|
         %th
           = column[:name]
diff --git a/src/app/views/layouts/_select_all_none.haml b/src/app/views/layouts/_select_all_none.haml
index ce2c5e8..fe14d61 100644
--- a/src/app/views/layouts/_select_all_none.haml
+++ b/src/app/views/layouts/_select_all_none.haml
@@ -1,5 +1,3 @@
-%p
-  Select:&nbsp;
-  = link_to "All", params.merge(:select => 'all')
-  %span> ,&nbsp;
-  = link_to "None", params.merge(:select => 'none')
+Select:&nbsp;
+= link_to "All", params.merge(:select => 'all')
+= link_to "None", params.merge(:select => 'none')
diff --git a/src/features/instance.feature b/src/features/instance.feature
index 4b1bed4..3df8072 100644
--- a/src/features/instance.feature
+++ b/src/features/instance.feature
@@ -69,7 +69,7 @@ Feature: Manage Instances
     Given there is a "mock1" running instance
     And I am on the instances page
     When I check "mock1" instance
-    And I press "Stop"
+    And I press "Stop Selected Instances"
     Then I should be on the instances page
     And I should see "mock1: stop action was successfully queued"
 
@@ -81,7 +81,7 @@ Feature: Manage Instances
     When I check "mock1" instance
     And I check "mock2" instance
     And I check "mock3" instance
-    And I press "Stop"
+    And I press "Stop Selected Instances"
     Then I should be on the instances page
     And I should see "mock1: stop action was successfully queued"
     And I should see "mock2: stop action was successfully queued"
Looks great! ACK

Jirka
_______________________________________________ aeolus-devel mailing list aeolus-devel@lists.fedorahosted.org https://fedorahosted.org/mailman/listinfo/aeolus-devel
Pushed by Jan