<!--

    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-hide="resourceTypes.$resolved">
    <div ng-include src="'partials/common-html/loading.html'"></div>
  </div>

  <div ng-show="resourceTypes.$resolved"> <!-- Main Message -->

    <!-- Page Header -->
    <div ng-include src="'partials/common-html/header-add-update.html'"></div>

    <div><!-- div-main -->
      <form class="form-horizontal">
        <div class="col-md-5">

            <div class="form-group">
              <label class="col-sm-2 control-label">{{ 'RESOURCE' | translate }}</label>
              <div class="col-sm-4 mc-form-fixer-left">
                <select class="form-control" pf-select ng-options="rT.displayName as rT.displayName for rT in resourceTypes"
                  ng-change="resourcesList = getResources(resourcesLogs.resourceType);resourcesLogs.resourceId=''" ng-model="resourcesLogs.resourceType">
                  <option value="" ng-hide="true"></option>
                </select>
              </div>
              <div class="col-sm-6 mc-form-fixer" ng-hide="resourcesLogs.resourceType === null || resourcesLogs.resourceType === undefined || resourcesLogs.resourceType === ''"><!-- List Resource -->
                <select class="form-control" pf-select data-live-search="true" ng-model="resourcesLogs.resourceId">
                   <option value="" ng-hide="true"></option>
                   <option ng-repeat="res in resourcesList" ng-bind-html="res.displayName | mcResourceRepresentation" value="{{res.id}}"></option>
                </select>
              </div>
            </div>

            <div class="form-group">
              <label class="col-sm-2 control-label">{{ 'MESSAGE_TYPE' | translate }}</label>
              <div class="col-sm-10 mc-form-fixer-left">
                <select class="form-control" pf-select ng-options="mt.displayName as mt.displayName for mt in messageTypes" ng-model="resourcesLogs.messageType">
                  <option value="" ng-hide="true"></option>
                </select>
              </div>
            </div>

          <div class="form-group">
            <label class="col-sm-2 control-label">{{ 'LOG_DIRECTION' | translate }}</label>
            <div class="col-sm-10 mc-form-fixer-left">
              <select class="form-control" pf-select ng-options="ld.displayName as ld.displayName for ld in logDirections" ng-model="resourcesLogs.logDirection">
                <option value="" ng-hide="true"></option>
              </select>
            </div>
          </div>

          <div class="form-group">
            <label class="col-sm-2 control-label">{{ 'LOG_LEVEL' | translate }}</label>
            <div class="col-sm-10 mc-form-fixer-left">
              <select class="form-control" pf-select ng-options="ll.displayName as ll.displayName for ll in logLevels" ng-model="resourcesLogs.logLevel">
                <option value="" ng-hide="true"></option>
              </select>
            </div>
          </div>

          <div class="form-group">
            <label class="col-sm-2 control-label">{{ 'MESSAGE_CONTAINS' | translate }}</label>
            <div class="col-sm-10 mc-form-fixer-left">
              <input class="form-control" placeholder="Message contains" ng-model="resourcesLogs.message"/>
            </div>
          </div>

          <div class="form-group">
            <label class="col-sm-2 control-label">{{ 'PURGE_BEFORE' | translate }}</label>

            <div class="col-sm-10 mc-form-fixer-left">
              <div class="dropdown">
                <a class="dropdown-toggle" id="datetime1" role="button" data-toggle="dropdown" data-target="#" href="">
                  <div class="input-group">
                    <input type="text" class="form-control mc-show-disabled" data-ng-model="pBeforeString" ng-readonly="true">
                    <span class="input-group-addon">
                       <i class="fa fa-calendar fa-lg"></i>
                    </span>
                  </div>
                </a>
                <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
                  <datetimepicker data-ng-model="purgeBefore" data-on-set-time="pBeforeString = getDateTimeDisplayFormat(newDate)" data-datetimepicker-config="{ dropdownSelector: '#datetime1', minuteStep:1 }"/>
                </ul>
              </div>
            </div>
          </div>




          <!-- Include save form buttons -->
          <div ng-include src="'partials/common-html/save-form.html'"></div>

        </div>
      </form>
    </div><!-- div-main -->

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