Skip to content

Commit 30bb027

Browse files
Create delegates.html
1 parent 8ccf794 commit 30bb027

File tree

1 file changed

+82
-0
lines changed
  • Modern Development/Service Portal Widgets/Manage Delegates Widget

1 file changed

+82
-0
lines changed
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
<div class="panel panel-default">
2+
<div class="panel-heading">
3+
<h3 class="panel-title">Delegates</h3>
4+
</div>
5+
<div class="panel-body">
6+
<div ng-if="!c.data.delegates.length" class="alert alert-info text-center">
7+
You have no active delegates.
8+
</div>
9+
10+
<ul class="list-group" ng-if="c.data.delegates.length > 0">
11+
<li class="list-group-item delegate-item" ng-repeat="d in c.data.delegates">
12+
<h4>{{d.delegate_display}}</h4>
13+
<p class="text-muted">
14+
<strong>User:</strong> {{d.user_display}} <br/>
15+
<strong>Starts:</strong> {{d.starts_display || 'N/A'}} <br/>
16+
<strong>Ends:</strong> {{d.ends_display || 'N/A'}}
17+
</p>
18+
<p>
19+
<strong>Notifications:</strong>
20+
<span ng-if="d.approvals"> Approvals</span>
21+
<span ng-if="d.assignments"> Assignments</span>
22+
<span ng-if="d.notifications"> All</span>
23+
<span ng-if="d.invitations"> Invitations</span>
24+
</p>
25+
<div class="btn-row">
26+
<button class="btn btn-sm btn-default" ng-click="c.edit(d.sys_id)">
27+
<i class="fa fa-edit"></i> Edit
28+
</button>
29+
</div>
30+
</li>
31+
</ul>
32+
33+
<hr/>
34+
35+
<div class="delegate-form-container">
36+
<h4 ng-if="!c.editing">Create a New Delegate</h4>
37+
<h4 ng-if="c.editing">Edit Delegate</h4>
38+
39+
<form name="delegateForm" ng-submit="c.saveDelegate()">
40+
<!-- User is not editable: recorded as current user server-side -->
41+
42+
<div class="form-group">
43+
<label for="delegate">Delegate <span class="text-danger">*</span></label>
44+
<sn-record-picker field="c.delegateField" table="'sys_user'" display-field="'name'" value-field="'sys_id'" search-fields="'name,email'" page-size="10" placeholder="Search delegate..." required></sn-record-picker>
45+
</div>
46+
47+
<div class="row">
48+
<div class="col-md-6">
49+
<div class="form-group">
50+
<label>Starts</label>
51+
<input type="datetime-local" class="form-control" ng-model="c.form.starts_local" />
52+
</div>
53+
</div>
54+
<div class="col-md-6">
55+
<div class="form-group">
56+
<label>Ends</label>
57+
<input type="datetime-local" class="form-control" ng-model="c.form.ends_local" />
58+
</div>
59+
</div>
60+
</div>
61+
62+
<div class="checkboxes form-group">
63+
<label class="checkbox-inline"><input type="checkbox" ng-model="c.form.approvals"> Approvals</label>
64+
<label class="checkbox-inline"><input type="checkbox" ng-model="c.form.assignments"> Assignments</label>
65+
<label class="checkbox-inline"><input type="checkbox" ng-model="c.form.notifications"> All notifications</label>
66+
<label class="checkbox-inline"><input type="checkbox" ng-model="c.form.invitations"> Meeting invitations</label>
67+
</div>
68+
69+
<div class="form-group">
70+
<button type="submit" class="btn btn-primary" ng-disabled="delegateForm.$invalid">
71+
<i class="fa" ng-class="{'fa-plus-circle': !c.editing, 'fa-save': c.editing}"></i>
72+
{{c.editing ? 'Save' : 'Create'}}
73+
</button>
74+
<button type="button" class="btn btn-default" ng-click="c.resetForm()">New</button>
75+
<button type="button" class="btn btn-danger" ng-if="c.editing" ng-click="c.deleteDelegate()">
76+
<i class="fa fa-trash"></i> Delete
77+
</button>
78+
</div>
79+
</form>
80+
</div>
81+
</div>
82+
</div>

0 commit comments

Comments
 (0)