anchor.diff: -// @todo Remove code duplication for the VMs listing by using a macro.
  +//- @todo Remove code duplication for the VMs listing by using a macro.
   .sub-bar
     .grid
       .grid-cell.overview
  
positive.code:                 a(xo-click="pool_addHost(host.UUID)")
                    i.fa.fa-cloud-download.fa-fw
                    |  Add to pool
            // /Header.
            // Stats.
            ul.list-unstyled.stats
              // Warning icon if host is halted or disabled
              li.text-danger(ng-if="host.power_state === 'Halted'")
                i.fa.fa-warning
                |  Halted
              li.text-warning(ng-if="!host.enabled && host.power_state === 'Running'")
                i.fa.fa-warning
                |  Disabled
              // Memory
              li(ng-if="host.power_state === 'Running' && host.enabled")
                i.xo-icon-memory.i-progress
                .progress.progress-small(tooltip="RAM: {{[host.memory.usage, host.memory.size] | %}} allocated")
                  .progress-bar(role="progressbar", aria-valuenow="{{100*host.memory.usage/host.memory.size}}", aria-valuemin="0", aria-valuemax="100", style="width: {{[host.memory.usage, host.memory.size] | %}}")
              // Host address
              li.text-muted.substats
                i.xo-icon-network
                |  {{host.address}}
          // Contains all the VMs of this host.
          .grid.grid-cell.vm-cell
            // If no VMs, fill the space with a message.
            .vms-notice(ng-if="!host.VMs.length")
              // TODO: put 'Halted' state in xo-server
              //p(ng-if="'Halted' === host.power_state")
              //  | Host halted.
              p(ng-if="'shutdown' === values(host.current_operations)[0]")
                | Host halted.
              div(ng-if="'shutdown' !== values(host.current_operations)[0]")
  
negative.code:                       i.fa.fa-refresh
                      a(tooltip="VM Console", xo-sref="consoles_view({id: VM.UUID})")
                        i.xo-icon-console
                  //- Description.
                  td.vm-description.col-md-4
                    i(class="xo-icon-{{osType(VM.os_version.distro)}}",ng-if="VM.os_version.distro", tooltip="{{VM.os_version.name}}")
                      | &nbsp;
                    i.fa.fa-fw(ng-if="!VM.os_version.distro")
                    | {{VM.name_description}}
                  //- Metrics.
                  //- Memory
                  td.vm-memory-stat.col-md-2
                    .cpu
                      | {{VM.memory.size | bytesToSize}}
                    i.fa.fa-fw(ng-if="VM.PV_drivers")
                    i.xo-icon-info.fa-fw(ng-if="!VM.PV_drivers", tooltip="Xen tools not installed")
                  //- /Metrics.
                  //- Address.
                  td.text-muted.text-right.col-md-2
                    | {{VM.addresses["0/ip"]}}
        //- Contains a pseudo-host which contains all VMs not in any hosts.
        .grid(ng-if="pool.VMs.length")
          //- This is where the information about a host would be displayed.
          .grid-cell.host-cell
          //- Contains all the VMs of this pool.
          .grid.grid-cell.vm-cell
            //- TODO: comment
            .table-responsive
              table.table.table-hover.table-condensed
                //- Contains a VM.
                tr(ng-repeat="VM in pool.VMs | resolve | orderBy:natural('name_label') track by VM.UUID", xo-sref="VMs_view({id: VM.UUID})")
                  //- Handle used for drag & drop.
                  td.grab
                  //- Checkbox used for selection.
                  td.select-vm
                    input(type="checkbox", ng-model="selected_VMs[VM.UUID]", ng-change="updateVMSelection(VM.UUID)")
                  //- Power state
                  td.vm-power-state
                    i.xo-icon-working(ng-if="isVMWorking(VM)", tooltip="{{VM.power_state}} and {{values(VM.current_operations)[0]}}")
                    i(class="xo-icon-{{VM.power_state | lowercase}}",ng-if="!isVMWorking(VM)", tooltip="{{VM.power_state}}")
                  //- VM name.
                  td.vm-name.col-md-2
                    p.vm {{VM.name_label}}
                  //- Quick actions.
                  td.vm-quick-buttons.col-md-2
                    .quick-buttons
                      a(tooltip="Shutdown VM", xo-click="stopVM(VM.UUID)")
  