Skip to content

Commit

Permalink
Displayed Assets Details information
Browse files Browse the repository at this point in the history
Fixed rubocop issues

Fixed rubocop issues
  • Loading branch information
MaysaMacedo committed May 2, 2017
1 parent 3dcde02 commit c323c0f
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
28 changes: 28 additions & 0 deletions app/helpers/physical_server_helper/textual_summary.rb
Expand Up @@ -10,6 +10,10 @@ def textual_group_relationships
def textual_group_compliance
end

def textual_group_assets
%i(support_contact description location room_id rack_name lowest_rack_unit)
end

def textual_host
{:label => _("Host"), :value => @record.host.try(:name), :icon => "pficon pficon-virtual-machine", :link => url_for(:controller => 'host', :action => 'show', :id => @record.host.try(:id))}
end
Expand Down Expand Up @@ -41,4 +45,28 @@ def textual_ems_ref
def textual_model
{:label => _("Model"), :value => @record.model}
end

def textual_support_contact
{:label => _("Support contact"), :value => @record.asset_details['contact']}
end

def textual_description
{:label => _("Description"), :value => @record.asset_details['description']}
end

def textual_location
{:label => _("Location"), :value => @record.asset_details['location']}
end

def textual_room_id
{:label => _("Room"), :value => @record.asset_details['room_id']}
end

def textual_rack_name
{:label => _("Rack name"), :value => @record.asset_details['rack_name']}
end

def textual_lowest_rack_unit
{:label => _("Lowest rack name"), :value => @record.asset_details['lowest_rack_unit']}
end
end
8 changes: 8 additions & 0 deletions app/views/physical_server/_main.html.haml
@@ -0,0 +1,8 @@
= render :partial => "layouts/flash_msg"
.row
.col-md-12.col-lg-6
= render :partial => "shared/summary/textual", :locals => {:title => _("Properties"), :items => textual_group_properties}
= render :partial => "shared/summary/textual", :locals => {:title => _("Relationships"), :items => textual_group_relationships}
= render :partial => "shared/summary/textual", :locals => {:title => _("Assets"), :items => textual_group_assets}
.col-md-12.col-lg-6
TODO: other groups

0 comments on commit c323c0f

Please sign in to comment.