<div class="row">
    <div class="col-lg-12">
        <div class="view-header">
            <div class="pull-right text-right" style="line-height: 14px">
                <!--<small>UI Elements<br>General<br> <span class="c-white">Grid system</span></small>-->
                <a class="btn btn-default" ng-if="vm.list" href="{{vm.baseUrl}}add">Add</a>
                <a class="btn btn-default" ng-if="!vm.list" href="{{vm.baseUrl}}">Back to {{vm.title.toLowerCase()}} list</a>
            </div>
            <div class="header-icon">
                <i class="pe page-header-icon pe-7s-note2"></i>
            </div>
            <div class="header-title">
                <h3>{{vm.title}}</h3>
                <!--<small>-->
                    <!--Responsive, mobile first fluid grid system.-->
                <!--</small>-->
            </div>
        </div>
        <hr>
    </div>
</div>
<div class="row" ng-show="vm.related.length > 0 && vm.model.id">
    <div class="view-header">
        <div class="col-lg-4">
            <h4>Related Items: </h4>
        </div>
        <div class="col-lg-8 text-right">
            <div class="btn-group">
                <a ng-if="vm.list" ng-repeat="r in vm.related" href="#/core/{{r.model.toLowerCase()}}s/" class="btn btn-default">
                    {{r.model}}
                </a>
                <a ng-if="!vm.list && vm.getRelatedItem(r, vm.model)" ng-repeat="r in vm.related" href="#/core/{{r.model.toLowerCase()}}s/{{vm.getRelatedItem(r, vm.model)}}" class="btn btn-default">
                    {{r.model}}
                </a>
            </div>
        </div>
        <hr>
    </div>
</div>
<div ng-if="vm.list">
    <xos-table config="vm.tableCfg" data="vm.tableData"></xos-table>
</div>

<div ng-if="!vm.list">
    <!--<pre>{{vm.model | json}}</pre>-->
    <xos-form ng-model="vm.model" config="vm.formCfg"></xos-form>
</div>
