-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGroupDetails.cshtml
131 lines (119 loc) · 3.8 KB
/
GroupDetails.cshtml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
@page
@model hack_together_groups_manager.Pages.GroupDetailsModel
@{
ViewData["Title"] = "M365 Group Details";
}
<script>
function showConfirmation(action) {
if (confirm("Are you sure you want to " + action + " this group?")) {
// Perform the delete action
document.getElementById("deleteGroupForm").submit();
}
}
</script>
<style>
body {
padding: 20px 0;
background: #f2f5f8;
}
</style>
<div class="text-left">
<h3 class="display-8">Group Details: </h3>
<table>
<tr>
<td>Display Name:</td>
<td>@Model.M365GroupDetails.DisplayName</td>
</tr>
<tr>
<td>Description:</td>
<td>@Model.M365GroupDetails.Description</td>
</tr>
<tr>
<td>Visibility:</td>
<td>@Model.M365GroupDetails.Visibility</td>
</tr>
</table>
<hr />
<p></p>
<div>
<h4 class="display-8">Owners:</h4>
</div>
<table class="table table-striped border">
@foreach (var owner in Model.M365GroupDetails.Owners)
{
<tr>
<td>
@Html.DisplayFor(m => owner)
</td>
</tr>
}
</table>
@if (Model.M365GroupDetails.UserRole == "Owner")
{
<form method="post" name="addOwners">
<input type="hidden" name="groupId" value="@Model.M365GroupDetails.Id" />
<div>
<div><b>Add Owners</b></div>
<table>
<tr>
<td>User Principal Name:</td>
<td>
<input type="text" asp-for="OwnerToAdd" placeholder="UPN of owner to add..." />
</td>
<td>
<input type="submit" id="btnAddOwner" value="Add Owner" asp-page-handler="AddOwner" />
</td>
</tr>
</table>
</div>
</form>
}
<hr />
<p></p>
<div>
<h4 class="display-8">Members:</h4>
</div>
<table class="table table-striped border">
@foreach (var member in Model.M365GroupDetails.Members)
{
<tr>
<td>
@Html.DisplayFor(m => member)
</td>
</tr>
}
</table>
@if (Model.M365GroupDetails.UserRole == "Owner")
{
<form method="post" name="addMembers">
<input type="hidden" name="groupId" value="@Model.M365GroupDetails.Id" />
<div>
<div><b>Add Members</b></div>
<table>
<tr>
<td>User Principal Name:</td>
<td>
<input type="text" asp-for="MemberToAdd" placeholder="UPN of member to add..." />
</td>
<td>
<input type="submit" id="btnAddMember" value="Add Member" asp-page-handler="AddMember" />
</td>
</tr>
</table>
</div>
</form>
}
<hr />
<form method="post" name="deleteGroupForm">
<input type="hidden" name="groupId" value="@Model.M365GroupDetails.Id" />
<table>
<tr>
@if (Model.M365GroupDetails.UserRole == "Owner")
{
<td><input type="submit" id="btnDelete" value="Delete Group" onclick="showConfirmation('delete')" asp-page-handler="Delete" /></td>
}
<td><input type="submit" id="btnLeave" value="Leave Group" onclick="showConfirmation('leave')" asp-page-handler="Leave" /></td>
</tr>
</table>
</form>
</div>