Inheritance: EntityBase
Beispiel #1
0
        public static void TaskSetMove(LineBase bl)
        {
            EntityListBase eb = bl as EntityListBase;

            if (eb != null)
            {
                PropertyRoute route = bl.PropertyRoute;

                eb.Move = Schema.Current.Settings.FieldAttributes(bl.PropertyRoute).OfType <PreserveOrderAttribute>().Any();
            }
        }
Beispiel #2
0
        public static MvcHtmlString MoveDown(HtmlHelper helper, EntityListBase listBase, bool btn)
        {
            if (!listBase.Move)
            {
                return(MvcHtmlString.Empty);
            }

            return(new HtmlTag("a", listBase.Compose("btnDown"))
                   .Class(btn ? "btn btn-default" : null)
                   .Class("sf-line-button move-down")
                   .Attr("onclick", listBase.SFControlThen("moveDown_click(event)"))
                   .Attr("title", JavascriptMessage.moveDown.NiceToString())
                   .InnerHtml(new HtmlTag("span").Class("glyphicon glyphicon-chevron-down")));
        }
Beispiel #3
0
 public static MvcHtmlString MoveDownItem(HtmlHelper helper, TypeContext itemContext, EntityListBase entityListBase, bool btn, string elementType = "a", bool isVertical = true)
 {
     return new HtmlTag(elementType, itemContext.Compose("btnDown"))
      .Class(btn ? "btn btn-default" : null)
      .Class("sf-line-button move-down")
      .Attr("onclick", entityListBase.SFControlThen("moveDown('{0}')".Formato(itemContext.Prefix)))
      .Attr("title", JavascriptMessage.moveDown.NiceToString())
      .InnerHtml(new HtmlTag("span").Class("glyphicon " + (isVertical ? "glyphicon-chevron-down" : "glyphicon-chevron-right")));
 }
Beispiel #4
0
        public static MvcHtmlString MoveDown(HtmlHelper helper, EntityListBase listBase, bool btn)
        {
            if (!listBase.Reorder)
                return MvcHtmlString.Empty;

            return new HtmlTag("a", listBase.Compose("btnDown"))
             .Class(btn ? "btn btn-default" : null)
             .Class("sf-line-button move-down")
             .Attr("onclick", listBase.SFControlThen("moveDown_click()"))
             .Attr("title", JavascriptMessage.moveDown.NiceToString())
             .InnerHtml(new HtmlTag("span").Class("glyphicon glyphicon-chevron-down"));
        }
Beispiel #5
0
 public static MvcHtmlString RemoveItem(HtmlHelper helper, TypeContext itemContext, EntityListBase entityListBase, bool btn, string elementType = "a")
 {
     return new HtmlTag(elementType, itemContext.Compose("btnRemove"))
           .Class(btn ? "btn btn-default" : null)
           .Class("sf-line-button sf-remove")
           .Attr("onclick", entityListBase.SFControlThen("removeItem_click('{0}')".Formato(itemContext.Prefix)))
           .Attr("title", EntityControlMessage.Remove.NiceToString())
           .InnerHtml(new HtmlTag("span").Class("glyphicon glyphicon-remove"));
 }
Beispiel #6
0
 public static MvcHtmlString WriteIndex(HtmlHelper helper, EntityListBase listBase, TypeContext itemTC, int itemIndex)
 {
     return helper.Hidden(itemTC.Compose(EntityListBaseKeys.Indexes), "{0};{1}".Formato(
         listBase.ShouldWriteOldIndex(itemTC) ? itemIndex.ToString() : "",
         itemIndex.ToString()));
 }
Beispiel #7
0
 public static MvcHtmlString MoveDownItem(HtmlHelper helper, TypeContext itemContext, EntityListBase entityListBase, bool btn, string elementType = "a", bool isVertical = true)
 {
     return(new HtmlTag(elementType, itemContext.Compose("btnDown"))
            .Class(btn ? "btn btn-default" : null)
            .Class("sf-line-button move-down")
            .Attr("onclick", entityListBase.SFControlThen("moveDown('{0}', event)".FormatWith(itemContext.Prefix)))
            .Attr("title", JavascriptMessage.moveDown.NiceToString())
            .InnerHtml(new HtmlTag("span").Class("glyphicon " + (isVertical ? "glyphicon-chevron-down" : "glyphicon-chevron-right"))));
 }
Beispiel #8
0
 public static MvcHtmlString RemoveItem(HtmlHelper helper, TypeContext itemContext, EntityListBase entityListBase, bool btn, string elementType = "a")
 {
     return(new HtmlTag(elementType, itemContext.Compose("btnRemove"))
            .Class(btn ? "btn btn-default" : null)
            .Class("sf-line-button sf-remove")
            .Attr("onclick", entityListBase.SFControlThen("removeItem_click('{0}', event)".FormatWith(itemContext.Prefix)))
            .Attr("title", EntityControlMessage.Remove.NiceToString())
            .InnerHtml(new HtmlTag("span").Class("glyphicon glyphicon-remove")));
 }