mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-26 20:16:15 +08:00
Merge branch '1.10.x' into dev
# Conflicts: # src/Gulpfile.js # src/Orchard.Web/Core/Common/Views/EditorTemplates/Fields.Common.Text.Edit.cshtml # src/Orchard.Web/Modules/Orchard.ContentPicker/Module.txt # src/Orchard.Web/Modules/Orchard.CustomForms/Module.txt # src/Orchard.Web/Modules/Orchard.Fields/Module.txt # src/Orchard.Web/Modules/Orchard.Fields/Views/DefinitionTemplates/EnumerationFieldSettings.cshtml # src/Orchard.Web/Modules/Orchard.Fields/Views/DefinitionTemplates/NumericFieldSettings.cshtml # src/Orchard.Web/Modules/Orchard.Fields/Views/EditorTemplates/Fields/Link.Edit.cshtml # src/Orchard.Web/Modules/Orchard.Fields/Views/EditorTemplates/Fields/Numeric.Edit.cshtml # src/Orchard.Web/Modules/Orchard.Forms/Module.txt # src/Orchard.Web/Modules/Orchard.Projections/Module.txt # src/Orchard.Web/Modules/Orchard.TaskLease/Module.txt # src/Orchard.Web/Modules/Orchard.Tokens/Module.txt # src/Package.json
This commit is contained in:
@@ -45,10 +45,13 @@ namespace Orchard.Core.Common.Drivers {
|
||||
protected override DriverResult Editor(ContentPart part, TextField field, dynamic shapeHelper) {
|
||||
return ContentShape("Fields_Common_Text_Edit", GetDifferentiator(field, part),
|
||||
() => {
|
||||
var settings = field.PartFieldDefinition.Settings.GetModel<TextFieldSettings>();
|
||||
var text = part.IsNew() ? settings.DefaultValue : field.Value;
|
||||
|
||||
var viewModel = new TextFieldDriverViewModel {
|
||||
Field = field,
|
||||
Text = field.Value,
|
||||
Settings = field.PartFieldDefinition.Settings.GetModel<TextFieldSettings>(),
|
||||
Text = text,
|
||||
Settings = settings,
|
||||
ContentItem = part.ContentItem
|
||||
};
|
||||
|
||||
@@ -65,10 +68,6 @@ namespace Orchard.Core.Common.Drivers {
|
||||
|
||||
field.Value = viewModel.Text;
|
||||
|
||||
if (String.IsNullOrWhiteSpace(field.Value) && !String.IsNullOrWhiteSpace(settings.DefaultValue)) {
|
||||
field.Value = settings.DefaultValue;
|
||||
}
|
||||
|
||||
if (settings.Required && String.IsNullOrWhiteSpace(field.Value)) {
|
||||
updater.AddModelError("Text", T("The field {0} is mandatory", T(field.DisplayName)));
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.10
|
||||
Version: 1.10.1
|
||||
OrchardVersion: 1.9
|
||||
Description: The common module introduces content parts that are going to be used by most content types (common, body, identity).
|
||||
FeatureDescription: Core content parts.
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
@model Orchard.Core.Common.ViewModels.TextFieldSettingsEventsViewModel
|
||||
|
||||
@* This is a token-less default value editor that can be overridden from features that can depend on Orchard.Tokens. *@
|
||||
|
||||
<label for="@Html.FieldIdFor(m => m.Settings.DefaultValue)">@T("Default value")</label>
|
||||
@Html.TextBoxFor(m => m.Settings.DefaultValue, new { @class = "text large" })
|
||||
<span class="hint">@T("Default value for the field. If there is no value given for the actual field, this will be filled in. (optional)")</span>
|
||||
<span class="hint">@T("The default value proposed when creating a content item. (optional)")</span>
|
||||
@Html.ValidationMessageFor(m => m.Settings.DefaultValue)
|
||||
@@ -1,7 +1,5 @@
|
||||
@model Orchard.Core.Common.ViewModels.TextFieldDriverViewModel
|
||||
@{
|
||||
var isRequired = Model.Settings.Required && String.IsNullOrWhiteSpace(Model.Settings.DefaultValue);
|
||||
}
|
||||
|
||||
<fieldset>
|
||||
<label for="@Html.FieldIdFor(m => m.Text)" @if(Model.Settings.Required) { <text>class="required"</text> }>@Model.Field.DisplayName</label>
|
||||
@if (String.IsNullOrWhiteSpace(Model.Settings.Flavor)) {
|
||||
@@ -16,7 +14,4 @@
|
||||
@if (HasText(Model.Settings.Hint)) {
|
||||
<span class="hint">@Model.Settings.Hint</span>
|
||||
}
|
||||
@if (!String.IsNullOrWhiteSpace(Model.Settings.DefaultValue)) {
|
||||
<span class="hint">@T("If the field is left empty then the default value will be used.")</span>
|
||||
}
|
||||
</fieldset>
|
||||
@@ -2,7 +2,7 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.10
|
||||
Version: 1.10.1
|
||||
OrchardVersion: 1.9
|
||||
Description: The containers module introduces container and containable behaviors for content items.
|
||||
FeatureDescription: Container and containable parts to enable parent-child relationships between content items.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.10
|
||||
Version: 1.10.1
|
||||
OrchardVersion: 1.9
|
||||
Description: The contents module enables the creation of custom content types.
|
||||
Features:
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.10
|
||||
Version: 1.10.1
|
||||
OrchardVersion: 1.9
|
||||
Description: The dashboard module is providing the dashboard screen of the admininstration UI of the application.
|
||||
FeatureDescription: Standard admin dashboard.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.10
|
||||
Version: 1.10.1
|
||||
OrchardVersion: 1.9
|
||||
Description: The Feeds module is providing RSS feeds to content items.
|
||||
FeatureDescription: RSS feeds for content items.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.10
|
||||
Version: 1.10.1
|
||||
OrchardVersion: 1.9
|
||||
Description: The navigation module creates and manages a simple navigation menu for the front-end of the application and allows you to add content items to the admin menu.
|
||||
FeatureDescription: Menu management.
|
||||
|
||||
@@ -30,6 +30,6 @@ using System.Security;
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.10")]
|
||||
[assembly: AssemblyFileVersion("1.10")]
|
||||
[assembly: AssemblyVersion("1.10.1")]
|
||||
[assembly: AssemblyFileVersion("1.10.1")]
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.10
|
||||
Version: 1.10.1
|
||||
OrchardVersion: 1.9
|
||||
Description: The dashboard module is providing the reports screen of the application.
|
||||
FeatureDescription: Reports management.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.10
|
||||
Version: 1.10.1
|
||||
OrchardVersion: 1.9
|
||||
Description: The scheduling module enables background task scheduling.
|
||||
FeatureDescription: Scheduled background tasks.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.10
|
||||
Version: 1.10.1
|
||||
OrchardVersion: 1.9
|
||||
Description: The settings module creates site settings that other modules can contribute to.
|
||||
FeatureDescription: Site settings.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.10
|
||||
Version: 1.10.1
|
||||
OrchardVersion: 1.9
|
||||
Description: The shapes module contains core shape templates and display hooks.
|
||||
FeatureDescription: Core shape templates and display hooks.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.10
|
||||
Version: 1.10.1
|
||||
OrchardVersion: 1.9
|
||||
Description: The title module enables content items to have titles.
|
||||
FeatureDescription: Title content part.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.10
|
||||
Version: 1.10.1
|
||||
OrchardVersion: 1.9
|
||||
Description: The XmlRpc module enables creation of contents from client applications such as LiveWriter.
|
||||
FeatureDescription: XML-RPC opt-in implementation.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.10
|
||||
Version: 1.10.1
|
||||
OrchardVersion: 1.9
|
||||
Description: The Lucene module enables the site to be indexed using Lucene.NET. The index generated by this module can then be used by the search module to provide an integrated full-text search experience to a web site.
|
||||
FeatureDescription: Lucene indexing services.
|
||||
|
||||
@@ -30,6 +30,6 @@ using System.Security;
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.10")]
|
||||
[assembly: AssemblyFileVersion("1.10")]
|
||||
[assembly: AssemblyVersion("1.10.1")]
|
||||
[assembly: AssemblyFileVersion("1.10.1")]
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.10
|
||||
Version: 1.10.1
|
||||
OrchardVersion: 1.9
|
||||
Description: The Markdown module enables rich text contents to be created using the Markdown syntax.
|
||||
FeatureDescription: Markdown editor.
|
||||
|
||||
@@ -26,6 +26,6 @@ using System.Runtime.InteropServices;
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.10")]
|
||||
[assembly: AssemblyFileVersion("1.10")]
|
||||
[assembly: AssemblyVersion("1.10.1")]
|
||||
[assembly: AssemblyFileVersion("1.10.1")]
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ Name: Alias
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.10
|
||||
Version: 1.10.1
|
||||
OrchardVersion: 1.9
|
||||
Description: Maps friendly urls to specific module actions.
|
||||
FeatureDescription: Maps friendly urls to specific module actions.
|
||||
|
||||
@@ -30,6 +30,6 @@ using System.Security;
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.10")]
|
||||
[assembly: AssemblyFileVersion("1.10")]
|
||||
[assembly: AssemblyVersion("1.10.1")]
|
||||
[assembly: AssemblyFileVersion("1.10.1")]
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ Name: AntiSpam
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.10
|
||||
Version: 1.10.1
|
||||
OrchardVersion: 1.9
|
||||
Description: Provides anti-spam services to protect your content from malicious submissions.
|
||||
Features:
|
||||
|
||||
@@ -29,6 +29,6 @@ using System.Runtime.InteropServices;
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.10")]
|
||||
[assembly: AssemblyFileVersion("1.10")]
|
||||
[assembly: AssemblyVersion("1.10.1")]
|
||||
[assembly: AssemblyFileVersion("1.10.1")]
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ Path: ArchiveLater
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.10
|
||||
Version: 1.10.1
|
||||
OrchardVersion: 1.9
|
||||
Description: The ArchiveLater module introduces scheduled archiving functionality.
|
||||
FeatureDescription: Scheduled archiving.
|
||||
|
||||
@@ -30,6 +30,6 @@ using System.Security;
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.10")]
|
||||
[assembly: AssemblyFileVersion("1.10")]
|
||||
[assembly: AssemblyVersion("1.10.1")]
|
||||
[assembly: AssemblyFileVersion("1.10.1")]
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.10
|
||||
Version: 1.10.1
|
||||
OrchardVersion: 1.9
|
||||
Description: Provides a log for recording and viewing back-end changes.
|
||||
Features:
|
||||
|
||||
@@ -135,7 +135,7 @@
|
||||
</Content>
|
||||
<Content Include="Scripts\Web.config" />
|
||||
<Content Include="Styles\Web.config" />
|
||||
<Content Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Content Include="Module.txt" />
|
||||
<Content Include="Views\Parts.Contents.AuditTrail.SummaryAdmin.cshtml" />
|
||||
<Content Include="Views\DefinitionTemplates\AuditTrailPartSettings.cshtml" />
|
||||
|
||||
@@ -32,6 +32,6 @@ using System.Security;
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
|
||||
[assembly: AssemblyVersion("1.10")]
|
||||
[assembly: AssemblyFileVersion("1.10")]
|
||||
[assembly: AssemblyVersion("1.10.1")]
|
||||
[assembly: AssemblyFileVersion("1.10.1")]
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ Name: Autoroute
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.10
|
||||
Version: 1.10.1
|
||||
OrchardVersion: 1.9
|
||||
Description: Description for the module
|
||||
Features:
|
||||
|
||||
@@ -30,6 +30,6 @@ using System.Security;
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.10")]
|
||||
[assembly: AssemblyFileVersion("1.10")]
|
||||
[assembly: AssemblyVersion("1.10.1")]
|
||||
[assembly: AssemblyFileVersion("1.10.1")]
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
AntiForgery: enabled
|
||||
Author: Microsoft Open Technologies, Inc
|
||||
Website: http://msopentech.com
|
||||
Version: 1.10
|
||||
Version: 1.10.1
|
||||
OrchardVersion: 1.9
|
||||
Description: Provides integration of Microsoft Azure Media Services functionality into Orchard.
|
||||
Features:
|
||||
|
||||
@@ -276,7 +276,7 @@
|
||||
</Content>
|
||||
<Content Include="Scripts\Web.config" />
|
||||
<Content Include="Styles\Web.config" />
|
||||
<Content Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Content Include="Module.txt" />
|
||||
<Content Include="Assets\TypeScript\cloudmedia-videoplayer-data.ts" />
|
||||
<Content Include="Assets\TypeScript\cloudmedia-videoplayer-injectors-dash.ts" />
|
||||
|
||||
@@ -32,6 +32,6 @@ using System.Security;
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.10")]
|
||||
[assembly: AssemblyFileVersion("1.10")]
|
||||
[assembly: AssemblyVersion("1.10.1")]
|
||||
[assembly: AssemblyFileVersion("1.10.1")]
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.10
|
||||
Version: 1.10.1
|
||||
OrchardVersion: 1.9
|
||||
Description: Provides a set of Orchard service implementations targeting Microsoft Azure services.
|
||||
Category: Hosting
|
||||
|
||||
@@ -31,6 +31,6 @@ using System.Security;
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.10")]
|
||||
[assembly: AssemblyFileVersion("1.10")]
|
||||
[assembly: AssemblyVersion("1.10.1")]
|
||||
[assembly: AssemblyFileVersion("1.10.1")]
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.10
|
||||
Version: 1.10.1
|
||||
OrchardVersion: 1.9
|
||||
Description: The Orchard Blogs module is implementing basic blogging features.
|
||||
FeatureDescription: A simple web log.
|
||||
|
||||
@@ -29,6 +29,6 @@ using System.Runtime.InteropServices;
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.10")]
|
||||
[assembly: AssemblyFileVersion("1.10")]
|
||||
[assembly: AssemblyVersion("1.10.1")]
|
||||
[assembly: AssemblyFileVersion("1.10.1")]
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
AntiForgery: enabled
|
||||
Author: Sébastien Ros
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.10
|
||||
Version: 1.10.1
|
||||
OrchardVersion: 1.9
|
||||
Description: Provides an API to cache business data.
|
||||
Features:
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Web.config" />
|
||||
<Content Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Content Include="Module.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -31,6 +31,6 @@ using System.Security;
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.10")]
|
||||
[assembly: AssemblyFileVersion("1.10")]
|
||||
[assembly: AssemblyVersion("1.10.1")]
|
||||
[assembly: AssemblyFileVersion("1.10.1")]
|
||||
|
||||
|
||||
@@ -32,6 +32,6 @@ using System.Security;
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
|
||||
[assembly: AssemblyVersion("1.10")]
|
||||
[assembly: AssemblyFileVersion("1.10")]
|
||||
[assembly: AssemblyVersion("1.10.1")]
|
||||
[assembly: AssemblyFileVersion("1.10.1")]
|
||||
|
||||
|
||||
@@ -69,7 +69,9 @@
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
</ItemGroup>
|
||||
$$FileIncludes$$<ItemGroup>
|
||||
$$CompileIncludes$$
|
||||
$$ContentIncludes$$
|
||||
<ItemGroup>
|
||||
$$OrchardReferences$$
|
||||
</ItemGroup>
|
||||
<PropertyGroup>
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 122 KiB After Width: | Height: | Size: 34 KiB |
@@ -273,6 +273,7 @@ namespace Orchard.CodeGeneration.Commands {
|
||||
string propertiesPath = modulePath + "Properties";
|
||||
var content = new HashSet<string>();
|
||||
var folders = new HashSet<string>();
|
||||
var compile = new HashSet<string>();
|
||||
|
||||
foreach (var folder in _moduleDirectories) {
|
||||
Directory.CreateDirectory(modulePath + folder);
|
||||
@@ -297,27 +298,29 @@ namespace Orchard.CodeGeneration.Commands {
|
||||
File.WriteAllText(modulePath + "Styles\\Web.config", File.ReadAllText(_codeGenTemplatePath + "StaticFilesWebConfig.txt"));
|
||||
content.Add(modulePath + "Styles\\Web.config");
|
||||
|
||||
string templateText = File.ReadAllText(_codeGenTemplatePath + "ModuleAssemblyInfo.txt");
|
||||
templateText = templateText.Replace("$$ModuleName$$", moduleName);
|
||||
templateText = templateText.Replace("$$ModuleTypeLibGuid$$", Guid.NewGuid().ToString());
|
||||
File.WriteAllText(propertiesPath + "\\AssemblyInfo.cs", templateText);
|
||||
content.Add(propertiesPath + "\\AssemblyInfo.cs");
|
||||
|
||||
templateText = File.ReadAllText(_codeGenTemplatePath + "ModuleManifest.txt");
|
||||
string templateText = File.ReadAllText(_codeGenTemplatePath + "ModuleManifest.txt");
|
||||
templateText = templateText.Replace("$$ModuleName$$", moduleName);
|
||||
File.WriteAllText(modulePath + "Module.txt", templateText, System.Text.Encoding.UTF8);
|
||||
content.Add(modulePath + "Module.txt");
|
||||
|
||||
var itemGroup = CreateProjectItemGroup(modulePath, content, folders);
|
||||
templateText = File.ReadAllText(_codeGenTemplatePath + "ModuleAssemblyInfo.txt");
|
||||
templateText = templateText.Replace("$$ModuleName$$", moduleName);
|
||||
templateText = templateText.Replace("$$ModuleTypeLibGuid$$", Guid.NewGuid().ToString());
|
||||
File.WriteAllText(propertiesPath + "\\AssemblyInfo.cs", templateText);
|
||||
compile.Add(propertiesPath + "\\AssemblyInfo.cs");
|
||||
|
||||
File.WriteAllText(modulePath + moduleName + ".csproj", CreateCsProject(moduleName, projectGuid, itemGroup));
|
||||
var contentItemGroup = CreateProjectItemGroup(modulePath, content, folders);
|
||||
var compileItemGroup = CreateCompileItemGroup(modulePath, compile);
|
||||
|
||||
File.WriteAllText(modulePath + moduleName + ".csproj", CreateCsProject(moduleName, projectGuid, contentItemGroup, compileItemGroup));
|
||||
}
|
||||
|
||||
private static string CreateCsProject(string projectName, string projectGuid, string itemGroup) {
|
||||
private static string CreateCsProject(string projectName, string projectGuid, string contentItemGroup, string compileItemGroup) {
|
||||
string text = File.ReadAllText(_codeGenTemplatePath + "\\ModuleCsProj.txt");
|
||||
text = text.Replace("$$ModuleName$$", projectName);
|
||||
text = text.Replace("$$ModuleProjectGuid$$", projectGuid);
|
||||
text = text.Replace("$$FileIncludes$$", itemGroup ?? "");
|
||||
text = text.Replace("$$ContentIncludes$$", contentItemGroup ?? "");
|
||||
text = text.Replace("$$CompileIncludes$$", compileItemGroup ?? "");
|
||||
text = text.Replace("$$OrchardReferences$$", GetOrchardReferences());
|
||||
return text;
|
||||
}
|
||||
@@ -402,7 +405,7 @@ namespace Orchard.CodeGeneration.Commands {
|
||||
// create new csproj for the theme
|
||||
if (projectGuid != null) {
|
||||
var itemGroup = CreateProjectItemGroup(themePath, createdFiles, createdFolders);
|
||||
string projectText = CreateCsProject(themeName, projectGuid, itemGroup);
|
||||
string projectText = CreateCsProject(themeName, projectGuid, itemGroup, null);
|
||||
File.WriteAllText(themePath + "\\" + themeName + ".csproj", projectText);
|
||||
}
|
||||
|
||||
@@ -464,6 +467,23 @@ namespace Orchard.CodeGeneration.Commands {
|
||||
return string.Format(CultureInfo.InvariantCulture, "<ItemGroup>\r\n{0}\r\n </ItemGroup>\r\n ", contentInclude);
|
||||
}
|
||||
|
||||
private static string CreateCompileItemGroup(string relativeFromPath, HashSet<string> compile) {
|
||||
var compileInclude = "";
|
||||
if (relativeFromPath != null && !relativeFromPath.EndsWith("\\", StringComparison.OrdinalIgnoreCase)) {
|
||||
relativeFromPath += "\\";
|
||||
}
|
||||
else if (relativeFromPath == null) {
|
||||
relativeFromPath = "";
|
||||
}
|
||||
|
||||
if (compile != null && compile.Count > 0) {
|
||||
compileInclude = string.Join("\r\n",
|
||||
from file in compile
|
||||
select " <Compile Include=\"" + file.Replace(relativeFromPath, "") + "\" />");
|
||||
}
|
||||
return string.Format(CultureInfo.InvariantCulture, "<ItemGroup>\r\n{0}\r\n </ItemGroup>\r\n ", compileInclude);
|
||||
}
|
||||
|
||||
private void AddFilesToOrchardThemesProject(TextWriter output, string itemGroup) {
|
||||
if (!File.Exists(_orchardThemesProj)) {
|
||||
output.WriteLine(T("Warning: Orchard.Themes project file could not be found at {0}", _orchardThemesProj));
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.10
|
||||
Version: 1.10.1
|
||||
OrchardVersion: 1.9
|
||||
Description: Tools to create Orchard components.
|
||||
FeatureDescription: Tools to create Orchard components.
|
||||
|
||||
@@ -30,6 +30,6 @@ using System.Security;
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.10")]
|
||||
[assembly: AssemblyFileVersion("1.10")]
|
||||
[assembly: AssemblyVersion("1.10.1")]
|
||||
[assembly: AssemblyFileVersion("1.10.1")]
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.10
|
||||
Version: 1.10.1
|
||||
OrchardVersion: 1.9
|
||||
Description: The comments system implemented by this module can be applied to arbitrary Orchard content types, such as blogs and pages. It includes comment validation and spam protection through the Akismet service.
|
||||
Features:
|
||||
|
||||
@@ -30,5 +30,5 @@ using System.Security;
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.10")]
|
||||
[assembly: AssemblyFileVersion("1.10")]
|
||||
[assembly: AssemblyVersion("1.10.1")]
|
||||
[assembly: AssemblyFileVersion("1.10.1")]
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.10
|
||||
Version: 1.10.1
|
||||
OrchardVersion: 1.9
|
||||
Description: Provides a rules API that evaluate to true or false.
|
||||
Features:
|
||||
|
||||
@@ -93,7 +93,7 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Web.config" />
|
||||
<Content Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Content Include="Module.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -32,6 +32,6 @@ using System.Security;
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
|
||||
[assembly: AssemblyVersion("1.10")]
|
||||
[assembly: AssemblyFileVersion("1.10")]
|
||||
[assembly: AssemblyVersion("1.10.1")]
|
||||
[assembly: AssemblyFileVersion("1.10.1")]
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ Name: Orchard.ContentPermissions
|
||||
AntiForgery: enabled
|
||||
Author: Chris Pyle, S<>bastien Ros
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.10
|
||||
Version: 1.10.1
|
||||
OrchardVersion: 1.9
|
||||
Description: Allows item-level front end view permissions.
|
||||
Features:
|
||||
|
||||
@@ -31,5 +31,5 @@ using System.Security;
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.10")]
|
||||
[assembly: AssemblyFileVersion("1.10")]
|
||||
[assembly: AssemblyVersion("1.10.1")]
|
||||
[assembly: AssemblyFileVersion("1.10.1")]
|
||||
|
||||
@@ -2,7 +2,7 @@ Name: Orchard.ContentPicker
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://www.orchardproject.net
|
||||
Version: 1.10
|
||||
Version: 1.10.1
|
||||
OrchardVersion: 1.9
|
||||
Description: UI for selecting Content Items.
|
||||
Features:
|
||||
|
||||
@@ -31,6 +31,6 @@ using System.Security;
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.10")]
|
||||
[assembly: AssemblyFileVersion("1.10")]
|
||||
[assembly: AssemblyVersion("1.10.1")]
|
||||
[assembly: AssemblyFileVersion("1.10.1")]
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.10
|
||||
Version: 1.10.1
|
||||
OrchardVersion: 1.9
|
||||
Description: ContentTypes modules enables the creation and alteration of content types not based on code.
|
||||
Dependencies: Contents
|
||||
|
||||
@@ -30,6 +30,6 @@ using System.Security;
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.10")]
|
||||
[assembly: AssemblyFileVersion("1.10")]
|
||||
[assembly: AssemblyVersion("1.10.1")]
|
||||
[assembly: AssemblyFileVersion("1.10.1")]
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ Name: Custom Forms
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://www.orchardproject.net
|
||||
Version: 1.10
|
||||
Version: 1.10.1
|
||||
OrchardVersion: 1.9
|
||||
LifecycleStatus: Deprecated
|
||||
Description: Create custom forms like contact forms or content contributions.
|
||||
|
||||
@@ -31,5 +31,5 @@ using System.Security;
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.10")]
|
||||
[assembly: AssemblyFileVersion("1.10")]
|
||||
[assembly: AssemblyVersion("1.10.1")]
|
||||
[assembly: AssemblyFileVersion("1.10.1")]
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.10
|
||||
Version: 1.10.1
|
||||
OrchardVersion: 1.9
|
||||
Description: The Dashboards module enables administrators to customize the dashboard screen of the administration UI of the application.
|
||||
Features:
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
<Content Include="Web.config" />
|
||||
<Content Include="Scripts\Web.config" />
|
||||
<Content Include="Styles\Web.config" />
|
||||
<Content Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Content Include="Module.txt" />
|
||||
<Content Include="Views\StaticDashboard.cshtml" />
|
||||
<Content Include="Views\Content.Dashboard.cshtml" />
|
||||
|
||||
@@ -32,6 +32,6 @@ using System.Security;
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
|
||||
[assembly: AssemblyVersion("1.10")]
|
||||
[assembly: AssemblyFileVersion("1.10")]
|
||||
[assembly: AssemblyVersion("1.10.1")]
|
||||
[assembly: AssemblyFileVersion("1.10.1")]
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.10
|
||||
Version: 1.10.1
|
||||
OrchardVersion: 1.9
|
||||
Description: Contains designer tools to ease the Themes development process
|
||||
FeatureName: Shape Tracing
|
||||
|
||||
@@ -31,5 +31,5 @@ using System.Security;
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.10")]
|
||||
[assembly: AssemblyFileVersion("1.10")]
|
||||
[assembly: AssemblyVersion("1.10.1")]
|
||||
[assembly: AssemblyFileVersion("1.10.1")]
|
||||
|
||||
@@ -2,7 +2,7 @@ Name: Dynamic Forms
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://www.orchardproject.net/
|
||||
Version: 1.10
|
||||
Version: 1.10.1
|
||||
OrchardVersion: 1.9
|
||||
Description: Create custom forms like contact forms using layouts.
|
||||
Features:
|
||||
|
||||
@@ -124,7 +124,7 @@
|
||||
<Content Include="Web.config" />
|
||||
<Content Include="Scripts\Web.config" />
|
||||
<Content Include="Styles\Web.config" />
|
||||
<Content Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Content Include="Module.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -32,6 +32,6 @@ using System.Security;
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
|
||||
[assembly: AssemblyVersion("1.10")]
|
||||
[assembly: AssemblyFileVersion("1.10")]
|
||||
[assembly: AssemblyVersion("1.10.1")]
|
||||
[assembly: AssemblyFileVersion("1.10.1")]
|
||||
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
<tbody>
|
||||
@if (partDescriptor.BindingContexts.Any()) {
|
||||
foreach (var partBinding in partDescriptor.BindingContexts.SelectMany(x => x.Bindings)) {
|
||||
var partBindingId = String.Format("binding-{0}-{1}", partDescriptor.Part.PartDefinition.Name.HtmlClassify(), partBinding.Name.HtmlClassify());
|
||||
var partBindingState = partState.Bindings.ElementAtOrDefault(partBindingIndex) ?? new BindingSettings();
|
||||
var partBindingId = String.Format("binding-{0}-{1}", partDescriptor.Part.PartDefinition.Name.HtmlClassify(), partBinding.Name.HtmlClassify());
|
||||
var partBindingState = partState.Bindings.FirstOrDefault(f => f.Name == partBinding.Name) ?? new BindingSettings();
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<input type="hidden" name="Parts[@partIndex].Bindings[@partBindingIndex].Name" value="@partBinding.Name" />
|
||||
@@ -36,7 +36,7 @@
|
||||
}
|
||||
@foreach (var fieldDescriptor in partDescriptor.FieldBindings) {
|
||||
var fieldBindingIndex = 0;
|
||||
var fieldState = partState.Fields.ElementAtOrDefault(fieldIndex) ?? new FieldBindingSettings();
|
||||
var fieldState = partState.Fields.FirstOrDefault(f=>f.Name == fieldDescriptor.Field.Name) ?? new FieldBindingSettings();
|
||||
if (fieldDescriptor.BindingContexts.Any()) {
|
||||
foreach (var fieldBinding in fieldDescriptor.BindingContexts.SelectMany(x => x.Bindings)) {
|
||||
var fieldBindingId = String.Format("binding-{0}-{1}-{2}", partDescriptor.Part.PartDefinition.Name.HtmlClassify(), fieldDescriptor.Field.Name.HtmlClassify(), fieldBinding.Name.HtmlClassify());
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.10
|
||||
Version: 1.10.1
|
||||
OrchardVersion: 1.9
|
||||
Description: The Email Messaging module adds Email sending functionalities.
|
||||
Features:
|
||||
|
||||
@@ -30,6 +30,6 @@ using System.Security;
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.10")]
|
||||
[assembly: AssemblyFileVersion("1.10")]
|
||||
[assembly: AssemblyVersion("1.10.1")]
|
||||
[assembly: AssemblyFileVersion("1.10.1")]
|
||||
|
||||
|
||||
@@ -34,26 +34,22 @@ namespace Orchard.Fields.Drivers {
|
||||
}
|
||||
|
||||
protected override DriverResult Editor(ContentPart part, BooleanField field, dynamic shapeHelper) {
|
||||
// if the content item is new, assign the default value
|
||||
if(!part.HasDraft() && !part.HasPublished()) {
|
||||
var settings = field.PartFieldDefinition.Settings.GetModel<BooleanFieldSettings>();
|
||||
field.Value = settings.DefaultValue;
|
||||
}
|
||||
|
||||
return ContentShape("Fields_Boolean_Edit", GetDifferentiator(field, part),
|
||||
() => shapeHelper.EditorTemplate(TemplateName: TemplateName, Model: field, Prefix: GetPrefix(field, part)));
|
||||
() => {
|
||||
if (part.IsNew()) {
|
||||
var settings = field.PartFieldDefinition.Settings.GetModel<BooleanFieldSettings>();
|
||||
field.Value = settings.DefaultValue;
|
||||
}
|
||||
return shapeHelper.EditorTemplate(TemplateName: TemplateName, Model: field, Prefix: GetPrefix(field, part));
|
||||
});
|
||||
}
|
||||
|
||||
protected override DriverResult Editor(ContentPart part, BooleanField field, IUpdateModel updater, dynamic shapeHelper) {
|
||||
if (updater.TryUpdateModel(field, GetPrefix(field, part), null, null)) {
|
||||
var settings = field.PartFieldDefinition.Settings.GetModel<BooleanFieldSettings>();
|
||||
|
||||
if (!settings.Optional && !field.Value.HasValue) {
|
||||
if (settings.DefaultValue.HasValue) {
|
||||
field.Value = settings.DefaultValue;
|
||||
}
|
||||
else {
|
||||
updater.AddModelError(field.Name, T("The field {0} is mandatory.", T(field.DisplayName)));
|
||||
}
|
||||
updater.AddModelError(field.Name, T("The field {0} is mandatory.", T(field.DisplayName)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ namespace Orchard.Fields.Drivers {
|
||||
|
||||
protected override DriverResult Editor(ContentPart part, DateTimeField field, dynamic shapeHelper) {
|
||||
var settings = field.PartFieldDefinition.Settings.GetModel<DateTimeFieldSettings>();
|
||||
var value = field.DateTime;
|
||||
var value = part.IsNew() ? settings.DefaultValue : field.DateTime;
|
||||
var options = new DateLocalizationOptions();
|
||||
|
||||
// Don't do any time zone conversion if field is semantically a date-only field, because that might mutate the date component.
|
||||
@@ -98,7 +98,6 @@ namespace Orchard.Fields.Drivers {
|
||||
Name = field.DisplayName,
|
||||
Hint = settings.Hint,
|
||||
IsRequired = settings.Required,
|
||||
HasDefaultValue = settings.DefaultValue.HasValue,
|
||||
Editor = new DateTimeEditor() {
|
||||
Date = showDate ? DateLocalizationServices.ConvertToLocalizedDateString(value, options) : null,
|
||||
Time = showTime ? DateLocalizationServices.ConvertToLocalizedTimeString(value, options) : null,
|
||||
@@ -137,37 +136,26 @@ namespace Orchard.Fields.Drivers {
|
||||
var showTime = settings.Display == DateTimeFieldDisplays.DateAndTime || settings.Display == DateTimeFieldDisplays.TimeOnly;
|
||||
|
||||
DateTime? value = null;
|
||||
var IsParseError = false;
|
||||
|
||||
// If required and one field is missing, don't try to parse data.
|
||||
if (settings.Required && ((showDate && String.IsNullOrWhiteSpace(viewModel.Editor.Date)) || (showTime && String.IsNullOrWhiteSpace(viewModel.Editor.Time)))) {
|
||||
// And use the default value only if all required fields are empty.
|
||||
if (!showDate || !showTime || (String.IsNullOrWhiteSpace(viewModel.Editor.Date) && String.IsNullOrWhiteSpace(viewModel.Editor.Time))) {
|
||||
value = settings.DefaultValue;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Try to parse data if not required or if there are no missing fields.
|
||||
if (!settings.Required || ((!showDate || !String.IsNullOrWhiteSpace(viewModel.Editor.Date)) && (!showTime || !String.IsNullOrWhiteSpace(viewModel.Editor.Time)))) {
|
||||
try {
|
||||
var utcDateTime = DateLocalizationServices.ConvertFromLocalizedString(viewModel.Editor.Date, viewModel.Editor.Time, options);
|
||||
value = utcDateTime.HasValue ? utcDateTime : settings.DefaultValue;
|
||||
value = DateLocalizationServices.ConvertFromLocalizedString(viewModel.Editor.Date, viewModel.Editor.Time, options);
|
||||
}
|
||||
catch {
|
||||
IsParseError = true;
|
||||
updater.AddModelError(GetPrefix(field, part), T("{0} could not be parsed as a valid date and time.", field.DisplayName));
|
||||
}
|
||||
}
|
||||
|
||||
if (!IsParseError) {
|
||||
// Hackish workaround to make sure a time-only field with an entered time equivalent to
|
||||
// 00:00 UTC doesn't get stored as a full DateTime.MinValue in the database, resulting
|
||||
// in it being interpreted as an empty value when subsequently retrieved.
|
||||
if (value.HasValue && settings.Display == DateTimeFieldDisplays.TimeOnly && value == DateTime.MinValue) {
|
||||
value = value.Value.AddDays(1);
|
||||
}
|
||||
// Hackish workaround to make sure a time-only field with an entered time equivalent to
|
||||
// 00:00 UTC doesn't get stored as a full DateTime.MinValue in the database, resulting
|
||||
// in it being interpreted as an empty value when subsequently retrieved.
|
||||
if (value.HasValue && settings.Display == DateTimeFieldDisplays.TimeOnly && value == DateTime.MinValue) {
|
||||
value = value.Value.AddDays(1);
|
||||
}
|
||||
|
||||
if (settings.Required && (!value.HasValue || (settings.Display != DateTimeFieldDisplays.TimeOnly && value.Value.Date == DateTime.MinValue))) {
|
||||
updater.AddModelError(GetPrefix(field, part), T("{0} is required.", field.DisplayName));
|
||||
}
|
||||
if (settings.Required && (!value.HasValue || (settings.Display != DateTimeFieldDisplays.TimeOnly && value.Value.Date == DateTime.MinValue))) {
|
||||
updater.AddModelError(GetPrefix(field, part), T("{0} is required.", field.DisplayName));
|
||||
}
|
||||
|
||||
field.DateTime = value.HasValue ? value.Value : DateTime.MinValue;
|
||||
|
||||
@@ -4,7 +4,6 @@ using Orchard.ContentManagement.Handlers;
|
||||
using Orchard.Fields.Fields;
|
||||
using Orchard.Fields.Settings;
|
||||
using Orchard.Localization;
|
||||
using Orchard.Tokens;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -13,11 +12,9 @@ namespace Orchard.Fields.Drivers {
|
||||
public class EnumerationFieldDriver : ContentFieldDriver<EnumerationField> {
|
||||
public IOrchardServices Services { get; set; }
|
||||
private const string TemplateName = "Fields/Enumeration.Edit";
|
||||
private readonly ITokenizer _tokenizer;
|
||||
|
||||
public EnumerationFieldDriver(IOrchardServices services, ITokenizer tokenizer) {
|
||||
public EnumerationFieldDriver(IOrchardServices services) {
|
||||
Services = services;
|
||||
_tokenizer = tokenizer;
|
||||
T = NullLocalizer.Instance;
|
||||
}
|
||||
|
||||
@@ -39,13 +36,12 @@ namespace Orchard.Fields.Drivers {
|
||||
protected override DriverResult Editor(ContentPart part, EnumerationField field, dynamic shapeHelper) {
|
||||
return ContentShape("Fields_Enumeration_Edit", GetDifferentiator(field, part),
|
||||
() => {
|
||||
if (field.Value == null) {
|
||||
if (part.IsNew()) {
|
||||
var settings = field.PartFieldDefinition.Settings.GetModel<EnumerationFieldSettings>();
|
||||
if (!String.IsNullOrWhiteSpace(settings.DefaultValue)) {
|
||||
field.Value = _tokenizer.Replace(settings.DefaultValue, new Dictionary<string, object> { { "Content", part.ContentItem } });
|
||||
field.Value = settings.DefaultValue;
|
||||
}
|
||||
}
|
||||
|
||||
return shapeHelper.EditorTemplate(TemplateName: TemplateName, Model: field, Prefix: GetPrefix(field, part));
|
||||
});
|
||||
}
|
||||
@@ -54,15 +50,6 @@ namespace Orchard.Fields.Drivers {
|
||||
if (updater.TryUpdateModel(field, GetPrefix(field, part), null, null)) {
|
||||
var settings = field.PartFieldDefinition.Settings.GetModel<EnumerationFieldSettings>();
|
||||
|
||||
if (field.SelectedValues.Length == 0 && !String.IsNullOrWhiteSpace(settings.DefaultValue) && !String.IsNullOrWhiteSpace(settings.Options)) {
|
||||
field.Value = _tokenizer.Replace(settings.DefaultValue, new Dictionary<string, object> { { "Content", part.ContentItem } });
|
||||
|
||||
string[] options = settings.Options.Split(new string[] { System.Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);
|
||||
var selectedValues = field.SelectedValues.ToList();
|
||||
selectedValues.RemoveAll(value => !options.Any(value.Equals));
|
||||
field.SelectedValues = selectedValues.ToArray();
|
||||
}
|
||||
|
||||
if (settings.Required && field.SelectedValues.Length == 0) {
|
||||
updater.AddModelError(field.Name, T("The field {0} is mandatory", T(field.DisplayName)));
|
||||
}
|
||||
|
||||
@@ -4,19 +4,15 @@ using Orchard.ContentManagement.Handlers;
|
||||
using Orchard.Fields.Fields;
|
||||
using Orchard.Fields.Settings;
|
||||
using Orchard.Localization;
|
||||
using Orchard.Tokens;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Orchard.Fields.Drivers {
|
||||
public class InputFieldDriver : ContentFieldDriver<InputField> {
|
||||
public IOrchardServices Services { get; set; }
|
||||
private const string TemplateName = "Fields/Input.Edit";
|
||||
private readonly ITokenizer _tokenizer;
|
||||
|
||||
public InputFieldDriver(IOrchardServices services, ITokenizer tokenizer) {
|
||||
public InputFieldDriver(IOrchardServices services) {
|
||||
Services = services;
|
||||
_tokenizer = tokenizer;
|
||||
T = NullLocalizer.Instance;
|
||||
}
|
||||
|
||||
@@ -39,17 +35,19 @@ namespace Orchard.Fields.Drivers {
|
||||
|
||||
protected override DriverResult Editor(ContentPart part, InputField field, dynamic shapeHelper) {
|
||||
return ContentShape("Fields_Input_Edit", GetDifferentiator(field, part),
|
||||
() => shapeHelper.EditorTemplate(TemplateName: TemplateName, Model: field, Prefix: GetPrefix(field, part)));
|
||||
() => {
|
||||
if (part.IsNew()) {
|
||||
var settings = field.PartFieldDefinition.Settings.GetModel<InputFieldSettings>();
|
||||
field.Value = settings.DefaultValue;
|
||||
}
|
||||
return shapeHelper.EditorTemplate(TemplateName: TemplateName, Model: field, Prefix: GetPrefix(field, part));
|
||||
});
|
||||
}
|
||||
|
||||
protected override DriverResult Editor(ContentPart part, InputField field, IUpdateModel updater, dynamic shapeHelper) {
|
||||
if (updater.TryUpdateModel(field, GetPrefix(field, part), null, null)) {
|
||||
var settings = field.PartFieldDefinition.Settings.GetModel<InputFieldSettings>();
|
||||
|
||||
if (String.IsNullOrWhiteSpace(field.Value) && !String.IsNullOrWhiteSpace(settings.DefaultValue)) {
|
||||
field.Value = _tokenizer.Replace(settings.DefaultValue, new Dictionary<string, object> { { "Content", part.ContentItem } });
|
||||
}
|
||||
|
||||
if (settings.Required && String.IsNullOrWhiteSpace(field.Value)) {
|
||||
updater.AddModelError(GetPrefix(field, part), T("The field {0} is mandatory.", T(field.DisplayName)));
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@ using Orchard.ContentManagement.Handlers;
|
||||
using Orchard.Fields.Fields;
|
||||
using Orchard.Fields.Settings;
|
||||
using Orchard.Localization;
|
||||
using Orchard.Tokens;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@@ -12,11 +11,9 @@ namespace Orchard.Fields.Drivers {
|
||||
public class LinkFieldDriver : ContentFieldDriver<LinkField> {
|
||||
public IOrchardServices Services { get; set; }
|
||||
private const string TemplateName = "Fields/Link.Edit";
|
||||
private readonly ITokenizer _tokenizer;
|
||||
|
||||
public LinkFieldDriver(IOrchardServices services, ITokenizer tokenizer) {
|
||||
public LinkFieldDriver(IOrchardServices services) {
|
||||
Services = services;
|
||||
_tokenizer = tokenizer;
|
||||
T = NullLocalizer.Instance;
|
||||
}
|
||||
|
||||
@@ -39,21 +36,20 @@ namespace Orchard.Fields.Drivers {
|
||||
|
||||
protected override DriverResult Editor(ContentPart part, LinkField field, dynamic shapeHelper) {
|
||||
return ContentShape("Fields_Link_Edit", GetDifferentiator(field, part),
|
||||
() => shapeHelper.EditorTemplate(TemplateName: TemplateName, Model: field, Prefix: GetPrefix(field, part)));
|
||||
() => {
|
||||
if (part.IsNew()) {
|
||||
var settings = field.PartFieldDefinition.Settings.GetModel<LinkFieldSettings>();
|
||||
field.Value = settings.DefaultValue;
|
||||
field.Text = settings.TextDefaultValue;
|
||||
}
|
||||
return shapeHelper.EditorTemplate(TemplateName: TemplateName, Model: field, Prefix: GetPrefix(field, part));
|
||||
});
|
||||
}
|
||||
|
||||
protected override DriverResult Editor(ContentPart part, LinkField field, IUpdateModel updater, dynamic shapeHelper) {
|
||||
if (updater.TryUpdateModel(field, GetPrefix(field, part), null, null)) {
|
||||
var settings = field.PartFieldDefinition.Settings.GetModel<LinkFieldSettings>();
|
||||
|
||||
if (String.IsNullOrWhiteSpace(field.Value) && !String.IsNullOrWhiteSpace(settings.DefaultValue)) {
|
||||
field.Value = _tokenizer.Replace(settings.DefaultValue, new Dictionary<string, object> { { "Content", part.ContentItem } });
|
||||
}
|
||||
|
||||
if(!String.IsNullOrWhiteSpace(settings.TextDefaultValue) && String.IsNullOrWhiteSpace(field.Text)) {
|
||||
field.Text = _tokenizer.Replace(settings.TextDefaultValue, new Dictionary<string, object> { { "Content", part.ContentItem } });
|
||||
}
|
||||
|
||||
if (settings.Required && String.IsNullOrWhiteSpace(field.Value)) {
|
||||
updater.AddModelError(GetPrefix(field, part), T("Url is required for {0}", field.DisplayName));
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@ using Orchard.Fields.Fields;
|
||||
using Orchard.Fields.Settings;
|
||||
using Orchard.Fields.ViewModels;
|
||||
using Orchard.Localization;
|
||||
using Orchard.Tokens;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
@@ -15,11 +14,9 @@ namespace Orchard.Fields.Drivers {
|
||||
public IOrchardServices Services { get; set; }
|
||||
private const string TemplateName = "Fields/Numeric.Edit";
|
||||
private readonly Lazy<CultureInfo> _cultureInfo;
|
||||
private readonly ITokenizer _tokenizer;
|
||||
|
||||
public NumericFieldDriver(IOrchardServices services, ITokenizer tokenizer) {
|
||||
public NumericFieldDriver(IOrchardServices services) {
|
||||
Services = services;
|
||||
_tokenizer = tokenizer;
|
||||
T = NullLocalizer.Instance;
|
||||
|
||||
_cultureInfo = new Lazy<CultureInfo>(() => CultureInfo.GetCultureInfo(Services.WorkContext.CurrentCulture));
|
||||
@@ -46,10 +43,13 @@ namespace Orchard.Fields.Drivers {
|
||||
protected override DriverResult Editor(ContentPart part, NumericField field, dynamic shapeHelper) {
|
||||
return ContentShape("Fields_Numeric_Edit", GetDifferentiator(field, part),
|
||||
() => {
|
||||
var settings = field.PartFieldDefinition.Settings.GetModel<NumericFieldSettings>();
|
||||
var value = part.IsNew() ? settings.DefaultValue : Convert.ToString(field.Value, _cultureInfo.Value);
|
||||
|
||||
var model = new NumericFieldViewModel {
|
||||
Field = field,
|
||||
Settings = field.PartFieldDefinition.Settings.GetModel<NumericFieldSettings>(),
|
||||
Value = Convert.ToString(field.Value, _cultureInfo.Value)
|
||||
Settings = settings,
|
||||
Value = value
|
||||
};
|
||||
|
||||
return shapeHelper.EditorTemplate(TemplateName: TemplateName, Model: model, Prefix: GetPrefix(field, part));
|
||||
@@ -64,10 +64,6 @@ namespace Orchard.Fields.Drivers {
|
||||
|
||||
var settings = field.PartFieldDefinition.Settings.GetModel<NumericFieldSettings>();
|
||||
|
||||
if (String.IsNullOrWhiteSpace(viewModel.Value) && !String.IsNullOrWhiteSpace(settings.DefaultValue)) {
|
||||
viewModel.Value = _tokenizer.Replace(settings.DefaultValue, new Dictionary<string, object> { { "Content", part.ContentItem } });
|
||||
}
|
||||
|
||||
field.Value = null;
|
||||
|
||||
if (String.IsNullOrWhiteSpace(viewModel.Value)) {
|
||||
@@ -76,7 +72,7 @@ namespace Orchard.Fields.Drivers {
|
||||
}
|
||||
}
|
||||
else if (!Decimal.TryParse(viewModel.Value, NumberStyles.Any, _cultureInfo.Value, out value)) {
|
||||
updater.AddModelError(GetPrefix(field, part), T("{0} or its default value is an invalid number", field.DisplayName));
|
||||
updater.AddModelError(GetPrefix(field, part), T("{0} is an invalid number", field.DisplayName));
|
||||
}
|
||||
else {
|
||||
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.ContentManagement.Drivers;
|
||||
using Orchard.Core.Common.Fields;
|
||||
using Orchard.Core.Common.Settings;
|
||||
using Orchard.Localization;
|
||||
using Orchard.Tokens;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Orchard.Fields.Drivers {
|
||||
// The original driver of the TextField is in Orchard.Core, where tokenization can not be used.
|
||||
// This driver was added so the default value of the TextField can be tokenized.
|
||||
public class TextFieldDriver : ContentFieldDriver<TextField> {
|
||||
private readonly ITokenizer _tokenizer;
|
||||
|
||||
public TextFieldDriver(ITokenizer tokenizer) {
|
||||
_tokenizer = tokenizer;
|
||||
T = NullLocalizer.Instance;
|
||||
}
|
||||
|
||||
public Localizer T { get; set; }
|
||||
|
||||
protected override DriverResult Editor(ContentPart part, TextField field, IUpdateModel updater, dynamic shapeHelper) {
|
||||
var settings = field.PartFieldDefinition.Settings.GetModel<TextFieldSettings>();
|
||||
|
||||
if (!String.IsNullOrWhiteSpace(settings.DefaultValue) && (String.IsNullOrWhiteSpace(field.Value) || field.Value.Equals(settings.DefaultValue))) {
|
||||
field.Value = _tokenizer.Replace(settings.DefaultValue, new Dictionary<string, object> { { "Content", part.ContentItem } });
|
||||
|
||||
if (settings.Required && String.IsNullOrWhiteSpace(field.Value)) {
|
||||
updater.AddModelError("Text", T("The field {0} is mandatory", T(field.DisplayName)));
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
Name: Fields
|
||||
AntiForgery: enabled
|
||||
Author: Antoine Griffard, S<>bastien Ros
|
||||
Author: Antoine Griffard, S<>bastien Ros
|
||||
Website: http://www.orchardproject.net
|
||||
Version: 1.10
|
||||
Version: 1.10.1
|
||||
OrchardVersion: 1.9
|
||||
Description: Some content fields
|
||||
Features:
|
||||
|
||||
@@ -100,7 +100,6 @@
|
||||
<Content Include="Styles\Images\move.gif" />
|
||||
<Content Include="Web.config" />
|
||||
<Content Include="Styles\Web.config" />
|
||||
<Compile Include="Drivers\TextFieldDriver.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Content Include="Module.txt" />
|
||||
</ItemGroup>
|
||||
@@ -175,9 +174,6 @@
|
||||
<ItemGroup>
|
||||
<Content Include="Views\Fields\Input.cshtml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Views\DefinitionTemplates\TextFieldDefaultValueEditor.cshtml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="packages.config" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -31,5 +31,5 @@ using System.Security;
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.10")]
|
||||
[assembly: AssemblyFileVersion("1.10")]
|
||||
[assembly: AssemblyVersion("1.10.1")]
|
||||
[assembly: AssemblyFileVersion("1.10.1")]
|
||||
|
||||
@@ -6,6 +6,5 @@ namespace Orchard.Fields.ViewModels {
|
||||
public string Hint { get; set; }
|
||||
public bool IsRequired { get; set; }
|
||||
public DateTimeEditor Editor { get; set; }
|
||||
public bool HasDefaultValue { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -50,7 +50,7 @@
|
||||
<div>
|
||||
<label for="@Html.FieldIdFor(m => m.Editor)">@T("Default value")</label>
|
||||
@Html.EditorFor(m => m.Editor)
|
||||
<span class="hint">@T("Pick a default date for the field. (optional)")</span>
|
||||
<span class="hint">@T("Pick a default date to be proposed when creating a content item. (optional)")</span>
|
||||
@Html.ValidationMessageFor(m => m.Editor)
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
@@ -31,8 +31,9 @@
|
||||
<fieldset>
|
||||
<div>
|
||||
<label for="@Html.FieldIdFor(m => m.DefaultValue)">@T("Default value")</label>
|
||||
@Html.TextBoxFor(m => m.DefaultValue, new { @class = "text large tokenized ui-autocomplete-input" })
|
||||
<span class="hint">@T("Enter a default option for the field. You can use tokens in this field. If there is no equivalent choice among Options, it will not be used. (optional)")</span>
|
||||
@Html.TextBoxFor(m => m.DefaultValue, new { @class = "text large" })
|
||||
<span class="hint">@T("The default option proposed when creating a content item. If there is no equivalent choice among Options, it will not be used. (optional)")</span>
|
||||
<span class="hint">@T("When using the Listbox or Checkbox List mode, you can define multiple options separated by a semicolon.")</span>
|
||||
@Html.ValidationMessageFor(m => m.DefaultValue)
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
@model Orchard.Fields.Settings.InputFieldSettings
|
||||
@using Orchard.Fields.Settings;
|
||||
|
||||
<fieldset>
|
||||
<div>
|
||||
@@ -80,8 +79,8 @@
|
||||
<fieldset>
|
||||
<div>
|
||||
<label for="@Html.FieldIdFor(m => m.DefaultValue)">@T("Default value")</label>
|
||||
@Html.TextBoxFor(m => m.DefaultValue, new { @class = "text large tokenized ui-autocomplete-input" })
|
||||
<span class="hint">@T("Default value for the field. You can use tokens in this field. If there is no value given for the actual field, this will be filled in. (optional)")</span>
|
||||
@Html.TextBoxFor(m => m.DefaultValue, new { @class = "text large" })
|
||||
<span class="hint">@T("The default value proposed when creating a content item. (optional)")</span>
|
||||
@Html.ValidationMessageFor(m => m.DefaultValue)
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
@@ -63,16 +63,16 @@
|
||||
<fieldset>
|
||||
<div>
|
||||
<label for="@Html.FieldIdFor(m => m.DefaultValue)">@T("Default value")</label>
|
||||
@Html.TextBoxFor(m => m.DefaultValue, new { @class = "text large tokenized ui-autocomplete-input" })
|
||||
<span class="hint">@T("A valid url as a default value, i.e. http://orchardproject.net, /content/file.pdf ... You can use tokens in this field. (optional)")</span>
|
||||
@Html.TextBoxFor(m => m.DefaultValue, new { @class = "text large" })
|
||||
<span class="hint">@T("A valid url proposed when creating a content item, i.e. http://orchardproject.net, /content/file.pdf, ... (optional)")</span>
|
||||
@Html.ValidationMessageFor(m => m.DefaultValue)
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<div>
|
||||
<label for="@Html.FieldIdFor(m => m.TextDefaultValue)">@T("Link text default value")</label>
|
||||
@Html.TextBoxFor(m => m.TextDefaultValue, new { @class = "text large tokenized ui-autocomplete-input" })
|
||||
<span class="hint">@T("If the Link text is set to Optional or Required, a default value can be set for it. You can use tokens in this field. (optional)")</span>
|
||||
@Html.TextBoxFor(m => m.TextDefaultValue, new { @class = "text large" })
|
||||
<span class="hint">@T("The default link text proposed when creating a content item. (optional)")</span>
|
||||
@Html.ValidationMessageFor(m => m.TextDefaultValue)
|
||||
</div>
|
||||
</fieldset>
|
||||
@@ -50,8 +50,6 @@
|
||||
<fieldset>
|
||||
<div class="editor-field">
|
||||
<label for="@Html.FieldIdFor(m => m.DefaultValue)">@T("Default value")</label>
|
||||
@Html.TextBoxFor(m => m.DefaultValue, new { @class = "text large tokenized ui-autocomplete-input" })
|
||||
<span class="hint">@T("The default value for the field. It must be a number, and if not it will not be shown. Make sure to set the Scale property if the value is not an integer. You can use tokens in this field. (optional)")</span>
|
||||
@Html.ValidationMessageFor(m => m.DefaultValue)
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
@model Orchard.Core.Common.ViewModels.TextFieldSettingsEventsViewModel
|
||||
@* This override is here so that the token helper can be used on the default value's textbox, which can not be used in Orchard.Core. *@
|
||||
|
||||
<label for="@Html.FieldIdFor(m => m.Settings.DefaultValue)">@T("Default value")</label>
|
||||
@Html.TextBoxFor(m => m.Settings.DefaultValue, new { @class = "text large tokenized ui-autocomplete-input" })
|
||||
<span class="hint">@T("Default value for the field. You can use tokens in this field. If there is no value given for the actual field, this will be filled in. (optional)")</span>
|
||||
@Html.ValidationMessageFor(m => m.Settings.DefaultValue)
|
||||
@@ -6,7 +6,4 @@
|
||||
@if (HasText(Model.Hint)) {
|
||||
<span class="hint">@Model.Hint</span>
|
||||
}
|
||||
@if (Model.HasDefaultValue) {
|
||||
<span class="hint">@T("If the field is left empty then the default value will be used if one is configured.")</span>
|
||||
}
|
||||
</fieldset>
|
||||
|
||||
@@ -3,27 +3,26 @@
|
||||
@{
|
||||
var settings = Model.PartFieldDefinition.Settings.GetModel<EnumerationFieldSettings>();
|
||||
string[] options = (!String.IsNullOrWhiteSpace(settings.Options)) ? settings.Options.Split(new string[] { System.Environment.NewLine }, StringSplitOptions.None) : new string[] { T("Select an option").ToString() };
|
||||
var isRequired = settings.Required && String.IsNullOrWhiteSpace(settings.DefaultValue);
|
||||
}
|
||||
<fieldset>
|
||||
<label for="@Html.FieldIdFor(m => m.Value)" @if (settings.Required) { <text> class="required" </text> }>@Model.DisplayName</label>
|
||||
@switch (settings.ListMode) {
|
||||
case ListMode.Dropdown:
|
||||
@Html.DropDownListFor(m => m.Value, new SelectList(options, Model.Value), isRequired ? new { required = "required" } : null)
|
||||
@Html.DropDownListFor(m => m.Value, new SelectList(options, Model.Value), settings.Required ? new { required = "required" } : null)
|
||||
break;
|
||||
|
||||
case ListMode.Radiobutton:
|
||||
foreach (var option in options) {
|
||||
if (string.IsNullOrWhiteSpace(option)) {
|
||||
<label>@Html.RadioButton("Value", "", string.IsNullOrWhiteSpace(Model.Value), isRequired ? new { required = "required" } : null)<i>@T("unset")</i></label> }
|
||||
<label>@Html.RadioButton("Value", "", string.IsNullOrWhiteSpace(Model.Value), settings.Required ? new { required = "required" } : null)<i>@T("unset")</i></label> }
|
||||
else {
|
||||
<label>@Html.RadioButton("Value", option, (option == Model.Value), isRequired ? new { required = "required" } : null)@option</label> }
|
||||
<label>@Html.RadioButton("Value", option, (option == Model.Value), settings.Required ? new { required = "required" } : null)@option</label> }
|
||||
}
|
||||
break;
|
||||
|
||||
case ListMode.Listbox:
|
||||
<input name="@Html.FieldNameFor(m => m.SelectedValues)" type="hidden" />
|
||||
@Html.ListBoxFor(m => m.SelectedValues, new MultiSelectList(options, Model.SelectedValues), isRequired ? new { required = "required" } : null)
|
||||
@Html.ListBoxFor(m => m.SelectedValues, new MultiSelectList(options, Model.SelectedValues), settings.Required ? new { required = "required" } : null)
|
||||
break;
|
||||
|
||||
case ListMode.Checkbox:
|
||||
@@ -45,7 +44,4 @@
|
||||
@if (HasText(settings.Hint)) {
|
||||
<span class="hint">@settings.Hint</span>
|
||||
}
|
||||
@if (!String.IsNullOrWhiteSpace(settings.DefaultValue)) {
|
||||
<span class="hint">@T("If no option is selected then the default value will be used.")</span>
|
||||
}
|
||||
</fieldset>
|
||||
@@ -1,18 +1,13 @@
|
||||
@model Orchard.Fields.Fields.InputField
|
||||
@using Orchard.Utility.Extensions;
|
||||
@model InputField
|
||||
@using Orchard.Fields.Settings;
|
||||
@{
|
||||
var settings = Model.PartFieldDefinition.Settings.GetModel<InputFieldSettings>();
|
||||
var isRequired = settings.Required && String.IsNullOrWhiteSpace(settings.DefaultValue);
|
||||
}
|
||||
<fieldset>
|
||||
<label for="@Html.FieldIdFor(m => m.Value)" @if (settings.Required) { <text> class="required" </text> }>@Model.DisplayName</label>
|
||||
<input type="@settings.Type.ToString().ToLower()" id="@Html.FieldIdFor(m => m.Value)" name="@Html.FieldNameFor(m => m.Value)" @if (!String.IsNullOrWhiteSpace(settings.Title)) { <text> title="@settings.Title" </text> } value="@Model.Value" @if (isRequired) { <text> required="required" </text> } @if (settings.AutoFocus) { <text> autofocus="autofocus" </text> } @if (settings.AutoComplete) { <text> autocomplete="on" </text> } @if (!String.IsNullOrWhiteSpace(settings.Placeholder)) { <text> placeholder="@settings.Placeholder" </text> } @if (!String.IsNullOrWhiteSpace(settings.Pattern)) { <text> pattern="@settings.Pattern" </text> } @if (!String.IsNullOrWhiteSpace(settings.EditorCssClass)) { <text> class="@settings.EditorCssClass" </text> } else { <text> class="text medium" </text> } @if (settings.MaxLength > 1) { <text> maxlength="@settings.MaxLength.ToString()" </text> } />
|
||||
<input type="@settings.Type.ToString().ToLower()" id="@Html.FieldIdFor(m => m.Value)" name="@Html.FieldNameFor(m => m.Value)" @if (!String.IsNullOrWhiteSpace(settings.Title)) { <text> title="@settings.Title" </text> } value="@Model.Value" @if (settings.Required) { <text> required="required" </text> } @if (settings.AutoFocus) { <text> autofocus="autofocus" </text> } @if (settings.AutoComplete) { <text> autocomplete="on" </text> } @if (!String.IsNullOrWhiteSpace(settings.Placeholder)) { <text> placeholder="@settings.Placeholder" </text> } @if (!String.IsNullOrWhiteSpace(settings.Pattern)) { <text> pattern="@settings.Pattern" </text> } @if (!String.IsNullOrWhiteSpace(settings.EditorCssClass)) { <text> class="@settings.EditorCssClass" </text> } else { <text> class="text medium" </text> } @if (settings.MaxLength > 1) { <text> maxlength="@settings.MaxLength.ToString()" </text> } />
|
||||
@Html.ValidationMessageFor(m => m.Value)
|
||||
@if (HasText(settings.Hint)) {
|
||||
<span class="hint">@settings.Hint</span>
|
||||
}
|
||||
@if (!String.IsNullOrWhiteSpace(settings.DefaultValue)) {
|
||||
<span class="hint">@T("If the field is left empty then the default value will be used.")</span>
|
||||
}
|
||||
</fieldset>
|
||||
|
||||
@@ -14,9 +14,6 @@
|
||||
target = "_top";
|
||||
break;
|
||||
}
|
||||
|
||||
var isRequired = settings.Required && String.IsNullOrWhiteSpace(settings.DefaultValue);
|
||||
var isTextRequired = settings.LinkTextMode == LinkTextMode.Required && String.IsNullOrWhiteSpace(settings.TextDefaultValue);
|
||||
}
|
||||
<fieldset>
|
||||
<label for="@Html.FieldIdFor(m => m.Value)">@Model.DisplayName</label>
|
||||
@@ -24,27 +21,19 @@
|
||||
<span class="hint">@settings.Hint</span>
|
||||
}
|
||||
<div class="editor-label">
|
||||
<label for="@Html.FieldIdFor(m => m.Value)" @if (settings.Required) { <text> class="required" </text> }>@T("Url")</label>
|
||||
<label for="@Html.FieldIdFor(m => m.Value)" @if (settings.Required) { <text> class="required" </text> }>@T("Url")</label>
|
||||
</div>
|
||||
<div class="editor-field">
|
||||
@(isRequired ? Html.TextBoxFor(m => m.Value, new { @class = "text large", placeholder = settings.UrlPlaceholder, required = "required" }) : Html.TextBoxFor(m => m.Value, new { @class = "text large", placeholder = settings.UrlPlaceholder }))
|
||||
<span class="hint">@T("A valid url, i.e. http://orchardproject.net, /content/file.pdf, ...")</span>
|
||||
</div>
|
||||
@if (!String.IsNullOrWhiteSpace(settings.DefaultValue)) {
|
||||
<span class="hint">@T("If the field is left empty then the default value will be used.")</span>
|
||||
}
|
||||
@if (settings.LinkTextMode == LinkTextMode.Optional || settings.LinkTextMode == LinkTextMode.Required) {
|
||||
<div class="editor-label">
|
||||
<label for="@Html.FieldIdFor(m => m.Text)" @if (settings.LinkTextMode == LinkTextMode.Required) { <text> class="required" </text> }>@T("Text")</label>
|
||||
<label for="@Html.FieldIdFor(m => m.Text)" @if (settings.LinkTextMode == LinkTextMode.Required) { <text> class="required" </text> }>@T("Text")</label>
|
||||
</div>
|
||||
<div class="editor-field">
|
||||
@(isTextRequired ? Html.TextBoxFor(m => m.Text, new { @class = "text medium", placeholder = settings.UrlPlaceholder, required = "required" }) : Html.TextBoxFor(m => m.Text, new { @class = "text medium", placeholder = settings.UrlPlaceholder }))
|
||||
@if (!String.IsNullOrWhiteSpace(settings.TextDefaultValue)) {
|
||||
<span class="hint">@T("If the field is left empty then the default value will be used.")</span>
|
||||
}
|
||||
else {
|
||||
<span class="hint">@T("The text of the link. If left empty, the url will be used instead.")</span>
|
||||
}
|
||||
<span class="hint">@T("The text of the link. If left empty, the url will be used instead.")</span>
|
||||
</div>
|
||||
}
|
||||
|
||||
|
||||
@@ -3,9 +3,6 @@
|
||||
@using Orchard.Fields.Settings;
|
||||
|
||||
@{
|
||||
var isRequired = Model.Settings.Required && String.IsNullOrWhiteSpace(Model.Settings.DefaultValue);
|
||||
var hasValue = !String.IsNullOrWhiteSpace(Model.Value);
|
||||
|
||||
var attributes = new Dictionary<string, object>();
|
||||
attributes.Add("class", "text-small"); attributes.Add("type", "text");
|
||||
attributes.Add("min", Model.Settings.Minimum.HasValue ? Model.Settings.Minimum.Value : 0);
|
||||
@@ -13,11 +10,11 @@
|
||||
attributes.Add("step", Math.Pow(10, 0 - Model.Settings.Scale).ToString(CultureInfo.InvariantCulture));
|
||||
attributes.Add("placeholder", Model.Settings.Placeholder);
|
||||
|
||||
if (isRequired) {
|
||||
if (Model.Settings.Required) {
|
||||
attributes.Add("required", "required");
|
||||
}
|
||||
|
||||
if (hasValue) {
|
||||
if (!String.IsNullOrWhiteSpace(Model.Value)) {
|
||||
attributes.Add("Value", Model.Value);
|
||||
}
|
||||
}
|
||||
@@ -29,7 +26,4 @@
|
||||
@if (HasText(Model.Settings.Hint)) {
|
||||
<span class="hint">@Model.Settings.Hint</span>
|
||||
}
|
||||
@if (!String.IsNullOrWhiteSpace(Model.Settings.DefaultValue)) {
|
||||
<span class="hint">@T("If the field is left empty then the default value will be used.")</span>
|
||||
}
|
||||
</fieldset>
|
||||
|
||||
@@ -2,7 +2,7 @@ Name: Forms
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://www.orchardproject.net
|
||||
Version: 1.10
|
||||
Version: 1.10.1
|
||||
OrchardVersion: 1.9
|
||||
Description: Provides a system to publish and alter html forms.
|
||||
Features:
|
||||
|
||||
@@ -31,5 +31,5 @@ using System.Security;
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.10")]
|
||||
[assembly: AssemblyFileVersion("1.10")]
|
||||
[assembly: AssemblyVersion("1.10.1")]
|
||||
[assembly: AssemblyFileVersion("1.10.1")]
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.10
|
||||
Version: 1.10.1
|
||||
OrchardVersion: 1.9
|
||||
Description: Adds a client side image editor for Media Library
|
||||
Features:
|
||||
|
||||
@@ -31,6 +31,6 @@ using System.Security;
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.10")]
|
||||
[assembly: AssemblyFileVersion("1.10")]
|
||||
[assembly: AssemblyVersion("1.10.1")]
|
||||
[assembly: AssemblyFileVersion("1.10.1")]
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ Path: ImportExport
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.10
|
||||
Version: 1.10.1
|
||||
OrchardVersion: 1.9
|
||||
Description: Provides content item data import and export capability.
|
||||
Features:
|
||||
|
||||
@@ -30,6 +30,6 @@ using System.Security;
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.10")]
|
||||
[assembly: AssemblyFileVersion("1.10")]
|
||||
[assembly: AssemblyVersion("1.10.1")]
|
||||
[assembly: AssemblyFileVersion("1.10.1")]
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.10
|
||||
Version: 1.10.1
|
||||
OrchardVersion: 1.9
|
||||
Description: The Indexing module enables the site to be indexed. The index generated by this module can then be used by the search module to provide an integrated full-text search experience to a web site.
|
||||
FeatureDescription: Indexing infrastructure. Requires an index implementation like the Lucene module.
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user