// Load data for lists
afforms: function(crmApi4) {
return crmApi4('Afform', 'get', {
- select: ['name', 'title', 'type', 'is_public', 'server_route', 'has_local', 'has_base'],
+ select: ['name', 'title', 'type', 'server_route', 'has_local', 'has_base', 'is_dashlet', 'contact_summary:label'],
orderBy: {title: 'ASC'}
});
}
this.afforms = _.transform(afforms, function(afforms, afform) {
afform.type = afform.type || 'system';
+ // Aggregate a couple fields for the "Placement" column
+ afform.placement = [];
+ if (afform.is_dashlet) {
+ afform.placement.push(ts('Dashboard'));
+ }
+ if (afform['contact_summary:label']) {
+ afform.placement.push(afform['contact_summary:label']);
+ }
afforms[afform.type] = afforms[afform.type] || [];
afforms[afform.type].push(afform);
}, {});
<th>{{:: ts('Title') }}</th>
<th>{{:: ts('Name') }}</th>
<th>{{:: ts('Page') }}</th>
- <th>{{:: ts('Style') }}</th>
+ <th>{{:: ts('Placement') }}</th>
<th></th>
</tr>
</thead>
<tbody>
<tr ng-repeat="afform in $ctrl.afforms[$ctrl.tab] | filter:$ctrl.searchAfformList">
- <td>{{afform.title}}</td>
+ <td>{{ afform.title }}</td>
<td>
- <code>{{afform.name}}</code>
+ <code>{{ afform.name }}</code>
</td>
<td>
<a ng-if="afform.server_route" ng-href="{{ crmUrl(afform.server_route) }}" target="_blank">
- <code>{{afform.server_route}}</code>
+ <code>{{ afform.server_route }}</code>
</a>
</td>
- <td>{{afform.is_public ? ts('Frontend') : ts('Backend')}}</td>
+ <td>{{ afform.placement.join(', ') }}</td>
<td class="text-right">
- <a ng-if="afform.type !== 'system'" href="#/edit/{{ afform.name }}" class="btn btn-xs btn-primary">{{ ts('Edit') }}</a>
- <a ng-if="afform.type !== 'system'" href="#/clone/{{ afform.name }}" class="btn btn-xs btn-primary">{{ ts('Clone') }}</a>
+ <a ng-if="afform.type !== 'system'" href="#/edit/{{ afform.name }}" class="btn btn-xs btn-primary">{{:: ts('Edit') }}</a>
+ <a ng-if="afform.type !== 'system'" href="#/clone/{{ afform.name }}" class="btn btn-xs btn-primary">{{:: ts('Clone') }}</a>
<a href ng-if="afform.has_local" class="btn btn-xs btn-danger" crm-confirm="{type: afform.has_base ? 'revert' : 'delete', obj: afform}" on-yes="$ctrl.revert(afform)">
{{ afform.has_base ? ts('Revert') : ts('Delete') }}
</a>