Roughing out a model aspect for body text. The format property will eventually determine the chain of output filters the text passes through, and which editor template is used for the text itself.

--HG--
extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4042796
This commit is contained in:
loudej
2009-12-01 05:30:10 +00:00
parent cd39efe610
commit 15b6b7116a
15 changed files with 171 additions and 20 deletions

View File

@@ -9,7 +9,7 @@ namespace Orchard.Blogs.Models {
public Blog Blog { get; set; }
public string Title { get { return this.As<RoutableAspect>().Title; } }
public string Body { get { return this.As<BodyAspect>().Record.Body; } }
public string Body { get { return this.As<BodyAspect>().Record.Text; } }
public string Slug { get { return this.As<RoutableAspect>().Slug; } }
public IUser Creator { get { return this.As<CommonAspect>().OwnerField.Value; } }
public DateTime? Published { get { return Record.Published; } }

View File

@@ -83,7 +83,7 @@ namespace Orchard.Sandbox.Controllers {
return View(model);
}
[HttpPost]
[HttpPost, ValidateInput(false)]
public ActionResult Edit(int id, FormCollection input) {
var settings = CurrentSite.Get<ContentPart<SandboxSettingsRecord>>();
if (settings.Record.AllowAnonymousEdits == false && CurrentUser == null) {

View File

@@ -20,11 +20,7 @@
</div>
<div id="main">
<% Html.RenderPartial("Messages", Model.Messages); %>
<h3>
<%=Html.Encode(Model.Page.Record.Name) %></h3>
<div>
TODO: page body
</div>
<h1><%=Html.Encode(Model.Page.Record.Name) %></h1>
<%foreach (var display in Model.Displays) { %>
<%=Html.DisplayFor(m=>display.Model, display.TemplateName, display.Prefix) %>
<%} %>

View File

@@ -42,6 +42,10 @@
<Reference Include="System.Data.DataSetExtensions">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\lib\aspnetmvc\System.Web.Mvc.dll</HintPath>
</Reference>
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
@@ -116,10 +120,14 @@
<Content Include="Scripts\utils\form_utils.js" />
<Content Include="Scripts\utils\mctabs.js" />
<Content Include="Scripts\utils\validate.js" />
<Content Include="Views\Models\EditorTemplates\TinyMceTextEditor.ascx" />
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="Views\Web.config" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v9.0\WebApplications\Microsoft.WebApplication.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.

View File

@@ -0,0 +1,11 @@
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<string>" %>
<%@ Import Namespace="System.Web.Mvc.Html" %>
<script src="<%=ResolveUrl("~/Packages/TinyMce/scripts/tiny_mce.js") %>" type="text/javascript"></script>
<%=Html.TextArea("", Model, 25, 80, new {}) %>
<script type="text/javascript">
tinyMCE.init({ theme: "advanced", mode: "textareas", plugins: "fullscreen,autoresize", theme_advanced_toolbar_location: "top", theme_advanced_toolbar_align: "left", theme_advanced_buttons3_add: "fullscreen" });
</script>

View File

@@ -0,0 +1,34 @@
<?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=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<controls>
<add assembly="System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" 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>
</configuration>