<!--

    Copyright (C) 2015-2016 Jeeva Kandasamy (jkandasa@gmail.com)

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

            http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->
<div class="container-fluid"> <!-- Container-fluid -->

    <!-- Loading icon disaplay -->
  <div ng-if="showLoading">
    <div ng-include src="'partials/common-html/loading.html'"></div>
  </div>

  <div ng-if="!showLoading"> <!-- Main Message -->

    <!-- Rooms Header -->
    <div class="mc-top-space-header">
      <legend>
        <a class="fa fa-object-group fa-lg mc-pointer" ng-click="getRoomRoot()"></a> <span ng-bind-html="roomHeader | mcResourceRepresentation"></span>
      </legend>
    </div>

    <!-- Display No Items on system -->
    <div ng-if="showNoRoomsSetup" ng-include src="'partials/common-html/no-items-system.html'"></div>

    <div class="container-cards-pf" ng-if="queryResponse.data.length > 0">
      <div class="row row-cards-pf">
        <div class="col-xs-12 col-sm-6 col-md-3 mc-pointer" ng-repeat="room in queryResponse.data" ng-click="getRoom(room)">
          <div class="card-pf card-pf-accented card-pf-aggregate-status card-pf-aggregate-status-mini">
            <h2 class="card-pf-title">
              <span class="fa fa-object-group"></span>
              <span class="card-pf-aggregate-status-count">{{room.name}}</span>
              <span>{{room.description || "-"}}</span>
            </h2>
          </div>
        </div>
      </div><!-- /row -->
    </div><!-- /container -->

    <!-- Sensors Header -->
    <div ng-if="queryResponse.data.length > 0 && sensorsList.length > 0">
      <legend></legend>
    </div>

    <div class="container-cards-pf">
      <div class="row row-cards-pf">
        <div class="col-xs-12 col-sm-6 col-md-4" ng-repeat="item in sensorsList">
          <div class="card-pf card-pf-aggregate-status card-pf-with-action card-pf-accented" style="height:80px;">
            <h2 class="card-pf-title">
              <span uib-tooltip="{{item.type.locale ? item.type.locale : 'Undefined'}}">
                <span class="mc-icon-lg" ng-class="cs.getSensorIcon(item.type.en)"></span>
                <span class="card-pf-aggregate-status-count">{{item.sensorId}}: {{item.name || "-"}}</span>
              </span>
              <span class="pull-right">
                <a class="btn btn-link" ui-sref="sensorsDetail({id:item.id})">
                  <i class="fa fa-chevron-circle-right fa-lg" tooltip="{{ 'VIEW_DETAILS' | translate }}" tooltip-placement="left"></i>
                </a>
              </span>
              <hr class="mc-sensors-hr">
            </h2>
            <div class="card-pf-body mc-sensors-room">
              <!-- variables ng-repeat --> <!-- Sensor variables -->
              <span class="card-pf-aggregate-status-notification mc-side-space" ng-include src="'partials/common-html/sensor-actions-items.html'" ng-repeat="variable in item.variables"></span>
            </div>
          </div>
        </div>
      </div><!-- /row -->
    </div><!-- /container -->

  </div> <!-- Main Message -->

</div> <!-- Container-fluid -->

