Starting to change the Admin UI to support RTL. Just content section for now.

This commit is contained in:
Nicholas Mayne
2014-08-10 16:01:40 +01:00
parent 245d703033
commit 87c6414d01
2 changed files with 13 additions and 2 deletions

View File

@@ -1,5 +1,6 @@
@model dynamic
@using Orchard.Environment.Descriptor.Models
@using Orchard.Localization
@using Orchard.Security;
@using Orchard.DisplayManagement.Descriptors;
@using Orchard.UI.Resources;
@@ -73,7 +74,7 @@
}
@if (Model.Content != null) {
<div id="content" class="group">
<div id="content" class="group" dir="@Html.Directionality()">
@Zone(Model.Content)
</div>
}

View File

@@ -6,6 +6,16 @@ using Orchard.Mvc.Html;
namespace Orchard.Localization {
public static class HtmlLocalizationExtensions {
/// <summary>
/// The dir attribute specifies the text direction.
///
/// Returns rtl or ltr based on if your content has an ILocalizableAspect or not.
/// </summary>
/// <returns>Returns rtl or ltr</returns>
public static string Directionality(this HtmlHelper html) {
return html.Directionality(null);
}
/// <summary>
/// The dir attribute specifies the text direction of the element's content.
///
@@ -20,7 +30,7 @@ namespace Orchard.Localization {
var workContext = html.GetWorkContext();
var culture = workContext.CurrentSite.SiteCulture;
if (content.Has<ILocalizableAspect>()) {
if (content != null && content.Has<ILocalizableAspect>()) {
return content.As<ILocalizableAspect>().Culture;
}