Moving script to end of page, and adding title and secondary zone

--HG--
branch : theming
This commit is contained in:
Louis DeJardin
2010-09-13 13:11:23 -07:00
parent f05a8eb626
commit 1b2bab702d
3 changed files with 49 additions and 27 deletions

View File

@@ -1,3 +1,12 @@
@{
var typeDisplayName = Model.ContentItem.TypeDefinition.DisplayName;
var pageTitle = T("Edit Content");
if (!string.IsNullOrWhiteSpace(typeDisplayName)) {
pageTitle = T("Edit {0}", typeDisplayName);
}
}
<h1>@Html.TitleForPage(pageTitle)</h1>
@using (Html.BeginFormAntiForgeryPost()) { @using (Html.BeginFormAntiForgeryPost()) {
@Html.ValidationSummary() @Html.ValidationSummary()
@Display(Model) @Display(Model)

View File

@@ -1,7 +1,11 @@
content item -> @Model.ContentItem.ContentType <div class="sections">
<div class="primary">
@Display(Model.primary) @Display(Model.primary)
</div>
<fieldset> <div class="secondary">
@Display(Model.secondary)
<fieldset>
<input class="button primaryAction" type="submit" name="submit.Save" value="@T("Save")"/> <input class="button primaryAction" type="submit" name="submit.Save" value="@T("Save")"/>
</fieldset> </fieldset>
</div>
</div>

View File

@@ -1,7 +1,7 @@
@model Orchard.Core.Routable.ViewModels.RoutableEditorViewModel @model Orchard.Core.Routable.ViewModels.RoutableEditorViewModel
@using Orchard.Utility.Extensions @using Orchard.Utility.Extensions
@using Orchard.Mvc.Spooling
@Html.RegisterFootScript("jquery.slugify.js");
<fieldset> <fieldset>
@Html.LabelFor(m => m.Title) @Html.LabelFor(m => m.Title)
@Html.TextBoxFor(m => m.Title, new { @class = "large text" }) @Html.TextBoxFor(m => m.Title, new { @class = "large text" })
@@ -13,9 +13,12 @@
<label for="@ViewData.TemplateInfo.GetFullHtmlFieldId("PromoteToHomePage")" class="forcheckbox">@T("Set as home page")</label> <label for="@ViewData.TemplateInfo.GetFullHtmlFieldId("PromoteToHomePage")" class="forcheckbox">@T("Set as home page")</label>
</fieldset> </fieldset>
@// todo: (sebros) add this script at the end of the page @{
@/* Html.RegisterFootScript("jquery.slugify.js");
<script type="text/javascript">
OutputStack.Push(new HtmlStringWriter());
try {
<script type="text/javascript">
$(function(){ $(function(){
//pull slug input from tab order //pull slug input from tab order
$("#@Html.FieldIdFor(m=>m.Slug)").attr("tabindex",-1); $("#@Html.FieldIdFor(m=>m.Slug)").attr("tabindex",-1);
@@ -24,11 +27,17 @@
if (slug.val()) { return true; } if (slug.val()) { return true; }
$(this).slugify({ $(this).slugify({
target:slug, target:slug,
url:"@Url.Action("Slugify","Item",new RouteValueDictionary{{"Area","Routable"}})",
contentType:"@Model.ContentType", contentType:"@Model.ContentType",
id:"@Model.Id" @if (Model.ContainerId != null) { <text>, containerId:@Model.ContainerId</text> } id:"@Model.Id",
@if (Model.ContainerId != null) {<text>containerId:@Model.ContainerId,</text>}
url:"@Url.Action("Slugify","Item",new RouteValueDictionary{{"Area","Routable"}})"
}) })
}) })
}) })
</script> </script>
*/ }
finally {
var script = OutputStack.Pop();
WorkContext.Page.Tail.Add(script);
}
}