FormBuilder - Hide configuration options that do not apply to certain form types
[civicrm-core.git] / ext / afform / admin / ang / afGuiEditor / config-form.html
1 <ng-form name="config_form">
2
3 <div class="form-group">
4 <label for="af_config_form_title">
5 {{:: ts('Title') }} <span class="crm-marker">*</span>
6 </label>
7 <p class="help-block" ng-if=":: editor.afform.type !== 'block'">{{:: ts('Public title (usually displayed at the top of the form).') }}</p>
8 <input ng-model="editor.afform.title" class="form-control" id="af_config_form_title" required title="{{:: ts('Required') }}" />
9 </div>
10
11 <div class="form-group">
12 <label for="af_config_form_description">
13 {{:: ts('Description') }}
14 </label>
15 <textarea ng-model="editor.afform.description" class="form-control" id="af_config_form_description"></textarea>
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
20 <!-- Form permissions do not apply to blocks -->
21 <div class="form-group" ng-if=":: editor.afform.type !== 'block'">
22 <label for="af_config_form_permission">
23 {{:: ts('Permission') }}
24 </label>
25 <input ng-model="editor.afform.permission" class="form-control" id="af_config_form_permission" crm-ui-select="{data: editor.meta.permissions}" />
26 <p class="help-block">{{:: ts('What permission is required to use this form?') }}</p>
27 </div>
28
29 <!-- Placement options do not apply to blocks -->
30 <fieldset ng-if=":: editor.afform.type !== 'block'">
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">
35 {{:: ts('Page') }}
36 </label>
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;') }}">
38 <p class="help-block">{{:: ts('Expose the form as a standalone webpage. (Example: "civicrm/my-form")') }}</p>
39 </div>
40
41 <div class="form-group" ng-if="!!editor.afform.server_route">
42 <label>
43 <input type="checkbox" ng-model="editor.afform.is_public">
44 {{:: ts('Accessible on front-end of website') }}
45 </label>
46 </div>
47
48 <div class="form-group" ng-if="!!editor.afform.server_route">
49 <label>
50 <input type="checkbox" ng-model="editor.afform.is_token">
51 {{:: ts('Provide Email Token') }}
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>
58 <input type="checkbox" ng-model="editor.afform.is_dashlet">
59 {{:: ts('Add to Dashboard') }}
60 </label>
61 <p class="help-block">{{:: ts('Allow CiviCRM users to add the form to their home dashboard.') }}</p>
62 </div>
63
64 <div class="form-group">
65 <div class="form-inline">
66 <label>
67 <input type="checkbox" ng-checked="editor.afform.contact_summary" ng-click="editor.toggleContactSummary()">
68 {{:: ts('Add to Contact Summary Page') }}
69 </label>
70 <select class="form-control" ng-model="editor.afform.contact_summary" ng-if="editor.afform.contact_summary">
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>
77 <div class="form-group" ng-if="editor.afform.contact_summary && editor.searchDisplay && editor.searchFilters.length > 1">
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>
88 </fieldset>
89
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'">
92 <legend>{{:: ts('Submit Actions') }}</legend>
93
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
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>
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') }}"/>
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>
110 </ng-form>