| 1 | <a href="#!/?name=0" class="btn btn-default"> |
| 2 | <i class="crm-i fa-plus"></i> {{:: ts('New Form') }} |
| 3 | </a> |
| 4 | <div |
| 5 | af-api4="['Afform', 'get', {select: ['name','title','is_public','server_route','has_local','has_base'], orderBy: {name:'ASC'}}]" |
| 6 | af-api4-ctrl="listCtrl"> |
| 7 | |
| 8 | <div ng-if="apiData.result.length == 0"> |
| 9 | {{:: ts('None found.') }} |
| 10 | </div> |
| 11 | |
| 12 | <table> |
| 13 | <thead> |
| 14 | <tr> |
| 15 | <th>{{:: ts('Name') }}</th> |
| 16 | <th>{{:: ts('Title') }}</th> |
| 17 | <th>{{:: ts('Server Route') }}</th> |
| 18 | <th>{{:: ts('Frontend?') }}</th> |
| 19 | <th></th> |
| 20 | </tr> |
| 21 | </thead> |
| 22 | <tbody> |
| 23 | <tr ng-repeat="availForm in listCtrl.result"> |
| 24 | <td> |
| 25 | <a ng-href="#!/?name={{availForm.name}}">{{availForm.name}}</a> |
| 26 | </td> |
| 27 | <td>{{availForm.title}}</td> |
| 28 | <td> |
| 29 | <a ng-if="availForm.server_route" ng-href="{{crmUrl(availForm.server_route)}}" target="_blank"> |
| 30 | <code>{{availForm.server_route}}</code> |
| 31 | </a> |
| 32 | </td> |
| 33 | <td>{{availForm.is_public ? ts('Frontend') : ts('Backend')}}</td> |
| 34 | <td> |
| 35 | <!--<a ng-click="crmStatus({start: ts('Reverting...'), success: ts('Reverted')}, crmApi4('Afform', 'revert', {where: [['name', '=', availForm.name]]}))">{{ts('Revert')}}</a>--> |
| 36 | <a af-api4-action="['Afform', 'revert', {where: [['name','=', availForm.name]]}]" |
| 37 | af-api4-start-msg="ts('Reverting...')" |
| 38 | af-api4-success-msg="ts('Reverted')" |
| 39 | af-api4-success="listCtrl.refresh()" |
| 40 | class="btn btn-xs btn-default" |
| 41 | ng-if="availForm.has_local && availForm.has_base" |
| 42 | >{{:: ts('Revert') }}</a> |
| 43 | <a af-api4-action="['Afform', 'revert', {where: [['name','=', availForm.name]]}]" |
| 44 | af-api4-start-msg="ts('Deleting...')" |
| 45 | af-api4-success-msg="ts('Deleted')" |
| 46 | af-api4-success="listCtrl.refresh()" |
| 47 | class="btn btn-xs btn-default" |
| 48 | ng-if="availForm.has_local && !availForm.has_base" |
| 49 | >{{:: ts('Delete') }}</a> |
| 50 | </td> |
| 51 | </tr> |
| 52 | </tbody> |
| 53 | </table> |
| 54 | |
| 55 | </div> |