mirror of https://github.com/abpframework/abp.git
17 changed files with 223 additions and 81 deletions
@ -1,34 +0,0 @@ |
|||
using Microsoft.AspNetCore.Razor.TagHelpers; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers |
|||
{ |
|||
public class AbpCardTagHelper : TagHelper |
|||
{ |
|||
public override void Process(TagHelperContext context, TagHelperOutput output) |
|||
{ |
|||
//TODO: Remove abp-modal HTML element which is unnecessary!
|
|||
output.TagName = "div"; |
|||
output.Attributes.Add("class", "card"); //TODO: Append class if any exists
|
|||
} |
|||
} |
|||
|
|||
public class AbpCardHeaderTagHelper : TagHelper |
|||
{ |
|||
public override void Process(TagHelperContext context, TagHelperOutput output) |
|||
{ |
|||
//TODO: Remove abp-modal HTML element which is unnecessary!
|
|||
output.TagName = "div"; |
|||
output.Attributes.Add("class", "card-header"); //TODO: Append class if any exists
|
|||
} |
|||
} |
|||
|
|||
public class AbpCardBodyTagHelper : TagHelper |
|||
{ |
|||
public override void Process(TagHelperContext context, TagHelperOutput output) |
|||
{ |
|||
//TODO: Remove abp-modal HTML element which is unnecessary!
|
|||
output.TagName = "div"; |
|||
output.Attributes.Add("class", "card-body"); //TODO: Append class if any exists
|
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,34 @@ |
|||
using System.Collections.Generic; |
|||
using Microsoft.AspNetCore.Razor.TagHelpers; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers |
|||
{ |
|||
public static class AbpTagHelperAttributeListExtensions |
|||
{ |
|||
public static void AddClass(this TagHelperAttributeList attributes, string className) |
|||
{ |
|||
var classAttribute = attributes["class"]; |
|||
if (classAttribute == null) |
|||
{ |
|||
attributes.Add("class", className); |
|||
} |
|||
else |
|||
{ |
|||
//TODO: Check if it's already added before!
|
|||
attributes.SetAttribute("class", classAttribute.Value + " " + className); |
|||
} |
|||
} |
|||
|
|||
public static void RemoveClass(this TagHelperAttributeList attributes, string className) |
|||
{ |
|||
var classAttribute = attributes["class"]; |
|||
if (classAttribute == null) |
|||
{ |
|||
return; |
|||
} |
|||
|
|||
//Can be optimized?
|
|||
attributes.SetAttribute("class", classAttribute.Value.ToString().Split(' ').RemoveAll(c => c == className).JoinAsString(" ")); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,14 @@ |
|||
using Microsoft.AspNetCore.Razor.TagHelpers; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers |
|||
{ |
|||
public class AbpCardBodyTagHelper : TagHelper |
|||
{ |
|||
public override void Process(TagHelperContext context, TagHelperOutput output) |
|||
{ |
|||
//TODO: Remove abp-modal HTML element which is unnecessary!
|
|||
output.TagName = "div"; |
|||
output.Attributes.AddClass("card-body"); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,14 @@ |
|||
using Microsoft.AspNetCore.Razor.TagHelpers; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers |
|||
{ |
|||
public class AbpCardHeaderTagHelper : TagHelper |
|||
{ |
|||
public override void Process(TagHelperContext context, TagHelperOutput output) |
|||
{ |
|||
//TODO: Remove abp-modal HTML element which is unnecessary!
|
|||
output.TagName = "div"; |
|||
output.Attributes.AddClass("card-header"); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,14 @@ |
|||
using Microsoft.AspNetCore.Razor.TagHelpers; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers |
|||
{ |
|||
public class AbpCardTagHelper : TagHelper |
|||
{ |
|||
public override void Process(TagHelperContext context, TagHelperOutput output) |
|||
{ |
|||
//TODO: Remove abp-modal HTML element which is unnecessary!
|
|||
output.TagName = "div"; |
|||
output.Attributes.AddClass("card"); |
|||
} |
|||
} |
|||
} |
|||
@ -1,13 +1,13 @@ |
|||
using Microsoft.AspNetCore.Razor.TagHelpers; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers |
|||
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal |
|||
{ |
|||
public class AbpModalBodyTagHelper : TagHelper |
|||
{ |
|||
public override void Process(TagHelperContext context, TagHelperOutput output) |
|||
{ |
|||
output.TagName = "div"; |
|||
output.Attributes.Add("class", "modal-body"); //TODO: Append class if any exists
|
|||
output.Attributes.AddClass("modal-body"); |
|||
} |
|||
} |
|||
} |
|||
@ -1,7 +1,7 @@ |
|||
using System.Text; |
|||
using Microsoft.AspNetCore.Razor.TagHelpers; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers |
|||
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal |
|||
{ |
|||
public class AbpModalTagHelper : TagHelper |
|||
{ |
|||
Loading…
Reference in new issue