|
9 | 9 |
|
10 | 10 | <PageTitle Title="@_localizer["Categories"]" /> |
11 | 11 |
|
12 | | -<div class="app-posts pr-0 pr-lg-5"> |
13 | | - |
| 12 | +@if (!IsEdit) |
| 13 | +{ |
| 14 | +<div class="section-content"> |
14 | 15 | <div class="list-toolbar"> |
15 | | - |
16 | 16 | <label class="list-check form-check" data-toggle="tooltip" title="Select All"> |
17 | 17 | <input type="checkbox" @onchange="EventArgs => { CheckAll(EventArgs.Value); }" class="list-check-input form-check-input"> |
18 | 18 | </label> |
19 | | - |
20 | 19 | @*<a class="btn btn-blogifier me-3 -add" href="/admin/pages/editor">@_localizer["New Category"]</a>*@ |
21 | | - |
22 | 20 | @if (Categories != null && Categories.Count > 0) |
23 | 21 | { |
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> |
30 | 36 | } |
31 | | - |
32 | 37 | <button type="button" class="btn btn-link list-search-toggle ms-auto" data-bs-toggle="collapse" data-bs-target="#collapseSearch"> |
33 | 38 | <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-search" viewBox="0 0 16 16"> |
34 | 39 | <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" /> |
35 | 40 | </svg> |
36 | 41 | </button> |
37 | | - |
38 | 42 | </div> |
39 | 43 |
|
40 | 44 | <div class="list-search collapse" id="collapseSearch"> |
|
78 | 82 | <p>@_localizer["This list is empty"]</p> |
79 | 83 | </div> |
80 | 84 | } |
| 85 | +</div> |
| 86 | +} |
81 | 87 |
|
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" /> |
103 | 98 | </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 | +} |
108 | 110 |
|
109 | | -</div> |
110 | 111 | <ToasterComponent @ref="Toaster" /> |
111 | 112 |
|
112 | 113 | @code { |
|
0 commit comments