Skip to content

Commit d62939b

Browse files
author
Farzin
committed
Categories page cleanup
1 parent 12e9288 commit d62939b

1 file changed

Lines changed: 40 additions & 39 deletions

File tree

src/Blogifier.Admin/Pages/Blog/CategoriesView.razor

Lines changed: 40 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -9,32 +9,36 @@
99

1010
<PageTitle Title="@_localizer["Categories"]" />
1111

12-
<div class="app-posts pr-0 pr-lg-5">
13-
12+
@if (!IsEdit)
13+
{
14+
<div class="section-content">
1415
<div class="list-toolbar">
15-
1616
<label class="list-check form-check" data-toggle="tooltip" title="Select All">
1717
<input type="checkbox" @onchange="EventArgs => { CheckAll(EventArgs.Value); }" class="list-check-input form-check-input">
1818
</label>
19-
2019
@*<a class="btn btn-blogifier me-3 -add" href="/admin/pages/editor">@_localizer["New Category"]</a>*@
21-
2220
@if (Categories != null && Categories.Count > 0)
2321
{
24-
<button type="button" @onclick="(async ()=> await RunAction(GroupAction.Delete))" class="btn btn-link text-danger" title="@_localizer["delete"]">
25-
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-x-circle" viewBox="0 0 16 16">
26-
<path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z" />
27-
<path d="M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z" />
28-
</svg>
29-
</button>
22+
<div class="dropdown dropdown-flush">
23+
<button class="btn btn-link dropdown-toggle" type="button" id="dropdownAction" data-bs-toggle="dropdown" aria-expanded="false">
24+
@_localizer["Action"]
25+
</button>
26+
<div class="dropdown-menu" aria-labelledby="dropdownAction">
27+
<button type="button" @onclick="(async ()=> await RunAction(GroupAction.Delete))" class="dropdown-item text-danger">
28+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-x-circle" viewBox="0 0 16 16">
29+
<path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z" />
30+
<path d="M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z" />
31+
</svg>
32+
<span>@_localizer["delete"]</span>
33+
</button>
34+
</div>
35+
</div>
3036
}
31-
3237
<button type="button" class="btn btn-link list-search-toggle ms-auto" data-bs-toggle="collapse" data-bs-target="#collapseSearch">
3338
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-search" viewBox="0 0 16 16">
3439
<path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z" />
3540
</svg>
3641
</button>
37-
3842
</div>
3943

4044
<div class="list-search collapse" id="collapseSearch">
@@ -78,35 +82,32 @@
7882
<p>@_localizer["This list is empty"]</p>
7983
</div>
8084
}
85+
</div>
86+
}
8187

82-
<!-- New or Edit -->
83-
@if(IsEdit && CurrentCategory != null)
84-
{
85-
<div>
86-
<h1 class="section-title">@_localizer["Edit Category"]</h1>
87-
<EditForm model="@CurrentCategory" OnValidSubmit="SaveEdit">
88-
<DataAnnotationsValidator />
89-
<ValidationSummary />
90-
<div class="section-content -half">
91-
<div class="form-item">
92-
<label class="form-label">@_localizer["title"]</label>
93-
<input type="text" class="form-control" name="title" @bind="CurrentCategory.Content" />
94-
</div>
95-
<div class="form-item">
96-
<label class="form-label">@_localizer["description"]</label>
97-
<textarea class="form-control" cols="30" rows="5" name="description" @bind="CurrentCategory.Description"></textarea>
98-
</div>
99-
<div class="form-item">
100-
<button type="submit" class="btn btn-blogifier px-5 me-3">@_localizer["save"]</button>
101-
<button type="button" class="btn btn-default px-4" @onclick="CancelEdit">@_localizer["cancel"]</button>
102-
</div>
88+
@if(IsEdit && CurrentCategory != null)
89+
{
90+
<h1 class="section-title">@_localizer["Edit Category"]</h1>
91+
<EditForm model="@CurrentCategory" OnValidSubmit="SaveEdit">
92+
<DataAnnotationsValidator />
93+
<ValidationSummary />
94+
<div class="section-content -half">
95+
<div class="form-item">
96+
<label class="form-label">@_localizer["title"]</label>
97+
<input type="text" class="form-control" name="title" @bind="CurrentCategory.Content" />
10398
</div>
104-
</EditForm>
105-
</div>
106-
}
107-
<!--/ -->
99+
<div class="form-item">
100+
<label class="form-label">@_localizer["description"]</label>
101+
<textarea class="form-control" cols="30" rows="5" name="description" @bind="CurrentCategory.Description"></textarea>
102+
</div>
103+
<div class="form-item">
104+
<button type="submit" class="btn btn-blogifier px-5 me-3">@_localizer["save"]</button>
105+
<button type="button" class="btn btn-default px-4" @onclick="CancelEdit">@_localizer["cancel"]</button>
106+
</div>
107+
</div>
108+
</EditForm>
109+
}
108110

109-
</div>
110111
<ToasterComponent @ref="Toaster" />
111112

112113
@code {

0 commit comments

Comments
 (0)