Browse Source

Completed the ui side

pull/15039/head
malik masis 4 years ago
parent
commit
b7b8bd1ea0
  1. 58
      modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/BlogPost.cshtml
  2. 16
      modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/blogPost.js
  3. 8
      modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/index.js
  4. 4
      modules/cms-kit/src/Volo.CmsKit.Public.Web/Volo.CmsKit.Public.Web.csproj

58
modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/BlogPost.cshtml

@ -50,14 +50,15 @@
<abp-script-bundle> <abp-script-bundle>
<abp-script type="typeof(HighlightJsScriptContributor)" /> <abp-script type="typeof(HighlightJsScriptContributor)" />
<abp-script src="/Pages/Public/CmsKit/highlightOnLoad.js" /> <abp-script src="/Pages/Public/CmsKit/highlightOnLoad.js" />
<abp-script src="/Pages/Public/CmsKit/Blogs/blogPost.js" />
</abp-script-bundle> </abp-script-bundle>
} }
<div class="row"> <div class="row">
<div @Html.Raw(isScrollIndexEnabled ? "class=\"col-md-10 col-sm-12\"" : "class=\"col-md-12\"")> <div @Html.Raw(isScrollIndexEnabled ? "class=\"col-md-10 col-sm-12\"" : "class=\"col-md-12\"")>
<abp-card class="mb-4"> <abp-card class="mb-4">
<img src="/api/cms-kit/media/@Model.ViewModel.CoverImageMediaId" class="card-img-top" onerror="this.src='@dummyImageSource'" /> <img src="/api/cms-kit/media/@Model.ViewModel.CoverImageMediaId" class="card-img-top" onerror="this.src='@dummyImageSource'" />
<input hidden id="BlogId" value="@Model.ViewModel.Id" />
<abp-card-body> <abp-card-body>
<abp-row> <abp-row>
<div class="col-lg-8 col-md-10 mx-auto pb-4"> <div class="col-lg-8 col-md-10 mx-auto pb-4">
@ -109,10 +110,10 @@
if (Model.ReactionsFeature?.IsEnabled == true) if (Model.ReactionsFeature?.IsEnabled == true)
{ {
@await Component.InvokeAsync(typeof(ReactionSelectionViewComponent), new @await Component.InvokeAsync(typeof(ReactionSelectionViewComponent), new
{ {
entityType = Volo.CmsKit.Blogs.BlogPostConsts.EntityType, entityType = Volo.CmsKit.Blogs.BlogPostConsts.EntityType,
entityId = Model.ViewModel.Id.ToString() entityId = Model.ViewModel.Id.ToString()
}) })
} }
} }
</abp-column> </abp-column>
@ -122,10 +123,10 @@
if (Model.RatingsFeature?.IsEnabled == true) if (Model.RatingsFeature?.IsEnabled == true)
{ {
@await Component.InvokeAsync(typeof(RatingViewComponent), new @await Component.InvokeAsync(typeof(RatingViewComponent), new
{ {
entityType = Volo.CmsKit.Blogs.BlogPostConsts.EntityType, entityType = Volo.CmsKit.Blogs.BlogPostConsts.EntityType,
entityId = Model.ViewModel.Id.ToString() entityId = Model.ViewModel.Id.ToString()
}) })
} }
} }
</abp-column> </abp-column>
@ -133,24 +134,31 @@
</abp-card-body> </abp-card-body>
</abp-card> </abp-card>
</div> </div>
@if (isScrollIndexEnabled)
{ <div class="col-md-2 d-sm-none d-md-block">
<div class="col-md-2 d-sm-none d-md-block"> <button id="deleteBlogPost" class="btn btn-danger">
<div id="scroll-index" class="docs-inner-anchors mt-2"> <i class="fa fa-remove">
<h5>@L["InThisDocument"]</h5> @L["Delete"]
<nav id="blog-post-sticky-index" class="navbar index-scroll pt-0"> </i>
</nav> </button>
<div class="row"> @if (isScrollIndexEnabled)
<div class="col p-0 py-3"> {
<a href="#" class="scroll-top-btn"> <div id="scroll-index" class="docs-inner-anchors mt-2">
<i class="fa fa-chevron-up"></i> @L["GoToTop"] <h5>@L["InThisDocument"]</h5>
</a> <nav id="blog-post-sticky-index" class="navbar index-scroll pt-0">
</nav>
<div class="row">
<div class="col p-0 py-3">
<a href="#" class="scroll-top-btn">
<i class="fa fa-chevron-up"></i> @L["GoToTop"]
</a>
</div>
</div> </div>
</div> </div>
</div> }
</div> </div>
}
</div> </div>

16
modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/blogPost.js

@ -0,0 +1,16 @@
$(function () {
let l = abp.localization.getResource("CmsKit");
$('#deleteBlogPost').on('click', '', function (e) {
abp.message.confirm(l("DeleteBlogPostMessage"), function (ok) {
if (ok) {
volo.cmsKit.public.blogs.blogPostPublic.delete(
$('#BlogId').val()
).then(function () {
document.location.href = "/";
});
}
})
});
});

8
modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/index.js

@ -1,14 +1,14 @@
$(function () { $(function () {
var $selectAuthor = $('#AuthorSelect'); let $selectAuthor = $('#AuthorSelect');
var $authorNameSpan = $('.author-name-span'); let $authorNameSpan = $('.author-name-span');
$selectAuthor.on('change', function () { $selectAuthor.on('change', function () {
var authorId = $selectAuthor.val(); let authorId = $selectAuthor.val();
reloadPageWithQueryString({'authorId': authorId}); reloadPageWithQueryString({'authorId': authorId});
}); });
$authorNameSpan.click(function () { $authorNameSpan.click(function () {
var authorId = $(this).data('author-id'); let authorId = $(this).data('author-id');
reloadPageWithQueryString({'authorId': authorId}); reloadPageWithQueryString({'authorId': authorId});
}); });

4
modules/cms-kit/src/Volo.CmsKit.Public.Web/Volo.CmsKit.Public.Web.csproj

@ -35,4 +35,8 @@
<Content Remove="wwwroot\**\*.css" /> <Content Remove="wwwroot\**\*.css" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<None Remove="Pages\Public\CmsKit\Blogs\blogPost.js" />
</ItemGroup>
</Project> </Project>

Loading…
Cancel
Save