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

<table class="table">
  <thead>
    <tr><td></td><td ng-repeat="column in columns">{{ column }}</td></tr>
  </thead>
  <tbody ui-sortable="sortable" ng-model="fields">
    <tr ng-repeat="field in fields"
	aconf-field="field"
	class="aconf-node aconf-model-fields">
      <td>{{ node.meta['ui-name'] }}</td>
      <td ng-repeat="column in columns">
	<ng-form name="form" ng-model="columns">
	  <aconf-widget field="{name: column.name, editable: column.editable, meta: column}"
			form-field="form[column.name]">
	  </aconf-widget>
	</ng-form>
      </td>
      <td ng-if="columns.length < fields.length">
	<aconf-link path="value" label="Details" status="status"></aconf-link>
      </td>
      <td ng-repeat="action in node.meta.actions">
	<button class="btn btn-default"
		ng-click="invoke(action.name)">{{ action["ui-name"] }}</button>
      </td>
      <td><aconf-del-button></aconf-del-button></td>
    </tr>
  </tbody>
</table>
