header “Hardware profiles”

subheader hardware_profile.name || hardware_profile.id

%div{ :'data-role' => :content, :'data-theme' => 'c'}

%l{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'd'}
  %i{ :'data-role' => 'list-divider'} Name
  %i
    %{ :'data-role' => 'fieldcontain'}=hardware_profile.name || hardware_profile.id
  - hardware_profile.each_property do |p|
    %i{ :'data-role' => 'list-divider'} #{p.name.to_s.titlecase}
    %i
      %{ :'data-role' => 'fieldcontain'}
        - if p.kind == :fixed
          =p.value
          =p.unit if not ['label', 'count'].include? p.unit
        -elsif p.kind == :range
          Minimum: #{p.first}
          =p.unit if not ['label', 'count'].include? p.unit
          Maximum: #{p.last}
          =p.unit if not ['label', 'count'].include? p.unit
        -elsif p.kind == :enum
          =p.values.join(" #{p.unit} or ")
          =p.unit