diff --git a/src/Orchard.Web/Modules/Orchard.Tags/DataMigrations/TagsDataMigration.cs b/src/Orchard.Web/Modules/Orchard.Tags/DataMigrations/TagsDataMigration.cs index 3953049c9..d1f84da85 100644 --- a/src/Orchard.Web/Modules/Orchard.Tags/DataMigrations/TagsDataMigration.cs +++ b/src/Orchard.Web/Modules/Orchard.Tags/DataMigrations/TagsDataMigration.cs @@ -25,7 +25,7 @@ namespace Orchard.Tags.DataMigrations { return 1; } public int UpdateFrom1() { - ContentDefinitionManager.AlterPartDefinition(typeof(HasTags).Name, cfg => cfg + ContentDefinitionManager.AlterPartDefinition(typeof(TagsPart).Name, cfg => cfg .WithLocation(new Dictionary { {"Default", new ContentLocation { Zone = "primary", Position = "49" }}, {"Editor", new ContentLocation { Zone = "primary", Position = "9" }}, diff --git a/src/Orchard.Web/Modules/Orchard.Tags/Drivers/HasTagsDriver.cs b/src/Orchard.Web/Modules/Orchard.Tags/Drivers/TagsPartDriver.cs similarity index 82% rename from src/Orchard.Web/Modules/Orchard.Tags/Drivers/HasTagsDriver.cs rename to src/Orchard.Web/Modules/Orchard.Tags/Drivers/TagsPartDriver.cs index 1096bb9e9..27f9e895e 100644 --- a/src/Orchard.Web/Modules/Orchard.Tags/Drivers/HasTagsDriver.cs +++ b/src/Orchard.Web/Modules/Orchard.Tags/Drivers/TagsPartDriver.cs @@ -11,11 +11,11 @@ using Orchard.Tags.ViewModels; namespace Orchard.Tags.Drivers { [UsedImplicitly] - public class HasTagsDriver : ContentPartDriver { + public class TagsPartDriver : ContentPartDriver { private readonly ITagService _tagService; private readonly IAuthorizationService _authorizationService; - public HasTagsDriver(ITagService tagService, + public TagsPartDriver(ITagService tagService, IAuthorizationService authorizationService) { _tagService = tagService; _authorizationService = authorizationService; @@ -23,11 +23,11 @@ namespace Orchard.Tags.Drivers { public virtual IUser CurrentUser { get; set; } - protected override DriverResult Display(HasTags part, string displayType) { + protected override DriverResult Display(TagsPart part, string displayType) { return ContentPartTemplate(part, "Parts/Tags.ShowTags").Location(part.GetLocation(displayType)); } - protected override DriverResult Editor(HasTags part) { + protected override DriverResult Editor(TagsPart part) { if (!_authorizationService.TryCheckAccess(Permissions.ApplyTag, CurrentUser, part)) return null; @@ -37,7 +37,7 @@ namespace Orchard.Tags.Drivers { return ContentPartTemplate(model, "Parts/Tags.EditTags").Location(part.GetLocation("Editor")); } - protected override DriverResult Editor(HasTags part, IUpdateModel updater) { + protected override DriverResult Editor(TagsPart part, IUpdateModel updater) { if (!_authorizationService.TryCheckAccess(Permissions.ApplyTag, CurrentUser, part)) return null; diff --git a/src/Orchard.Web/Modules/Orchard.Tags/Handlers/HasTagsHandler.cs b/src/Orchard.Web/Modules/Orchard.Tags/Handlers/TagsPartHandler.cs similarity index 72% rename from src/Orchard.Web/Modules/Orchard.Tags/Handlers/HasTagsHandler.cs rename to src/Orchard.Web/Modules/Orchard.Tags/Handlers/TagsPartHandler.cs index c1af0e6d2..50ba44eee 100644 --- a/src/Orchard.Web/Modules/Orchard.Tags/Handlers/HasTagsHandler.cs +++ b/src/Orchard.Web/Modules/Orchard.Tags/Handlers/TagsPartHandler.cs @@ -8,10 +8,10 @@ using Orchard.Tags.Models; namespace Orchard.Tags.Handlers { [UsedImplicitly] - public class HasTagsHandler : ContentHandler { - public HasTagsHandler(IRepository tagsRepository, IRepository tagsContentItemsRepository) { + public class TagsPartHandler : ContentHandler { + public TagsPartHandler(IRepository tagsRepository, IRepository tagsContentItemsRepository) { - OnLoading((context, tags) => { + OnLoading((context, tags) => { // provide names of all tags on demand tags._allTags.Loader(list => tagsRepository.Table.ToList()); @@ -28,11 +28,11 @@ namespace Orchard.Tags.Handlers { }); - OnRemoved((context, ht) => { + OnRemoved((context, tags) => { tagsContentItemsRepository.Flush(); - HasTags tags = context.ContentItem.As(); - foreach (var tag in tags.CurrentTags) { + TagsPart tagsPart = context.ContentItem.As(); + foreach (var tag in tagsPart.CurrentTags) { if (!tagsContentItemsRepository.Fetch(x => x.ContentItemId == context.ContentItem.Id).Any()) { tagsRepository.Delete(tag); } diff --git a/src/Orchard.Web/Modules/Orchard.Tags/Models/HasTags.cs b/src/Orchard.Web/Modules/Orchard.Tags/Models/TagsPart.cs similarity index 87% rename from src/Orchard.Web/Modules/Orchard.Tags/Models/HasTags.cs rename to src/Orchard.Web/Modules/Orchard.Tags/Models/TagsPart.cs index f3fc4f296..0ece312d4 100644 --- a/src/Orchard.Web/Modules/Orchard.Tags/Models/HasTags.cs +++ b/src/Orchard.Web/Modules/Orchard.Tags/Models/TagsPart.cs @@ -3,8 +3,8 @@ using Orchard.ContentManagement; using Orchard.ContentManagement.Utilities; namespace Orchard.Tags.Models { - public class HasTags : ContentPart { - public HasTags() { + public class TagsPart : ContentPart { + public TagsPart() { AllTags = new List(); CurrentTags = new List(); } diff --git a/src/Orchard.Web/Modules/Orchard.Tags/Orchard.Tags.csproj b/src/Orchard.Web/Modules/Orchard.Tags/Orchard.Tags.csproj index 4fba11da8..618828ff0 100644 --- a/src/Orchard.Web/Modules/Orchard.Tags/Orchard.Tags.csproj +++ b/src/Orchard.Web/Modules/Orchard.Tags/Orchard.Tags.csproj @@ -72,11 +72,11 @@ - + - + - + diff --git a/src/Orchard.Web/Modules/Orchard.Tags/Views/DisplayTemplates/Parts/Tags.ShowTags.ascx b/src/Orchard.Web/Modules/Orchard.Tags/Views/DisplayTemplates/Parts/Tags.ShowTags.ascx index 61af1bc1f..2c4b07785 100644 --- a/src/Orchard.Web/Modules/Orchard.Tags/Views/DisplayTemplates/Parts/Tags.ShowTags.ascx +++ b/src/Orchard.Web/Modules/Orchard.Tags/Views/DisplayTemplates/Parts/Tags.ShowTags.ascx @@ -1,4 +1,4 @@ -<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl" %> +<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl" %> <%@ Import Namespace="Orchard.Tags.Models" %> <% if (Model.CurrentTags.Count > 0) { %>

diff --git a/src/Orchard.Web/Themes/Contoso/Views/DisplayTemplates/Parts/Tags.ShowTags.ascx b/src/Orchard.Web/Themes/Contoso/Views/DisplayTemplates/Parts/Tags.ShowTags.ascx index a21c5af7d..67185eb63 100644 --- a/src/Orchard.Web/Themes/Contoso/Views/DisplayTemplates/Parts/Tags.ShowTags.ascx +++ b/src/Orchard.Web/Themes/Contoso/Views/DisplayTemplates/Parts/Tags.ShowTags.ascx @@ -1,4 +1,4 @@ -<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl" %> +<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl" %> <%@ Import Namespace="Orchard.Tags.Models" %> <% if (Model.CurrentTags.Count > 0) { %>

diff --git a/src/Orchard.Web/Themes/Corporate/Views/DisplayTemplates/Parts/Tags.ShowTags.ascx b/src/Orchard.Web/Themes/Corporate/Views/DisplayTemplates/Parts/Tags.ShowTags.ascx index a21c5af7d..67185eb63 100644 --- a/src/Orchard.Web/Themes/Corporate/Views/DisplayTemplates/Parts/Tags.ShowTags.ascx +++ b/src/Orchard.Web/Themes/Corporate/Views/DisplayTemplates/Parts/Tags.ShowTags.ascx @@ -1,4 +1,4 @@ -<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl" %> +<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl" %> <%@ Import Namespace="Orchard.Tags.Models" %> <% if (Model.CurrentTags.Count > 0) { %>