Example #1
0
 public static MvcHtmlString EmbeddedTemplate(EntityBase entityBase, MvcHtmlString template, string defaultString)
 {
     return(MvcHtmlString.Create("<script type=\"template\" id=\"{0}\" data-toString=\"{2}\">{1}</script>".FormatWith(
                                     entityBase.Compose(EntityBaseKeys.Template),
                                     regex.Replace(template.ToHtmlString(), m => m.Value + "X"),
                                     defaultString)));
 }
Example #2
0
        public static MvcHtmlString Remove(HtmlHelper helper, EntityBase entityBase, bool btn)
        {
            if (!entityBase.Remove)
            {
                return(MvcHtmlString.Empty);
            }

            return(new HtmlTag("a", entityBase.Compose("btnRemove"))
                   .Class(btn ? "btn btn-default" : null)
                   .Class("sf-line-button sf-remove")
                   .Attr("onclick", entityBase.SFControlThen("remove_click(event)"))
                   .Attr("title", EntityControlMessage.Remove.NiceToString())
                   .InnerHtml(new HtmlTag("span").Class("glyphicon glyphicon-remove")));
        }
Example #3
0
        public static MvcHtmlString Remove(HtmlHelper helper, EntityBase entityBase, bool btn)
        {
            if (!entityBase.Remove)
                return MvcHtmlString.Empty;

            return new HtmlTag("a", entityBase.Compose("btnRemove"))
                .Class(btn ? "btn btn-default" : null)
                .Class("sf-line-button sf-remove")
                .Attr("onclick", entityBase.SFControlThen("remove_click()"))
                .Attr("title", EntityControlMessage.Remove.NiceToString())
                .InnerHtml(new HtmlTag("span").Class("glyphicon glyphicon-remove"));
        }
Example #4
0
        public static MvcHtmlString View(HtmlHelper helper, EntityBase entityBase, bool btn)
        {
            if (!entityBase.View)
                return MvcHtmlString.Empty;

            return new HtmlTag("a", entityBase.Compose("btnView"))
                .Class(btn ? "btn btn-default" : null)
                .Class("sf-line-button sf-view")
                .Attr("onclick", entityBase.SFControlThen("view_click()"))
                .Attr("title", EntityControlMessage.View.NiceToString())
                .InnerHtml(new HtmlTag("span").Class("glyphicon glyphicon-arrow-right"));
        }
Example #5
0
 public static MvcHtmlString EmbeddedTemplate(EntityBase entityBase, MvcHtmlString template, string defaultString)
 {
     return MvcHtmlString.Create("<script type=\"template\" id=\"{0}\" data-toString=\"{2}\">{1}</script>".Formato(
                         entityBase.Compose(EntityBaseKeys.Template),
                         regex.Replace(template.ToHtmlString(), m => m.Value + "X"),
                         defaultString));
 }