FormBuilder - Hide configuration options that do not apply to certain form types
[civicrm-core.git] / ext / afform / admin / ang / afGuiEditor / config-form.html
CommitLineData
e7e01b75
TO
1<ng-form name="config_form">
2
e597f904
CW
3 <div class="form-group">
4 <label for="af_config_form_title">
12cf72ab 5 {{:: ts('Title') }} <span class="crm-marker">*</span>
e597f904 6 </label>
09a3e370 7 <p class="help-block" ng-if=":: editor.afform.type !== 'block'">{{:: ts('Public title (usually displayed at the top of the form).') }}</p>
d617083a 8 <input ng-model="editor.afform.title" class="form-control" id="af_config_form_title" required title="{{:: ts('Required') }}" />
e597f904
CW
9 </div>
10
11 <div class="form-group">
12 <label for="af_config_form_description">
12cf72ab 13 {{:: ts('Description') }}
e597f904 14 </label>
d617083a 15 <textarea ng-model="editor.afform.description" class="form-control" id="af_config_form_description"></textarea>
e597f904
CW
16 <p class="help-block">{{:: ts("Internal note about the form's purpose (not displayed on form).") }}</p>
17 <!-- Description is "semi-private": not generally public, but not audited for secrecy -->
18 </div>
19
09a3e370
CW
20 <!-- Form permissions do not apply to blocks -->
21 <div class="form-group" ng-if=":: editor.afform.type !== 'block'">
e597f904 22 <label for="af_config_form_permission">
12cf72ab 23 {{:: ts('Permission') }}
e597f904 24 </label>
d617083a 25 <input ng-model="editor.afform.permission" class="form-control" id="af_config_form_permission" crm-ui-select="{data: editor.meta.permissions}" />
e597f904
CW
26 <p class="help-block">{{:: ts('What permission is required to use this form?') }}</p>
27 </div>
28
09a3e370
CW
29 <!-- Placement options do not apply to blocks -->
30 <fieldset ng-if=":: editor.afform.type !== 'block'">
e597f904
CW
31 <legend>{{:: ts('Placement') }}</legend>
32
33 <div class="form-group" ng-class="{'has-error': !!config_form.server_route.$error.pattern}">
34 <label for="af_config_form_server_route">
12cf72ab 35 {{:: ts('Page') }}
e597f904 36 </label>
d617083a 37 <input ng-model="editor.afform.server_route" name="server_route" class="form-control" id="af_config_form_server_route" pattern="^civicrm\/[-0-9a-zA-Z\/_]+$" onfocus="this.value = this.value || 'civicrm/'" onblur="if (this.value === 'civicrm/') this.value = ''" title="{{:: ts('Path must begin with &quot;civicrm/&quot;') }}">
e597f904
CW
38 <p class="help-block">{{:: ts('Expose the form as a standalone webpage. (Example: "civicrm/my-form")') }}</p>
39 </div>
40
d617083a 41 <div class="form-group" ng-if="!!editor.afform.server_route">
e597f904 42 <label>
d617083a
CW
43 <input type="checkbox" ng-model="editor.afform.is_public">
44 {{:: ts('Accessible on front-end of website') }}
e597f904
CW
45 </label>
46 </div>
47
d617083a 48 <div class="form-group" ng-if="!!editor.afform.server_route">
e597f904 49 <label>
d617083a 50 <input type="checkbox" ng-model="editor.afform.is_token">
12cf72ab 51 {{:: ts('Provide Email Token') }}
e597f904
CW
52 </label>
53 <p class="help-block">{{:: ts('Allows CiviMail authors to easily link to this page') }}</p>
54 </div>
55
56 <div class="form-group">
57 <label>
d617083a 58 <input type="checkbox" ng-model="editor.afform.is_dashlet">
12cf72ab 59 {{:: ts('Add to Dashboard') }}
e597f904
CW
60 </label>
61 <p class="help-block">{{:: ts('Allow CiviCRM users to add the form to their home dashboard.') }}</p>
62 </div>
c63f20d3
CW
63
64 <div class="form-group">
65 <div class="form-inline">
66 <label>
d617083a 67 <input type="checkbox" ng-checked="editor.afform.contact_summary" ng-click="editor.toggleContactSummary()">
12cf72ab 68 {{:: ts('Add to Contact Summary Page') }}
c63f20d3 69 </label>
d617083a 70 <select class="form-control" ng-model="editor.afform.contact_summary" ng-if="editor.afform.contact_summary">
c63f20d3
CW
71 <option value="block">{{:: ts('As Block') }}</option>
72 <option value="tab">{{:: ts('As Tab') }}</option>
73 </select>
74 </div>
75 <p class="help-block">{{:: ts('Placement can be configured using the Contact Layout Editor.') }}</p>
76 </div>
d617083a 77 <div class="form-group" ng-if="editor.afform.contact_summary && editor.searchDisplay && editor.searchFilters.length > 1">
c63f20d3
CW
78 <div class="form-inline">
79 <label for="af_config_form_search_filters">
80 {{:: ts('Filter on:') }}
81 </label>
82 <select class="form-control" id="af_config_form_search_filters" ng-model="editor.searchDisplay.filters">
83 <option ng-repeat="option in editor.searchFilters" value="{{ option.key }}">{{ option.label }}</option>
84 </select>
85 </div>
86 <p class="help-block">{{:: ts('Choose which contact from the search should match the contact being viewed.') }}</p>
87 </div>
e597f904 88 </fieldset>
b6e13973 89
09a3e370
CW
90 <!-- Submit actions are only applicable to form types with a submit button (exclude blocks and search forms) -->
91 <fieldset ng-if=":: editor.afform.type === 'custom'">
b6e13973 92 <legend>{{:: ts('Submit Actions') }}</legend>
18542414 93
e6772fc6
CW
94 <div class="form-group" >
95 <label>
96 <input type="checkbox" ng-model="editor.afform.create_submission" >
97 {{:: ts('Log Submissions') }}
98 </label>
99 <p class="help-block">{{:: ts('Keep a log of the date, time, user, and items saved by each form submission.') }}</p>
100 </div>
101
b6e13973
SL
102 <div class="form-group" ng-class="{'has-error': !!config_form.redirect.$error.pattern}">
103 <label for="af_config_redirect">
104 {{:: ts('Post-Submit Page') }}
105 </label>
d617083a 106 <input ng-model="editor.afform.redirect" name="redirect" class="form-control" id="af_config_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') }}"/>
b6e13973
SL
107 <p class="help-block">{{:: ts('Enter a URL or path that the form should redirect to following a successful submission.') }}</p>
108 </div>
109 </fieldset>
e7e01b75 110</ng-form>