Apply the comment viewlet template and styles to the new title-less comments. This might require integrators to apply their custom templates and styles.

svn path=/plone.app.discussion/trunk/; revision=40433
This commit is contained in:
Timo Stollenwerk 2010-09-29 08:13:54 +00:00
parent 8d00463502
commit 689fd26c12
3 changed files with 96 additions and 82 deletions

View File

@ -4,6 +4,10 @@ Changelog
1.0b8 (unreleased) 1.0b8 (unreleased)
------------------ ------------------
- Apply the comment viewlet template and styles to the new title-less comments.
This might require integrators to apply their custom templates and styles.
[timo]
- Remove title field from the comment form and replace it with an auto-generated - Remove title field from the comment form and replace it with an auto-generated
title ("John Doe on Welcome to Plone"). title ("John Doe on Welcome to Plone").
[timo] [timo]

View File

@ -46,84 +46,83 @@
<img src="defaultUser.gif" <img src="defaultUser.gif"
alt="" alt=""
border="0" border="0"
width="75" height="32"
tal:attributes="src portrait_url; tal:attributes="src portrait_url;
alt reply/Creator" /> alt reply/Creator" />
</a> </a>
<img src="defaultUser.gif" <img src="defaultUser.gif"
alt="" alt=""
border="0" border="0"
width="75" height="32"
tal:condition="not: has_author_link" tal:condition="not: has_author_link"
tal:attributes="src portrait_url; tal:attributes="src portrait_url;
alt reply/Creator" /> alt reply/Creator" />
</div> </div>
<h3 class="commentTitle"
tal:content="reply/Title" />
<div class="documentByLine" i18n:domain="plone.app.discussion"> <div class="documentByLine" i18n:domain="plone.app.discussion">
<tal:posted i18n:translate="label_comment_by">Posted by</tal:posted> <tal:name>
<tal:name> <a href=""
<a href="" tal:condition="has_author_link"
tal:condition="has_author_link" tal:content="reply/Creator"
tal:content="reply/Creator" tal:attributes="href author_home_url">
tal:attributes="href author_home_url"> Poster Name
Poster Name </a>
</a> <span tal:condition="not: has_author_link"
<span tal:condition="not: has_author_link" tal:replace="reply/Creator" />
tal:replace="reply/Creator" /> <span tal:condition="not: reply/Creator">Anonymous</span>
</tal:name> </tal:name>
<tal:name condition="python:reply.Creator() in ('Anonymous User', '', None)" <tal:posted i18n:translate="label_says">says:</tal:posted>
tal:content="reply/author_name">Anonymous User</tal:name> <div class="commentDate"
<tal:at i18n:translate="label_commented_at">at</tal:at> tal:content="python:view.format_time(reply.modification_date)">
<span tal:replace="python:view.format_time(reply.modification_date)">8/23/2001 12:40:44 PM</span> 8/23/2001 12:40:44 PM
</div>
</div> </div>
<div class="commentBody" <div class="commentBody">
tal:content="structure python:view.cook(reply.getText())" />
<span tal:replace="structure python:view.cook(reply.getText())" />
<div class="commentActions">
<button class="context reply-to-comment-button hide allowMultiSubmit" <div class="commentActions">
tal:condition="python:isDiscussionAllowed and (isAnon and isAnonymousDiscussionAllowed or userHasReplyPermission)" <form name="delete"
i18n:translate="label_reply"> action=""
Reply method="post"
</button> style="display: inline;"
tal:condition="canManage"
<form name="delete" tal:attributes="action string:${reply/absolute_url}/@@moderate-delete-comment">
action="" <input name="form.button.DeleteComment"
method="post" class="destructive"
style="display: inline;" type="submit"
tal:condition="canManage" value="Delete"
tal:attributes="action string:${reply/absolute_url}/@@moderate-delete-comment"> i18n:attributes="value label_delete;"
<input name="form.button.DeleteComment" />
class="destructive" </form>
type="submit"
value="Delete" <!-- Workflow actions (e.g. 'publish') -->
i18n:attributes="value label_delete;" <form name=""
/> action=""
</form> method="get"
style="display: inline;"
<!-- Workflow actions (e.g. 'publish') --> tal:condition="canManage"
<form name="" tal:repeat="action reply_dict/actions|nothing"
action="" tal:attributes="action string:${reply/absolute_url}/@@moderate-publish-comment;
method="get" name action/id">
style="display: inline;" <input type="hidden" name="workflow_action" tal:attributes="value action/id" />
tal:condition="canManage" <input name="form.button.PublishComment"
tal:repeat="action reply_dict/actions|nothing" class="context"
tal:attributes="action string:${reply/absolute_url}/@@moderate-publish-comment; type="submit"
name action/id"> tal:attributes="value action/title"
<input type="hidden" name="workflow_action" tal:attributes="value action/id" /> i18n:attributes="value"
<input name="form.button.PublishComment" />
class="context" </form>
type="submit" </div>
tal:attributes="value action/title"
i18n:attributes="value"
/>
</form>
</div> </div>
<button class="context reply-to-comment-button hide allowMultiSubmit"
tal:condition="python:isDiscussionAllowed and (isAnon and isAnonymousDiscussionAllowed or userHasReplyPermission)"
i18n:translate="label_reply">
Reply
</button>
</div> </div>
</tal:getreplies> </tal:getreplies>

View File

@ -17,13 +17,12 @@
} }
.comment { .comment {
min-height: 100px;
} }
.commentImage { .commentImage {
width: 90px;
float: left; float: left;
margin-right: -90px; width: 2.5em;
height: 3.5em;
} }
.commentImage a:link { .commentImage a:link {
@ -32,24 +31,36 @@
} }
.commentImage img { .commentImage img {
margin-right: 1em;
}
.commentDate {
display: block;
font-size: 85%;
line-height: 1.5em;
padding-top: 0.5em;
color: #76797C;
} }
.commentBody { .commentBody {
clear: both;
margin: 1em 0; margin: 1em 0;
overflow: auto;
} }
.showCommenterImage h3, .commentBody p {
.showCommenterImage .documentByLine, float: left;
.showCommenterImage .commentBody, }
.showCommenterImage .commentActions,
.showCommenterImage .reply { .discussion .documentByLine {
/* The showCommenterImage CSS class is only set if showing the float: left;
* commenters image is enabled. margin-left: 0;
*/
margin-left: 90px;
} }
.commentActions {
float: right;
text-align: right;
}
/* Reply Form /* Reply Form
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
@ -60,10 +71,10 @@
} }
.reply .text-widget { .reply .text-widget {
/* Make sure the input fields are always below the label. This sometimes /* Make sure the input fields are always below the label. This sometimes
* break when the reply form is copied from the main comment form. * break when the reply form is copied from the main comment form.
*/ */
display: block; display: block;
} }
.reply-to-comment-button { .reply-to-comment-button {
@ -94,7 +105,7 @@
.comment-publish-button { .comment-publish-button {
float: left; float: left;
margin-right: 0.5em; margin-right: 0.5em;
} }
.comment-delete-button { .comment-delete-button {