Moved changes to User Shape to core. Revised default HTML for Comments, User Display. Finished CSS styling ThemeMachine - Blogs, Tags, Comments

--HG--
branch : dev
This commit is contained in:
Michael Dorian Bach
2010-10-19 14:19:32 -07:00
parent 15f2238c99
commit 40b771dfa9
8 changed files with 77 additions and 74 deletions

View File

@@ -6,4 +6,4 @@
string bodyHtml = Model.Html.ToString();
var body = new HtmlString(Html.Excerpt(bodyHtml, 200).ToString().Replace(Environment.NewLine, "</p>" + Environment.NewLine + "<p>"));
}
<p>@body @Html.ItemDisplayLink(T("[more]").ToString(), contentItem)</p>
<p>@body @Html.ItemDisplayLink(T("more").ToString(), contentItem)</p>

View File

@@ -1,10 +1,13 @@
@using System.Web.Mvc;
<div class="user-display">
@if (Request.IsAuthenticated) {
@T("Welcome, <strong>{0}</strong>!", WorkContext.CurrentUser.UserName)
@Html.ActionLink(T("Log Off").ToString(), "LogOff", new { Controller = "Account", Area = "Orchard.Users", ReturnUrl = Context.Request.RawUrl })
@:&#124; @Html.ActionLink("Admin", "Index", new {Area = "Dashboard", Controller = "Admin"})
} else {
@Html.ActionLink(T("Log On").ToString(), "LogOn", new { Controller = "Account", Area = "Orchard.Users", ReturnUrl = Context.Request.RawUrl })
}
</div>
<div class="user-display">
@if (Request.IsAuthenticated) {
<span class="welcome">@T("Welcome, <strong>{0}</strong>!", WorkContext.CurrentUser.UserName)</span>
<span class="user-actions">
@Html.ActionLink(T("Sign Out").ToString(), "LogOff", new { Controller = "Account", Area = "Orchard.Users", ReturnUrl = Context.Request.RawUrl })
@Html.ActionLink("Dashboard", "Index", new { Area = "Dashboard", Controller = "Admin" })
</span>
} else {
<span class="user-actions">@Html.ActionLink(T("Sign In").ToString(), "LogOn", new { Controller = "Account", Area = "Orchard.Users", ReturnUrl = Context.Request.RawUrl })</span>
}
</div>

View File

@@ -3,26 +3,30 @@
@using Orchard.Security;
@using Orchard.Utility.Extensions;
@if (Model.ContentPart.Comments.Count > 0) {
<h2 id="comments">@T.Plural("1 Comment", "{0} Comments", (int)Model.ContentPart.Comments.Count)</h2>
Html.RenderPartial("ListOfComments", (IEnumerable<Orchard.Comments.Models.CommentPart>)Model.ContentPart.Comments);
@if (Model.ContentPart.Comments.Count > 0) {
<div id="comments">
<h2 class="comment-count">@T.Plural("1 Comment", "{0} Comments", (int)Model.ContentPart.Comments.Count)</h2>
@{Html.RenderPartial("ListOfComments", (IEnumerable<Orchard.Comments.Models.CommentPart>)Model.ContentPart.Comments);}
</div>
}
@if (Model.CommentsActive == false) {
if (Model.Comments.Count > 0) {
<p>@T("Comments have been disabled for this content.")</p>
<div id="comments">
<p class="comment-disabled">@T("Comments have been disabled for this content.")</p>
</div>
}
}
else if(!Request.IsAuthenticated && !AuthorizedFor(Permissions.AddComment)) {
<h2 id="addacomment">@T("Add a Comment")</h2>
<h2 id="add-comment">@T("Add a Comment")</h2>
<p class="info message">@T("You must {0} to comment.", Html.ActionLink(T("log on").ToString(), "LogOn", new { Controller = "Account", Area = "Orchard.Users", ReturnUrl = string.Format("{0}#addacomment", Context.Request.RawUrl) }))</p>
} else {
using (Html.BeginForm("Create", "Comment", new { area = "Orchard.Comments" }, FormMethod.Post, new { @class = "comment" })) {
using (Html.BeginForm("Create", "Comment", new { area = "Orchard.Comments" }, FormMethod.Post, new { @class = "comment-form" })) {
@Html.ValidationSummary()
if (!Request.IsAuthenticated) {
<fieldset class="who">
<legend id="addacomment">@T("Add a Comment")</legend>
<legend id="add-comment">@T("Add a Comment")</legend>
<ol>
<li>
<label for="Name">@T("Name")</label>
@@ -48,7 +52,7 @@ using (Html.BeginForm("Create", "Comment", new { area = "Orchard.Comments" }, Fo
<ol>
<li>
<label for="CommentText">@T("Comment")</label>
<textarea id="CommentText" rows="10" cols="30" name="CommentText"></textarea>
<textarea id="comment-text" rows="10" cols="30" name="comment-text"></textarea>
</li>
<li>
<input type="submit" class="button" value="@T("Submit Comment")" />

View File

@@ -3,8 +3,8 @@
@{
Html.AddTitleParts(T("Tags").ToString());
Html.AddTitleParts(T("Contents tagged with {0}", Model.TagName).ToString());
Model.List.Classes.Add("taggedPosts");
Model.List.Classes.Add("contentItems");
Model.List.Classes.Add("tagged-posts");
Model.List.Classes.Add("content-items");
}
<h1 class="page-title">@T("Contents tagged with <span>{0}</span>", Model.TagName)</h1>

View File

@@ -9,19 +9,19 @@
<legend>@T("Account Information")</legend>
<ol>
<li>
<label for="userNameOrEmail">@T("Username:")</label>
@Html.TextBox("userNameOrEmail", "", new { autofocus = "autofocus" })
<label for="username-email">@T("Username")</label>
@Html.TextBox("username-email", "", new { autofocus = "autofocus" })
@Html.ValidationMessage("userNameOrEmail")
</li>
<li>
<label for="password">@T("Password:")</label>
<label for="password">@T("Password")</label>
@Html.Password("password")
@Html.ValidationMessage("password")
</li>
<li>
@Html.CheckBox("rememberMe")<label class="forcheckbox" for="rememberMe">@T("Remember me?")</label>
@Html.CheckBox("remember-me")<label class="forcheckbox" for="remember-me">@T("Remember me?")</label>
</li>
<input type="submit" value="@T("Log On")" />
<input type="submit" value="@T("Sign In")" />
</ol>
</fieldset>
}

View File

@@ -207,7 +207,6 @@ pre,code,tt { font: 1em 'andale mono', 'lucida console', monospace; line-height:
}
/* Navigation */
#layout-navigation
{
@@ -308,10 +307,18 @@ nav ul
float:left;
}
/* Secondary
***************************************************************/
/* Blogs */
.blog-description { font-size: 1.3em; }
/* Posts Summary List */
.blog-post .tags { margin-top: 12px; }
.blog-post .tags a { background-color: #dbdbdb; padding: 3px; color: #434343; }
.blog-post .tags a:hover { background-color: #434343; padding: 3px; color: #fff; }
/* Blogs Posts Summary List */
.blog-posts { padding: 0; margin: 0; list-style: none; }
.blog-posts li { padding: 0; margin: 0; }
.blog-posts .blog-post { border-top: 1px solid #dbdbdb; padding: 6px 0 6px 0; }
@@ -326,24 +333,46 @@ nav ul
.blog-posts .blog-post .metadata .published { display: inline; margin: 0 6px 0 0; }
.blog-posts .blog-post .metadata .commentcount { display: inline; }
/* Post Detail */
/* Blogs Post Detail */
.blog-post {}
.blog-post-title {}
.meta {}
/* Secondary
***************************************************************/
/* Comments */
.comment {}
#comments { margin: 24px 0 0 0; padding: 0; }
.comment-form { margin: 24px 0 0 0; padding: 0; }
.comments { margin: 0; padding: 0; list-style: none; }
.comments li { margin: 12px 0 0 0; padding: 12px; border: 1px solid #dbdbdb; }
.comment { margin: 0; padding: 0; }
.comment h4 { font-size: 1.4em; }
.comment .who {}
.comment .what {}
.comment #add-comment {}
.comment #comment-by { font-size: 1.6em; font-weight: normal; margin: 0 0 1.2em 0; border:none; }
.comment #comment-text { width: 33.2em; }
.comment input[type="text"] { width: 32em; }
.comment-form #comment-by { font-size: 1.6em; font-weight: normal; margin: 0 0 1.2em 0; border:none; }
.comment-form #comment-text { width: 33.2em; }
.comment-form input[type="text"] { width: 32em; }
.comment-disabled {}
.comment-count { font-size: 1.6em; }
/* Tag Search */
.tagged-posts {}
.tagged-posts { padding: 0; margin: 0; list-style: none; }
.tagged-posts li { padding: 0; margin: 0; }
.tagged-posts .blog-post { border-top: 1px solid #dbdbdb; padding: 6px 0 6px 0; }
.tagged-posts .blog-post header {}
.tagged-posts .blog-post header h1 { font-size: 1.7em; }
.tagged-posts .blog-post header h1 a { color: #434343; }
.tagged-posts .blog-post header h1 a:hover {}
.tagged-posts .blog-post .tags { margin-top: 12px; }
.tagged-posts .blog-post .tags a { background-color: #dbdbdb; padding: 3px; color: #434343; }
.tagged-posts .blog-post .tags a:hover { background-color: #434343; padding: 3px; color: #fff; }
.tagged-posts .blog-post .metadata { margin: 0 0 12px 0; color: #999; font-size: 1.1em; }
.tagged-posts .blog-post .metadata .published { display: inline; margin: 0 6px 0 0; }
.tagged-posts .blog-post .metadata .commentcount { display: inline; }
@@ -424,6 +453,7 @@ button:focus, .button:focus {
.user-display .welcome {}
.user-display .user-actions {}
.login-form { margin: 24px 0 0 0; }
/* CSS 3 Enhancements
@@ -432,30 +462,6 @@ button:focus, .button:focus {
/* For testing purposes */
article.comment h4 {
font-size:1.4em;
}
article.comment a {
color:#484848;
text-decoration:none;
}
article.comment span.who {
font-weight:600;
font-style:normal;
text-transform:capitalize;
color:#333;
}
article.comment p.text {
margin:.6em 0 2.4em 0;
}
.user-display {
display:inline;
}
/*.aside.third {
border-top:1px solid #dbdbdb;
clear:both;

View File

@@ -1,13 +0,0 @@
@using System.Web.Mvc;
<div class="user-display">
@if (Request.IsAuthenticated) {
<span class="welcome">@T("Welcome, <strong>{0}</strong>!", WorkContext.CurrentUser.UserName)</span>
<span class="user-actions">
@Html.ActionLink(T("Log Off").ToString(), "LogOff", new { Controller = "Account", Area = "Orchard.Users", ReturnUrl = Context.Request.RawUrl })
@Html.ActionLink("Dashboard", "Index", new { Area = "Dashboard", Controller = "Admin" })
</span>
} else {
<span class="user-actions">@Html.ActionLink(T("Login").ToString(), "LogOn", new { Controller = "Account", Area = "Orchard.Users", ReturnUrl = Context.Request.RawUrl })</span>
}
</div>

View File

@@ -67,7 +67,6 @@
<Content Include="Web.config">
<SubType>Designer</SubType>
</Content>
<Content Include="TheThemeMachine\Views\User.cshtml" />
<None Include="TheAdmin\Views\Menu.cshtml" />
</ItemGroup>
<ItemGroup>
@@ -224,6 +223,10 @@
</Content>
<Content Include="TheThemeMachine\Views\Layout.cshtml" />
</ItemGroup>
<ItemGroup>
<Folder Include="TheThemeMachine\Views\Fields\" />
<Folder Include="TheThemeMachine\Views\Parts\" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.