mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-12-03 20:13:52 +08:00
Some work on blog post create edit. Starting to put together some standard for zoning
--HG-- extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4043756
This commit is contained in:
@@ -102,7 +102,7 @@ namespace Orchard.Core.Common.Providers {
|
|||||||
if (instance.Owner != null)
|
if (instance.Owner != null)
|
||||||
viewModel.Owner = instance.Owner.UserName;
|
viewModel.Owner = instance.Owner.UserName;
|
||||||
|
|
||||||
context.AddEditor(new TemplateViewModel(viewModel, "CommonAspect"));
|
context.AddEditor(new TemplateViewModel(viewModel, "CommonAspect") { Position = "9" });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -132,7 +132,7 @@ namespace Orchard.Core.Common.Providers {
|
|||||||
instance.Owner = newOwner;
|
instance.Owner = newOwner;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
context.AddEditor(new TemplateViewModel(viewModel, "CommonAspect"));
|
context.AddEditor(new TemplateViewModel(viewModel, "CommonAspect") { Position = "9" });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -74,12 +74,14 @@ namespace Orchard.Blogs.Models {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
OnGetEditorViewModel<BlogPost>((context, blogPost) =>
|
OnGetEditorViewModel<BlogPost>((context, blogPost) => {
|
||||||
context.AddEditor(new TemplateViewModel(blogPost) {TemplateName = "BlogPostFields"})
|
context.AddEditor(new TemplateViewModel(blogPost) { TemplateName = "BlogPostFieldsPrimary", ZoneName = "body", Position = "1" });
|
||||||
);
|
context.AddEditor(new TemplateViewModel(blogPost) { TemplateName = "BlogPostFieldsSecondary", ZoneName = "sidebar", Position = "1" });
|
||||||
|
});
|
||||||
|
|
||||||
OnUpdateEditorViewModel<BlogPost>((context, blogPost) => {
|
OnUpdateEditorViewModel<BlogPost>((context, blogPost) => {
|
||||||
context.AddEditor(new TemplateViewModel(blogPost) { TemplateName = "BlogPostFields" });
|
context.AddEditor(new TemplateViewModel(blogPost) { TemplateName = "BlogPostFieldsPrimary", ZoneName = "body", Position = "1" });
|
||||||
|
context.AddEditor(new TemplateViewModel(blogPost) { TemplateName = "BlogPostFieldsSecondary", ZoneName = "sidebar", Position = "1" });
|
||||||
context.Updater.TryUpdateModel(blogPost, "", null, null);
|
context.Updater.TryUpdateModel(blogPost, "", null, null);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -109,7 +109,7 @@
|
|||||||
<Content Include="Views\Models\DisplayTemplates\BlogDetail.ascx" />
|
<Content Include="Views\Models\DisplayTemplates\BlogDetail.ascx" />
|
||||||
<Content Include="Views\Models\DisplayTemplates\BlogPostList.ascx" />
|
<Content Include="Views\Models\DisplayTemplates\BlogPostList.ascx" />
|
||||||
<Content Include="Views\Models\DisplayTemplates\BlogSummary.ascx" />
|
<Content Include="Views\Models\DisplayTemplates\BlogSummary.ascx" />
|
||||||
<Content Include="Views\Models\EditorTemplates\BlogPostFields.ascx" />
|
<Content Include="Views\Models\EditorTemplates\BlogPostFieldsSecondary.ascx" />
|
||||||
<Content Include="Views\BlogPost\Item.aspx" />
|
<Content Include="Views\BlogPost\Item.aspx" />
|
||||||
<Content Include="Views\Blog\Create.aspx" />
|
<Content Include="Views\Blog\Create.aspx" />
|
||||||
<Content Include="Views\Blog\Edit.aspx" />
|
<Content Include="Views\Blog\Edit.aspx" />
|
||||||
@@ -119,6 +119,7 @@
|
|||||||
<Content Include="Views\Models\EditorTemplates\BlogFields.ascx" />
|
<Content Include="Views\Models\EditorTemplates\BlogFields.ascx" />
|
||||||
<Content Include="Views\Models\EditorTemplates\Blog.ascx" />
|
<Content Include="Views\Models\EditorTemplates\Blog.ascx" />
|
||||||
<Content Include="Views\Models\EditorTemplates\BlogPost.ascx" />
|
<Content Include="Views\Models\EditorTemplates\BlogPost.ascx" />
|
||||||
|
<Content Include="Views\Models\EditorTemplates\BlogPostFieldsPrimary.ascx" />
|
||||||
<Content Include="Web.config" />
|
<Content Include="Web.config" />
|
||||||
<Content Include="Views\Web.config" />
|
<Content Include="Views\Web.config" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|||||||
@@ -2,4 +2,15 @@
|
|||||||
<%@ Import Namespace="Orchard.Models.ViewModels"%>
|
<%@ Import Namespace="Orchard.Models.ViewModels"%>
|
||||||
<%@ Import Namespace="Orchard.Mvc.Html"%>
|
<%@ Import Namespace="Orchard.Mvc.Html"%>
|
||||||
<%@ Import Namespace="Orchard.Blogs.Models"%>
|
<%@ Import Namespace="Orchard.Blogs.Models"%>
|
||||||
<%=Html.EditorZonesAny() %>
|
<div class="sections">
|
||||||
|
<div class="primary">
|
||||||
|
<%=Html.EditorZone("body") %>
|
||||||
|
<%=Html.EditorZonesExcept("sidebar") %>
|
||||||
|
</div>
|
||||||
|
<div class="secondary">
|
||||||
|
<%=Html.EditorZone("sidebar") %>
|
||||||
|
<fieldset>
|
||||||
|
<input class="button" type="submit" name="submit.Save" value="Save"/>
|
||||||
|
</fieldset>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|||||||
@@ -1,31 +0,0 @@
|
|||||||
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<BlogPost>" %>
|
|
||||||
<%@ Import Namespace="Orchard.Blogs.Models"%>
|
|
||||||
<%@ Import Namespace="Orchard.Blogs.Extensions"%>
|
|
||||||
<%@ Import Namespace="Orchard.Blogs.ViewModels"%>
|
|
||||||
<div class="sections">
|
|
||||||
<div class="primary">
|
|
||||||
<%-- todo: (heskew) thin out the fieldsets if they become overkill --%>
|
|
||||||
<fieldset>
|
|
||||||
<label for="title">Title</label>
|
|
||||||
<span><%=Html.TextBoxFor(m => m.Title, new { id = "title", @class = "large text" })%></span>
|
|
||||||
</fieldset>
|
|
||||||
<fieldset>
|
|
||||||
<label class="sub" for="permalink">Permalink<br /><span><%=Request.Url.ToRootString() %>/<%=Model.Blog.Slug %>/</span></label>
|
|
||||||
<span><%=Html.TextBoxFor(m => m.Slug, new { id = "permalink", @class = "text" })%></span>
|
|
||||||
</fieldset>
|
|
||||||
</div>
|
|
||||||
<div class="secondary">
|
|
||||||
<fieldset>
|
|
||||||
<legend>Publish Settings</legend>
|
|
||||||
<label for="Command_SaveDraft"><%=Html.RadioButton("Command", "SaveDraft", true, new { id = "Command_SaveDraft" }) %> Save Draft</label><br />
|
|
||||||
<input class="button" type="submit" name="submit.Save" value="Save"/>
|
|
||||||
</fieldset>
|
|
||||||
<%--<fieldset>
|
|
||||||
<label for="Command_PublishNow"><%=Html.RadioButton("Command", "PublishNow", new { id = "Command_PublishNow" }) %> Publish Now</label>
|
|
||||||
</fieldset>
|
|
||||||
<fieldset>
|
|
||||||
<label for="Command_PublishLater"><%=Html.RadioButton("Command", "PublishLater", new { id = "Command_PublishLater" }) %> Publish Later</label>
|
|
||||||
<%=Html.EditorFor(m => m.Published) %>
|
|
||||||
</fieldset>--%>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<BlogPost>" %>
|
||||||
|
<%@ Import Namespace="Orchard.Blogs.Models"%>
|
||||||
|
<%@ Import Namespace="Orchard.Blogs.Extensions"%>
|
||||||
|
<%@ Import Namespace="Orchard.Blogs.ViewModels"%>
|
||||||
|
<fieldset>
|
||||||
|
<label for="title">Title</label>
|
||||||
|
<span><%=Html.TextBoxFor(m => m.Title, new { id = "title", @class = "large text" })%></span>
|
||||||
|
</fieldset>
|
||||||
|
<fieldset>
|
||||||
|
<label class="sub" for="permalink">Permalink<br /><span><%=Request.Url.ToRootString() %>/<%=Model.Blog.Slug %>/</span></label>
|
||||||
|
<span><%=Html.TextBoxFor(m => m.Slug, new { id = "permalink", @class = "text" })%></span>
|
||||||
|
</fieldset>
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<BlogPost>" %>
|
||||||
|
<%@ Import Namespace="Orchard.Blogs.Models"%>
|
||||||
|
<%@ Import Namespace="Orchard.Blogs.Extensions"%>
|
||||||
|
<%@ Import Namespace="Orchard.Blogs.ViewModels"%>
|
||||||
|
<fieldset>
|
||||||
|
<legend>Publish Settings</legend>
|
||||||
|
<label for="Command_SaveDraft"><%=Html.RadioButton("Command", "SaveDraft", true, new { id = "Command_SaveDraft" }) %> Save Draft</label><br />
|
||||||
|
</fieldset>
|
||||||
|
<%--<fieldset>
|
||||||
|
<label for="Command_PublishNow"><%=Html.RadioButton("Command", "PublishNow", new { id = "Command_PublishNow" }) %> Publish Now</label>
|
||||||
|
</fieldset>
|
||||||
|
<fieldset>
|
||||||
|
<label for="Command_PublishLater"><%=Html.RadioButton("Command", "PublishLater", new { id = "Command_PublishLater" }) %> Publish Later</label>
|
||||||
|
<%=Html.EditorFor(m => m.Published) %>
|
||||||
|
</fieldset>--%>
|
||||||
Reference in New Issue
Block a user