1
1
@using LinkDotNet .Blog .Domain
2
+ @using Microsoft .EntityFrameworkCore .Metadata .Internal
2
3
@inject IJSRuntime JSRuntime
3
4
4
5
<h3 >@Title </h3 >
7
8
<div class =" new-content" >
8
9
<EditForm Model =" @model" OnValidSubmit =" OnValidBlogPostCreatedAsync" >
9
10
<DataAnnotationsValidator />
10
- <ValidationSummary />
11
11
<div class =" mb-3" >
12
12
<label for =" title" >Title</label >
13
- <input class =" form-control" id =" title"
14
- @oninput =" args => model.Title = args.Value.ToString()" value =" @model.Title" />
13
+ <input class =" form-control" id =" title"
14
+ @oninput =" args => model.Title = args.Value.ToString()" value =" @model.Title" />
15
+ <ValidationMessage For =" () => model.Title" ></ValidationMessage >
15
16
</div >
16
17
<div class =" mb-3" >
17
18
<label for =" short" >Short Description</label >
18
19
<TextAreaWithShortcuts Id =" short" Class =" form-control" Rows =" 4"
19
20
@bind-Value =" @model.ShortDescription" ></TextAreaWithShortcuts >
20
- <small for =" short" class =" form-text text-muted" >You can use markdown to style your component</small >
21
+ <small for =" short" class =" form-text text-muted" >You can use markdown to style your component</small >
22
+ <ValidationMessage For =" () => model.ShortDescription" ></ValidationMessage >
21
23
</div >
22
24
<div class =" mb-3" >
23
25
<label for =" content" >Content</label >
24
26
<TextAreaWithShortcuts Id =" content" Class =" form-control" Rows =" 10"
25
27
@bind-Value =" @model.Content" ></TextAreaWithShortcuts >
26
28
<small for =" content" class =" form-text text-muted" >You can use markdown to style your component. Additional features and keyboard shortcuts are listed <a @onclick =" @(() => FeatureDialog.Open())" >here</a ></small >
27
29
<UploadFile OnFileUploaded =" SetContentFromFile" id =" content-upload" ></UploadFile >
28
- <small for =" content-upload" class =" form-text text-muted" >Drag and drop markdown files to upload and
29
- insert them</small >
30
+ <small for =" content-upload" class =" form-text text-muted" >Drag and drop markdown files to upload and
31
+ insert them</small >
32
+ <ValidationMessage For =" () => model.Content" ></ValidationMessage >
30
33
</div >
31
34
<div class =" mb-3" >
32
35
<label for =" preview" >Preview-Url</label >
33
36
<InputText class =" form-control" id =" preview" @bind-Value =" model.PreviewImageUrl" />
34
37
<small for =" preview" class =" form-text text-muted" >The primary image which will be used.</small >
38
+ <ValidationMessage For =" () => model.PreviewImageUrl" ></ValidationMessage >
35
39
</div >
36
40
<div class =" mb-3" >
37
41
<label for =" preview" >Fallback Preview-Url</label >
38
42
<InputText class =" form-control" id =" fallback-preview" @bind-Value =" model.PreviewImageUrlFallback" />
39
43
<small for =" fallback-preview" class =" form-text text-muted" >Optional: Used as a fallback if the preview image can't be used by the browser.
40
- <br >For example using a jpg or png as fallback for avif which is not supported in Safari or Edge.</small >
44
+ <br >For example using a jpg or png as fallback for avif which is not supported in Safari or Edge.</small >
45
+ <ValidationMessage For =" () => model.PreviewImageUrlFallback" ></ValidationMessage >
41
46
</div >
42
47
<div class =" form-check" >
43
48
<InputCheckbox class =" form-check-input" id =" published" @bind-Value =" model.IsPublished" />
141
146
context .PreventNavigation ();
142
147
}
143
148
}
144
- }
149
+ }
0 commit comments