mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Removing MVC dependency on code generation
--HG-- branch : 1.x
This commit is contained in:
@@ -1,98 +0,0 @@
|
|||||||
<#@ template language="C#" HostSpecific="True" #>
|
|
||||||
<#
|
|
||||||
MvcTextTemplateHost mvcHost = (MvcTextTemplateHost)(Host);
|
|
||||||
#>
|
|
||||||
using System.Web.Mvc;
|
|
||||||
using Orchard.Localization;
|
|
||||||
using Orchard;
|
|
||||||
|
|
||||||
namespace <#= mvcHost.Namespace #>
|
|
||||||
{
|
|
||||||
public class <#= mvcHost.ControllerName #> : Controller
|
|
||||||
{
|
|
||||||
public IOrchardServices Services { get; set; }
|
|
||||||
|
|
||||||
public <#= mvcHost.ControllerName #>(IOrchardServices services) {
|
|
||||||
Services = services;
|
|
||||||
T = NullLocalizer.Instance;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Localizer T { get; set; }
|
|
||||||
|
|
||||||
<#
|
|
||||||
if(mvcHost.AddActionMethods) {
|
|
||||||
#>
|
|
||||||
public ActionResult Index()
|
|
||||||
{
|
|
||||||
return View();
|
|
||||||
}
|
|
||||||
|
|
||||||
public ActionResult Details(int id)
|
|
||||||
{
|
|
||||||
return View();
|
|
||||||
}
|
|
||||||
|
|
||||||
public ActionResult Create()
|
|
||||||
{
|
|
||||||
return View();
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpPost]
|
|
||||||
public ActionResult Create(FormCollection collection)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
// TODO: Add insert logic here
|
|
||||||
|
|
||||||
return RedirectToAction("Index");
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
return View();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public ActionResult Edit(int id)
|
|
||||||
{
|
|
||||||
return View();
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpPost]
|
|
||||||
public ActionResult Edit(int id, FormCollection collection)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
// TODO: Add update logic here
|
|
||||||
|
|
||||||
return RedirectToAction("Index");
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
return View();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public ActionResult Delete(int id)
|
|
||||||
{
|
|
||||||
return View();
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpPost]
|
|
||||||
public ActionResult Delete(int id, FormCollection collection)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
// TODO: Add delete logic here
|
|
||||||
|
|
||||||
return RedirectToAction("Index");
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
return View();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
<#
|
|
||||||
}
|
|
||||||
#>
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
<ProductVersion>9.0.30729</ProductVersion>
|
<ProductVersion>9.0.30729</ProductVersion>
|
||||||
<SchemaVersion>2.0</SchemaVersion>
|
<SchemaVersion>2.0</SchemaVersion>
|
||||||
<ProjectGuid>{$$ModuleProjectGuid$$}</ProjectGuid>
|
<ProjectGuid>{$$ModuleProjectGuid$$}</ProjectGuid>
|
||||||
<ProjectTypeGuids>{E53F8FEA-EAE0-44A6-8774-FFD645390401};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
|
<ProjectTypeGuids>{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
|
||||||
<OutputType>Library</OutputType>
|
<OutputType>Library</OutputType>
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
<RootNamespace>$$ModuleName$$</RootNamespace>
|
<RootNamespace>$$ModuleName$$</RootNamespace>
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ namespace Orchard.CodeGeneration.Commands {
|
|||||||
"", "Content", "Styles", "Scripts", "Views", "Zones"
|
"", "Content", "Styles", "Scripts", "Views", "Zones"
|
||||||
};
|
};
|
||||||
private static readonly string[] _moduleDirectories = new [] {
|
private static readonly string[] _moduleDirectories = new [] {
|
||||||
"", "Properties", "Controllers", "Views", "Models", "Scripts", "Styles", "CodeTemplates/AddController"
|
"", "Properties", "Controllers", "Views", "Models", "Scripts", "Styles"
|
||||||
};
|
};
|
||||||
|
|
||||||
private const string ModuleName = "CodeGeneration";
|
private const string ModuleName = "CodeGeneration";
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
<AssemblyName>Orchard.CodeGeneration</AssemblyName>
|
<AssemblyName>Orchard.CodeGeneration</AssemblyName>
|
||||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||||
<MvcBuildViews>false</MvcBuildViews>
|
<MvcBuildViews>false</MvcBuildViews>
|
||||||
|
<UseIISExpress>false</UseIISExpress>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
<DebugSymbols>true</DebugSymbols>
|
<DebugSymbols>true</DebugSymbols>
|
||||||
@@ -82,9 +83,6 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Content Include="CodeGenerationTemplates\Placement.info" />
|
<Content Include="CodeGenerationTemplates\Placement.info" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
|
||||||
<Content Include="CodeGenerationTemplates\Controller.tt" />
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
|
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||||
|
|||||||
Reference in New Issue
Block a user