Blogging add post url controls

pull/318/head
Yunus Emre Kalkan 7 years ago
parent 603d17737c
commit be562c4b5e

@ -1,23 +1,25 @@
@page
@using Volo.Blogging.Pages.Blog.Posts
@model EditModel
@inherits Volo.Blogging.Pages.Blog.BloggingPage
<form method="post" id="edit-post-form">
<abp-input asp-for="@Model.Post.Title" auto-focus="true" />
@section scripts {
<abp-script-bundle name="@typeof(EditModel).FullName">
<abp-script src="/pages/blog/posts/edit.js" />
</abp-script-bundle>
}
<form method="post">
<abp-input asp-for="@Model.Post.Title" auto-focus="true" />
<abp-input asp-for="@Model.Post.Url" />
<div class="form-group">
<label>Content</label>
<label>@L["Content"]</label>
<textarea rows="4" class="form-control" name="Post.Content">@Model.Post.Content</textarea>
</div>
<abp-input asp-for="@Model.Post.BlogId" hidden="" />
<abp-input asp-for="@Model.Post.Id" hidden="" />
<abp-button type="submit" form="edit-post-form">
<span>Submit</span>
</abp-button>
<abp-button type="submit" text="@L["Submit"].Value" />
</form>

@ -2,6 +2,12 @@
@using Volo.Blogging.Pages.Blog.Posts
@model NewModel
@inherits Volo.Blogging.Pages.Blog.BloggingPage
@section scripts {
<abp-script-bundle name="@typeof(NewModel).FullName">
<abp-script src="/pages/blog/posts/bew.js" />
</abp-script-bundle>
}
<form method="post">
<abp-input asp-for="Post.Title" auto-focus="true" />

@ -25,4 +25,8 @@
<EmbeddedResource Include="Pages\**\*.cshtml" Exclude="*.cs" />
</ItemGroup>
<ItemGroup>
<Content Remove="wwwroot\pages\blog\posts\edit.js" />
</ItemGroup>
</Project>

@ -0,0 +1,14 @@
(function ($) {
$('#Post_Title').on("change paste keyup", function() {
var title = $('#Post_Title').val();
if (title.length > 64) {
title = title.substring(0, 64);
}
title = title.replace(' ','-');
$('#Post_Url').val(title);
});
})(jQuery);

@ -0,0 +1,14 @@
(function ($) {
$('#Post_Title').on("change paste keyup", function() {
var title = $('#Post_Title').val();
if (title.length > 64) {
title = title.substring(0, 64);
}
title = title.replace(' ','-');
$('#Post_Url').val(title);
});
})(jQuery);
Loading…
Cancel
Save