Skip to content

Commit

Permalink
Afform Tags - add to FormBuilder afform listing
Browse files Browse the repository at this point in the history
  • Loading branch information
ufundo committed Jan 27, 2025
1 parent fca5d42 commit d99b988
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ext/afform/admin/ang/afAdmin.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// Load data for lists
afforms: function(crmApi4) {
return crmApi4('Afform', 'get', {
select: ['name', 'title', 'type', 'server_route', 'is_public', 'submission_count', 'submission_date', 'submit_limit', 'submit_enabled', 'submit_currently_open', 'has_local', 'has_base', 'base_module', 'base_module:label', 'placement:label']
select: ['name', 'title', 'type', 'server_route', 'is_public', 'submission_count', 'submission_date', 'submit_limit', 'submit_enabled', 'submit_currently_open', 'has_local', 'has_base', 'base_module', 'base_module:label', 'placement:label', 'tags:label']
});
}
}
Expand Down
1 change: 1 addition & 0 deletions ext/afform/admin/ang/afAdmin/afAdminList.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
this.afforms = _.transform(afforms, function(afforms, afform) {
afform.type = afform.type || 'system';
afform.placement = afform['placement:label'];
afform.tags = afform['tags:label'];
if (afform.submission_date) {
afform.submission_date = CRM.utils.formatDate(afform.submission_date);
}
Expand Down
14 changes: 12 additions & 2 deletions ext/afform/admin/ang/afAdmin/afAdminList.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,12 @@ <h1 crm-page-title>{{:: ts('FormBuilder') }}</h1>
<i class="crm-i fa-sort-{{ $ctrl.sortDir ? 'asc' : 'desc' }}" ng-if="$ctrl.sortField === 'base_module'"></i>
{{:: ts('Package') }}
</th>
<th></th>
<th title="{{:: ts('Click to sort') }}" ng-click="$ctrl.sortBy('tags')">
<i class="crm-i fa-sort disabled" ng-if="$ctrl.sortField !== 'tags'"></i>
<i class="crm-i fa-sort-{{ $ctrl.sortDir ? 'asc' : 'desc' }}" ng-if="$ctrl.sortField === 'tags'"></i>
{{:: ts('Tags') }}
</th>
<th>{{:: ts('Actions') }}</th>
</tr>
</thead>
<tbody>
Expand All @@ -90,7 +95,9 @@ <h1 crm-page-title>{{:: ts('FormBuilder') }}</h1>
{{:: afform.server_route }}
</a>
</td>
<td>{{:: afform.placement.join(', ') }}</td>
<td>
{{:: afform.placement.join(', ') }}
</td>
<td ng-if="$ctrl.tab === 'form'">
{{:: afform.submit_currently_open ? ts('Open') : ts('Closed') }}
<span ng-if="afform.submit_limit && afform.submit_enabled">
Expand All @@ -108,6 +115,9 @@ <h1 crm-page-title>{{:: ts('FormBuilder') }}</h1>
<td>
{{:: afform['base_module:label'] }}
</td>
<td>
{{:: afform.tags.join(', ') }}
</td>
<td class="text-right">
<a ng-if="afform.type !== 'system'" ng-href="#/edit/{{:: afform.name }}" class="btn btn-xs btn-primary">{{:: ts('Edit') }}</a>
<a ng-if="afform.type !== 'system'" ng-href="#/clone/{{:: afform.name }}" class="btn btn-xs btn-secondary">{{:: ts('Clone') }}</a>
Expand Down

0 comments on commit d99b988

Please sign in to comment.