<!--
* 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.
-->

<!--hide when view model and no model selected-->
<div class="box box-primary model-design box-2px" ng-init="model" ng-hide="state.mode=='view'&&!modelsManager.selectedModel.name">
    <div class="box-header widget-header-blue widget-header-flat">
        <h4 class="box-title text-info">Model Designer</h4>
    </div>
    <div class="box-body">
            <div>
                <ul class="wizard-steps">
                    <li ng-repeat="step in wizardSteps"
                        class="{{step==curStep?'active':''}} {{step.isComplete?'complete':''}}">
                        <span style="cursor:pointer;" ng-click="checkForm($index)?goToStep($index):''" class="step">{{step.step = ($index + 1)}}</span>
                        <span class="title">{{step.title}}</span>
                     </li>
                </ul>
            </div>
            <hr/>
            <div class="step-content pos-rel" id="step-container">
                <div ng-include src="curStep.src"></div>
            </div>
            <hr/>
            <div class="wizard-actions">
                <div class="row">
                    <div class="col-xs-8" style="display:block;">
                        <div>
                        </div>
                    </div>
                    <div class="col-xs-4 pull-right">
                        <button class="btn btn-prev" ng-click="preView()" ng-show="curStep.title!='Model Info'">
                            <i class="ace-icon fa fa-arrow-left"></i>
                            Prev
                        </button>
                        <button id="nextButton" class="btn btn-success btn-next" ng-disabled="forms[curStep.form].$invalid" ng-click="checkForm($index)?nextView():''"
                                ng-show="curStep.title!='Settings'">
                            Next
                            <i class="ace-icon fa fa-arrow-right icon-on-right"></i>
                        </button>
                        <button class="btn btn-primary"  ng-click="prepareModel();saveModel()"
                                ng-if="curStep.title=='Settings' && state.mode=='edit' && checkForm($index)">
                            Save
                        </button>
                    </div>
                </div>
            </div>
    </div>
</div>

<!--show create model tip when no models list-->
<div ng-show="state.mode=='view'&&!modelsManager.models.length" style="margin-top:40px;">
    <div class="box box-primary">
        <div class="box-header with-border">
            <i class="fa fa-bullhorn"></i>
            <h3 class="box-title">No models</h3>
        </div>
        <div class="box-body">
            <p>
                <a href="models/add" ng-if="userService.hasRole('ROLE_ADMIN') || hasPermission('project',projectModel, permissions.ADMINISTRATION.mask, permissions.MANAGEMENT.mask)">Click here to create your model</a>
            </p>
        </div><!-- /.box-body -->
    </div>
</div>

<!--show select model tip when models not empty and no model selected-->
<div ng-show="state.mode=='view'&&!!modelsManager.models.length&&!modelsManager.selectedModel.name" style="margin-top:40px;">
    <div class="box box-primary">
        <div class="box-header with-border">
            <i class="fa fa-bullhorn"></i>
            <h3 class="box-title">No model selected</h3>
        </div>
        <div class="box-body">
            <p>
               Select your model
            </p>
        </div><!-- /.box-body -->
    </div>
</div>
