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(); } }
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"))); }
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"))); }
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")); }
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")); }
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())); }
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")))); }
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"))); }