<!--
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements.  See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership.  The ASF licenses this file
* to you 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.
-->

<!--show detail when exist models-->
<script type="text/ng-template" id="modelDetail.html">
  <div class="modal-header">
  </div>

<div  class="modal-body nav-tabs-custom" height ng-controller="CubeModelCtrl" style="margin-top:40px;">
    <ul ng-show="modelsManager.selectedModel.name" class="nav nav-tabs">
        <li class="{{(!modelsManager.selectedModel.visiblePage || modelsManager.selectedModel.visiblePage=='metadata')? 'active':''}}">
            <a href="" ng-click="modelsManager.selectedModel.visiblePage='metadata'">Grid</a>
        </li>
        <li class="{{modelsManager.selectedModel.visiblePage=='graph'? 'active':''}}">
            <a href="" ng-click="modelsManager.selectedModel.visiblePage='graph';buildGraph(modelsManager.selectedModel);$event.stopPropagation();">Visualization</a>
        </li>
      <li class="{{modelsManager.selectedModel.visiblePage=='json_model'? 'active':''}}">
        <a href="" ng-click="modelsManager.selectedModel.visiblePage='json_model';">JSON</a>
      </li>

    </ul>

    <div class="model-detail" ng-if="!modelsManager.selectedModel.visiblePage || modelsManager.selectedModel.visiblePage=='metadata'">
        <div ng-include="'partials/models/model_schema.html'" ng-controller="ModelSchemaCtrl"
             ng-init="state={mode:'view', modelName:modelsManager.selectedModel.name}">
        </div>
    </div>
    <div ng-show="modelsManager.selectedModel.visiblePage=='graph'" id="model_graph_{{modelsManager.selectedModel.name}}" class="model-detail model_graph">
    </div>
    <div ng-show="modelsManager.selectedModel.visiblePage=='json_model'" class="cube-detail">
            <pre
              style="background-color: white;border: 0px">{{cleanStatus(modelsManager.selectedModel)}}</pre>
    </div>
</div>

  <div class="modal-footer">
    <button class="btn btn-warning" ng-click="cancel()">Close</button>
  </div>

</script>
