Skip to content

Commit 2ff9422

Browse files
authored
Merge pull request #65 from ZahraaaRezaeiii/develop
Complete the Enhance the Visual Style of the "Organization Setting" Page #61
2 parents 63b7899 + 5076336 commit 2ff9422

File tree

2 files changed

+69
-15
lines changed

2 files changed

+69
-15
lines changed

src/CrystallineSociety/Client/CrystallineSociety.Client.Core/Components/Pages/OrganizationsSettingsPage.razor

Lines changed: 60 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,64 @@
33
@using CrystallineSociety.Shared.Dtos.Organization
44
@inherits AppComponentBase
55

6-
<BitBasicList TItem="OrganizationDto"
7-
ItemSize="4"
8-
Items="Organizations"
9-
Style="border: 1px #a19f9d solid; border-radius: 3px; height: auto; width: 50%;max-height:500px;">
10-
<RowTemplate Context="Organization">
11-
<div @key="Organization.Code" style="@(Organizations.Count > 1 ? "border-bottom: 1px #8a8886 solid; padding: 5px 20px; margin: 10px;" : "")">
12-
<div style="margin-left:3%; display: inline-block;">
13-
<p>Organization Name: <strong>@Organization.Title</strong></p>
14-
<BitButton OnClick="WrapHandled(()=>HandelSyncAsync(Organization))">
15-
Sync
16-
<BitRollerLoading Size="@(IsSyncing ? 13 : 0)" />
17-
</BitButton>
18-
</div>
6+
<div class="container-fluid p-4 pt-2">
7+
<div class="table-container">
8+
<h3 class="mb-3">Manage organizations</h3>
9+
<div class="d-flex justify-content-end mb-3">
10+
<button class="btn btn-outline-success">
11+
+ Add new organization
12+
</button>
1913
</div>
20-
</RowTemplate>
21-
</BitBasicList>
14+
<table class="table table-bordered table-fixed">
15+
<thead class="table-light">
16+
<tr>
17+
<th class="col-6">Organization name</th>
18+
<th class="col-6">Organization actions</th>
19+
</tr>
20+
</thead>
21+
<tbody>
22+
@foreach (var organization in Organizations)
23+
{
24+
<tr>
25+
<td>@organization.Title</td>
26+
<td class="d-flex justify-content-start gap-1 flex-wrap">
27+
<button class="btn btn-sm @(IsSyncing ? "btn-success opacity-100" : "btn-outline-success")"
28+
@onclick="async () => await HandelSyncAsync(organization)"
29+
disabled="@(IsSyncing)">
30+
@if (IsSyncing)
31+
{
32+
<div class="d-flex align-items-center">
33+
<span class="spinner-border spinner-border-sm me-2" role="status" aria-hidden="true"></span>
34+
Sync
35+
</div>
36+
}
37+
else
38+
{
39+
<span>Sync</span>
40+
}
41+
</button>
42+
<button class="btn btn-outline-primary btn-sm">
43+
Edit
44+
</button>
45+
<button class="btn btn-sm @(IsDeleting ? "btn-danger opacity-100" : "btn-outline-danger")"
46+
@onclick="async () => await HandelDeleteAsync(organization)"
47+
disabled="@(IsDeleting)">
48+
@if (IsDeleting)
49+
{
50+
<div class="d-flex align-items-center">
51+
<span class="spinner-border spinner-border-sm me-2" role="status" aria-hidden="true"></span>
52+
Delete
53+
</div>
54+
}
55+
else
56+
{
57+
<span>Delete</span>
58+
}
59+
</button>
60+
</td>
61+
</tr>
62+
}
63+
</tbody>
64+
</table>
65+
</div>
66+
</div>

src/CrystallineSociety/Client/CrystallineSociety.Client.Core/Components/Pages/OrganizationsSettingsPage.razor.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ public partial class OrganizationsSettingsPage
55
{
66
private List<OrganizationDto> Organizations = new();
77
private bool IsSyncing = false;
8+
private bool IsDeleting = false;
89

910

1011
protected override async Task OnInitAsync()
@@ -21,4 +22,12 @@ private async Task HandelSyncAsync(OrganizationDto organization)
2122
await HttpClient.PostAsJsonAsync("api/ProgramDocument/SyncOrganizationProgramDocuments", organization);
2223
IsSyncing = false;
2324
}
25+
26+
private async Task HandelDeleteAsync(OrganizationDto organization)
27+
{
28+
IsDeleting = true;
29+
await HttpClient.PostAsJsonAsync("api/Organization/SyncOrganizationBadges", organization);
30+
await HttpClient.PostAsJsonAsync("api/ProgramDocument/SyncOrganizationProgramDocuments", organization);
31+
IsDeleting = false;
32+
}
2433
}

0 commit comments

Comments
 (0)