mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Refactored SetupRecipeStep into RecipeMetadataStep.
This enables users to configure the recipe's metadata without having to turn it into a Setup recipe.
This commit is contained in:
@@ -83,7 +83,7 @@
|
||||
<Compile Include="Models\VersionHistoryOptions.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="RecipeBuilders\DataRecipeBuilderStep.cs" />
|
||||
<Compile Include="RecipeBuilders\SetupRecipeBuilderStep.cs" />
|
||||
<Compile Include="RecipeBuilders\RecipeMetadataBuilderStep.cs" />
|
||||
<Compile Include="RecipeBuilders\SiteSettingsBuilderStep.cs" />
|
||||
<Compile Include="RecipeHandlers\CommandRecipeHandler.cs" />
|
||||
<Compile Include="RecipeHandlers\DataRecipeHandler.cs" />
|
||||
@@ -149,7 +149,7 @@
|
||||
<Content Include="Views\EditorTemplates\ExportSteps\Data.cshtml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Views\EditorTemplates\ExportSteps\SetupRecipe.cshtml" />
|
||||
<Content Include="Views\EditorTemplates\ExportSteps\RecipeMetadata.cshtml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Views\EditorTemplates\ExportSteps\SiteSettings.cshtml" />
|
||||
|
||||
@@ -4,22 +4,22 @@ using Orchard.Recipes.Services;
|
||||
using Orchard.Recipes.ViewModels;
|
||||
|
||||
namespace Orchard.Recipes.RecipeBuilders {
|
||||
public class SetupRecipeBuilderStep : RecipeBuilderStep {
|
||||
public class RecipeMetadataBuilderStep : RecipeBuilderStep {
|
||||
private readonly IOrchardServices _orchardServices;
|
||||
public SetupRecipeBuilderStep(IOrchardServices orchardServices) {
|
||||
public RecipeMetadataBuilderStep(IOrchardServices orchardServices) {
|
||||
_orchardServices = orchardServices;
|
||||
}
|
||||
|
||||
public override string Name {
|
||||
get { return "SetupRecipe"; }
|
||||
get { return "RecipeMetadata"; }
|
||||
}
|
||||
|
||||
public override LocalizedString DisplayName {
|
||||
get { return T("Setup Recipe"); }
|
||||
get { return T("Recipe Metadata"); }
|
||||
}
|
||||
|
||||
public override LocalizedString Description {
|
||||
get { return T("Turns the export file into a Setup recipe."); }
|
||||
get { return T("Provides additional information about the recipe."); }
|
||||
}
|
||||
|
||||
public override int Priority { get { return -10; } }
|
||||
@@ -48,10 +48,10 @@ namespace Orchard.Recipes.RecipeBuilders {
|
||||
RecipeWebsite = viewModel.RecipeWebsite;
|
||||
RecipeTags = viewModel.RecipeTags;
|
||||
RecipeVersion = viewModel.RecipeVersion;
|
||||
IsSetupRecipe = true;
|
||||
IsSetupRecipe = viewModel.IsSetupRecipe;
|
||||
}
|
||||
|
||||
return shapeFactory.EditorTemplate(TemplateName: "ExportSteps/SetupRecipe", Model: viewModel, Prefix: Prefix);
|
||||
return shapeFactory.EditorTemplate(TemplateName: "ExportSteps/RecipeMetadata", Model: viewModel, Prefix: Prefix);
|
||||
}
|
||||
|
||||
public override void Build(BuildContext context) {
|
||||
@@ -6,5 +6,6 @@ namespace Orchard.Recipes.ViewModels {
|
||||
public string RecipeWebsite { get; set; }
|
||||
public string RecipeTags { get; set; }
|
||||
public string RecipeVersion { get; set; }
|
||||
public bool IsSetupRecipe { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -26,6 +26,11 @@
|
||||
</div>
|
||||
<div>
|
||||
@Html.LabelFor(m => m.RecipeVersion, T("Version"))
|
||||
@Html.TextBoxFor(m => m.RecipeVersion, new { @class = "text small" })
|
||||
@Html.TextBoxFor(m => m.RecipeVersion, new {@class = "text small"})
|
||||
@Html.Hint(T("Optionally provide a version for the setup recipe."))
|
||||
</div>
|
||||
<div>
|
||||
@Html.CheckBoxFor(m => m.IsSetupRecipe)
|
||||
@Html.LabelFor(m => m.IsSetupRecipe, T("Is Setup Recipe").ToString(), new { @class = "forcheckbox" })
|
||||
@Html.Hint(T("Check this option to make this a Setup recipe."))
|
||||
</div>
|
||||
Reference in New Issue
Block a user