--HG--
branch : dev
This commit is contained in:
Renaud Paquay
2010-07-15 10:43:05 -07:00
6 changed files with 12 additions and 6 deletions

View File

@@ -59,6 +59,12 @@ namespace Orchard.Core.Routable.Drivers {
if (path != null && path.EndsWith(part.Slug)) {
model.DisplayLeadingPath = path.Substring(0, path.Length - part.Slug.Length);
}
else {
var containerSlug = GetContainerSlug(part);
model.DisplayLeadingPath = !string.IsNullOrWhiteSpace(containerSlug)
? string.Format("{0}/", containerSlug)
: "";
}
return ContentPartTemplate(model, TemplateName, Prefix).Location("primary", "before.5");
}

View File

@@ -1,6 +1,5 @@
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<Orchard.Core.Routable.ViewModels.RoutableEditorViewModel>" %>
<%@ Import Namespace="Orchard.Utility.Extensions"%>
<%@ Import Namespace="Orchard.ContentManagement.Extenstions"%>
<% Html.RegisterFootScript("jquery.slugify.js"); %>
<fieldset>

View File

@@ -1,4 +1,3 @@
using System;
using System.Linq;
using System.Web.Mvc;
using JetBrains.Annotations;
@@ -8,7 +7,6 @@ using Orchard.Blogs.Models;
using Orchard.Blogs.Services;
using Orchard.Blogs.ViewModels;
using Orchard.ContentManagement;
using Orchard.Core.Common.Models;
using Orchard.Localization;
using Orchard.Mvc.Results;
using Orchard.Settings;

View File

@@ -2,7 +2,6 @@ using JetBrains.Annotations;
using Orchard.Blogs.Drivers;
using Orchard.Blogs.Models;
using Orchard.ContentManagement.Handlers;
using Orchard.Core.Common.Models;
using Orchard.Core.Routable.Models;
using Orchard.Data;
@@ -11,7 +10,6 @@ namespace Orchard.Blogs.Handlers {
public class BlogHandler : ContentHandler {
public BlogHandler(IRepository<BlogRecord> repository) {
Filters.Add(new ActivatingFilter<Blog>(BlogDriver.ContentType.Name));
Filters.Add(new ActivatingFilter<CommonAspect>(BlogDriver.ContentType.Name));
Filters.Add(new ActivatingFilter<IsRoutable>(BlogDriver.ContentType.Name));
Filters.Add(StorageFilter.For(repository));
}

View File

@@ -12,7 +12,7 @@ if (Model.Entries.Count() > 0) { %>
int totalPostCount = entry.TotalPostCount;
var linkText = T.Plural("1 post", "{0} posts", totalPostCount).ToString();
if (draftCount==0){
if (draftCount > 0){
linkText = linkText + " (" + T.Plural("1 draft", "{0} drafts", draftCount).ToString() + ")";
}

View File

@@ -12,6 +12,11 @@ namespace Orchard.ContentManagement.Drivers {
public string TemplateName { get; set; }
public override void Apply(BuildDisplayModelContext context) {
//todo: (heskew)evaluate - for lack of having access to the full context in a driver to conditionally return results (e.g. BlogDriver item display is otherwise being overriden by the ContentPartDriver)
if (!string.IsNullOrWhiteSpace(context.ViewModel.TemplateName)
&& context.ViewModel.GetType() != typeof(ContentItemViewModel<TContent>))
return;
context.ViewModel.TemplateName = TemplateName;
if (context.ViewModel.GetType() != typeof(ContentItemViewModel<TContent>)) {
context.ViewModel.Adaptor = (html, viewModel) => {