<!--
    Copyright (c) 2012-2015 Kaarle Ritvanen
    See LICENSE file for license details
-->

<aconf-inline>
  <aconf-header></aconf-header>

  <aconf-model ng-if="node.meta.type == 'model'">
    <p>
      <button class="btn btn-default"
	      ng-if="node.meta.type == 'model'"
	      ng-repeat="action in node.meta.actions"
	      ng-click="invoke(action.name)">{{ action["ui-name"] }}</button>
      <aconf-del-button></aconf-del-button>
    </p>

    <ng-form name="form" ng-model="fields">
      <aconf-widget ng-repeat="field in fields"
		    ng-if="isRelevant(field)"
		    field="{name: field.name, label: field['ui-name'], editable: field.editable, meta: field}"
		    form-field="form[field.name]">
      </aconf-widget>
    </ng-form>
  </aconf-model>

  <aconf-collection ng-if="node.meta.type != 'model'"></aconf-collection>
</aconf-inline>
