Show More
@@ -27,6 +27,7 b' class NeboardForm(forms.Form):' | |||
|
27 | 27 | def as_p(self): |
|
28 | 28 | "Returns this form rendered as HTML <p>s." |
|
29 | 29 | return self._html_output( |
|
30 | # TODO Do not show hidden rows in the list here | |
|
30 | 31 | normal_row='<div class="form-row">' |
|
31 | 32 | '<div class="form-label">' |
|
32 | 33 | '%(label)s' |
@@ -36,12 +37,11 b' class NeboardForm(forms.Form):' | |||
|
36 | 37 | '</div>' |
|
37 | 38 | '%(help_text)s' |
|
38 | 39 | '</div>', |
|
39 | error_row='<div class="form-errors">%s</div>', | |
|
40 | error_row='<div class="form-row"><div class="form-label"></div><div class="form-errors">%s</div></div>', | |
|
40 | 41 | row_ender='</p>', |
|
41 | 42 | help_text_html=' <span class="helptext">%s</span>', |
|
42 | 43 | errors_on_separate_row=True) |
|
43 | 44 | |
|
44 | ||
|
45 | 45 | class PostForm(NeboardForm): |
|
46 | 46 | |
|
47 | 47 | title = forms.CharField(max_length=TITLE_MAX_LENGTH, required=False, |
@@ -203,63 +203,21 b'' | |||
|
203 | 203 | {% trans 'No threads exist. Create the first one!' %}</div> |
|
204 | 204 |
|
|
205 | 205 | |
|
206 | <form enctype="multipart/form-data" method="post">{% csrf_token %} | |
|
207 | 206 | <div class="post-form-w"> |
|
208 | ||
|
209 | <div class="form-title">{% trans "Create new thread" %}</div> | |
|
210 | 207 | <div class="post-form"> |
|
211 | <div class="form-row"> | |
|
212 | <div class="form-label">{% trans 'Title' %}</div> | |
|
213 | <div class="form-input">{{ form.title }}</div> | |
|
214 | <div class="form-errors">{{ form.title.errors }}</div> | |
|
215 | </div> | |
|
216 | <div class="form-row"> | |
|
217 | <div class="form-label">{% trans 'Formatting' %}</div> | |
|
218 | <div class="form-input" id="mark_panel"> | |
|
219 | <span class="mark_btn" id="quote"><span class="quote">>{% trans 'quote' %}</span></span> | |
|
220 | <span class="mark_btn" id="italic"><i>{% trans 'italic' %}</i></span> | |
|
221 | <span class="mark_btn" id="bold"><b>{% trans 'bold' %}</b></span> | |
|
222 | <span class="mark_btn" id="spoiler"><span class="spoiler">{% trans 'spoiler' %}</span></span> | |
|
223 | <span class="mark_btn" id="comment"><span class="comment">// {% trans 'comment' %}</span></span> | |
|
224 | </div> | |
|
225 | </div> | |
|
226 | <div class="form-row"> | |
|
227 | <div class="form-label">{% trans 'Text' %}</div> | |
|
228 | <div class="form-input">{{ form.text }}</div> | |
|
229 | <div class="form-errors">{{ form.text.errors }}</div> | |
|
230 | </div> | |
|
231 | <div class="form-row"> | |
|
232 | <div class="form-label">{% trans 'Image' %}</div> | |
|
233 | <div class="form-input">{{ form.image }}</div> | |
|
234 | <div class="form-errors">{{ form.image.errors }}</div> | |
|
235 | </div> | |
|
236 | <div class="form-row"> | |
|
237 | <div class="form-label">{% trans 'Tags' %}</div> | |
|
238 | <div class="form-input">{{ form.tags }}</div> | |
|
239 | <div class="form-errors">{{ form.tags.errors }}</div> | |
|
240 | </div> | |
|
241 | <div class="form-row form-email"> | |
|
242 | <div class="form-label">{% trans 'e-mail' %}</div> | |
|
243 | <div class="form-input">{{ form.email }}</div> | |
|
244 | <div class="form-errors">{{ form.email.errors }}</div> | |
|
245 | </div> | |
|
246 | <div class="form-row"> | |
|
247 | {{ form.captcha }} | |
|
248 | <div class="form-errors">{{ form.captcha.errors }}</div> | |
|
249 | </div> | |
|
250 | <div class="form-row"> | |
|
251 | <div class="form-errors">{{ form.other.errors }}</div> | |
|
252 | </div> | |
|
253 | </div> | |
|
208 | <div class="form-title">{% trans "Create new thread" %}</div> | |
|
209 | <form enctype="multipart/form-data" method="post">{% csrf_token %} | |
|
210 | {{ form.as_p }} | |
|
254 | 211 | <div class="form-submit"> |
|
255 | 212 | <input type="submit" value="{% trans "Post" %}"/></div> |
|
256 | 213 | <div> |
|
214 | </form> | |
|
257 | 215 | {% trans 'Tags must be delimited by spaces. Text or image is required.' %} |
|
258 | 216 | </div> |
|
259 | 217 | <div><a href="{% url "staticpage" name="help" %}"> |
|
260 | 218 | {% trans 'Text syntax' %}</a></div> |
|
261 | 219 | </div> |
|
262 |
</ |
|
|
220 | </div> | |
|
263 | 221 | |
|
264 | 222 | {% endblock %} |
|
265 | 223 |
@@ -93,56 +93,20 b'' | |||
|
93 | 93 | </div> |
|
94 | 94 | {% endcache %} |
|
95 | 95 | |
|
96 | <form id="form" enctype="multipart/form-data" method="post" | |
|
97 | >{% csrf_token %} | |
|
98 | 96 |
|
|
99 | 97 |
|
|
100 | 98 |
|
|
101 | <div class="form-row"> | |
|
102 | <div class="form-label">{% trans 'Title' %}</div> | |
|
103 | <div class="form-input">{{ form.title }}</div> | |
|
104 | <div class="form-errors">{{ form.title.errors }}</div> | |
|
105 | </div> | |
|
106 | <div class="form-row"> | |
|
107 | <div class="form-label">{% trans 'Formatting' %}</div> | |
|
108 | <div class="form-input" id="mark_panel"> | |
|
109 | <span class="mark_btn" id="quote"><span class="quote">>{% trans 'quote' %}</span></span> | |
|
110 | <span class="mark_btn" id="italic"><i>{% trans 'italic' %}</i></span> | |
|
111 | <span class="mark_btn" id="bold"><b>{% trans 'bold' %}</b></span> | |
|
112 | <span class="mark_btn" id="spoiler"><span class="spoiler">{% trans 'spoiler' %}</span></span> | |
|
113 | <span class="mark_btn" id="comment"><span class="comment">// {% trans 'comment' %}</span></span> | |
|
114 | </div> | |
|
115 | </div> | |
|
116 | <div class="form-row"> | |
|
117 | <div class="form-label">{% trans 'Text' %}</div> | |
|
118 | <div class="form-input">{{ form.text }}</div> | |
|
119 | <div class="form-errors">{{ form.text.errors }}</div> | |
|
99 | <form id="form" enctype="multipart/form-data" method="post" | |
|
100 | >{% csrf_token %} | |
|
101 | {{ form.as_p }} | |
|
102 | <div class="form-submit"> | |
|
103 | <input type="submit" value="{% trans "Post" %}"/> | |
|
120 | 104 |
|
|
121 | <div class="form-row"> | |
|
122 | <div class="form-label">{% trans 'Image' %}</div> | |
|
123 | <div class="form-input">{{ form.image }}</div> | |
|
124 | <div class="form-errors">{{ form.image.errors }}</div> | |
|
125 | </div> | |
|
126 | <div class="form-row form-email"> | |
|
127 | <div class="form-label">{% trans 'e-mail' %}</div> | |
|
128 | <div class="form-input">{{ form.email }}</div> | |
|
129 | <div class="form-errors">{{ form.email.errors }}</div> | |
|
130 | </div> | |
|
131 | <div class="form-row"> | |
|
132 | {{ form.captcha }} | |
|
133 | <div class="form-errors">{{ form.captcha.errors }}</div> | |
|
134 | </div> | |
|
135 | <div class="form-row"> | |
|
136 | <div class="form-errors">{{ form.other.errors }}</div> | |
|
137 | </div> | |
|
138 | </div> | |
|
139 | ||
|
140 | <div class="form-submit"><input type="submit" | |
|
141 | value="{% trans "Post" %}"/></div> | |
|
105 | </form> | |
|
142 | 106 |
|
|
143 | 107 |
|
|
144 | 108 | </div> |
|
145 |
</ |
|
|
109 | </div> | |
|
146 | 110 | |
|
147 | 111 | {% endspaceless %} |
|
148 | 112 | {% endblock %} |
General Comments 0
You need to be logged in to leave comments.
Login now