public static string EncapsulWidget(WidgetsHelpersPoco poco) { try { poco.Init(); StringBuilder html = new StringBuilder(); html.Append(EncapsulWidgetBeforeBody(poco)); html.Append(poco.BodyHtml); html.Append(EncapsulWidgetAfterBody(poco)); return(html.ToString()); } catch (Exception) { return(string.Empty); } }
public static string EncapsulWidgetAfterBody(WidgetsHelpersPoco poco) { try { StringBuilder html = new StringBuilder(); // close body html.Append("</div>"); html.Append("</div>"); html.Append("</div>"); //close widget html.Append("</div>"); return(html.ToString()); } catch (Exception) { return(string.Empty); } }
public static string EncapsulWidgetBeforeBody(WidgetsHelpersPoco poco) { try { StringBuilder html = new StringBuilder(); html.Append("<div class=\"widget-item\">"); html.Append("<div class=\"controller overlay right\"> <a href=\"javascript:;\" class=\"reload\"></a> <a href=\"javascript:;\" class=\"remove\"></a> </div>"); if (poco.isHeader) { if (!string.IsNullOrWhiteSpace(poco.HeaderImage)) { html.AppendFormat("<div class=\"tiles {0} overflow-hidden full-height\" style=\"max-height:{1}px\">", poco.HeaderColor, poco.HeaderMaxheight); html.AppendFormat("<img src=\"{0}\" alt=\"\" ", poco.HeaderImage); if (poco.HeaderImagelazyhovereffectimg) { html.Append(" class=\"lazy hover-effect-img\" "); } html.Append(" />"); } else { html.AppendFormat("<div class=\"tiles {0}\" style=\"max-height:{1}px\">", poco.HeaderColor, poco.HeaderMaxheight); html.Append("<div class=\"tiles-body\">"); if (!string.IsNullOrWhiteSpace(poco.HeaderTitle)) { html.Append("<h3 class=\"text-white m-t-50 m-b-30 m-r-20\">" + poco.HeaderTitle + "</h3>"); } else if (!string.IsNullOrWhiteSpace(poco.HeaderHtml)) { html.Append(poco.HeaderHtml); } html.Append("</div>"); } if (!string.IsNullOrWhiteSpace(poco.HeaderOverlayerHtml)) { html.Append("<div class=\"overlayer bottom-right fullwidth\">"); html.Append("<div class=\"overlayer-wrapper\">"); html.Append("<div class=\" p-l-20 p-r-20 p-b-20 p-t-20\">"); html.Append(poco.HeaderOverlayerHtml); html.Append("<div class=\"clearfix\"></div>"); html.Append("</div>"); html.Append("</div>"); html.Append("</div>"); } html.Append("</div>"); } // start body html.AppendFormat("<div class=\"tiles {0}\">", poco.BodyColor); html.Append("<div class=\"tiles-body\">"); html.Append("<div class=\"row\">"); return(html.ToString()); } catch (Exception) { return(string.Empty); } }