-
Notifications
You must be signed in to change notification settings - Fork 105
Expand file tree
/
Copy pathBlogManagePlugin.razor
More file actions
71 lines (66 loc) · 2.59 KB
/
BlogManagePlugin.razor
File metadata and controls
71 lines (66 loc) · 2.59 KB
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
@rendermode InteractiveServer
<div class="m-4">
@if(CurrentState == BlogManagementState.List)
{
<Grid ItemsSmall="GridItems.Start" JustifySmall="GridJustify.Between">
<GridItem>
<Typography Size="TextSize.H5">Blogs</Typography>
</GridItem>
<GridItem>
<Stack>
<Button @onclick="NavigateBack">
Back
</Button>
<Button Color="Color.Primary" @onclick="OnAddItemClicked">
<Icon Name="IconName.Plus" />
Add Blog
</Button>
</Stack>
</GridItem>
</Grid>
<Spacer />
@if (Items != null)
{
<div class="">
@foreach (var item in Items)
{
<div class="flex pt-4 border-t justify-between items-center">
<div class="flex-1">
<div class="mb-4">
<h2 class="text-xl font-bold"><a href="@GetDetailUrl("Blog Detail", new { Id = item.Id })">@item.Title</a></h2>
<p class="text-gray-800">@item.Description</p>
</div>
</div>
<Stack>
<Button Color="Color.Danger" Outline @onclick="() => OnDeleteItemClicked(item)">delete</Button>
<Button Color="Color.Primary" Outline @onclick="() => OnEditItemClicked(item)">Edit</Button>
</Stack>
</div>
}
</div>
}
}
else if (CurrentState == BlogManagementState.Create)
{
<Typography Size="TextSize.H5">Create Blog Content</Typography>
<Spacer />
<Card>
<CardBody>
<BlogEditForm Model="@Model" FormName="@CONTENT_TYPE_NAME" OnSubmit="OnCreateBlog" OnCancel="NavigateBack"/>
</CardBody>
</Card>
}
else if (CurrentState == BlogManagementState.Edit)
{
<Typography Size="TextSize.H5">Edit Blog Content</Typography>
<Spacer />
<Card>
<CardBody>
<BlogEditForm Model="@Model" FormName="@CONTENT_TYPE_NAME" OnSubmit="OnEditBlog" OnCancel="NavigateBack"/>
</CardBody>
</Card>
}
</div>
<Confirm OnConfirm="OnDeleteItem" OnCancel="OnConfirmClose" Visible="DeleteConfirmOpen">
Are you sure to delete this content?
</Confirm>