public static MvcHtmlString RenderContent(HtmlHelper helper, TypeContext typeContext, RenderContentMode mode, EntityBase line) { TypeContext tc = TypeContextUtilities.CleanTypeContext((TypeContext)typeContext); ViewDataDictionary vdd = GetViewData(helper, line, tc); string partialViewName = line.PartialViewName ?? OnPartialViewName(tc); switch (mode) { case RenderContentMode.Content: return helper.Partial(partialViewName, vdd); case RenderContentMode.ContentInVisibleDiv: return helper.Div(typeContext.Compose(EntityBaseKeys.Entity), helper.Partial(partialViewName, vdd), "", null); case RenderContentMode.ContentInInvisibleDiv: return helper.Div(typeContext.Compose(EntityBaseKeys.Entity), helper.Partial(partialViewName, vdd), "", new Dictionary<string, object> { { "style", "display:none" } }); default: throw new InvalidOperationException(); } }
public static MvcHtmlString RenderPopup(HtmlHelper helper, TypeContext typeContext, RenderPopupMode mode, EntityBase line, bool isTemplate = false) { TypeContext tc = TypeContextUtilities.CleanTypeContext((TypeContext)typeContext); ViewDataDictionary vdd = GetViewData(helper, line, tc); string partialViewName = line.PartialViewName ?? OnPartialViewName(tc); vdd[ViewDataKeys.PartialViewName] = partialViewName; vdd[ViewDataKeys.ViewMode] = !line.ReadOnly; vdd[ViewDataKeys.ViewMode] = ViewMode.View; vdd[ViewDataKeys.ShowOperations] = true; vdd[ViewDataKeys.SaveProtected] = OperationLogic.IsSaveProtected(tc.UntypedValue.GetType()); vdd[ViewDataKeys.WriteEntityState] = !isTemplate && !(tc.UntypedValue is EmbeddedEntity) && ((ModifiableEntity)tc.UntypedValue).Modified == ModifiedState.SelfModified; switch (mode) { case RenderPopupMode.Popup: return helper.Partial(Navigator.Manager.PopupControlView, vdd); case RenderPopupMode.PopupInDiv: return helper.Div(typeContext.Compose(EntityBaseKeys.Entity), helper.Partial(Navigator.Manager.PopupControlView, vdd), "", new Dictionary<string, object> { { "style", "display:none" } }); default: throw new InvalidOperationException(); } }
public virtual void WriteBody(TextWriter writer, Tab first, TypeContext context) { using (TabContainer.Surround(writer, new HtmlTag("div", context.Compose(this.Id)).Class("tab-pane fade").Class(this == first ? "in active" : null))) this.Body.WriteTo(writer); }
public virtual void WriteHeader(TextWriter writer, Tab first, TypeContext context) { using (TabContainer.Surround(writer, new HtmlTag("li").Class(this == first ? "active" : null))) using (TabContainer.Surround(writer, new HtmlTag("a").Attr("href", "#" + context.Compose(this.Id)).Attr("data-toggle", "tab").Attr("title", this.ToolTip))) this.Title.WriteTo(writer); }
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 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 override void Execute() { WriteLiteral("\r\n\r\n"); #line 11 "..\..\Dashboard\Views\UserChartPart.cshtml" Write(Html.ScriptCss("~/Chart/Content/Chart.css")); #line default #line hidden WriteLiteral("\r\n\r\n"); #line 13 "..\..\Dashboard\Views\UserChartPart.cshtml" using (var tc = Html.TypeContext <UserChartPartEntity>()) { UserChartEntity uc = tc.Value.UserChart; ChartRequest request = uc.ToRequest(); using (var crc = new TypeContext <ChartRequest>(request, tc.Prefix)) { #line default #line hidden WriteLiteral(" <div"); WriteAttribute("id", Tuple.Create(" id=\"", 541), Tuple.Create("\"", 576) #line 20 "..\..\Dashboard\Views\UserChartPart.cshtml" , Tuple.Create(Tuple.Create("", 546), Tuple.Create <System.Object, System.Int32>(crc.Compose("sfChartControl") #line default #line hidden , 546), false) ); WriteLiteral(" class=\"sf-chart-control SF-control-container\""); WriteLiteral(">\r\n <div"); WriteLiteral(" style=\"display: none\""); WriteLiteral(">\r\n"); WriteLiteral(" "); #line 22 "..\..\Dashboard\Views\UserChartPart.cshtml" Write(Html.HiddenRuntimeInfo(crc)); #line default #line hidden WriteLiteral("\r\n"); WriteLiteral(" "); #line 23 "..\..\Dashboard\Views\UserChartPart.cshtml" Write(Html.Hidden(crc.Compose("sfOrders"), request.Orders.IsNullOrEmpty() ? "" : (request.Orders.ToString(oo => (oo.OrderType == OrderType.Ascending ? "" : "-") + oo.Token.FullKey(), ";") + ";"))); #line default #line hidden WriteLiteral("\r\n"); #line 25 "..\..\Dashboard\Views\UserChartPart.cshtml" #line default #line hidden #line 25 "..\..\Dashboard\Views\UserChartPart.cshtml" ViewData[ViewDataKeys.QueryDescription] = DynamicQueryManager.Current.QueryDescription(request.QueryName); ViewData[ViewDataKeys.FilterOptions] = request.Filters.Select(f => new FilterOption { Token = f.Token, Operation = f.Operation, Value = f.Value }).ToList(); #line default #line hidden WriteLiteral("\r\n"); WriteLiteral(" "); #line 29 "..\..\Dashboard\Views\UserChartPart.cshtml" Write(Html.Partial(Finder.Manager.FilterBuilderView, crc)); #line default #line hidden WriteLiteral("\r\n <div"); WriteAttribute("id", Tuple.Create(" id=\"", 1325), Tuple.Create("\"", 1369) #line 30 "..\..\Dashboard\Views\UserChartPart.cshtml" , Tuple.Create(Tuple.Create("", 1330), Tuple.Create <System.Object, System.Int32>(crc.Compose("sfChartBuilderContainer") #line default #line hidden , 1330), false) ); WriteLiteral(" class=\"SF-control-container\""); WriteLiteral(">\r\n"); WriteLiteral(" "); #line 31 "..\..\Dashboard\Views\UserChartPart.cshtml" Write(Html.Partial(ChartClient.ChartBuilderView, crc)); #line default #line hidden WriteLiteral("\r\n </div>\r\n <script"); WriteLiteral(" type=\"text/javascript\""); WriteLiteral(">\r\n require([\""); #line 34 "..\..\Dashboard\Views\UserChartPart.cshtml" Write(ChartClient.Module); #line default #line hidden WriteLiteral("\"], function (Chart) {\r\n var options = "); #line 35 "..\..\Dashboard\Views\UserChartPart.cshtml" Write(MvcHtmlString.Create(uc.ToRequest().ToChartRequest(Url, tc.Prefix, tc.Value.ShowData ? ChartRequestMode.data: ChartRequestMode.chart).ToString())); #line default #line hidden WriteLiteral(";\r\n new Chart.ChartRequest(options);\r\n });\r\n " + " </script>\r\n </div> \r\n <div"); WriteAttribute("id", Tuple.Create(" id=\"", 1919), Tuple.Create("\"", 1952) #line 40 "..\..\Dashboard\Views\UserChartPart.cshtml" , Tuple.Create(Tuple.Create("", 1924), Tuple.Create <System.Object, System.Int32>(Model.Compose("divResults") #line default #line hidden , 1924), false) ); WriteLiteral(" class=\"sf-search-results-container\""); WriteLiteral(">\r\n"); WriteLiteral(" "); #line 41 "..\..\Dashboard\Views\UserChartPart.cshtml" Write(JavascriptMessage.searchForResults.NiceToString()); #line default #line hidden WriteLiteral("\r\n </div>\r\n </div>\r\n"); #line 44 "..\..\Dashboard\Views\UserChartPart.cshtml" } } #line default #line hidden }