Commit | Line | Data |
---|---|---|
894cb44d | 1 | <div af-api4-ctrl="apiData" af-api4="['Afform', 'get', {layoutFormat: 'html', where: [['name', '=', options.name]]}]"> |
1aac4625 TO |
2 | |
3 | <div ng-if="apiData.result.length == 0"> | |
4 | {{ts('Failed to find requested form.')}} | |
5 | </div> | |
6 | ||
ee1d684a TO |
7 | <div ng-repeat="resultForm in apiData.result" ng-if="apiData.result.length > 0" class="container-fluid"> |
8 | ||
9 | <div class="row"> | |
10 | ||
11 | <div class="col-sm-12 col-md-4"> | |
12 | <div class="panel panel-default"> | |
13 | <div class="panel-heading">{{ts('Properties')}}</div> | |
14 | <div class="panel-body"> | |
15 | ||
16 | <div crm-ui-debug="resultForm"></div> | |
17 | ||
18 | <div class="form-group"> | |
19 | <label class="control-label">{{ts('Name')}}</label> | |
20 | <p class="form-control-static">{{resultForm.name}}</p> | |
21 | </div> | |
22 | <div class="form-group"> | |
23 | <label class="control-label">{{ts('Title')}}</label> | |
24 | <input ng-model="resultForm.title" type="text" class="form-control" /> | |
25 | </div> | |
5a843dab TO |
26 | <div class="form-group"> |
27 | <label class="control-label">{{ts('Description')}}</label> | |
28 | <textarea class="form-control" ng-model="resultForm.description"></textarea> | |
29 | <p class="help-block">{{ts('Semi-private description about the form\'s purpose.')}}</p> | |
30 | <!-- "Semi-private": not generally public, but not audited for secrecy --> | |
31 | </div> | |
ee1d684a TO |
32 | <div class="form-group"> |
33 | <label class="control-label">{{ts('Path')}}</label> | |
34 | <input ng-model="resultForm.server_route" type="text" class="form-control" /> | |
5a843dab TO |
35 | <p class="help-block">{{ts('Expose the form as a standalone page on the web site. (Example: "civicrm/my-form")')}}</p> |
36 | </div> | |
37 | <div class="form-group" ng-if="!!resultForm.server_route"> | |
38 | <label for="af_config_form_is_public"> | |
39 | <input type="checkbox" id="af_config_form_is_public" ng-model="resultForm.is_public"> | |
40 | {{ ts('Enable frontend styling') }} | |
41 | </label> | |
42 | <p class="help-block">{{ts('The general look/feel should match the frontend')}}</p> | |
ee1d684a | 43 | </div> |
51fcb47c TO |
44 | <div class="form-group" ng-if="!!resultForm.server_route"> |
45 | <label for="af_config_form_is_token"> | |
46 | <input type="checkbox" id="af_config_form_is_token" ng-model="resultForm.is_token"> | |
47 | {{ ts('Enable email token') }} | |
48 | </label> | |
49 | <p class="help-block">{{ts('Allow email authors to easily link to this form')}}</p> | |
50 | </div> | |
ee1d684a | 51 | <div class="form-group"> |
5a843dab TO |
52 | <label for="af_config_form_is_dashlet"> |
53 | <input type="checkbox" id="af_config_form_is_dashlet" ng-model="resultForm.is_dashlet"> | |
54 | {{ ts('Enable dashlet') }} | |
55 | </label> | |
56 | <p class="help-block">{{ts('Allow backend users to embed the form on the dashboard.')}}</p> | |
ee1d684a TO |
57 | </div> |
58 | <div class="form-group"> | |
5a843dab TO |
59 | <label class="control-label">{{ts('Permission')}}</label> |
60 | <input ng-model="resultForm.permission" type="text" class="form-control" /> | |
61 | <p class="help-block">{{ts('What permission is required to use this form?')}}</p> | |
ee1d684a | 62 | </div> |
ee1d684a TO |
63 | </div> |
64 | </div> | |
784141a8 | 65 | |
ee1d684a | 66 | <div class="clearfix"></div> |
bbd4d814 SL |
67 | |
68 | <div class="panel panel-default"> | |
69 | <div class="panel-heading">{{ts('Submit Actions')}}</div> | |
70 | <div class="panel-body"> | |
71 | <ng-form name="submitActions"> | |
72 | <div class="form-group" ng-class="{'has-error': !!submitActions.redirect.$error.pattern}"> | |
73 | <label class="control-label" for="af_config_redirect">{{ ts('Post-Submit Page') }}</label> | |
74 | <input ng-model="resultForm.redirect" name="redirect" class="form-control" id="af_result_from_redirect" title="{{ ts('Post-Submit Page') }}" pattern="^((http|https):\/\/|\/|civicrm\/)[-0-9a-zA-Z\/_.]\S+$" title="{{ ts('Post-Submit Page must be either an absolute url, a relative url or a path starting with CiviCRM') }}"/> | |
75 | <p class="help-block">{{ts('Enter a URL or path that the form should redirect to following a successful submission.') }}</p> | |
76 | </div> | |
77 | </ng-form> | |
78 | </div> | |
79 | </div> | |
80 | ||
81 | <div class="clearfix"></div> | |
82 | ||
ee1d684a | 83 | </div> |
9313f9f5 | 84 | |
ee1d684a TO |
85 | <div class="col-sm-12 col-md-8"> |
86 | <div class="panel panel-default"> | |
87 | <div class="panel-heading"> | |
88 | <div class="btn-group btn-group-xs pull-right" role="group" aria-label="{{ts('Actions')}}"> | |
9313f9f5 | 89 | |
ee1d684a TO |
90 | <a class="btn btn-default" target="_blank" ng-href="{{crmUrl(resultForm.server_route)}}" ng-if="resultForm.server_route"> |
91 | <i class="crm-i fa-location-arrow"></i> | |
92 | {{ts('Open')}} | |
93 | </a> | |
94 | ||
95 | <a class="btn btn-default" | |
96 | af-api4-action="['Afform', 'update', {layoutFormat: 'html', where: [['name', '=', resultForm.name]], values:resultForm}]"> | |
97 | <i class="crm-i fa-floppy-o"></i> | |
98 | {{ts('Save')}} | |
99 | </a> | |
100 | ||
101 | </div> | |
102 | ||
103 | {{ts('Markup')}} | |
104 | </div> | |
105 | <div class="panel-body"> | |
9a78af90 | 106 | <div crm-monaco ng-model="resultForm.layout"></div> |
ee1d684a TO |
107 | </div> |
108 | </div> | |
109 | </div> | |
110 | ||
111 | </div> | |
1aac4625 | 112 | </div> |
fc2cb864 | 113 | |
1aac4625 | 114 | </div> |