mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Starting to change the Admin UI to support RTL. Just content section for now.
This commit is contained in:
@@ -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>
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user