From: Jason Guiditta <[email protected]>

From: Steve Linabery <[email protected]>

These are mostly placeholders, impl expected to follow later.
Cucumber features are fixed for now, but will need to be revisited
once new design is in place.
---
 src/app/controllers/instance_controller.rb  |    4 ++
 src/app/controllers/provider_controller.rb  |    3 +
 src/app/controllers/settings_controller.rb  |    4 ++
 src/app/controllers/templates_controller.rb |   12 +++++
 src/app/controllers/users_controller.rb     |    4 ++
 src/app/views/instance/show.haml            |   63 ++++++++++++++++++++++++++-
 src/app/views/layouts/_header.haml          |    2 +-
 src/app/views/provider/list.haml            |    1 +
 src/app/views/settings/index.haml           |    2 +-
 src/app/views/settings/self-service.haml    |    1 +
 src/app/views/templates/builds.haml         |    1 +
 src/app/views/templates/index.haml          |    1 +
 src/app/views/templates/packages.haml       |    8 +++
 src/app/views/users/index.haml              |   16 +++++++
 src/features/provider.feature               |   28 ++++++------
 15 files changed, 132 insertions(+), 18 deletions(-)
 create mode 100644 src/app/views/provider/list.haml
 create mode 100644 src/app/views/settings/self-service.haml
 create mode 100644 src/app/views/templates/builds.haml
 create mode 100644 src/app/views/templates/index.haml
 create mode 100644 src/app/views/templates/packages.haml
 create mode 100644 src/app/views/users/index.haml

diff --git a/src/app/controllers/instance_controller.rb 
b/src/app/controllers/instance_controller.rb
index e94eea9..e2a1eaf 100644
--- a/src/app/controllers/instance_controller.rb
+++ b/src/app/controllers/instance_controller.rb
@@ -89,6 +89,10 @@ class InstanceController < ApplicationController
   #  end
   #end
 
+  def show
+    @instance = Instance.find(params[:id])
+  end
+
   def new
     @instance = Instance.new(params[:instance])
     require_privilege(Privilege::INSTANCE_MODIFY, @instance.pool) if 
@instance.pool
diff --git a/src/app/controllers/provider_controller.rb 
b/src/app/controllers/provider_controller.rb
index 1605eaf..af8c3f9 100644
--- a/src/app/controllers/provider_controller.rb
+++ b/src/app/controllers/provider_controller.rb
@@ -87,4 +87,7 @@ class ProviderController < ApplicationController
     @provider = Provider.find(params[:id])
   end
 
+  def list
+    @providers = Provider.list_for_user(@current_user, 
Privilege::PROVIDER_VIEW)
+  end
 end
diff --git a/src/app/controllers/settings_controller.rb 
b/src/app/controllers/settings_controller.rb
index efeec2d..84f80be 100644
--- a/src/app/controllers/settings_controller.rb
+++ b/src/app/controllers/settings_controller.rb
@@ -26,4 +26,8 @@ class SettingsController < ApplicationController
     @providers = Provider.list_for_user(@current_user, 
Privilege::PROVIDER_VIEW)
   end
 
+  def self_service
+    @providers = Provider.list_for_user(@current_user, 
Privilege::PROVIDER_VIEW)
+  end
+
 end
diff --git a/src/app/controllers/templates_controller.rb 
b/src/app/controllers/templates_controller.rb
index 975d46d..c701486 100644
--- a/src/app/controllers/templates_controller.rb
+++ b/src/app/controllers/templates_controller.rb
@@ -8,6 +8,9 @@ class TemplatesController < ApplicationController
     request.xhr? ? false : 'aggregator'
   end
 
+  def index
+  end
+
   def new
     update_xml
     if params[:next]
@@ -15,6 +18,15 @@ class TemplatesController < ApplicationController
     end
   end
 
+  def packages
+    repository_manager = RepositoryManager.new
+    @packages = repository_manager.get_packages
+  end
+
+  def builds
+    #This will be the list of builds associated with template specified by {id}
+  end
+
   def services
     update_xml
     if params[:back]
diff --git a/src/app/controllers/users_controller.rb 
b/src/app/controllers/users_controller.rb
index b9d290a..a26d8d2 100644
--- a/src/app/controllers/users_controller.rb
+++ b/src/app/controllers/users_controller.rb
@@ -60,4 +60,8 @@ class UsersController < ApplicationController
       render :action => :edit
     end
   end
+
+  def index
+    @users = User.all
+  end
 end
diff --git a/src/app/views/instance/show.haml b/src/app/views/instance/show.haml
index 8036db2..d9c0e4c 100644
--- a/src/app/views/instance/show.haml
+++ b/src/app/views/instance/show.haml
@@ -1,2 +1,61 @@
-= render :partial => 'instance/instances'
-= link_to "Add a new instance", :controller => "instance", :action => "new", 
:id => @pool
+%table
+  %tr
+    %td :external_key
+    %td= @instance.external_key
+  %tr
+    %td :name
+    %td= @instance.name
+  %tr
+    %td :hardware_profile_id
+    %td= @instance.hardware_profile_id
+  %tr
+    %td :image_id
+    %td= @instance.image_id
+  %tr
+    %td :realm_id
+    %td= @instance.realm_id
+  %tr
+    %td :pool_id
+    %td= @instance.pool_id
+  %tr
+    %td :cloud_account_id
+    %td= @instance.cloud_account_id
+  %tr
+    %td :public_address
+    %td= @instance.public_address
+  %tr
+    %td :private_address
+    %td= @instance.private_address
+  %tr
+    %td :state
+    %td= @instance.state
+  %tr
+    %td :condor_job_id
+    %td= @instance.condor_job_id
+  %tr
+    %td :lock_version
+    %td= @instance.lock_version
+  %tr
+    %td :acc_pending_time
+    %td= @instance.acc_pending_time
+  %tr
+    %td :acc_running_time
+    %td= @instance.acc_running_time
+  %tr
+    %td :acc_shutting_down_time
+    %td= @instance.acc_shutting_down_time
+  %tr
+    %td :acc_stopped_time
+    %td= @instance.acc_stopped_time
+  %tr
+    %td :time_last_pending
+    %td= @instance.time_last_pending
+  %tr
+    %td :time_last_running
+    %td= @instance.time_last_running
+  %tr
+    %td :time_last_shutting_down
+    %td= @instance.time_last_shutting_down
+  %tr
+    %td :time_last_stopped
+    %td= @instance.time_last_stopped
diff --git a/src/app/views/layouts/_header.haml 
b/src/app/views/layouts/_header.haml
index 0ea60bc..6fbd4a9 100644
--- a/src/app/views/layouts/_header.haml
+++ b/src/app/views/layouts/_header.haml
@@ -1,7 +1,7 @@
 - menu = [ { :text => t(:dashboard), :controller => "dashboard" }, |
   { :text => t(:instances), :controller => "instance" }, |
   { :text => t(:templates), :controller => "image", :action => "show" }, |
-    ({ :text => "Users", :controller => "permissions", :action => "list" } if 
@current_user && 
has_view_perms?(BasePermissionObject.general_permission_scope)), |
+    ({ :text => "Users", :controller => "users", :action => "index" } if 
@current_user && 
has_view_perms?(BasePermissionObject.general_permission_scope)), |
   { :text => t(:settings), :controller => "settings" }, |
   ].find_all {|item| item != nil} |
 .header_logo
diff --git a/src/app/views/provider/list.haml b/src/app/views/provider/list.haml
new file mode 100644
index 0000000..6e68450
--- /dev/null
+++ b/src/app/views/provider/list.haml
@@ -0,0 +1 @@
+= render :partial => 'provider/providers'
\ No newline at end of file
diff --git a/src/app/views/settings/index.haml 
b/src/app/views/settings/index.haml
index b7a708c..fc7e3b2 100644
--- a/src/app/views/settings/index.haml
+++ b/src/app/views/settings/index.haml
@@ -1,2 +1,2 @@
 %h1 Settings
-= render :partial => 'provider/providers'
+Insert Page 3100 Implementation Here.
diff --git a/src/app/views/settings/self-service.haml 
b/src/app/views/settings/self-service.haml
new file mode 100644
index 0000000..0185073
--- /dev/null
+++ b/src/app/views/settings/self-service.haml
@@ -0,0 +1 @@
+Insert Page 3170 Implementation Here.
diff --git a/src/app/views/templates/builds.haml 
b/src/app/views/templates/builds.haml
new file mode 100644
index 0000000..1cab588
--- /dev/null
+++ b/src/app/views/templates/builds.haml
@@ -0,0 +1 @@
+Insert page 4200 implementation.
diff --git a/src/app/views/templates/index.haml 
b/src/app/views/templates/index.haml
new file mode 100644
index 0000000..22d8a31
--- /dev/null
+++ b/src/app/views/templates/index.haml
@@ -0,0 +1 @@
+Insert page 4100 implementation.
diff --git a/src/app/views/templates/packages.haml 
b/src/app/views/templates/packages.haml
new file mode 100644
index 0000000..1c84e08
--- /dev/null
+++ b/src/app/views/templates/packages.haml
@@ -0,0 +1,8 @@
+Packages:
+%br/
+- if @packages
+  - @packages.each do |package|
+    = package
+- else
+  no packages found
+  %br/
diff --git a/src/app/views/users/index.haml b/src/app/views/users/index.haml
new file mode 100644
index 0000000..529cb5c
--- /dev/null
+++ b/src/app/views/users/index.haml
@@ -0,0 +1,16 @@
+%table
+  %tr
+    %td login
+    %td email
+    %td first_name
+    %td last_name
+    %td current_login_at
+    %td last_login_at
+  [email protected] do |user|
+    %tr
+      %td= user.login
+      %td= user.email
+      %td= user.first_name
+      %td= user.last_name
+      %td= user.current_login_at
+      %td= user.last_login_at
diff --git a/src/features/provider.feature b/src/features/provider.feature
index d1b10a6..a2e76e8 100644
--- a/src/features/provider.feature
+++ b/src/features/provider.feature
@@ -14,7 +14,7 @@ Feature: Manage Providers
     | provider1 |
     | provider2 |
     | provider3 |
-    When I follow "Settings"
+    When I go to the providers page
     Then I should see the following:
     | provider1 |
     | provider2 |
@@ -22,7 +22,7 @@ Feature: Manage Providers
 
   Scenario: Show provider details
     Given there is a provider named "testprovider"
-    And I am on the settings page
+    And I am on the providers page
     When I follow "testprovider"
     Then I should see "Accounts"
     And I should see "Realms"
@@ -30,21 +30,21 @@ Feature: Manage Providers
     And I should see "Settings"
 
   Scenario: Create a new Provider
-         Given I am on the settings page
-         And there is not a provider named "testprovider"
-         When I follow "Add a provider"
-         Then I should be on the new provider page
-         And I should see "Add a cloud provider"
-         When I fill in "provider[name]" with "testprovider"
-         And I fill in "provider[url]" with "http://localhost:3001/api";
-         And I press "Save"
-         Then I should be on the show provider page
-         And I should see "Provider added"
-         And I should have a provider named "testprovider"
+    Given I am on the providers page
+    And there is not a provider named "testprovider"
+    When I follow "Add a provider"
+    Then I should be on the new provider page
+    And I should see "Add a cloud provider"
+    When I fill in "provider[name]" with "testprovider"
+    And I fill in "provider[url]" with "http://localhost:3001/api";
+    And I press "Save"
+    Then I should be on the show provider page
+    And I should see "Provider added"
+    And I should have a provider named "testprovider"
 
   Scenario: Delete a provider
     Given there is a provider named "testprovider"
-    And I am on the settings page
+    And I am on the providers page
     Then I should see "testprovider"
     When I follow "testprovider"
     Then I should be on the show provider page
-- 
1.7.2.2

_______________________________________________
deltacloud-devel mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/deltacloud-devel

Reply via email to