Adapting ShowTags view model

The new model change would break some themes
This commit is contained in:
Sebastien Ros
2014-01-15 16:39:12 -08:00
parent 97026dd0fa
commit 7eb3579816
4 changed files with 8 additions and 2 deletions

View File

@@ -33,7 +33,7 @@ namespace Orchard.Tags.Drivers {
protected override DriverResult Display(TagsPart part, string displayType, dynamic shapeHelper) {
return ContentShape("Parts_Tags_ShowTags",
() => shapeHelper.Parts_Tags_ShowTags(Tags: part.CurrentTags));
() => shapeHelper.Parts_Tags_ShowTags(Tags: part.CurrentTags.Select(x => new ShowTagViewModel { TagName = x })));
}
protected override DriverResult Editor(TagsPart part, dynamic shapeHelper) {

View File

@@ -91,6 +91,7 @@
<Compile Include="ViewModels\TagsAdminCreateViewModel.cs" />
<Compile Include="ViewModels\TagsAdminEditViewModel.cs" />
<Compile Include="ViewModels\TagsAdminIndexViewModel.cs" />
<Compile Include="ViewModels\ShowTagsViewModel.cs" />
<Compile Include="ViewModels\TagsSearchViewModel.cs" />
<Compile Include="ViewModels\TagsIndexViewModel.cs" />
</ItemGroup>

View File

@@ -0,0 +1,5 @@
namespace Orchard.Tags.ViewModels {
public class ShowTagViewModel {
public string TagName { get; set; }
}
}

View File

@@ -4,7 +4,7 @@
if (tagsHtml.Any()) {
tagsHtml.Add(new HtmlString(", "));
}
tagsHtml.Add(Html.ActionLink((string)t, "Search", "Home", new { area = "Orchard.Tags", tagName = (string)t }, new { }));
tagsHtml.Add(Html.ActionLink((string)t.TagName, "Search", "Home", new { area = "Orchard.Tags", tagName = (string)t.TagName }, new { }));
}
}