/// <summary>
        /// Renders a partial view in the current theme based on the current IMasterModel
        /// </summary>
        /// <param name="html"></param>
        /// <param name="model"></param>
        /// <param name="partialName"></param>
        /// <param name="viewModel"></param>
        /// <param name="viewData"></param>
        /// <returns></returns>
        public static IHtmlString ThemedPartial(this HtmlHelper html, IMasterModel model, string partialName, object viewModel, ViewDataDictionary viewData = null)
        {
            var path = PathHelper.GetThemePartialViewPath(model, partialName);

            return(html.Partial(path, viewModel, viewData));
        }
 public static HtmlHelper RequiresThemedJs(this HtmlHelper html, IMasterModel model, string filePath)
 {
     return(html.RequiresJs(PathHelper.GetThemePath(model) + "Assets/js" + filePath.EnsureStartsWith('/')));
 }
 public static HtmlHelper RequiresThemedJsFolder(this HtmlHelper html, IMasterModel model)
 {
     return(html.RequiresJsFolder(PathHelper.GetThemePath(model) + "Assets/js"));
 }
Exemplo n.º 4
0
 /// <summary>
 /// Returns the url of a themed asset
 /// </summary>
 /// <param name="url"></param>
 /// <param name="model"></param>
 /// <param name="relativeAssetPath"></param>
 /// <returns></returns>
 public static string ThemedAsset(this UrlHelper url, IMasterModel model, string relativeAssetPath)
 {
     return(VirtualPathUtility.ToAbsolute(PathHelper.GetThemePath(model)).EnsureEndsWith('/') + "assets/" + relativeAssetPath);
 }