mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 11:44:58 +08:00
Moving script to end of page, and adding title and secondary zone
--HG-- branch : theming
This commit is contained in:
@@ -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)
|
||||||
|
@@ -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">
|
||||||
<input class="button primaryAction" type="submit" name="submit.Save" value="@T("Save")"/>
|
@Display(Model.secondary)
|
||||||
</fieldset>
|
<fieldset>
|
||||||
|
<input class="button primaryAction" type="submit" name="submit.Save" value="@T("Save")"/>
|
||||||
|
</fieldset>
|
||||||
|
</div>
|
||||||
|
</div>
|
@@ -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,22 +13,31 @@
|
|||||||
<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">
|
|
||||||
$(function(){
|
OutputStack.Push(new HtmlStringWriter());
|
||||||
//pull slug input from tab order
|
try {
|
||||||
$("#@Html.FieldIdFor(m=>m.Slug)").attr("tabindex",-1);
|
<script type="text/javascript">
|
||||||
$("#@Html.FieldIdFor(m=>m.Title)").blur(function(){
|
$(function(){
|
||||||
var slug = $("#@Html.FieldIdFor(m=>m.Slug)");
|
//pull slug input from tab order
|
||||||
if (slug.val()) { return true; }
|
$("#@Html.FieldIdFor(m=>m.Slug)").attr("tabindex",-1);
|
||||||
$(this).slugify({
|
$("#@Html.FieldIdFor(m=>m.Title)").blur(function(){
|
||||||
target:slug,
|
var slug = $("#@Html.FieldIdFor(m=>m.Slug)");
|
||||||
url:"@Url.Action("Slugify","Item",new RouteValueDictionary{{"Area","Routable"}})",
|
if (slug.val()) { return true; }
|
||||||
contentType:"@Model.ContentType",
|
$(this).slugify({
|
||||||
id:"@Model.Id" @if (Model.ContainerId != null) { <text>, containerId:@Model.ContainerId</text> }
|
target:slug,
|
||||||
})
|
contentType:"@Model.ContentType",
|
||||||
})
|
id:"@Model.Id",
|
||||||
})
|
@if (Model.ContainerId != null) {<text>containerId:@Model.ContainerId,</text>}
|
||||||
</script>
|
url:"@Url.Action("Slugify","Item",new RouteValueDictionary{{"Area","Routable"}})"
|
||||||
*/
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
var script = OutputStack.Pop();
|
||||||
|
WorkContext.Page.Tail.Add(script);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user