コード例 #1
0
        public ActionResult Preview(PageData currentPage, BlogListModel blogModel)
        {
            var pd = (BlogItemPage)currentPage;
            PreviewTextLength = 200;

            var model = new BlogItemPageModel(pd)
            {
                Tags = GetTags(pd),
                PreviewText = GetPreviewText(pd),
                ShowIntroduction = blogModel.ShowIntroduction,
                ShowPublishDate = blogModel.ShowPublishDate
            };

            return PartialView("Preview", model);
        }
コード例 #2
0
        public ActionResult Preview(PageData currentPage, BlogListModel blogModel)
        {
            var pd = (BlogItemPage)currentPage;

            PreviewTextLength = 200;

            var model = new BlogItemPageModel(pd)
            {
                Tags             = GetTags(pd),
                PreviewText      = GetPreviewText(pd),
                ShowIntroduction = blogModel.ShowIntroduction,
                ShowPublishDate  = blogModel.ShowPublishDate
            };

            return(PartialView("Preview", model));
        }
コード例 #3
0
        private BlogItemPageModel GetBlogItemPageModel(PageData currentPage, BlogListPageViewModel blogModel)
        {
            var pd = (BlogItemPage)currentPage;

            PreviewTextLength = 200;

            var model = new BlogItemPageModel(pd)
            {
                Tags             = GetTags(pd),
                PreviewText      = GetPreviewText(pd),
                ShowIntroduction = blogModel.ShowIntroduction,
                ShowPublishDate  = blogModel.ShowPublishDate,
                Template         = blogModel.CurrentContent.Template,
                PreviewOption    = blogModel.CurrentContent.PreviewOption,
                StartPublish     = currentPage.StartPublish ?? DateTime.UtcNow
            };

            return(model);
        }
コード例 #4
0
        public ActionResult Preview(PageData currentPage, BlogListPageViewModel blogModel, bool?flip)
        {
            var pd = (BlogItemPage)currentPage;

            PreviewTextLength = 200;

            var model = new BlogItemPageModel(pd)
            {
                Tags             = GetTags(pd),
                PreviewText      = GetPreviewText(pd),
                ShowIntroduction = blogModel.ShowIntroduction,
                ShowPublishDate  = blogModel.ShowPublishDate,
                Template         = blogModel.CurrentContent.Template,
                PreviewOption    = blogModel.CurrentContent.PreviewOption,
                StartPublish     = currentPage.StartPublish ?? DateTime.UtcNow,
                Flip             = flip ?? false
            };

            return(PartialView("Preview", model));
        }
コード例 #5
0
        public ActionResult Full(BlogItemPage currentPage)
        {
            PreviewTextLength = 200;

            var model = new BlogItemPageModel(currentPage)
            {
                Category = currentPage.Category,
                Tags = GetTags(currentPage),
                PreviewText = GetPreviewText(currentPage),
                MainBody = currentPage.MainBody,
                StartPublish = currentPage.StartPublish
            };

            var editHints = ViewData.GetEditHints<BlogItemPageModel, BlogItemPage>();
            editHints.AddConnection(m => m.Category, p => p.Category);
            editHints.AddFullRefreshFor(p => p.Category);
            editHints.AddFullRefreshFor(p => p.StartPublish);

            return PartialView("Full", model);
        }
コード例 #6
0
        public ActionResult Index(BlogItemPage currentPage)
        {
            PreviewTextLength = 200;

            var model = new BlogItemPageModel(currentPage)
            {
                Category     = currentPage.Category,
                Tags         = GetTags(currentPage),
                PreviewText  = GetPreviewText(currentPage),
                MainBody     = currentPage.MainBody,
                StartPublish = currentPage.StartPublish ?? DateTime.UtcNow,
                BreadCrumbs  = GetBreadCrumb(currentPage)
            };

            var editHints = ViewData.GetEditHints <ContentViewModel <BlogItemPage>, BlogItemPage>();

            editHints.AddConnection(m => m.CurrentContent.Category, p => p.Category);
            editHints.AddConnection(m => m.CurrentContent.StartPublish, p => p.StartPublish);

            return(View(model));
        }
コード例 #7
0
        public ActionResult Full(BlogItemPage currentPage)
        {
            PreviewTextLength = 200;

            var model = new BlogItemPageModel(currentPage)
            {
                Category     = currentPage.Category,
                Tags         = GetTags(currentPage),
                PreviewText  = GetPreviewText(currentPage),
                MainBody     = currentPage.MainBody,
                StartPublish = currentPage.StartPublish.Value
            };

            var editHints = ViewData.GetEditHints <BlogItemPageModel, BlogItemPage>();

            editHints.AddConnection(m => m.Category, p => p.Category);
            editHints.AddFullRefreshFor(p => p.Category);
            editHints.AddFullRefreshFor(p => p.StartPublish);

            return(PartialView("Full", model));
        }