2ecd5e76a5
svn path=/plone.app.discussion/trunk/; revision=27190
139 lines
5.9 KiB
XML
139 lines
5.9 KiB
XML
<tal:block define="userHasReplyPermission view/can_reply;
|
|
isDiscussionAllowed view/is_discussion_allowed;
|
|
replies view/get_replies;
|
|
isAnon view/is_anonymous;
|
|
errors options/state/getErrors|nothing;"
|
|
i18n:domain="plone">
|
|
|
|
<div class="discussion"
|
|
tal:condition="python:replies or (userHasReplyPermission and isDiscussionAllowed) or (isAnon and not userHasReplyPermission and isDiscussionAllowed)">
|
|
<tal:getreplies repeat="reply_dict replies">
|
|
|
|
<div class="comment"
|
|
tal:define="reply reply_dict/comment;
|
|
depth reply_dict/depth|python:0;
|
|
creator reply/Creator;
|
|
author_home_url string:${context/portal_url}/author/${reply/author_username};
|
|
anonymous_creator python:creator in ('Anonymous User', '');"
|
|
tal:attributes="class python:'comment replyTreeLevel'+str(depth);
|
|
style string:margin-left: ${depth}em;
|
|
id string:comment-${reply/id}">
|
|
|
|
|
|
<tal:authorimage tal:condition="not:anonymous_creator">
|
|
<a href="" tal:attributes="href author_home_url">
|
|
<img src="" alt=""
|
|
tal:attributes="src string:${context/portal_url}/portal_memberdata/portraits/${reply/author_username};
|
|
alt reply/creator" />
|
|
</a>
|
|
</tal:authorimage>
|
|
|
|
<h3>
|
|
<a name="comments" tal:attributes="name reply/title">
|
|
<span tal:replace="reply/title">Comment title</span>
|
|
</a>
|
|
</h3>
|
|
|
|
<div class="documentByLine">
|
|
<tal:posted i18n:translate="label_comment_by">Posted by</tal:posted>
|
|
<tal:name condition="not:anonymous_creator">
|
|
<a href=""
|
|
tal:content="creator"
|
|
tal:attributes="href author_home_url">
|
|
Poster Name
|
|
</a>
|
|
</tal:name>
|
|
<tal:name i18n:translate="label_anonymous_user"
|
|
condition="anonymous_creator">Anonymous User</tal:name>
|
|
<tal:at i18n:translate="label_commented_at">at</tal:at>
|
|
<span tal:replace="python:view.format_time(reply.modification_date)">8/23/2001 12:40:44 PM</span>
|
|
</div>
|
|
|
|
<div class="commentBody"
|
|
tal:content="structure reply/text">
|
|
This is the body text of the comment.
|
|
</div>
|
|
|
|
<a href="#" class="reply-to-comment-button" title="reply to this comment"
|
|
tal:attributes="onclick string:createReplyToCommentForm(${reply/id});
|
|
id string:reply-to-comment-${reply/id}-button;
|
|
href string:#comment-${reply/id}">
|
|
<img src="++resource++plone.app.discussion.images/reply.gif" />
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</tal:getreplies>
|
|
</div>
|
|
|
|
<div class="reply">
|
|
<fieldset>
|
|
|
|
<legend i18n:translate="legend_add_comment">Add comment</legend>
|
|
<p i18n:translate="description_add_comment">
|
|
You can add a comment by filling out the form below. Plain text
|
|
formatting.
|
|
</p>
|
|
|
|
<form name="reply"
|
|
action=""
|
|
method="get"
|
|
tal:attributes="action string:${context/absolute_url}/++conversation++default/@@add-comment">
|
|
|
|
<div class="field"
|
|
tal:define="error errors/subject|nothing;"
|
|
tal:attributes="class python: error and 'field error' or 'field'">
|
|
|
|
<label for="subject" i18n:translate="label_subject">Subject</label>
|
|
|
|
<span class="fieldRequired" title="Required"
|
|
i18n:attributes="title title_required;"
|
|
i18n:translate="label_required">(Required)</span>
|
|
|
|
<div tal:content="error">Validation error output</div>
|
|
|
|
<input name="subject"
|
|
id="subject"
|
|
value=""
|
|
size="40"
|
|
tal:attributes="value request/subject|request/title_override|nothing;" />
|
|
|
|
</div>
|
|
|
|
<div class="field"
|
|
tal:define="error errors/body_text|nothing;"
|
|
tal:attributes="class python: error and 'field error' or 'field'">
|
|
|
|
<label for="body_text" i18n:translate="label_comment">Comment</label>
|
|
|
|
<span class="fieldRequired" title="Required"
|
|
i18n:attributes="title title_required;"
|
|
i18n:translate="label_required">(Required)</span>
|
|
|
|
<div tal:content="error">Validation error output</div>
|
|
|
|
<textarea name="body_text"
|
|
id="body_text"
|
|
cols="40"
|
|
rows="8"
|
|
tal:content="request/body_text|request/text_override | nothing"></textarea>
|
|
|
|
</div>
|
|
|
|
<div class="formControls">
|
|
|
|
<input class="context"
|
|
type="submit"
|
|
value="Add Comment"
|
|
name="form.button.AddComment"
|
|
i18n:attributes="value label_add_comment;" />
|
|
|
|
</div>
|
|
|
|
<input type="hidden" name="form.submitted" value="1" />
|
|
|
|
</form>
|
|
</fieldset>
|
|
</div>
|
|
|
|
</tal:block> |