Whole lot more admin UI work mostly around blogs

--HG--
extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4043158
This commit is contained in:
skewed
2009-12-04 05:02:02 +00:00
parent 6d7c45c0a1
commit ee782adc33
18 changed files with 64 additions and 104 deletions

View File

@@ -151,7 +151,7 @@ h3 { font-size:2.1em; } /* 21px */
h4 { font-size:1.8em; } /* 18px */ h4 { font-size:1.8em; } /* 18px */
h5 { font-size:1.6em; } /* 16px */ h5 { font-size:1.6em; } /* 16px */
h6, p, label, input, select, .button, .cancel /* todo: (heskew) need to do something better with cancel */, h6, p, legend, label, input, select, .button, .cancel /* todo: (heskew) need to do something better with cancel */,
.message, th, td { font-size:1.5em; line-height:1.5em; } /* 15px */ .message, th, td { font-size:1.5em; line-height:1.5em; } /* 15px */
p .button, p .button,
td *, .mceLayout td { font-size:inherit; } td *, .mceLayout td { font-size:inherit; }
@@ -304,20 +304,20 @@ span.message {
} }
.confirmation.message { .confirmation.message {
background:#e6f1c9; background:#e6f1c9; /* green */
border:1px solid #cfe493; border:1px solid #cfe493;
} }
.warning.message { .warning.message {
background:#fdf5bc; background:#fdf5bc; /* yellow */
border:1px solid #ffea9b; border:1px solid #ffea9b;
} }
.critical.message { .critical.message {
background:#e68585; background:#e68585; /* red */
border:1px solid #990808; border:1px solid #990808;
color:#fff; color:#fff;
} }
.info.message { .info.message {
background:#fff; background:#fff; /* orange :P */
border:1px dashed #D2D6C6; border:1px dashed #D2D6C6;
} }
.debug.message { .debug.message {
@@ -355,7 +355,6 @@ label input {
/* todo: (heskew) try to get .text on stuff like #PublishLaterDate and .text-box */ /* todo: (heskew) try to get .text on stuff like #PublishLaterDate and .text-box */
select, textarea, input.text, input.text-box, #PublishLaterDate { select, textarea, input.text, input.text-box, #PublishLaterDate {
margin:3px 4px 4px;
padding:2px; padding:2px;
border:1px solid #d2d6c6; border:1px solid #d2d6c6;
color:#5a5b32; color:#5a5b32;
@@ -377,15 +376,15 @@ textarea {
min-height:8em; min-height:8em;
} }
.primary input.large.text, .primary textarea { .primary input.large.text, .primary textarea {
margin:.613% 0 .613% .613%; margin:0;
padding:4px; padding:4px;
width:98.161%; width:98%;
} }
/* todo: (heskew) move editor specific style elsewhere */ /* todo: (heskew) move editor specific style elsewhere */
.primary .mceEditor { .primary .mceEditor {
display:block; display:block;
margin:.613% 0 .613% .613%; margin:0;
} }
.secondary fieldset { .secondary fieldset {
margin:.446% 0 .446% .446%; margin:.446% 0 .446% .446%;

View File

@@ -178,11 +178,10 @@
<Content Include="Content\Site3.css" /> <Content Include="Content\Site3.css" />
<Content Include="Views\Shared\AdminHead.aspx" /> <Content Include="Views\Shared\AdminHead.aspx" />
<Content Include="Views\Shared\AdminFoot.aspx" /> <Content Include="Views\Shared\AdminFoot.aspx" />
<Content Include="Views\Admin\Messages.ascx" /> <Content Include="Views\Shared\Messages.ascx" />
<Content Include="Views\Shared\ExtraUserControl.ascx" /> <Content Include="Views\Shared\ExtraUserControl.ascx" />
<Content Include="Views\Shared\Footer.ascx" /> <Content Include="Views\Shared\Footer.ascx" />
<Content Include="Views\Shared\Header.ascx" /> <Content Include="Views\Shared\Header.ascx" />
<Content Include="Views\Shared\Messages.ascx" />
<Content Include="Views\Shared\Navigation.ascx" /> <Content Include="Views\Shared\Navigation.ascx" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@@ -70,7 +70,11 @@ namespace Orchard.Blogs.Controllers {
if (blog == null) if (blog == null)
return new NotFoundResult(); return new NotFoundResult();
return View(new CreateBlogPostViewModel { Blog = blog, ItemView = _contentManager.GetEditorViewModel(_contentManager.New("blogpost"), null) }); var model = new CreateBlogPostViewModel {
Blog = blog,
ItemView = _contentManager.GetEditorViewModel(_contentManager.New("blogpost"), null)
};
return View(model);
} }
[HttpPost] [HttpPost]

View File

@@ -123,7 +123,6 @@
<Content Include="Views\Blog\EditorTemplates\CreateBlogViewModel.ascx" /> <Content Include="Views\Blog\EditorTemplates\CreateBlogViewModel.ascx" />
<Content Include="Views\Blog\Item.aspx" /> <Content Include="Views\Blog\Item.aspx" />
<Content Include="Views\Shared\DisplayTemplates\BlogPostPreviewForAdmin.ascx" /> <Content Include="Views\Shared\DisplayTemplates\BlogPostPreviewForAdmin.ascx" />
<Content Include="Views\Shared\Messages.ascx" />
<Content Include="Web.config" /> <Content Include="Web.config" />
<Content Include="Views\Web.config" /> <Content Include="Views\Web.config" />
</ItemGroup> </ItemGroup>

View File

@@ -1,11 +1,11 @@
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<BlogEditViewModel>" %> <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<BlogEditViewModel>" %>
<%@ Import Namespace="Orchard.Blogs.ViewModels"%> <%@ Import Namespace="Orchard.Blogs.ViewModels"%>
<fieldset> <fieldset>
<label for="Name">Blog Name:</label> <label for="Name">Blog Name</label>
<%=Html.EditorFor(m => m.Name) %> <%=Html.EditorFor(m => m.Name) %>
</fieldset> </fieldset>
<%=Html.EditorFor(m => m.Slug, "BlogPermalink") %> <%=Html.EditorFor(m => m.Slug, "BlogPermalink") %>
<fieldset> <fieldset>
<label for="Description">Description:</label> <label for="Description">Description</label>
<%=Html.TextAreaFor(m => m.Description, 5, 60, null) %> <%=Html.TextAreaFor(m => m.Description, 5, 60, null) %>
</fieldset> </fieldset>

View File

@@ -2,5 +2,5 @@
<%@ Import Namespace="Orchard.Blogs.Extensions"%> <%@ Import Namespace="Orchard.Blogs.Extensions"%>
<fieldset> <fieldset>
<label class="sub" for="permalink">Permalink: <span><%=Request.Url.ToRootString() %>/</span></label> <label class="sub" for="permalink">Permalink: <span><%=Request.Url.ToRootString() %>/</span></label>
<span><%=Html.TextBox("", Model, new { id = "permalink", @class = "text" })%> <span> &laquo; How to write a permalink. &raquo; </span></span> <span><%=Html.TextBox("", Model, new { id = "permalink", @class = "text" })%></span>
</fieldset> </fieldset>

View File

@@ -1,11 +1,11 @@
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<CreateBlogViewModel>" %> <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<CreateBlogViewModel>" %>
<%@ Import Namespace="Orchard.Blogs.ViewModels"%> <%@ Import Namespace="Orchard.Blogs.ViewModels"%>
<fieldset> <fieldset>
<label for="">Blog Name:</label> <label for="Name">Blog Name</label>
<%=Html.EditorFor(m => m.Name) %> <%=Html.EditorFor(m => m.Name) %>
</fieldset> </fieldset>
<%=Html.EditorFor(m => m.Slug, "BlogPermalink") %> <%=Html.EditorFor(m => m.Slug, "BlogPermalink") %>
<fieldset> <fieldset>
<label for="">Description:</label> <label for="Description">Description</label>
<%=Html.TextAreaFor(m => m.Description, 5, 60, null) %> <%=Html.TextAreaFor(m => m.Description, 5, 60, null) %>
</fieldset> </fieldset>

View File

@@ -8,13 +8,5 @@
<%using (Html.BeginForm()) { %> <%using (Html.BeginForm()) { %>
<%= Html.ValidationSummary() %> <%= Html.ValidationSummary() %>
<%= Html.EditorForModel() %> <%= Html.EditorForModel() %>
<%foreach (var editor in Model.ItemView.Editors) { %>
<%-- TODO: why is Body in editors? --%>
<%-- TODO: because any content type using the body editor doesn't need
to re-implement the rich editor, media extensions, format filter chain selection, etc --%>
<% if (!String.Equals(editor.Prefix, "Body")) { %>
<%=Html.EditorFor(m=>editor.Model, editor.TemplateName, editor.Prefix) %>
<% } %>
<%} %>
<% } %> <% } %>
<% Html.Include("AdminFoot"); %> <% Html.Include("AdminFoot"); %>

View File

@@ -3,20 +3,19 @@
<%@ Import Namespace="Orchard.Blogs.ViewModels"%> <%@ Import Namespace="Orchard.Blogs.ViewModels"%>
<div class="sections"> <div class="sections">
<div class="primary"> <div class="primary">
<h3>Content</h3>
<%-- todo: (heskew) thin out the fieldsets if they become overkill --%> <%-- todo: (heskew) thin out the fieldsets if they become overkill --%>
<fieldset> <fieldset>
<label for="title">Title:</label> <label for="title">Title</label>
<span><%=Html.TextBoxFor(m => m.Title, new { id = "title", @class = "large text" })%></span> <span><%=Html.TextBoxFor(m => m.Title, new { id = "title", @class = "large text" })%></span>
</fieldset> </fieldset>
<fieldset> <fieldset>
<label class="sub" for="permalink">Permalink: <span><%=Request.Url.ToRootString() %>/<%=Model.Blog.Slug %>/</span></label> <label class="sub" for="permalink">Permalink: <span><%=Request.Url.ToRootString() %>/<%=Model.Blog.Slug %>/</span></label>
<span><%=Html.TextBoxFor(m => m.Slug, new { id = "permalink", @class = "text" })%> <span> &laquo; How to write a permalink. &raquo; </span></span> <span><%=Html.TextBoxFor(m => m.Slug, new { id = "permalink", @class = "text" })%></span>
</fieldset> </fieldset>
<fieldset> <fieldset>
<%--<label for="body">Excerpt:</label> <%--<label for="body">Excerpt</label>
<span>[still needed]</span>--%> <span>[still needed]</span>--%>
<label for="body">Body:</label> <label for="body">Body</label>
<span><%=Html.TextAreaFor(m => m.Body, new { id = "body", @class = "html" })%></span> <span><%=Html.TextAreaFor(m => m.Body, new { id = "body", @class = "html" })%></span>
</fieldset> </fieldset>
<% foreach (var e in Model.ItemView.Editors) { <% foreach (var e in Model.ItemView.Editors) {
@@ -30,7 +29,11 @@
} %> } %>
</div> </div>
<div class="secondary"> <div class="secondary">
<h3>Publish Settings</h3> <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> <%--<fieldset>
<label for="Command_PublishNow"><%=Html.RadioButton("Command", "PublishNow", new { id = "Command_PublishNow" }) %> Publish Now</label> <label for="Command_PublishNow"><%=Html.RadioButton("Command", "PublishNow", new { id = "Command_PublishNow" }) %> Publish Now</label>
</fieldset> </fieldset>
@@ -38,11 +41,5 @@
<label for="Command_PublishLater"><%=Html.RadioButton("Command", "PublishLater", new { id = "Command_PublishLater" }) %> Publish Later</label> <label for="Command_PublishLater"><%=Html.RadioButton("Command", "PublishLater", new { id = "Command_PublishLater" }) %> Publish Later</label>
<%=Html.EditorFor(m => m.Published) %> <%=Html.EditorFor(m => m.Published) %>
</fieldset>--%> </fieldset>--%>
<fieldset>
<label for="Command_SaveDraft"><%=Html.RadioButton("Command", "SaveDraft", true, new { id = "Command_SaveDraft" }) %> Save Draft</label>
</fieldset>
<fieldset>
<input class="button" type="submit" name="submit.Save" value="Save"/>
</fieldset>
</div> </div>
</div> </div>

View File

@@ -1,26 +1,39 @@
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<CreateBlogPostViewModel>" %> <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<CreateBlogPostViewModel>" %>
<%@ Import Namespace="Orchard.Blogs.Extensions"%>
<%@ Import Namespace="Orchard.Blogs.ViewModels"%> <%@ Import Namespace="Orchard.Blogs.ViewModels"%>
<div class="sections"> <div class="sections">
<div class="primary"> <div class="primary">
<h3>Content</h3>
<%-- todo: (heskew) thin out the fieldsets if they become overkill --%> <%-- todo: (heskew) thin out the fieldsets if they become overkill --%>
<fieldset> <fieldset>
<label for="title">Title:</label> <label for="title">Title</label>
<span><%=Html.TextBoxFor(m => m.Title, new { id = "title", @class = "text" })%></span> <span><%=Html.TextBoxFor(m => m.Title, new { id = "title", @class = "large text" })%></span>
</fieldset> </fieldset>
<fieldset> <fieldset>
<label class="sub" for="permalink">Permalink: <span>http://localhost/<%=Model.Blog.Slug %>/</span></label> <label class="sub" for="permalink">Permalink: <span><%=Request.Url.ToRootString() %>/<%=Model.Blog.Slug %>/</span></label>
<span><%=Html.TextBoxFor(m => m.Slug, new { id = "permalink", @class = "text" })%> <span> &laquo; How to write a permalink. &raquo; </span></span> <span><%=Html.TextBoxFor(m => m.Slug, new { id = "permalink", @class = "text" })%></span>
</fieldset> </fieldset>
<fieldset> <fieldset>
<%--<label for="body">Excerpt:</label> <%--<label for="body">Excerpt</label>
<span>[still needed]</span>--%> <span>[still needed]</span>--%>
<label for="body">Body:</label> <label for="body">Body</label>
<span><%=Html.TextAreaFor(m => m.Body, new { id = "body", @class = "html" })%></span> <span><%=Html.TextAreaFor(m => m.Body, new { id = "body", @class = "html" })%></span>
</fieldset> </fieldset>
<% foreach (var e in Model.ItemView.Editors) {
var editor = e;
// TODO: why is Body in editors?
// TODO: because any content type using the body editor doesn't need
// to re-implement the rich editor, media extensions, format filter chain selection, etc
if (!String.Equals(editor.Prefix, "Body")) {
%><%=Html.EditorFor(m=>editor.Model, editor.TemplateName, editor.Prefix) %>
<% }
} %>
</div> </div>
<div class="secondary"> <div class="secondary">
<h3>Publish Settings</h3> <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> <%--<fieldset>
<label for="Command_PublishNow"><%=Html.RadioButton("Command", "PublishNow", new { id = "Command_PublishNow" }) %> Publish Now</label> <label for="Command_PublishNow"><%=Html.RadioButton("Command", "PublishNow", new { id = "Command_PublishNow" }) %> Publish Now</label>
</fieldset> </fieldset>
@@ -28,11 +41,6 @@
<label for="Command_PublishLater"><%=Html.RadioButton("Command", "PublishLater", new { id = "Command_PublishLater" }) %> Publish Later</label> <label for="Command_PublishLater"><%=Html.RadioButton("Command", "PublishLater", new { id = "Command_PublishLater" }) %> Publish Later</label>
<%=Html.EditorFor(m => m.Published) %> <%=Html.EditorFor(m => m.Published) %>
</fieldset>--%> </fieldset>--%>
<fieldset>
<label for="Command_SaveDraft"><%=Html.RadioButton("Command", "SaveDraft", true, new { id = "Command_SaveDraft" }) %> Save Draft</label></li>
</fieldset>
<fieldset>
<input class="button" type="submit" name="submit.Save" value="Save"/>
</fieldset>
</div> </div>
</div> </div>

View File

@@ -1,17 +0,0 @@
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<IEnumerable<NotifyEntry>>" %>
<%@ Import Namespace="Orchard.UI.Notify"%>
<script runat="server">
string CssClassName(NotifyType type) {
switch(type) {
case NotifyType.Error:
return "critical";
case NotifyType.Warning:
return "warning";
}
return "informational";
}</script>
<% foreach (var item in Model) { %>
<div class="<%=CssClassName(item.Type) %> message"><%=Html.Encode(item.Message) %></div>
<% } %>

View File

@@ -1,18 +1,14 @@
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<HasComments>" %> <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<HasComments>" %>
<%@ Import Namespace="Orchard.Comments.Models"%> <%@ Import Namespace="Orchard.Comments.Models"%>
<% if (Model.ContentItem.Id != 0) { %> <fieldset>
<h3>Comments</h3> <legend>Comments<% if (Model.ContentItem.Id != 0) { %>: <% var commentCount = Model.Comments.Count(); %>
<div class="meta">
<% var commentCount = Model.Comments.Count(); %>
<%=Html.ActionLink( <%=Html.ActionLink(
string.Format("{0} comment{1}", commentCount, commentCount == 1 ? "" : "s"), string.Format("{0} comment{1}", commentCount, commentCount == 1 ? "" : "s"),
"Details", "Details",
new { Area = "Orchard.Comments", Controller = "Admin", id = Model.ContentItem.Id, returnUrl = Context.Request.Url } new { Area = "Orchard.Comments", Controller = "Admin", id = Model.ContentItem.Id, returnUrl = Context.Request.Url }
) %> ) %>
/ <a href="#">0 pending</a> - <a href="#">0 pending</a><% } %></legend>
</div> <label for="Closed"><%=Html.EditorFor(hc => hc.Closed) %> Close comments</label>
<fieldset>
<label for="Closed"><%=Html.CheckBox("Allow comments", Model.Closed, new { id = "Closed" }) %> Close comments</label>
</fieldset> </fieldset>
<%-- <%--
todo: (heskew) would be better to have a ↑ checkbox ↑ instead of a ↓ button ↓ todo: (heskew) would be better to have a ↑ checkbox ↑ instead of a ↓ button ↓
@@ -34,4 +30,3 @@ todo: (heskew) shouldn't have comments when editing a content item. besides bein
</li> </li>
<% } %> <% } %>
</ol>--%> </ol>--%>
<% } %>

View File

@@ -1,5 +1,7 @@
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<ShowDebugLink>" %> <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<ShowDebugLink>" %>
<%@ Import Namespace="Orchard.DevTools.Models" %> <%@ Import Namespace="Orchard.DevTools.Models" %>
<% if (Model.ContentItem.Id > 0) { %>
<div class="debug message"> <div class="debug message">
DevTools: editing DevTools: editing
<%= Html.ActionLink(Model.ContentItem.ContentType + " #" + Model.ContentItem.Id, "details", "content", new { area = "Orchard.DevTools", Model.ContentItem.Id }, new { })%></div> <%= Html.ActionLink(Model.ContentItem.ContentType + " #" + Model.ContentItem.Id, "details", "content", new { area = "Orchard.DevTools", Model.ContentItem.Id }, new { })%></div>
<% } %>

View File

@@ -40,7 +40,7 @@ namespace Orchard.Tags.Models {
if (context.ContentItem.Has<HasTags>() == false) { if (context.ContentItem.Has<HasTags>() == false) {
return; return;
} }
context.AddEditor(new TemplateViewModel(context.ContentItem.Get<HasTags>())); context.AddEditor(new TemplateViewModel(context.ContentItem.Get<HasTags>()) { Position = "0" });
} }
protected override void UpdateEditorViewModel(UpdateEditorViewModelContext context) { protected override void UpdateEditorViewModel(UpdateEditorViewModelContext context) {

View File

@@ -1,9 +1,8 @@
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<HasTags>" %> <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<HasTags>" %>
<%@ Import Namespace="Orchard.Mvc.Html"%> <%@ Import Namespace="Orchard.Mvc.Html"%>
<%@ Import Namespace="Orchard.Tags.Models"%> <%@ Import Namespace="Orchard.Tags.Models"%>
<h3>Tags</h3>
<formset> <formset>
<label for="Tags">Tag names:</label> <label for="Tags">Tags</label>
<input class="large text" id="Tags" name="Tags" type="text" value="<%=string.Join(", ", Model.CurrentTags.Select((t, i) => t.TagName).ToArray()) %>" /> <input class="large text" id="Tags" name="Tags" type="text" value="<%=string.Join(", ", Model.CurrentTags.Select((t, i) => t.TagName).ToArray()) %>" />
</formset> </formset>
<%--<% Html.BeginForm("Update", "Home", new { area = "Orchard.Tags" }); %>--%> <%--<% Html.BeginForm("Update", "Home", new { area = "Orchard.Tags" }); %>--%>

View File

@@ -1,17 +0,0 @@
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<IEnumerable<NotifyEntry>>" %>
<%@ Import Namespace="Orchard.UI.Notify"%>
<script runat="server">
string CssClassName(NotifyType type) {
switch(type) {
case NotifyType.Error:
return "critical";
case NotifyType.Warning:
return "warning";
}
return "informational";
}</script>
<% foreach (var item in Model) { %>
<div class="<%=CssClassName(item.Type) %> message"><%=Html.Encode(item.Message) %></div>
<% } %>

View File

@@ -28,7 +28,7 @@ todo: (heskew) rework how/what pages are assembled when we get into theming --%>
theme_advanced_buttons2: "", theme_advanced_buttons2: "",
theme_advanced_buttons3: "" theme_advanced_buttons3: ""
}); });
</script> </script>
</head> </head>
<body> <body>
<div id="header" role="banner"> <div id="header" role="banner">

View File

@@ -5,13 +5,13 @@
string CssClassName(NotifyType type) { string CssClassName(NotifyType type) {
switch(type) { switch(type) {
case NotifyType.Error: case NotifyType.Error:
return "validation-summary-errors"; return "critical";
case NotifyType.Warning: case NotifyType.Warning:
return "validation-summary-errors"; return "warning";
} }
return "validation-summary-errors"; return "info";
}</script> }</script>
<%if (Model != null){ foreach (var item in Model) { %> <% foreach (var item in Model) { %>
<div class="<%=CssClassName(item.Type) %> message"><%=Html.Encode(item.Message) %></div> <div class="<%=CssClassName(item.Type) %> message"><%=Html.Encode(item.Message) %></div>
<% }} %> <% } %>