Ejemplo n.º 1
0
        public static LoginStatusExpression DisplayDependingOnLoginStatus(this IAltOxitePage viewPage)
        {
            var renderer    = ServiceLocator.Current.GetInstance <IWebFormsViewRenderer>();
            var conventions = ServiceLocator.Current.GetInstance <FubuConventions>();

            return(new LoginStatusExpression(viewPage, renderer, conventions));
        }
Ejemplo n.º 2
0
        public static ScriptReferenceExpression SkinScript(this IAltOxitePage viewPage, IEnumerable <string> urls)
        {
            var siteConfig = ServiceLocator.Current.GetInstance <SiteConfiguration>();
            var baseUrl    = siteConfig.ScriptsPath;

            return(viewPage.Script(urls).BasedAt(baseUrl));
        }
Ejemplo n.º 3
0
        public static LinkExpression SkinCSS(this IAltOxitePage viewPage, string url)
        {
            var siteConfig = ServiceLocator.Current.GetInstance <SiteConfiguration>();
            var baseUrl    = siteConfig.CssPath;

            return(viewPage.CSS(url).BasedAt(baseUrl));
        }
        public static string GetGravatarImage(this IAltOxitePage viewPage, User user)
        {
            var siteConfig = ServiceLocator.Current.GetInstance <SiteConfiguration>();

            return("<img alt=\"{0} (gravatar)\" class=\"gravatar\" height=\"48\" src=\"{1}\" title=\"{0} (gravatar)\" width=\"48\" />"
                   .ToFormat(
                       user.DisplayName,
                       "http://www.gravatar.com/avatar/{0}?s=48&amp;default={1}".ToFormat(
                           user.HashedEmail,
                           siteConfig.GravatarDefault)));
        }
        public static string GetCommentsText(this IAltOxitePage viewPage, PostDisplay post)
        {
            var commentCount = (post.Comments == null) ? 0 : post.Comments.Count();

            return("<a href=\"{0}#comments\">{1}</a>"
                   .ToFormat(
                       viewPage.UrlTo().PublishedPost(post),
                       (commentCount == 1)
                       ? "{0} comment".ToFormat(commentCount)
                       : "{0} comments".ToFormat(commentCount)));
        }
 public static string GetCommenterNameAndLink(this IAltOxitePage viewPage, CommentDisplay comment)
 {
     return((!string.IsNullOrEmpty(comment.User.Url))
         ? "<a href=\"{0}\">{1}</a>".ToFormat(comment.User.Url, comment.User.DisplayName)
         : comment.User.DisplayName);
 }
 public static string GetCommenterGravatarAndLink(this IAltOxitePage viewPage, CommentDisplay comment)
 {
     return((!string.IsNullOrEmpty(comment.User.Url))
         ? "<a class=\"avatar\" href=\"{0}\" rel=\"nofollow\">{1}</a>".ToFormat(comment.User.Url, viewPage.GetGravatarImage(comment.User))
         : viewPage.GetGravatarImage(comment.User));
 }
 public static string GetCommentPremalinkBookmark(this IAltOxitePage viewPage, CommentDisplay comment)
 {
     return((!string.IsNullOrEmpty(comment.PermalinkHash))
         ? "<div><a name=\"{0}\"></a></div>".ToFormat(comment.PermalinkHash)
         : "");
 }
 public static string GetCommentPremalink(this IAltOxitePage viewPage, CommentDisplay comment)
 {
     return((!string.IsNullOrEmpty(comment.PermalinkHash))
         ? "<a href=\"#{0}\">{1}</a>".ToFormat(comment.PermalinkHash, comment.LocalPublishedDate)
         : "");
 }
Ejemplo n.º 10
0
 public static IUrlResolver UrlTo(this IAltOxitePage viewPage)
 {
     return(ServiceLocator.Current.GetInstance <IUrlResolver>());
 }
Ejemplo n.º 11
0
 public LoginStatusExpression(IAltOxitePage viewPage, IWebFormsViewRenderer renderer, FubuConventions conventions)
 {
     _viewPage    = viewPage;
     _renderer    = renderer;
     _conventions = conventions;
 }