On 06/08/2011 07:30 PM, Tomas Hrcka wrote:
---
.../controllers/hardware_profiles_controller.rb | 4 ++-
src/app/views/hardware_profiles/edit.haml | 25 ++++++++++++++++----
src/app/views/hardware_profiles/new.haml | 16 ++++++++----
src/app/views/hardware_profiles/show.haml | 10 ++++++++
4 files changed, 44 insertions(+), 11 deletions(-)
diff --git a/src/app/controllers/hardware_profiles_controller.rb
b/src/app/controllers/hardware_profiles_controller.rb
index 6c739c4..2d4d4ee 100644
--- a/src/app/controllers/hardware_profiles_controller.rb
+++ b/src/app/controllers/hardware_profiles_controller.rb
@@ -75,7 +75,9 @@ class HardwareProfilesController< ApplicationController
end
end
- def delete
+ def destroy
+ HardwareProfile.destroy(params[:id])
Add flash[:notice/:error] /w if
conditions based on calling
HardwareProfile.destroy
+ redirect_to hardware_profiles_path
end
def edit
diff --git a/src/app/views/hardware_profiles/edit.haml
b/src/app/views/hardware_profiles/edit.haml
index bcd59ed..7530ce8 100644
--- a/src/app/views/hardware_profiles/edit.haml
+++ b/src/app/views/hardware_profiles/edit.haml
@@ -1,6 +1,21 @@
-%h3
- Edit Hardware Profile
--form_for @hardware_profile, :url => hardware_profile_path(@hardware_profile), :html
=> { :multipart => true } do |hwp_form|
- = render :partial => "form", :locals => { :hwp_form => hwp_form
}
+= render :partial => 'layouts/admin_header'
-= render :partial => 'matching_provider_hardware_profiles'
+%header.page-header
+ %h1{:class => controller.controller_name}= @hardware_profile.name.titlecase
+ #obj_actions.button-container
+ = link_to 'New Hardware Profile', hardware_profile_url, :class =>
'button primary', :id => 'new_user_button'
+ %div.button-group
+ = link_to 'Cancel Editing', hardware_profile_path(@hardware_profile),
:class => 'button pill danger', :id => 'new_user_button'
+ .corner
+
+%section.content-section.hardware_profile
+ %header
+ %h2 Properties
+
+ .content
+ %h3
+ Edit Hardware Profile
+ -form_for @hardware_profile, :url => hardware_profile_path(@hardware_profile),
:html => { :multipart => true } do |hwp_form|
+ = render :partial => "form", :locals => { :hwp_form =>
hwp_form }
+
+ = render :partial => 'matching_provider_hardware_profiles'
\ No newline at end of file
diff --git a/src/app/views/hardware_profiles/new.haml
b/src/app/views/hardware_profiles/new.haml
index 20ca068..7f12554 100644
--- a/src/app/views/hardware_profiles/new.haml
+++ b/src/app/views/hardware_profiles/new.haml
@@ -1,6 +1,12 @@
-%h3
- New Hardware Profile
--form_for @hardware_profile, :url => hardware_profiles_path, :html => {
:multipart => true } do |hwp_form|
- = render :partial => "form", :locals => { :hwp_form => hwp_form
}
+= render :partial => 'layouts/admin_header'
+= render :partial => 'section_header'
-= render :partial => 'matching_provider_hardware_profiles'
+%section.content-section.users
+ %header
+ %h2 New Hardware Profile
+
+ .content
+ -form_for @hardware_profile, :url => hardware_profiles_path, :html => {
:multipart => true } do |hwp_form|
+ = render :partial => "form", :locals => { :hwp_form =>
hwp_form }
+
+ = render :partial => 'matching_provider_hardware_profiles'
diff --git a/src/app/views/hardware_profiles/show.haml
b/src/app/views/hardware_profiles/show.haml
index 1228a23..52c95ca 100644
--- a/src/app/views/hardware_profiles/show.haml
+++ b/src/app/views/hardware_profiles/show.haml
@@ -1,4 +1,14 @@
= render :partial => 'layouts/admin_header'
+%header.page-header
+ %h1{:class => controller.controller_name}= @hardware_profile.name
+ #obj_actions.button-container
+ = link_to 'New Hardware Profile', new_hardware_profile_url, :class =>
'button primary', :id => 'new_role_button'
+ .button-group
+ = button_to 'Delete', hardware_profile_path(@hardware_profile), :method
=> :delete, :class => 'button pill danger'
+ = link_to 'Edit', edit_hardware_profile_path(@hardware_profile), :class
=> 'button pill'
Change order of Delete and Edit, add :confirm to Delete
action.
+%section.content-section.hardware_profile
+ %header
+ %h2 Properties
%div#view
= render :partial => 'properties'
%h1 Matching Provider Hardware Profiles
Bad indetantion ^^
ACK w/ some inline notes.
Inline notes were fixed and patch was pushed.