mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Removing sandbox module
The only thing it contained was done in a way that is very out of date No reason to port it - would be cleaner and easier to create new sandbox module if needed --HG-- branch : dev
This commit is contained in:
@@ -1,13 +0,0 @@
|
||||
using System.Web.Mvc;
|
||||
|
||||
namespace Orchard.Sandbox.Controllers
|
||||
{
|
||||
public class Home : Controller {
|
||||
|
||||
public ActionResult Index()
|
||||
{
|
||||
return RedirectToAction("index","page");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@@ -1,109 +0,0 @@
|
||||
using System.Linq;
|
||||
using System.Web.Mvc;
|
||||
using Orchard.Localization;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.Sandbox.Drivers;
|
||||
using Orchard.Sandbox.Models;
|
||||
using Orchard.Sandbox.ViewModels;
|
||||
using Orchard.Security;
|
||||
using Orchard.Settings;
|
||||
using Orchard.UI.Notify;
|
||||
|
||||
namespace Orchard.Sandbox.Controllers {
|
||||
public class PageController : Controller, IUpdateModel {
|
||||
public PageController(IOrchardServices orchardServices) {
|
||||
Services = orchardServices;
|
||||
}
|
||||
|
||||
public IOrchardServices Services { get; set; }
|
||||
public virtual ISite CurrentSite { get; set; }
|
||||
public virtual IUser CurrentUser { get; set; }
|
||||
public Localizer T { get; set; }
|
||||
|
||||
public ActionResult Index() {
|
||||
var model = new PageIndexViewModel {
|
||||
Pages = Services.ContentManager.Query<SandboxPagePart, SandboxPagePartRecord>()
|
||||
.OrderBy(x => x.Name)
|
||||
.List()
|
||||
.Select(x => Services.ContentManager.BuildDisplayModel(x, "SummaryList"))
|
||||
};
|
||||
return View(model);
|
||||
}
|
||||
|
||||
public ActionResult Show(int id) {
|
||||
return View(new PageShowViewModel {
|
||||
Page = Services.ContentManager.BuildDisplayModel<SandboxPagePart>(id, "Detail")
|
||||
});
|
||||
}
|
||||
|
||||
public ActionResult Create() {
|
||||
var settings = CurrentSite.Get<ContentPart<SandboxSettingsPartRecord>>();
|
||||
if (settings.Record.AllowAnonymousEdits == false && CurrentUser == null) {
|
||||
Services.Notifier.Error(T("Anonymous users can not create pages"));
|
||||
return RedirectToAction("index");
|
||||
}
|
||||
|
||||
return View(new PageCreateViewModel());
|
||||
}
|
||||
|
||||
|
||||
[HttpPost]
|
||||
public ActionResult Create(PageCreateViewModel model) {
|
||||
var settings = CurrentSite.Get<ContentPart<SandboxSettingsPartRecord>>();
|
||||
if (settings.Record.AllowAnonymousEdits == false && CurrentUser == null) {
|
||||
Services.Notifier.Error(T("Anonymous users can not create pages"));
|
||||
return RedirectToAction("index");
|
||||
}
|
||||
|
||||
var page = Services.ContentManager.Create<SandboxPagePart>(SandboxPagePartDriver.ContentType.Name, item => {
|
||||
item.Record.Name = model.Name;
|
||||
});
|
||||
return RedirectToAction("show", new { page.ContentItem.Id });
|
||||
}
|
||||
|
||||
|
||||
public ActionResult Edit(int id) {
|
||||
if (IsEditAllowed() == false) {
|
||||
return RedirectToAction("show", new { id });
|
||||
}
|
||||
|
||||
var latest = Services.ContentManager.GetLatest<SandboxPagePart>(id);
|
||||
return View(new PageEditViewModel {
|
||||
Page = Services.ContentManager.BuildEditorModel(latest)
|
||||
});
|
||||
}
|
||||
|
||||
[HttpPost, ActionName("Edit"), ValidateInput(false)]
|
||||
public ActionResult _Edit(int id) {
|
||||
if (IsEditAllowed() == false) {
|
||||
return RedirectToAction("show", new { id });
|
||||
}
|
||||
var latest = Services.ContentManager.GetDraftRequired<SandboxPagePart>(id);
|
||||
var model = new PageEditViewModel {
|
||||
Page = Services.ContentManager.UpdateEditorModel(latest, this)
|
||||
};
|
||||
if (!ModelState.IsValid) {
|
||||
Services.TransactionManager.Cancel();
|
||||
return View(model);
|
||||
}
|
||||
Services.ContentManager.Publish(latest.ContentItem);
|
||||
return RedirectToAction("show", new { id });
|
||||
}
|
||||
|
||||
bool IsEditAllowed() {
|
||||
var settings = CurrentSite.Get<ContentPart<SandboxSettingsPartRecord>>();
|
||||
if (settings.Record.AllowAnonymousEdits == false && CurrentUser == null) {
|
||||
Services.Notifier.Error(T("Anonymous users can not edit pages"));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool IUpdateModel.TryUpdateModel<TModel>(TModel model, string prefix, string[] includeProperties, string[] excludeProperties) {
|
||||
return TryUpdateModel(model, prefix, includeProperties, excludeProperties);
|
||||
}
|
||||
void IUpdateModel.AddModelError(string key, LocalizedString errorMessage) {
|
||||
ModelState.AddModelError(key, errorMessage.ToString());
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,34 +0,0 @@
|
||||
using Orchard.ContentManagement.MetaData;
|
||||
using Orchard.Data.Migration;
|
||||
|
||||
namespace Orchard.Sandbox.DataMigrations {
|
||||
public class SandboxDataMigration : DataMigrationImpl {
|
||||
|
||||
public int Create() {
|
||||
SchemaBuilder.CreateTable("SandboxPagePartRecord", table => table
|
||||
.ContentPartRecord()
|
||||
.Column<string>("Name")
|
||||
);
|
||||
|
||||
SchemaBuilder.CreateTable("SandboxSettingsPartRecord", table => table
|
||||
.ContentPartRecord()
|
||||
.Column<bool>("AllowAnonymousEdits")
|
||||
);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
public int UpdateFrom1() {
|
||||
|
||||
ContentDefinitionManager.AlterTypeDefinition("SandboxPage",
|
||||
cfg => cfg
|
||||
.WithPart("SandboxPagePart")
|
||||
.WithPart("CommonPart")
|
||||
.WithPart("RoutePart")
|
||||
.WithPart("BodyPart")
|
||||
);
|
||||
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,59 +0,0 @@
|
||||
using System;
|
||||
using System.Web.Routing;
|
||||
using JetBrains.Annotations;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.ContentManagement.Drivers;
|
||||
using Orchard.Mvc.ViewModels;
|
||||
using Orchard.Sandbox.Models;
|
||||
|
||||
namespace Orchard.Sandbox.Drivers {
|
||||
[UsedImplicitly]
|
||||
public class SandboxPagePartDriver : ContentItemDriver<SandboxPagePart> {
|
||||
public readonly static ContentType ContentType = new ContentType {
|
||||
Name = "SandboxPage",
|
||||
DisplayName = "Sandbox Page"
|
||||
};
|
||||
|
||||
protected override ContentType GetContentType() {
|
||||
return ContentType;
|
||||
}
|
||||
protected override string GetDisplayText(SandboxPagePart item) {
|
||||
return item.Record.Name;
|
||||
}
|
||||
|
||||
public override RouteValueDictionary GetDisplayRouteValues(SandboxPagePart item) {
|
||||
return new RouteValueDictionary(
|
||||
new {
|
||||
area = "Orchard.Sandbox",
|
||||
controller = "Page",
|
||||
action = "Show",
|
||||
id = item.ContentItem.Id,
|
||||
});
|
||||
}
|
||||
|
||||
public override RouteValueDictionary GetEditorRouteValues(SandboxPagePart item) {
|
||||
return new RouteValueDictionary(
|
||||
new {
|
||||
area = "Orchard.Sandbox",
|
||||
controller = "Page",
|
||||
action = "Edit",
|
||||
id = item.ContentItem.Id,
|
||||
});
|
||||
}
|
||||
|
||||
protected override DriverResult Display(SandboxPagePart part, string displayType) {
|
||||
return Combined(
|
||||
ContentItemTemplate("Items/Sandbox.Page").LongestMatch(displayType, "Summary"),
|
||||
ContentPartTemplate(part, "Parts/Sandbox.Page.Title").Location("title"));
|
||||
}
|
||||
|
||||
protected override DriverResult Editor(ContentItemViewModel<SandboxPagePart> model) {
|
||||
return ContentItemTemplate("Items/Sandbox.Page");
|
||||
}
|
||||
|
||||
protected override DriverResult Editor(ContentItemViewModel<SandboxPagePart> model, IUpdateModel updater) {
|
||||
updater.TryUpdateModel(model, Prefix, null, null);
|
||||
return ContentItemTemplate("Items/Sandbox.Page");
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,20 +0,0 @@
|
||||
using JetBrains.Annotations;
|
||||
using Orchard.Data;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.ContentManagement.Handlers;
|
||||
using Orchard.Sandbox.Models;
|
||||
|
||||
namespace Orchard.Sandbox.Handlers {
|
||||
[UsedImplicitly]
|
||||
public class SandboxPagePartHandler : ContentHandler {
|
||||
public SandboxPagePartHandler(IRepository<SandboxPagePartRecord> pageRepository, IRepository<SandboxSettingsPartRecord> settingsRepository) {
|
||||
// define the "SandboxPage" content type
|
||||
Filters.Add(StorageFilter.For(pageRepository) );
|
||||
|
||||
// add settings to site, and simple record-template gui
|
||||
Filters.Add(new ActivatingFilter<ContentPart<SandboxSettingsPartRecord>>("Site"));
|
||||
Filters.Add(StorageFilter.For(settingsRepository));
|
||||
Filters.Add(new TemplateFilterForRecord<SandboxSettingsPartRecord>("SandboxSettings", "Parts/Sandbox.SiteSettings"));
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,6 +0,0 @@
|
||||
using Orchard.ContentManagement;
|
||||
|
||||
namespace Orchard.Sandbox.Models {
|
||||
public class SandboxPagePart : ContentPart<SandboxPagePartRecord> {
|
||||
}
|
||||
}
|
@@ -1,7 +0,0 @@
|
||||
using Orchard.ContentManagement.Records;
|
||||
|
||||
namespace Orchard.Sandbox.Models {
|
||||
public class SandboxPagePartRecord : ContentPartRecord {
|
||||
public virtual string Name { get; set; }
|
||||
}
|
||||
}
|
@@ -1,7 +0,0 @@
|
||||
using Orchard.ContentManagement.Records;
|
||||
|
||||
namespace Orchard.Sandbox.Models {
|
||||
public class SandboxSettingsPartRecord : ContentPartRecord {
|
||||
public virtual bool AllowAnonymousEdits { get; set; }
|
||||
}
|
||||
}
|
@@ -1,11 +0,0 @@
|
||||
name: Sandbox
|
||||
antiforgery: enabled
|
||||
author: The Orchard Team
|
||||
website: http://orchardproject.net
|
||||
version: 0.5.0
|
||||
orchardversion: 0.5.0
|
||||
description: The sandbox module is a testing ground for Orchard developers and should not be activated except for testing and development purposes.
|
||||
features:
|
||||
Orchard.Sandbox:
|
||||
Description: A module to mess around with. Currently wiki-like.
|
||||
Category: Developer
|
@@ -1,145 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{17C44253-65A2-4597-98C7-16EE576824B6}</ProjectGuid>
|
||||
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Orchard.Sandbox</RootNamespace>
|
||||
<AssemblyName>Orchard.Sandbox</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<MvcBuildViews>false</MvcBuildViews>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
<OldToolsVersion>3.5</OldToolsVersion>
|
||||
<UpgradeBackupLocation />
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.ComponentModel.DataAnnotations">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Web.ApplicationServices" />
|
||||
<Reference Include="System.Web.DynamicData" />
|
||||
<Reference Include="System.Web.Entity" />
|
||||
<Reference Include="System.Web.Extensions" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Web" />
|
||||
<Reference Include="System.Web.Abstractions" />
|
||||
<Reference Include="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\lib\aspnetmvc\System.Web.Mvc.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Routing" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Web.Services" />
|
||||
<Reference Include="System.EnterpriseServices" />
|
||||
<Reference Include="System.Web.Mobile" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Controllers\HomeController.cs" />
|
||||
<Compile Include="Controllers\PageController.cs" />
|
||||
<Compile Include="DataMigrations\SandBoxDataMigration.cs" />
|
||||
<Compile Include="Drivers\SandboxPagePartDriver.cs" />
|
||||
<Compile Include="Models\SandboxPagePart.cs" />
|
||||
<Compile Include="Handlers\SandboxPagePartHandler.cs" />
|
||||
<Compile Include="Models\SandboxPagePartRecord.cs" />
|
||||
<Compile Include="Models\SandboxSettingsPartRecord.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="ViewModels\PageEditViewModel.cs" />
|
||||
<Compile Include="ViewModels\PageCreateViewModel.cs" />
|
||||
<Compile Include="ViewModels\PageShowViewModel.cs" />
|
||||
<Compile Include="ViewModels\PageIndexViewModel.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Module.txt" />
|
||||
<Content Include="Views\Page\Edit.aspx" />
|
||||
<Content Include="Views\Page\Create.aspx" />
|
||||
<Content Include="Views\Page\Show.aspx" />
|
||||
<Content Include="Views\Page\Index.aspx" />
|
||||
<Content Include="Views\DisplayTemplates\Parts\Sandbox.Page.Title.ascx" />
|
||||
<Content Include="Views\DisplayTemplates\Items\Sandbox.Page.ascx" />
|
||||
<Content Include="Views\DisplayTemplates\Items\Sandbox.Page.Summary.ascx" />
|
||||
<Content Include="Views\EditorTemplates\Items\Sandbox.Page.ascx" />
|
||||
<Content Include="Views\EditorTemplates\Parts\Sandbox.SiteSettings.ascx" />
|
||||
<Content Include="Web.config" />
|
||||
<Content Include="Views\Web.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\Orchard\Orchard.Framework.csproj">
|
||||
<Project>{2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6}</Project>
|
||||
<Name>Orchard.Framework</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Core\Orchard.Core.csproj">
|
||||
<Project>{9916839C-39FC-4CEB-A5AF-89CA7E87119F}</Project>
|
||||
<Name>Orchard.Core</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.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.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target> -->
|
||||
<Target Name="AfterBuild" DependsOnTargets="AfterBuildCompiler">
|
||||
<PropertyGroup>
|
||||
<AreasManifestDir>$(ProjectDir)\..\Manifests</AreasManifestDir>
|
||||
</PropertyGroup>
|
||||
<!-- If this is an area child project, uncomment the following line:
|
||||
<CreateAreaManifest AreaName="$(AssemblyName)" AreaType="Child" AreaPath="$(ProjectDir)" ManifestPath="$(AreasManifestDir)" ContentFiles="@(Content)" />
|
||||
-->
|
||||
<!-- If this is an area parent project, uncomment the following lines:
|
||||
<CreateAreaManifest AreaName="$(AssemblyName)" AreaType="Parent" AreaPath="$(ProjectDir)" ManifestPath="$(AreasManifestDir)" ContentFiles="@(Content)" />
|
||||
<CopyAreaManifests ManifestPath="$(AreasManifestDir)" CrossCopy="false" RenameViews="true" />
|
||||
-->
|
||||
</Target>
|
||||
<Target Name="AfterBuildCompiler" Condition="'$(MvcBuildViews)'=='true'">
|
||||
<AspNetCompiler VirtualPath="temp" PhysicalPath="$(ProjectDir)\..\$(ProjectName)" />
|
||||
</Target>
|
||||
<ProjectExtensions>
|
||||
<VisualStudio>
|
||||
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
|
||||
<WebProjectProperties>
|
||||
<UseIIS>False</UseIIS>
|
||||
<AutoAssignPort>True</AutoAssignPort>
|
||||
<DevelopmentServerPort>53613</DevelopmentServerPort>
|
||||
<DevelopmentServerVPath>/</DevelopmentServerVPath>
|
||||
<IISUrl>
|
||||
</IISUrl>
|
||||
<NTLMAuthentication>False</NTLMAuthentication>
|
||||
<UseCustomServer>True</UseCustomServer>
|
||||
<CustomServerUrl>http://orchard.codeplex.com</CustomServerUrl>
|
||||
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
|
||||
</WebProjectProperties>
|
||||
</FlavorProperties>
|
||||
</VisualStudio>
|
||||
</ProjectExtensions>
|
||||
</Project>
|
@@ -1,34 +0,0 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Orchard.Sandbox")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyProduct("Orchard")]
|
||||
[assembly: AssemblyCopyright("Copyright © CodePlex Foundation 2009")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("41e95feb-a95e-4ff1-9d74-fa158a569f60")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("0.5.0")]
|
||||
[assembly: AssemblyFileVersion("0.5.0")]
|
@@ -1,12 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using Orchard.Mvc.ViewModels;
|
||||
using Orchard.Sandbox.Models;
|
||||
|
||||
namespace Orchard.Sandbox.ViewModels {
|
||||
public class PageCreateViewModel : BaseViewModel {
|
||||
public string Name { get; set; }
|
||||
}
|
||||
}
|
@@ -1,10 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Orchard.Mvc.ViewModels;
|
||||
using Orchard.Sandbox.Models;
|
||||
|
||||
namespace Orchard.Sandbox.ViewModels {
|
||||
public class PageEditViewModel : BaseViewModel {
|
||||
public ContentItemViewModel<SandboxPagePart> Page { get; set; }
|
||||
}
|
||||
}
|
@@ -1,9 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using Orchard.Mvc.ViewModels;
|
||||
using Orchard.Sandbox.Models;
|
||||
|
||||
namespace Orchard.Sandbox.ViewModels {
|
||||
public class PageIndexViewModel : BaseViewModel {
|
||||
public IEnumerable<ContentItemViewModel<SandboxPagePart>> Pages { get; set; }
|
||||
}
|
||||
}
|
@@ -1,8 +0,0 @@
|
||||
using Orchard.Mvc.ViewModels;
|
||||
using Orchard.Sandbox.Models;
|
||||
|
||||
namespace Orchard.Sandbox.ViewModels {
|
||||
public class PageShowViewModel : BaseViewModel {
|
||||
public ContentItemViewModel<SandboxPagePart> Page { get; set; }
|
||||
}
|
||||
}
|
@@ -1,8 +0,0 @@
|
||||
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<ContentItemViewModel<SandboxPagePart>>" %>
|
||||
<%@ Import Namespace="Orchard.Mvc.ViewModels"%>
|
||||
<%@ Import Namespace="Orchard.Sandbox.Models" %>
|
||||
<div class="item">
|
||||
<% Html.Zone("title");
|
||||
Html.Zone("metatop");
|
||||
Html.Zone("body"); %>
|
||||
</div>
|
@@ -1,23 +0,0 @@
|
||||
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<ContentItemViewModel<SandboxPagePart>>" %>
|
||||
<%@ Import Namespace="Orchard.Mvc.ViewModels"%>
|
||||
<%@ Import Namespace="Orchard.Sandbox.Models" %>
|
||||
<div class="item">
|
||||
<% Html.Zone("first"); %>
|
||||
<div class="title">
|
||||
<% Html.Zone("title"); %>
|
||||
</div>
|
||||
<% Html.Zone("metatop"); %>
|
||||
<div class="actions">
|
||||
<%: Html.ItemEditLink(T("Edit this page").ToString(), Model.Item) %>
|
||||
<%: Html.ActionLink(T("Return to list").ToString(), "index") %>
|
||||
<% Html.Zone("actions"); %>
|
||||
</div>
|
||||
<div class="body">
|
||||
<% Html.Zone("body"); %>
|
||||
</div>
|
||||
<% Html.Zone("metabottom"); %>
|
||||
<div class="footer">
|
||||
<% Html.ZonesExcept("last"); %>
|
||||
<% Html.Zone("last"); %>
|
||||
</div>
|
||||
</div>
|
@@ -1,3 +0,0 @@
|
||||
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<IContent>" %>
|
||||
<%@ Import Namespace="Orchard.ContentManagement"%>
|
||||
<h2><%: Html.ItemDisplayLink(Model) %></h2>
|
@@ -1,8 +0,0 @@
|
||||
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<ContentItemViewModel<SandboxPagePart>>" %>
|
||||
<%@ Import Namespace="Orchard.Mvc.ViewModels"%>
|
||||
<%@ Import Namespace="Orchard.Sandbox.Models"%>
|
||||
<fieldset>
|
||||
<%: Html.LabelFor(m => m.Item.Record.Name) %>
|
||||
<%: Html.EditorFor(m => m.Item.Record.Name) %>
|
||||
</fieldset>
|
||||
<% Html.ZonesAny(); %>
|
@@ -1,10 +0,0 @@
|
||||
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<SandboxSettingsPartRecord>" %>
|
||||
<%@ Import Namespace="Orchard.Sandbox.Models"%>
|
||||
<fieldset>
|
||||
<legend>Sandbox</legend>
|
||||
<div>
|
||||
<%: Html.EditorFor(m => m.AllowAnonymousEdits) %>
|
||||
<label class="forcheckbox" for="SandboxSettings_AllowAnonymousEdits"><%: T("Anyone can create and edit pages") %></label>
|
||||
<%: Html.ValidationMessage("AllowAnonymousEdits", "*") %>
|
||||
</div>
|
||||
</fieldset>
|
@@ -1,10 +0,0 @@
|
||||
<%@ Page Language="C#" Inherits="Orchard.Mvc.ViewPage<PageCreateViewModel>" %>
|
||||
<%@ Import Namespace="Orchard.Sandbox.ViewModels" %>
|
||||
<h1><%: Html.TitleForPage(T("Create Page").ToString())%></h1>
|
||||
<% using (Html.BeginFormAntiForgeryPost()) { %>
|
||||
<fieldset>
|
||||
<%: Html.LabelFor(x => x.Name) %>
|
||||
<%: Html.EditorFor(x => x.Name) %>
|
||||
<input type="submit" name="submit" value="<%: T("Add") %>" />
|
||||
</fieldset>
|
||||
<% } %>
|
@@ -1,9 +0,0 @@
|
||||
<%@ Page Language="C#" Inherits="Orchard.Mvc.ViewPage<PageEditViewModel>" %>
|
||||
<%@ Import Namespace="Orchard.Sandbox.ViewModels" %>
|
||||
<h1><%: Html.TitleForPage(T("Edit Page").ToString()) %></h1>
|
||||
<%using (Html.BeginFormAntiForgeryPost()) { %>
|
||||
<%: Html.EditorForItem(Model.Page) %>
|
||||
<fieldset>
|
||||
<input type="submit" name="submit" value="<%: T("Save") %>" />
|
||||
</fieldset>
|
||||
<% } %>
|
@@ -1,5 +0,0 @@
|
||||
<%@ Page Language="C#" Inherits="Orchard.Mvc.ViewPage<PageIndexViewModel>" %>
|
||||
<%@ Import Namespace="Orchard.Sandbox.ViewModels" %>
|
||||
<h1><%: Html.TitleForPage(T("Sandbox Pages").ToString()) %></h1>
|
||||
<p><%: Html.ActionLink(T("Add new page").ToString(), "create") %></p>
|
||||
<%: Html.UnorderedList(Model.Pages, (sp, i) => Html.DisplayForItem(sp), "pages contentItems") %>
|
@@ -1,3 +0,0 @@
|
||||
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<PageShowViewModel>" %>
|
||||
<%@ Import Namespace="Orchard.Sandbox.ViewModels" %>
|
||||
<%: Html.DisplayForItem(Model.Page) %>
|
@@ -1,42 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<configuration>
|
||||
<system.web>
|
||||
<httpHandlers>
|
||||
<add path="*" verb="*"
|
||||
type="System.Web.HttpNotFoundHandler"/>
|
||||
</httpHandlers>
|
||||
|
||||
<!--
|
||||
Enabling request validation in view pages would cause validation to occur
|
||||
after the input has already been processed by the controller. By default
|
||||
MVC performs request validation before a controller processes the input.
|
||||
To change this behavior apply the ValidateInputAttribute to a
|
||||
controller or action.
|
||||
-->
|
||||
<pages
|
||||
validateRequest="false"
|
||||
pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"
|
||||
pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"
|
||||
userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<controls>
|
||||
<add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" namespace="System.Web.Mvc" tagPrefix="mvc" />
|
||||
</controls>
|
||||
</pages>
|
||||
</system.web>
|
||||
|
||||
<system.webServer>
|
||||
<validation validateIntegratedModeConfiguration="false"/>
|
||||
<handlers>
|
||||
<remove name="BlockViewHandler"/>
|
||||
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler"/>
|
||||
</handlers>
|
||||
</system.webServer>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
|
||||
<bindingRedirect oldVersion="2.0.0.0" newVersion="3.0.0.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
@@ -1,32 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<configuration>
|
||||
<system.web>
|
||||
<compilation debug="true" targetFramework="4.0">
|
||||
<assemblies>
|
||||
<add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"/>
|
||||
</assemblies>
|
||||
</compilation>
|
||||
|
||||
<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID">
|
||||
<namespaces>
|
||||
<add namespace="System.Web.Mvc"/>
|
||||
<add namespace="System.Web.Mvc.Ajax"/>
|
||||
<add namespace="System.Web.Mvc.Html"/>
|
||||
<add namespace="System.Web.Routing"/>
|
||||
<add namespace="System.Linq"/>
|
||||
<add namespace="System.Collections.Generic"/>
|
||||
<add namespace="Orchard.Mvc.Html"/>
|
||||
</namespaces>
|
||||
</pages>
|
||||
</system.web>
|
||||
<system.web.extensions/>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
|
||||
<bindingRedirect oldVersion="2.0.0.0" newVersion="3.0.0.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
Reference in New Issue
Block a user