From 6637200b8af6a361f265007aa440f6f0a36cdbe5 Mon Sep 17 00:00:00 2001 From: Sebastien Ros Date: Tue, 26 Aug 2014 15:08:16 -0700 Subject: [PATCH] Hide culture filters if not more than 1 --- .../Core/Contents/Views/Admin/List.cshtml | 22 ++++++++++------ .../Views/WidgetFiltersControl.cshtml | 25 ++++++++++--------- 2 files changed, 27 insertions(+), 20 deletions(-) diff --git a/src/Orchard.Web/Core/Contents/Views/Admin/List.cshtml b/src/Orchard.Web/Core/Contents/Views/Admin/List.cshtml index dc6bda6c3..e091e129f 100644 --- a/src/Orchard.Web/Core/Contents/Views/Admin/List.cshtml +++ b/src/Orchard.Web/Core/Contents/Views/Admin/List.cshtml @@ -8,6 +8,8 @@ createLinkText = T("Create New {0}", typeDisplayName); } + IEnumerable cultures = Model.Options.Cultures; + Layout.Title = pageTitle; } @@ -29,17 +31,21 @@ - - + + @if (cultures.Count() > 1) { + + + } + - @Html.SelectOption((string)Model.CurrentCulture, "", T("any (show all)").ToString()) - @foreach (var culture in cultures) { - @Html.SelectOption((string)Model.CurrentCulture, (string)culture, System.Globalization.CultureInfo.GetCultureInfo(culture).DisplayName) - } - - - + @if (cultures.Count() > 1) { + @using (Html.BeginForm("index", "admin", FormMethod.Get, new { area = "Orchard.Widgets" })) { +
+ + + +
+ } }