mirror of https://github.com/abpframework/abp.git
7 changed files with 78 additions and 0 deletions
@ -0,0 +1,11 @@ |
|||||
|
@model Volo.CmsKit.ViewComponents.CommentDateViewComponent |
||||
|
|
||||
|
<p>Welcome Comment Date Component</p> |
||||
|
@if (Model.IsShow) |
||||
|
{ |
||||
|
<p> @DateTime.Today.ToLongDateString()</p> |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
<p>Without date</p> |
||||
|
} |
||||
@ -0,0 +1,25 @@ |
|||||
|
using System.Threading.Tasks; |
||||
|
using Microsoft.AspNetCore.Mvc; |
||||
|
using Volo.Abp.AspNetCore.Mvc; |
||||
|
using Volo.Abp.AspNetCore.Mvc.UI.Widgets; |
||||
|
|
||||
|
namespace Volo.CmsKit.ViewComponents; |
||||
|
|
||||
|
[Widget( |
||||
|
AutoInitialize = true |
||||
|
)] |
||||
|
|
||||
|
[ViewComponent(Name = "CommentDate")] |
||||
|
public class CommentDateViewComponent : AbpViewComponent |
||||
|
{ |
||||
|
public bool IsShow { get; set; } |
||||
|
|
||||
|
public CommentDateViewComponent() |
||||
|
{ |
||||
|
} |
||||
|
|
||||
|
public virtual async Task<IViewComponentResult> InvokeAsync(string isShow) |
||||
|
{ |
||||
|
return View("~/ViewComponents/CommentDate.cshtml", new CommentDateViewComponent() { IsShow = bool.Parse(isShow) }); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,6 @@ |
|||||
|
<div class="form-check mb-3"> |
||||
|
<input class="form-check-input" type="checkbox" id="NewOption" /> |
||||
|
<label class="form-check-label text-primary d-block" for="NewOption"> |
||||
|
Show date in the component |
||||
|
</label> |
||||
|
</div> |
||||
@ -0,0 +1,23 @@ |
|||||
|
using System.Threading.Tasks; |
||||
|
using Microsoft.AspNetCore.Mvc; |
||||
|
using Volo.Abp.AspNetCore.Mvc; |
||||
|
using Volo.Abp.AspNetCore.Mvc.UI.Widgets; |
||||
|
|
||||
|
namespace Volo.CmsKit.ViewComponents; |
||||
|
|
||||
|
[Widget( |
||||
|
AutoInitialize = true |
||||
|
)] |
||||
|
|
||||
|
[ViewComponent(Name = "DecisionCommentDate")] |
||||
|
public class DecisionCommentDateViewComponent : AbpViewComponent |
||||
|
{ |
||||
|
public DecisionCommentDateViewComponent() |
||||
|
{ |
||||
|
} |
||||
|
|
||||
|
public virtual async Task<IViewComponentResult> InvokeAsync() |
||||
|
{ |
||||
|
return View("~/ViewComponents/DecisionCommentDate.cshtml"); |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue