/
add_comment_form.cpt
176 lines (146 loc) · 6.98 KB
/
add_comment_form.cpt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"
xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal"
xmlns:i18n="http://xml.zope.org/namespaces/i18n"
lang="en-US"
metal:use-macro="context/main_template/macros/master"
i18n:domain="ploneboard">
<head>
<metal:block fill-slot="top_slot"
tal:define="dummy python:request.set('disable_border',1);
kdummy python:request.set('text_text_format', 'text/html');" />
</head>
<body>
<div metal:fill-slot="main"
tal:define="errors options/state/getErrors;
view context/@@singlecomment_view;"
i18n:domain="ploneboard">
<h2 i18n:translate="add_comment">Add comment</h2>
<div class="documentDescription"></div>
<tal:defines define="comment view/comment;
quotedBody view/quotedBody"
metal:define-macro="view_comments">
<div class="boardConversation">
<div class="boardComment visualIEFloatFix">
<metal:comment metal:use-macro="context/comment_view/macros/comment" />
</div>
<form name="edit_form"
action=""
method="post"
enctype="multipart/form-data"
tal:define="title_required python:0;
text_required python:1;"
tal:attributes="action template/getId">
<input type="hidden" name="form.submitted" value="1" />
<div metal:define-macro="comment_body_title" tal:omit-tag="">
<div class="commentReplyTitle" tal:omit-tag="title_required">
<div class="field"
id="archetypes-fieldname-title"
tal:define="error_title errors/title|nothing;
Title request/title | nothing;
Title python:Title and (Title.lower().startswith('re:') and Title or 'Re: '+Title) or None;"
tal:attributes="class python:test(error_title, 'field error', 'field')">
<label for="title" i18n:translate="label_title_posting">Title</label>
<span tal:condition="title_required | nothing" class="fieldRequired" title="Required" i18n:translate="label_required" i18n:attributes="title label_required;">(Required)</span>
<div tal:replace="error_title">Validation error output</div>
<div class="formHelp">
</div>
<input type="text"
name="title"
id="title"
value="#"
size="40"
tal:attributes="value Title;"
/>
</div>
</div>
</div>
<div metal:define-macro="comment_body_text" tal:omit-tag="">
<div class="field"
tal:define="error_text errors/text|nothing;
text quotedBody | string:;
text python:request.get('text', text)"
tal:attributes="class python:test(error_text, 'field error', 'field')">
<label for="text" i18n:translate="label_body_text_posting">Body text</label>
<span tal:condition="text_required | nothing" class="fieldRequired" title="Required" i18n:translate="label_required" i18n:attributes="title label_required;">(Required)</span>
<div tal:replace="error_text">Validation Error Comment</div>
<div class="formHelp">
<tal:p condition="python:'url_to_hyperlink' in context.portal_ploneboard.getEnabledTransforms()"
i18n:translate="help_body_text_posting_linkify_enabled">
URLs will be automatically hyperlinked.
</tal:p>
<tal:p i18n:translate="help_body_text_posting">
Basic HTML tags are OK.
</tal:p>
</div>
<tal:editor define="inputname string:text;
formname string:add_comment_form;
inputvalue text;
cooked_inputvalue string:;
tabindex nothing">
<div metal:use-macro="context/wysiwyg_support/macros/wysiwygEditorBox">
The WYSIWYG code
</div>
</tal:editor>
</div>
</div>
<div metal:define-macro="comment_body_attachments"
tal:omit-tag=""
tal:define="attachments context/getMaxAttachments;
maxsize context/getMaxAttachmentSize"
tal:condition="python:attachments and checkPermission('Ploneboard: Add Comment Attachment', context)">
<div class="field"
tal:define="error_files errors/files|nothing"
tal:attributes="class python:test(error_files, 'field error', 'field')">
<label for="text" i18n:translate="label_body_files_posting">Attachments</label>
<div class="formHelp">
<span tal:omit-tag="" i18n:translate="help_body_attachments_posting">
Select a file to upload as an attachment to this comment.
</span>
<span tal:omit-tag="" tal:condition="python:maxsize>0"
i18n:translate="help_body_attachments_maxsize">
The maximum allowed attachment size is
<span tal:omit-tag="" i18n:name="maxsize"
tal:content="maxsize">1024</span>
kilobytes.
</span>
</div>
<div tal:replace="error_files">Validation Error Comment</div>
<div tal:attributes="attachments attachments">
<input name="files:list"
type="file"
size="30"
/><br/>
<a tal:condition="python:attachments>1"
i18n:translate="new_attachment"
href=""
onclick="return AddAttachmentField(this);">
Add another attachment
</a>
</div>
</div>
</div>
<div metal:define-macro="comment_body_buttons" tal:omit-tag="">
<div class="row">
<div class="field">
<input class="context"
type="submit"
name="form.button.Post"
value="Post comment"
i18n:attributes="value"
/>
<input class="destructive"
type="submit"
name="form.button.Cancel"
value="Cancel"
i18n:attributes="value"
/>
</div>
</div>
</div>
</form>
</div>
</tal:defines>
</div>
</body>
</html>