Migrating Routable and XmlRpc

--HG--
branch : theming
This commit is contained in:
Sebastien Ros
2010-09-10 16:33:55 -07:00
parent b5119c57cd
commit 3ea9359c7a
7 changed files with 40 additions and 40 deletions

View File

@@ -315,8 +315,8 @@
<Content Include="Localization\Views\CultureSelection.ascx" />
<Content Include="Routable\Module.txt" />
<Content Include="Routable\Scripts\jquery.slugify.js" />
<Content Include="Routable\Views\EditorTemplates\Parts\Routable.RoutePart.ascx" />
<Content Include="Routable\Views\Item\Display.ascx" />
<None Include="Routable\Views\EditorTemplates\Parts\Routable.RoutePart.cshtml" />
<None Include="Routable\Views\Item\Display.cshtml" />
<Content Include="Settings\Module.txt" />
<Content Include="Settings\Styles\admin.css" />
<None Include="Settings\Views\Admin\Index.cshtml" />
@@ -344,7 +344,7 @@
<Content Include="Shapes\Views\UI\Switchable.ascx" />
<Content Include="Web.config" />
<Content Include="XmlRpc\Module.txt" />
<Content Include="XmlRpc\Views\Home\Index.aspx" />
<None Include="XmlRpc\Views\Home\Index.cshtml" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Clay\src\ClaySharp\ClaySharp.csproj">

View File

@@ -42,7 +42,7 @@ namespace Orchard.Core.Routable.Controllers {
}
var model = _contentManager.BuildDisplayModel<IRoutableAspect>(hits.Single(), "Detail");
return View(Shape.Model(model));
return View(model);
}
public ActionResult Slugify(string contentType, int? id, int? containerId) {

View File

@@ -1,32 +0,0 @@
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<Orchard.Core.Routable.ViewModels.RoutableEditorViewModel>" %>
<%@ Import Namespace="Orchard.Utility.Extensions"%>
<% Html.RegisterFootScript("jquery.slugify.js"); %>
<fieldset>
<%: Html.LabelFor(m => m.Title) %>
<%: Html.TextBoxFor(m => m.Title, new { @class = "large text" }) %>
</fieldset>
<fieldset class="permalink">
<label class="sub" for="Slug"><%: T("Permalink")%><br /><span><%: Request.ToRootUrlString()%>/<%: Model.DisplayLeadingPath %></span></label>
<span><%: Html.TextBoxFor(m => m.Slug, new { @class = "text" })%></span>
<%: Html.EditorFor(m => m.PromoteToHomePage) %>
<label for="<%:ViewData.TemplateInfo.GetFullHtmlFieldId("PromoteToHomePage") %>" class="forcheckbox"><%: T("Set as home page") %></label>
</fieldset>
<% using (this.Capture("end-of-page-scripts")) { %>
<script type="text/javascript">
$(function(){
//pull slug input from tab order
$("#<%: Html.FieldIdFor(m=>m.Slug)%>").attr("tabindex",-1);
$("#<%: Html.FieldIdFor(m=>m.Title)%>").blur(function(){
var slug = $("#<%:Html.FieldIdFor(m=>m.Slug)%>");
if (slug.val()) { return true; }
$(this).slugify({
target:slug,
url:"<%: Url.Action("Slugify","Item",new RouteValueDictionary{{"Area","Routable"}})%>",
contentType:"<%: Model.ContentType %>",
id:"<%=Model.Id %>" <%if (Model.ContainerId != null) { %>,
containerId:<%: Model.ContainerId %><%} %>
})
})
})</script>
<% } %>

View File

@@ -0,0 +1,32 @@
@model Orchard.Core.Routable.ViewModels.RoutableEditorViewModel
@using Orchard.Utility.Extensions
@Html.RegisterFootScript("jquery.slugify.js");
<fieldset>
@Html.LabelFor(m => m.Title)
@Html.TextBoxFor(m => m.Title, new { @class = "large text" })
</fieldset>
<fieldset class="permalink">
<label class="sub" for="Slug">@T("Permalink")<br /><span>@Request.ToRootUrlString()/@Model.DisplayLeadingPath</span></label>
<span>@Html.TextBoxFor(m => m.Slug, new { @class = "text" })</span>
@Html.EditorFor(m => m.PromoteToHomePage)
<label for="@ViewData.TemplateInfo.GetFullHtmlFieldId("PromoteToHomePage")" class="forcheckbox">@T("Set as home page")</label>
</fieldset>
@using (this.Capture("end-of-page-scripts")) {
<script type="text/javascript">
$(function(){
//pull slug input from tab order
$("#@Html.FieldIdFor(m=>m.Slug)").attr("tabindex",-1);
$("#@Html.FieldIdFor(m=>m.Title)").blur(function(){
var slug = $("#@Html.FieldIdFor(m=>m.Slug)");
if (slug.val()) { return true; }
$(this).slugify({
target:slug,
url:"@Url.Action("Slugify","Item",new RouteValueDictionary{{"Area","Routable"}})",
contentType:"@Model.ContentType",
id:"@Model.Id" @if (Model.ContainerId != null) {,
containerId:@Model.ContainerId}
})
})
})</script>
}

View File

@@ -1,3 +0,0 @@
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<Orchard.Core.Routable.ViewModels.RoutableDisplayViewModel>" %>
<% Html.AddTitleParts(Model.Routable.Item.Title); %>
<%: Html.DisplayForItem(m=>m.Routable) %>

View File

@@ -0,0 +1,3 @@
@model Orchard.Core.Routable.ViewModels.RoutableDisplayViewModel
@Html.AddTitleParts(Model.Routable.Item.Title);
@Display(Model.Routable)

View File

@@ -1,4 +1,4 @@
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" %>
@model dynamic
<!DOCTYPE html>
<html>
<head><title>Use this url for LiveWriter</title></head>