diff --git a/src/Orchard.Web/Core/Localization/Drivers/LocalizationDriver.cs b/src/Orchard.Web/Core/Localization/Drivers/LocalizationDriver.cs index 0f30e48ce..f8a7d35fa 100644 --- a/src/Orchard.Web/Core/Localization/Drivers/LocalizationDriver.cs +++ b/src/Orchard.Web/Core/Localization/Drivers/LocalizationDriver.cs @@ -23,13 +23,8 @@ namespace Orchard.Core.Localization.Drivers { public IOrchardServices Services { get; set; } protected override DriverResult Display(Localized part, string displayType) { - // for viewing or adding translation - if (!Services.Authorizer.Authorize(Permissions.ChangeOwner)) { - return null; - } - var model = new ContentLocalizationsViewModel(part) { - CanLocalize = _cultureManager.ListCultures() + CanLocalize = Services.Authorizer.Authorize(Permissions.ChangeOwner) && _cultureManager.ListCultures() .Where(s => s != _cultureManager.GetCurrentCulture(new HttpContextWrapper(HttpContext.Current)) && s != _localizationService.GetContentCulture(part.ContentItem)) .Count() > 0, Localizations = _localizationService.GetLocalizations(part.ContentItem) @@ -38,12 +33,6 @@ namespace Orchard.Core.Localization.Drivers { } protected override DriverResult Editor(Localized part) { - // ContentTranslations: for when there are drafts of translations - // CultureSelection: for a new translation - - //var model = new SelectTranslationsViewModel(part); - //if (part.ContentItem.Is()) - return ContentPartTemplate(new SelectLocalizationsViewModel(part), "Parts/Localization.ContentTranslations").Location("secondary", "5"); } } diff --git a/src/Orchard.Web/Core/Localization/Styles/admin.css b/src/Orchard.Web/Core/Localization/Styles/admin.css index bd4604788..fab4f64b5 100644 --- a/src/Orchard.Web/Core/Localization/Styles/admin.css +++ b/src/Orchard.Web/Core/Localization/Styles/admin.css @@ -1,10 +1,12 @@ -.content-localization .content-localizations li, +.content-localization { + margin:1.44em 0 .44em; +} +.content-localization .content-localizations li, .content-localization .add-localization { font-size:1.4em; } .content-localization .content-localizations { font-size:.9em; - margin:1.44em 0 .44em; } .content-localization .content-localizations>* { display:inline; diff --git a/src/Orchard.Web/Core/Localization/Styles/base.css b/src/Orchard.Web/Core/Localization/Styles/base.css new file mode 100644 index 000000000..a8d97db8e --- /dev/null +++ b/src/Orchard.Web/Core/Localization/Styles/base.css @@ -0,0 +1,30 @@ +.content-localization { + overflow:auto; +} +.content-localization .content-localizations, +.content-localization .add-localization { + clear:right; + float:right; +} +.content-localization .content-localizations li, +.content-localization .add-localization { + font-size:1.2em; +} +.content-localization .content-localizations { + font-size:.9em; +} +.content-localization .content-localizations>* { + display:inline; +} +.content-localization .content-localizations li { + border-bottom:0; + display:inline; + margin-left:.5em; + padding:0; +} +.content-localization .content-localizations li::after { + content:", "; +} +.content-localization .content-localizations li:last-child::after { + content:""; +} \ No newline at end of file diff --git a/src/Orchard.Web/Core/Localization/Views/DisplayTemplates/Parts/Localization.ContentTranslations.ascx b/src/Orchard.Web/Core/Localization/Views/DisplayTemplates/Parts/Localization.ContentTranslations.ascx index 9cf7d0d03..460899d70 100644 --- a/src/Orchard.Web/Core/Localization/Views/DisplayTemplates/Parts/Localization.ContentTranslations.ascx +++ b/src/Orchard.Web/Core/Localization/Views/DisplayTemplates/Parts/Localization.ContentTranslations.ascx @@ -1 +1,16 @@ <%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl" %> +<%@ Import Namespace="Orchard.Core.Localization.Models" %> +<%@ Import Namespace="Orchard.ContentManagement" %> +<% + Html.RegisterStyle("base.css"); %> +<% if (Model.Localizations.Count() > 0 || Model.CanLocalize) { %> +
<% + if (Model.Localizations.Count() > 0) { %> + <%--//todo: need this info in the view model--%> +
<%:Html.UnorderedList(Model.Localizations, (c, i) => Html.ItemDisplayLink(c.ContentItem.As().Culture != null ? c.ContentItem.As().Culture.Culture : "[site's default culture]", c), "localizations") %>
<% + } + if (Model.CanLocalize) { %> +
<%:Html.ActionLink(T("+ New translation").Text, "translate", "admin", new { area = "Localization", id = Model.Id }, null)%>
<% + } %> +
<% +} %> \ No newline at end of file diff --git a/src/Orchard.Web/Core/Orchard.Core.csproj b/src/Orchard.Web/Core/Orchard.Core.csproj index 53e7945db..39536e9c0 100644 --- a/src/Orchard.Web/Core/Orchard.Core.csproj +++ b/src/Orchard.Web/Core/Orchard.Core.csproj @@ -244,6 +244,7 @@ + diff --git a/src/Orchard.Web/Modules/Orchard.ContentTypes/Orchard.ContentTypes.csproj b/src/Orchard.Web/Modules/Orchard.ContentTypes/Orchard.ContentTypes.csproj index ab8dca7c2..45431ed1f 100644 --- a/src/Orchard.Web/Modules/Orchard.ContentTypes/Orchard.ContentTypes.csproj +++ b/src/Orchard.Web/Modules/Orchard.ContentTypes/Orchard.ContentTypes.csproj @@ -120,9 +120,7 @@ - - - + {2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6}