mirror of https://github.com/abpframework/abp.git
13 changed files with 157 additions and 32 deletions
@ -1,13 +1,11 @@ |
|||||
using Microsoft.AspNetCore.Razor.TagHelpers; |
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Card |
||||
|
|
||||
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Card |
|
||||
{ |
{ |
||||
public class AbpCardBodyTagHelper : TagHelper |
public class AbpCardBodyTagHelper : TagHelper<AbpCardBodyTagHelperService> |
||||
{ |
{ |
||||
public override void Process(TagHelperContext context, TagHelperOutput output) |
public AbpCardBodyTagHelper(AbpCardBodyTagHelperService tagHelperService) |
||||
|
: base(tagHelperService) |
||||
{ |
{ |
||||
output.TagName = "div"; |
|
||||
output.Attributes.AddClass("card-body"); |
|
||||
} |
} |
||||
} |
} |
||||
} |
} |
||||
@ -0,0 +1,13 @@ |
|||||
|
using Microsoft.AspNetCore.Razor.TagHelpers; |
||||
|
|
||||
|
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Card |
||||
|
{ |
||||
|
public class AbpCardBodyTagHelperService : TagHelperService |
||||
|
{ |
||||
|
public override void Process(TagHelperContext context, TagHelperOutput output) |
||||
|
{ |
||||
|
output.TagName = "div"; |
||||
|
output.Attributes.AddClass("card-body"); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -1,13 +1,10 @@ |
|||||
using Microsoft.AspNetCore.Razor.TagHelpers; |
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Card |
||||
|
|
||||
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Card |
|
||||
{ |
{ |
||||
public class AbpCardHeaderTagHelper : TagHelper |
public class AbpCardHeaderTagHelper : TagHelper<AbpCardHeaderTagHelperService> |
||||
{ |
{ |
||||
public override void Process(TagHelperContext context, TagHelperOutput output) |
public AbpCardHeaderTagHelper(AbpCardHeaderTagHelperService tagHelperService) |
||||
|
: base(tagHelperService) |
||||
{ |
{ |
||||
output.TagName = "div"; |
|
||||
output.Attributes.AddClass("card-header"); |
|
||||
} |
} |
||||
} |
} |
||||
} |
} |
||||
@ -0,0 +1,13 @@ |
|||||
|
using Microsoft.AspNetCore.Razor.TagHelpers; |
||||
|
|
||||
|
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Card |
||||
|
{ |
||||
|
public class AbpCardHeaderTagHelperService : TagHelperService |
||||
|
{ |
||||
|
public override void Process(TagHelperContext context, TagHelperOutput output) |
||||
|
{ |
||||
|
output.TagName = "div"; |
||||
|
output.Attributes.AddClass("card-header"); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -1,13 +1,10 @@ |
|||||
using Microsoft.AspNetCore.Razor.TagHelpers; |
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Card |
||||
|
|
||||
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Card |
|
||||
{ |
{ |
||||
public class AbpCardTagHelper : TagHelper |
public class AbpCardTagHelper : TagHelper<AbpCardTagHelperService> |
||||
{ |
{ |
||||
public override void Process(TagHelperContext context, TagHelperOutput output) |
public AbpCardTagHelper(AbpCardTagHelperService tagHelperService) |
||||
|
: base(tagHelperService) |
||||
{ |
{ |
||||
output.TagName = "div"; |
|
||||
output.Attributes.AddClass("card"); |
|
||||
} |
} |
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -0,0 +1,13 @@ |
|||||
|
using Microsoft.AspNetCore.Razor.TagHelpers; |
||||
|
|
||||
|
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Card |
||||
|
{ |
||||
|
public class AbpCardTagHelperService : TagHelperService |
||||
|
{ |
||||
|
public override void Process(TagHelperContext context, TagHelperOutput output) |
||||
|
{ |
||||
|
output.TagName = "div"; |
||||
|
output.Attributes.AddClass("card"); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,15 @@ |
|||||
|
using System.Threading.Tasks; |
||||
|
using Microsoft.AspNetCore.Razor.TagHelpers; |
||||
|
using Volo.Abp.DependencyInjection; |
||||
|
|
||||
|
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers |
||||
|
{ |
||||
|
public interface ITagHelperService : ITransientDependency |
||||
|
{ |
||||
|
int Order { get; } |
||||
|
|
||||
|
void Init(TagHelperContext context); |
||||
|
|
||||
|
Task ProcessAsync(TagHelperContext context, TagHelperOutput output); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,21 @@ |
|||||
|
using System.Threading.Tasks; |
||||
|
using Microsoft.AspNetCore.Razor.TagHelpers; |
||||
|
|
||||
|
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers |
||||
|
{ |
||||
|
public abstract class TagHelper<TService> : TagHelper |
||||
|
where TService : ITagHelperService |
||||
|
{ |
||||
|
private readonly TService _tagHelperService; |
||||
|
|
||||
|
protected TagHelper(TService tagHelperService) |
||||
|
{ |
||||
|
_tagHelperService = tagHelperService; |
||||
|
} |
||||
|
|
||||
|
public override Task ProcessAsync(TagHelperContext context, TagHelperOutput output) |
||||
|
{ |
||||
|
return _tagHelperService.ProcessAsync(context, output); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,24 @@ |
|||||
|
using System.Threading.Tasks; |
||||
|
using Microsoft.AspNetCore.Razor.TagHelpers; |
||||
|
|
||||
|
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers |
||||
|
{ |
||||
|
public class TagHelperService : ITagHelperService |
||||
|
{ |
||||
|
public virtual int Order { get; } |
||||
|
|
||||
|
public virtual void Init(TagHelperContext context) |
||||
|
{ |
||||
|
} |
||||
|
|
||||
|
public virtual void Process(TagHelperContext context, TagHelperOutput output) |
||||
|
{ |
||||
|
} |
||||
|
|
||||
|
public virtual Task ProcessAsync(TagHelperContext context, TagHelperOutput output) |
||||
|
{ |
||||
|
Process(context, output); |
||||
|
return Task.CompletedTask; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -1,8 +1,10 @@ |
|||||
.demo-with-code .demo-area { |
.demo-with-code { |
||||
margin-bottom: 2em; } |
padding-bottom: 10px; |
||||
|
margin-bottom: 10px; } |
||||
.demo-with-code .code-area { |
.demo-with-code .demo-area { |
||||
border: 1px solid #ddd; |
margin-bottom: 1em; } |
||||
padding: 10px; |
.demo-with-code .code-area { |
||||
font-size: 0.9em; } |
border: 1px solid #ddd; |
||||
|
padding: 10px; |
||||
|
font-size: 0.9em; } |
||||
|
|
||||
|
|||||
@ -1 +1 @@ |
|||||
.demo-with-code .demo-area{margin-bottom:2em;}.demo-with-code .code-area{border:1px solid #ddd;padding:10px;font-size:.9em;} |
.demo-with-code{padding-bottom:10px;margin-bottom:10px;}.demo-with-code .demo-area{margin-bottom:1em;}.demo-with-code .code-area{border:1px solid #ddd;padding:10px;font-size:.9em;} |
||||
Loading…
Reference in new issue