mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Merge 1.x -> default
This commit is contained in:
10
Orchard.proj
10
Orchard.proj
@@ -276,13 +276,18 @@
|
||||
$(StageFolder)\**\Modules\Lucene\**;
|
||||
$(StageFolder)\**\Modules\Orchard.ArchiveLater\**;
|
||||
$(StageFolder)\**\Modules\Orchard.CodeGeneration\**;
|
||||
$(StageFolder)\**\Modules\Orchard.DesignerTools\**;
|
||||
$(StageFolder)\**\Modules\Orchard.Email\**;
|
||||
$(StageFolder)\**\Modules\Orchard.Experimental\**;
|
||||
$(StageFolder)\**\Modules\Orchard.ImportExport\**;
|
||||
$(StageFolder)\**\Modules\Orchard.Indexing\**;
|
||||
$(StageFolder)\**\Modules\Orchard.MediaPicker\**;
|
||||
$(StageFolder)\**\Modules\Orchard.Migrations\**;
|
||||
$(StageFolder)\**\Modules\Orchard.MultiTenancy\**;
|
||||
$(StageFolder)\**\Modules\Orchard.Recipes\**;
|
||||
$(StageFolder)\**\Modules\Orchard.Scripting.Dlr\**;
|
||||
$(StageFolder)\**\Modules\Orchard.Search\**;
|
||||
$(StageFolder)\**\Modules\Orchard.Warmup\**;
|
||||
" />
|
||||
|
||||
<MsDeploy-Folder-Input Include="$(StageFolder)\**\*" Exclude="$(StageFolder)\**\bin\**\*.xml;@(MsDeploy-Exclude-Modules)" />
|
||||
@@ -375,13 +380,18 @@
|
||||
<Exec Command=""$(GalleryFolder)\bin\Orchard.exe" package create Lucene "$(GalleryArtifactFolder)"" WorkingDirectory="$(GalleryFolder)"/>
|
||||
<Exec Command=""$(GalleryFolder)\bin\Orchard.exe" package create Orchard.ArchiveLater "$(GalleryArtifactFolder)"" WorkingDirectory="$(GalleryFolder)"/>
|
||||
<Exec Command=""$(GalleryFolder)\bin\Orchard.exe" package create Orchard.CodeGeneration "$(GalleryArtifactFolder)"" WorkingDirectory="$(GalleryFolder)"/>
|
||||
<Exec Command=""$(GalleryFolder)\bin\Orchard.exe" package create Orchard.DesignerTools "$(GalleryArtifactFolder)"" WorkingDirectory="$(GalleryFolder)"/>
|
||||
<Exec Command=""$(GalleryFolder)\bin\Orchard.exe" package create Orchard.Email "$(GalleryArtifactFolder)"" WorkingDirectory="$(GalleryFolder)"/>
|
||||
<Exec Command=""$(GalleryFolder)\bin\Orchard.exe" package create Orchard.Experimental "$(GalleryArtifactFolder)"" WorkingDirectory="$(GalleryFolder)"/>
|
||||
<Exec Command=""$(GalleryFolder)\bin\Orchard.exe" package create Orchard.ImportExport "$(GalleryArtifactFolder)"" WorkingDirectory="$(GalleryFolder)"/>
|
||||
<Exec Command=""$(GalleryFolder)\bin\Orchard.exe" package create Orchard.Indexing "$(GalleryArtifactFolder)"" WorkingDirectory="$(GalleryFolder)"/>
|
||||
<Exec Command=""$(GalleryFolder)\bin\Orchard.exe" package create Orchard.MediaPicker "$(GalleryArtifactFolder)"" WorkingDirectory="$(GalleryFolder)"/>
|
||||
<Exec Command=""$(GalleryFolder)\bin\Orchard.exe" package create Orchard.Migrations "$(GalleryArtifactFolder)"" WorkingDirectory="$(GalleryFolder)"/>
|
||||
<Exec Command=""$(GalleryFolder)\bin\Orchard.exe" package create Orchard.MultiTenancy "$(GalleryArtifactFolder)"" WorkingDirectory="$(GalleryFolder)"/>
|
||||
<Exec Command=""$(GalleryFolder)\bin\Orchard.exe" package create Orchard.Recipies "$(GalleryArtifactFolder)"" WorkingDirectory="$(GalleryFolder)"/>
|
||||
<Exec Command=""$(GalleryFolder)\bin\Orchard.exe" package create Orchard.Scripting.Dlr "$(GalleryArtifactFolder)"" WorkingDirectory="$(GalleryFolder)"/>
|
||||
<Exec Command=""$(GalleryFolder)\bin\Orchard.exe" package create Orchard.Search "$(GalleryArtifactFolder)"" WorkingDirectory="$(GalleryFolder)"/>
|
||||
<Exec Command=""$(GalleryFolder)\bin\Orchard.exe" package create Orchard.Warmup "$(GalleryArtifactFolder)"" WorkingDirectory="$(GalleryFolder)"/>
|
||||
</Target>
|
||||
|
||||
<!-- ValidateProjectFiles-->
|
||||
|
||||
@@ -33,5 +33,5 @@ Scenario: I can add content items to a list
|
||||
| Routable.Title | MyContentItem |
|
||||
And I hit "Save"
|
||||
And I am redirected
|
||||
Then I should see "Manage Content for MyList"
|
||||
Then I should see "Manage MyList"
|
||||
And I should see "MyContentItem"
|
||||
|
||||
6
src/Orchard.Specs/Lists.feature.cs
generated
6
src/Orchard.Specs/Lists.feature.cs
generated
@@ -1,7 +1,7 @@
|
||||
// ------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by SpecFlow (http://www.specflow.org/).
|
||||
// SpecFlow Version:1.5.0.0
|
||||
// SpecFlow Version:1.4.0.0
|
||||
// Runtime Version:4.0.30319.1
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
@@ -14,7 +14,7 @@ namespace Orchard.Specs
|
||||
using TechTalk.SpecFlow;
|
||||
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.5.0.0")]
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.4.0.0")]
|
||||
[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[NUnit.Framework.TestFixtureAttribute()]
|
||||
[NUnit.Framework.DescriptionAttribute("Lists")]
|
||||
@@ -135,7 +135,7 @@ this.ScenarioSetup(scenarioInfo);
|
||||
#line 35
|
||||
testRunner.And("I am redirected");
|
||||
#line 36
|
||||
testRunner.Then("I should see \"Manage Content for MyList\"");
|
||||
testRunner.Then("I should see \"Manage MyList\"");
|
||||
#line 37
|
||||
testRunner.And("I should see \"MyContentItem\"");
|
||||
#line hidden
|
||||
|
||||
@@ -273,6 +273,7 @@
|
||||
<Compile Include="Stubs\StubVirtualPathMonitor.cs" />
|
||||
<Compile Include="Stubs\StubCacheManager.cs" />
|
||||
<Compile Include="Stubs\StubWebSiteFolder.cs" />
|
||||
<Compile Include="UI\Resources\ResourceManagerTests.cs" />
|
||||
<Compile Include="UI\ShapeTests.cs" />
|
||||
<Compile Include="Utility\ContainerExtensions.cs" />
|
||||
<Compile Include="Environment\TestDependencies\TestDependency.cs" />
|
||||
|
||||
133
src/Orchard.Tests/UI/Resources/ResourceManagerTests.cs
Normal file
133
src/Orchard.Tests/UI/Resources/ResourceManagerTests.cs
Normal file
@@ -0,0 +1,133 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using Autofac;
|
||||
using NUnit.Framework;
|
||||
using Orchard.DisplayManagement.Implementation;
|
||||
using Orchard.Tests.Stubs;
|
||||
using Orchard.UI.Admin;
|
||||
using Orchard.UI.Resources;
|
||||
|
||||
namespace Orchard.Tests.UI.Resources {
|
||||
[TestFixture]
|
||||
public class ResourceManagerTests {
|
||||
private IContainer _container;
|
||||
private IResourceManager _resourceManager;
|
||||
private TestManifestProvider _testManifest;
|
||||
private string _appPath = "/AppPath/";
|
||||
|
||||
private class TestManifestProvider : IResourceManifestProvider {
|
||||
public Action<ResourceManifest> DefineManifest { get; set; }
|
||||
|
||||
public TestManifestProvider() {
|
||||
|
||||
}
|
||||
public void BuildManifests(ResourceManifestBuilder builder) {
|
||||
var manifest = builder.Add();
|
||||
if (DefineManifest != null) {
|
||||
DefineManifest(manifest);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void VerifyPaths(string resourceType, RequireSettings defaultSettings, string expectedPaths) {
|
||||
defaultSettings = defaultSettings ?? new RequireSettings();
|
||||
var requiredResources = _resourceManager.BuildRequiredResources(resourceType);
|
||||
var renderedResources = string.Join(",", requiredResources.Select(context => context.GetResourceUrl(defaultSettings, _appPath)).ToArray());
|
||||
Assert.That(renderedResources, Is.EqualTo(expectedPaths));
|
||||
}
|
||||
|
||||
[SetUp]
|
||||
public void Init() {
|
||||
var builder = new ContainerBuilder();
|
||||
builder.RegisterType<ResourceManager>().As<IResourceManager>();
|
||||
builder.RegisterType<TestManifestProvider>().As<IResourceManifestProvider>().SingleInstance();
|
||||
_container = builder.Build();
|
||||
_resourceManager = _container.Resolve<IResourceManager>();
|
||||
_testManifest = _container.Resolve<IResourceManifestProvider>() as TestManifestProvider;
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ReleasePathIsTheDefaultPath() {
|
||||
_testManifest.DefineManifest = m => {
|
||||
m.DefineResource("script", "Script1").SetUrl("script1.min.js", "script1.js");
|
||||
};
|
||||
_resourceManager.Require("script", "Script1");
|
||||
VerifyPaths("script", null, "script1.min.js");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void DebugPathIsUsedWithDebugMode() {
|
||||
_testManifest.DefineManifest = m => {
|
||||
m.DefineResource("script", "Script1").SetUrl("script1.min.js", "script1.js");
|
||||
};
|
||||
_resourceManager.Require("script", "Script1");
|
||||
VerifyPaths("script", new RequireSettings { DebugMode = true }, "script1.js");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ReleasePathIsUsedWhenNoDebugPath() {
|
||||
_testManifest.DefineManifest = m => {
|
||||
m.DefineResource("script", "Script1").SetUrl("script1.min.js");
|
||||
};
|
||||
_resourceManager.Require("script", "Script1");
|
||||
VerifyPaths("script", new RequireSettings { DebugMode = true }, "script1.min.js");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void DefaultSettingsAreOverriddenByUseDebugMode() {
|
||||
_testManifest.DefineManifest = m => {
|
||||
m.DefineResource("script", "Script1").SetUrl("script1.min.js", "script1.js");
|
||||
};
|
||||
_resourceManager.Require("script", "Script1").UseDebugMode();
|
||||
VerifyPaths("script", new RequireSettings { DebugMode = false }, "script1.js");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void CdnPathIsUsedInCdnMode() {
|
||||
_testManifest.DefineManifest = m => {
|
||||
m.DefineResource("script", "Script1").SetUrl("script1.js").SetCdn("http://cdn/script1.min.js");
|
||||
};
|
||||
_resourceManager.Require("script", "Script1");
|
||||
VerifyPaths("script", new RequireSettings { CdnMode = true }, "http://cdn/script1.min.js");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void CdnDebugPathIsUsedInCdnModeAndDebugMode() {
|
||||
_testManifest.DefineManifest = m => {
|
||||
m.DefineResource("script", "Script1").SetUrl("script1.js").SetCdn("http://cdn/script1.min.js", "http://cdn/script1.js");
|
||||
};
|
||||
_resourceManager.Require("script", "Script1");
|
||||
VerifyPaths("script", new RequireSettings { CdnMode = true, DebugMode = true }, "http://cdn/script1.js");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void DebugPathIsUsedInCdnModeAndDebugModeAndThereIsNoCdnDebugPath() {
|
||||
_testManifest.DefineManifest = m => {
|
||||
m.DefineResource("script", "Script1").SetUrl("script1.min.js", "script1.js").SetCdn("http://cdn/script1.min.js");
|
||||
};
|
||||
_resourceManager.Require("script", "Script1");
|
||||
VerifyPaths("script", new RequireSettings { CdnMode = true, DebugMode = true }, "script1.js");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void DependenciesAreAutoIncluded() {
|
||||
_testManifest.DefineManifest = m => {
|
||||
m.DefineResource("script", "Script1").SetUrl("script1.min.js");
|
||||
m.DefineResource("script", "Script2").SetUrl("script2.min.js").SetDependencies("Script1");
|
||||
};
|
||||
_resourceManager.Require("script", "Script2");
|
||||
VerifyPaths("script", null, "script1.min.js,script2.min.js");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void DependenciesAssumeTheirParentUseDebugModeSetting() {
|
||||
_testManifest.DefineManifest = m => {
|
||||
m.DefineResource("script", "Script1").SetUrl("script1.min.js", "script1.js");
|
||||
m.DefineResource("script", "Script2").SetUrl("script2.min.js", "script2.js").SetDependencies("Script1");
|
||||
};
|
||||
_resourceManager.Require("script", "Script2").UseDebugMode();
|
||||
VerifyPaths("script", new RequireSettings { DebugMode = false }, "script1.js,script2.js");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ using System.Web.Mvc;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.ContentManagement.Aspects;
|
||||
using Orchard.ContentManagement.Drivers;
|
||||
using Orchard.Core.Common.Models;
|
||||
using Orchard.Core.Containers.Models;
|
||||
using Orchard.Core.Containers.ViewModels;
|
||||
using Orchard.Localization;
|
||||
@@ -27,7 +28,7 @@ namespace Orchard.Core.Containers.Drivers {
|
||||
return ContentShape(
|
||||
"Parts_Containable_Edit",
|
||||
() => {
|
||||
var commonPart = part.As<ICommonPart>();
|
||||
var commonPart = part.As<CommonPart>();
|
||||
|
||||
var model = new ContainableViewModel();
|
||||
if (commonPart != null && commonPart.Container != null) {
|
||||
@@ -37,10 +38,12 @@ namespace Orchard.Core.Containers.Drivers {
|
||||
if (updater != null) {
|
||||
var oldContainerId = model.ContainerId;
|
||||
updater.TryUpdateModel(model, "Containable", null, null);
|
||||
if (oldContainerId != model.ContainerId)
|
||||
if (oldContainerId != model.ContainerId) {
|
||||
if (commonPart != null) {
|
||||
commonPart.Container = _contentManager.Get(model.ContainerId, VersionOptions.Latest);
|
||||
var containerItem = _contentManager.Get(model.ContainerId, VersionOptions.Latest);
|
||||
commonPart.Record.Container = containerItem == null ? null : containerItem.Record;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// note: string.isnullorempty not being recognized by linq-to-nhibernate hence the inline or
|
||||
@@ -50,7 +53,7 @@ namespace Orchard.Core.Containers.Drivers {
|
||||
var listItems = new[] { new SelectListItem { Text = T("(None)").Text, Value = "0" } }
|
||||
.Concat(containers.Select(x => new SelectListItem {
|
||||
Value = Convert.ToString(x.Id),
|
||||
Text = x.ContentItem.TypeDefinition.DisplayName + ": " + x.As<IRoutableAspect>().Title,
|
||||
Text = x.ContentItem.TypeDefinition.DisplayName + ": " + _contentManager.GetItemMetadata(x.ContentItem).DisplayText,
|
||||
Selected = x.Id == model.ContainerId,
|
||||
}))
|
||||
.ToList();
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
}, "Id", "Text", (int)Model.ResourceDebugMode);
|
||||
}
|
||||
<fieldset>
|
||||
<legend>@T("General Settings")</legend>
|
||||
<legend>@T("General")</legend>
|
||||
<div>
|
||||
<label for="SiteName">@T("Site name")</label>
|
||||
@Html.EditorFor(m => m.SiteName)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
@using Orchard.Comments.Models;
|
||||
|
||||
<fieldset>
|
||||
<legend>@T("Settings for Comments")</legend>
|
||||
<legend>@T("Comments")</legend>
|
||||
<div>
|
||||
@Html.EditorFor(m => m.ModerateComments)
|
||||
<label class="forcheckbox" for="CommentSettings_ModerateComments">@T("Comments must be approved before they appear")</label>
|
||||
|
||||
@@ -126,6 +126,11 @@ namespace Orchard.DesignerTools.Services {
|
||||
foreach (var member in members) {
|
||||
if (o is ContentItem && member.Name == "Parts") {
|
||||
foreach (var part in ((ContentItem) o).Parts) {
|
||||
// ignore contentparts like ContentPart<ContentItemVersionRecord>
|
||||
if(part.GetType().IsGenericType) {
|
||||
continue;
|
||||
}
|
||||
|
||||
SafeCall(() => Dump(part, part.PartDefinition.Name));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ namespace Orchard.DesignerTools.Services {
|
||||
|
||||
var sb = new StringBuilder();
|
||||
ConvertToJSon(dump, sb);
|
||||
shape.Dump = sb.ToString();
|
||||
shape._Dump = sb.ToString();
|
||||
|
||||
shape.Template = null;
|
||||
shape.OriginalTemplate = descriptor.BindingSource;
|
||||
@@ -159,26 +159,29 @@ namespace Orchard.DesignerTools.Services {
|
||||
|
||||
switch (x.Name.ToString()) {
|
||||
case "ul" :
|
||||
var first = true;
|
||||
foreach(var li in x.Elements()) {
|
||||
if (!first) sb.Append(",");
|
||||
ConvertToJSon(li, sb);
|
||||
sb.Append(",");
|
||||
first = false;
|
||||
}
|
||||
break;
|
||||
case "li":
|
||||
var name = x.Element("h1").Value;
|
||||
var value = x.Element("span").Value;
|
||||
|
||||
sb.AppendFormat("name: \"{0}\", ", FormatJsonValue(name));
|
||||
sb.AppendFormat("value: \"{0}\"", FormatJsonValue(value));
|
||||
sb.AppendFormat("\"name\": \"{0}\", ", FormatJsonValue(name));
|
||||
sb.AppendFormat("\"value\": \"{0}\"", FormatJsonValue(value));
|
||||
|
||||
var ul = x.Element("ul");
|
||||
if (ul != null && ul.Descendants().Any()) {
|
||||
sb.Append(", children: [");
|
||||
sb.Append(", \"children\": [");
|
||||
first = true;
|
||||
foreach (var li in ul.Elements()) {
|
||||
sb.Append("{ ");
|
||||
sb.Append(first ? "{ " : ", {");
|
||||
ConvertToJSon(li, sb);
|
||||
sb.Append(" }");
|
||||
sb.Append(", ");
|
||||
first = false;
|
||||
}
|
||||
sb.Append("]");
|
||||
}
|
||||
@@ -189,7 +192,7 @@ namespace Orchard.DesignerTools.Services {
|
||||
|
||||
private static string FormatJsonValue(string value) {
|
||||
// replace " by \" in json strings
|
||||
return value.Replace("\"", @"\""");
|
||||
return value.Replace(@"\", @"\\").Replace("\"", @"\""").Replace("\r\n", @"\n").Replace("\n", @"\n");
|
||||
}
|
||||
|
||||
private static string FormatShapeFilename(string shape, string shapeType, string displayType, string themePrefix, string extension) {
|
||||
|
||||
@@ -40,6 +40,6 @@
|
||||
Wrappers: Model.Metadata.Wrappers,
|
||||
ChildContent: Model.Metadata.ChildContent,
|
||||
ShapeId: Model.ShapeId,
|
||||
Dump: Model.Dump
|
||||
Dump: Model._Dump
|
||||
));
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
@using System.Net.Mail;
|
||||
|
||||
<fieldset>
|
||||
<legend>@T("SMTP")</legend>
|
||||
<legend>@T("Email")</legend>
|
||||
<div>
|
||||
<label for="@Html.FieldIdFor(m => m.Address)">@T("Sender email address")</label>
|
||||
@Html.EditorFor(m => m.Address)
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
@using (Html.BeginForm("update", "admin", FormMethod.Post, new {area = "Orchard.Indexing"})) {
|
||||
<fieldset>
|
||||
<legend>@T("Search Index Statistics")</legend>
|
||||
<legend>@T("Search Index")</legend>
|
||||
<ol class="decimal">
|
||||
@if (Model.IndexEntry == null) {
|
||||
|
||||
|
||||
@@ -311,7 +311,7 @@ namespace Lists.Controllers {
|
||||
// ensure the item can be in that container.
|
||||
if (!string.IsNullOrEmpty(itemContentType) && item.ContentType != itemContentType) {
|
||||
Services.TransactionManager.Cancel();
|
||||
Services.Notifier.Information(T("One or more items could not be moved to '{0}' because it is restricted to containing items of type '{1}'.", _contentManager.GetItemMetadata(targetContainer).DisplayText, itemContentType));
|
||||
Services.Notifier.Information(T("One or more items could not be moved to '{0}' because it is restricted to containing items of type '{1}'.", _contentManager.GetItemMetadata(targetContainer).DisplayText ?? targetContainer.ContentItem.ContentType, itemContentType));
|
||||
return true; // todo: transactions
|
||||
}
|
||||
|
||||
@@ -319,7 +319,7 @@ namespace Lists.Controllers {
|
||||
FixItemPath(item);
|
||||
}
|
||||
Services.Notifier.Information(T("Content successfully moved to <a href=\"{0}\">{1}</a>.",
|
||||
Url.Action("List", new { containerId = targetContainerId }), _contentManager.GetItemMetadata(targetContainer).DisplayText));
|
||||
Url.Action("List", new { containerId = targetContainerId }), _contentManager.GetItemMetadata(targetContainer).DisplayText ?? targetContainer.ContentItem.ContentType));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,14 +8,14 @@
|
||||
|
||||
var targetContainers = ((IEnumerable<ContentItem>)Model.Containers).Select(
|
||||
contentItem => new SelectListItem {
|
||||
Text = T("Move to {0}", contentItem.ContentManager.GetItemMetadata(contentItem).DisplayText).ToString(),
|
||||
Text = T("Move to {0}", contentItem.ContentManager.GetItemMetadata(contentItem).DisplayText ?? contentItem.ContentType).ToString(),
|
||||
Value = contentItem.Id.ToString(System.Globalization.CultureInfo.InvariantCulture),
|
||||
Selected = contentItem.Id == targetContainerId
|
||||
}).ToList();
|
||||
|
||||
var sourceContainers = ((IEnumerable<ContentItem>)Model.Containers).Select(
|
||||
contentItem => new SelectListItem {
|
||||
Text = contentItem.ContentManager.GetItemMetadata(contentItem).DisplayText,
|
||||
Text = contentItem.ContentManager.GetItemMetadata(contentItem).DisplayText ?? contentItem.ContentType,
|
||||
Value = contentItem.Id.ToString(System.Globalization.CultureInfo.InvariantCulture),
|
||||
Selected = contentItem.Id == sourceContainerId
|
||||
}).ToList();
|
||||
|
||||
@@ -31,15 +31,16 @@
|
||||
</div>
|
||||
|
||||
@using (Html.BeginFormAntiForgeryPost()) {
|
||||
var options = (ContentOptions) Model.Options;
|
||||
<fieldset class="bulk-actions">
|
||||
<label for="publishActions">@T("Actions:")</label>
|
||||
<select id="publishActions" name="Options.BulkAction">
|
||||
@Html.SelectOption((ContentsBulkAction)Model.Options.BulkAction, ContentsBulkAction.None, T("Choose action...").ToString())
|
||||
@Html.SelectOption((ContentsBulkAction)Model.Options.BulkAction, ContentsBulkAction.PublishNow, T("Publish Now").ToString())
|
||||
@Html.SelectOption((ContentsBulkAction)Model.Options.BulkAction, ContentsBulkAction.Unpublish, T("Unpublish").ToString())
|
||||
@Html.SelectOption((ContentsBulkAction)Model.Options.BulkAction, ContentsBulkAction.Remove, T("Delete").ToString())
|
||||
@Html.SelectOption((ContentsBulkAction)Model.Options.BulkAction, ContentsBulkAction.RemoveFromList, T("Remove from List").ToString())
|
||||
@Html.SelectOption((ContentsBulkAction)Model.Options.BulkAction, ContentsBulkAction.MoveToList, T("Move to List...").ToString())
|
||||
@Html.SelectOption(options.BulkAction, ContentsBulkAction.None, T("Choose action...").ToString())
|
||||
@Html.SelectOption(options.BulkAction, ContentsBulkAction.PublishNow, T("Publish Now").ToString())
|
||||
@Html.SelectOption(options.BulkAction, ContentsBulkAction.Unpublish, T("Unpublish").ToString())
|
||||
@Html.SelectOption(options.BulkAction, ContentsBulkAction.Remove, T("Delete").ToString())
|
||||
@Html.SelectOption(options.BulkAction, ContentsBulkAction.RemoveFromList, T("Remove from List").ToString())
|
||||
@Html.SelectOption(options.BulkAction, ContentsBulkAction.MoveToList, T("Move to List...").ToString())
|
||||
</select>
|
||||
@Html.DropDownList("TargetContainerId", lists, new { id = "TargetContainerId" })
|
||||
<button type="submit" name="submit.BulkEdit" value="yes">@T("Apply")</button>
|
||||
|
||||
@@ -233,16 +233,8 @@ namespace Orchard.Media.Controllers {
|
||||
}
|
||||
}
|
||||
|
||||
public ActionResult EditMedia(string name, DateTime lastUpdated, long size, string folderName, string mediaPath) {
|
||||
var model = new MediaItemEditViewModel();
|
||||
model.Name = name;
|
||||
// todo: reimplement
|
||||
//model.Caption = caption ?? String.Empty;
|
||||
model.LastUpdated = lastUpdated;
|
||||
model.Size = size;
|
||||
model.FolderName = folderName;
|
||||
model.MediaPath = mediaPath;
|
||||
model.PublicUrl = _mediaService.GetPublicUrl(Path.Combine(mediaPath, name));
|
||||
public ActionResult EditMedia(MediaItemEditViewModel model) {
|
||||
model.PublicUrl = _mediaService.GetPublicUrl(Path.Combine(model.MediaPath, model.Name));
|
||||
return View(model);
|
||||
}
|
||||
|
||||
@@ -293,9 +285,8 @@ namespace Orchard.Media.Controllers {
|
||||
mediaPath = viewModel.MediaPath });
|
||||
}
|
||||
catch (Exception exception) {
|
||||
this.Error(exception, T("Editing media file failed: {0}", exception.Message), Logger, Services.Notifier);
|
||||
|
||||
return View(viewModel);
|
||||
this.Error(exception, T("Editing media file failed."), Logger, Services.Notifier);
|
||||
return EditMedia(viewModel);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -140,7 +140,10 @@ namespace Orchard.Media.Services {
|
||||
Argument.ThrowIfNullOrEmpty(newFileName, "newFileName");
|
||||
|
||||
if (!FileAllowed(newFileName, false)) {
|
||||
throw new ArgumentException(T("New file name {0} is not allowed", newFileName).ToString());
|
||||
if (string.IsNullOrEmpty(Path.GetExtension(newFileName))) {
|
||||
throw new ArgumentException(T("New file name \"{0}\" is not allowed. Please provide a file extension.", newFileName).ToString());
|
||||
}
|
||||
throw new ArgumentException(T("New file name \"{0}\" is not allowed.", newFileName).ToString());
|
||||
}
|
||||
|
||||
_storageProvider.RenameFile(_storageProvider.Combine(folderPath, currentFileName), _storageProvider.Combine(folderPath, newFileName));
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
@model Orchard.Media.Models.MediaSettingsPartRecord
|
||||
|
||||
<fieldset>
|
||||
<legend>@T("Settings for Media")</legend>
|
||||
<legend>@T("Media")</legend>
|
||||
<div>
|
||||
@Html.LabelFor(m => m.UploadAllowedFileTypeWhitelist, T("Upload allowed file types (list of extensions separated by spaces)"))
|
||||
@Html.TextBoxFor(m => m.UploadAllowedFileTypeWhitelist, new { @class = "textMedium" })
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
@{ Layout.Title = T("Settings").ToString(); }
|
||||
|
||||
<h2>@T("Settings for Gallery")</h2>
|
||||
<h2>@T("Gallery")</h2>
|
||||
<div class="manage">
|
||||
@Html.ActionLink(T("Add Feed").Text, "AddSource", new { }, new { @class = "button primaryAction" })
|
||||
</div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
@using Orchard.Search.ViewModels;
|
||||
|
||||
<fieldset>
|
||||
<legend>@T("Settings for Search")</legend>
|
||||
<legend>@T("Search")</legend>
|
||||
<div>
|
||||
@{var entryIndex = 0;}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
@model Orchard.Users.Models.RegistrationSettingsPartRecord
|
||||
|
||||
<fieldset>
|
||||
<legend>@T("Settings for Users")</legend>
|
||||
<legend>@T("Users")</legend>
|
||||
<div>
|
||||
@Html.EditorFor(m => m.UsersCanRegister)
|
||||
<label class="forcheckbox" for="@Html.FieldIdFor( m => m.UsersCanRegister)">@T("Users can create new accounts on the site")</label>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
@Html.ValidationSummary()
|
||||
|
||||
<fieldset>
|
||||
<legend>@T("Settings for Warmup")</legend>
|
||||
<legend>@T("Warmup")</legend>
|
||||
<div>
|
||||
<label for="@Html.FieldIdFor(m => m.Urls)">@T("Urls for which static warmup pages will be generated")</label>
|
||||
@Html.TextAreaFor(m => m.Urls, new { @class = "textMedium" })
|
||||
|
||||
Reference in New Issue
Block a user