| 1 |
{% load i18n %} |
|---|
| 2 |
{% load sph_extras %} |
|---|
| 3 |
{% load sphboard_extras %} |
|---|
| 4 |
{% if bbcodewysiwyg %} |
|---|
| 5 |
<link rel="stylesheet" href="{{ MEDIA_URL }}sphene/sphboard/styles/editor.css" /> |
|---|
| 6 |
<script type="text/javascript" src="{{ MEDIA_URL }}sphene/sphboard/js/editor.js"></script> |
|---|
| 7 |
{% endif %} |
|---|
| 8 |
<script language="JavaScript" type="text/javascript" src="{{ MEDIA_URL }}sphene/community/xmlhttp.js"></script> |
|---|
| 9 |
<script language="JavaScript" type="text/javascript"> |
|---|
| 10 |
<!-- |
|---|
| 11 |
function doPreview() { |
|---|
| 12 |
{% if bbcodewysiwyg %} |
|---|
| 13 |
doCheck(); |
|---|
| 14 |
{% endif %} |
|---|
| 15 |
var markup = ""; |
|---|
| 16 |
if(document.postform.markup) { |
|---|
| 17 |
markup = "&markup=" + encodeURIComponent( document.postform.markup.value ); |
|---|
| 18 |
} |
|---|
| 19 |
showResponseInElement( 'previewarea', '{% trans "Loading Preview ..." %}', "type=preview" + markup + "&body=" + encodeURIComponent( document.postform.body.value ) ); |
|---|
| 20 |
} |
|---|
| 21 |
|
|---|
| 22 |
</script> |
|---|
| 23 |
|
|---|
| 24 |
<div id="previewarea" class="board_previewarea"></div> |
|---|
| 25 |
<form enctype="multipart/form-data" method="post" action='{{ form_action|default:"." }}' name="postform" {% if bbcodewysiwyg %}onsubmit="doCheck()" {% endif %}> |
|---|
| 26 |
<input type="hidden" name="category" value="{{ category.id }}" /> |
|---|
| 27 |
{% if thread %} |
|---|
| 28 |
<input type="hidden" name="thread" value="{{ thread.id }}" /> |
|---|
| 29 |
{% endif %} |
|---|
| 30 |
{% if post %} |
|---|
| 31 |
<input type="hidden" name="post_id" value="{{ post.id }}" /> |
|---|
| 32 |
{% endif %} |
|---|
| 33 |
<table class="sphboard form"> |
|---|
| 34 |
{{ form }} |
|---|
| 35 |
{% if bbcodewysiwyg %} |
|---|
| 36 |
<script type="text/javascript"> |
|---|
| 37 |
var emoticons_url = "{{ MEDIA_URL }}sphene/emoticons"; |
|---|
| 38 |
var editor_static = "{{ MEDIA_URL }}sphene/sphboard"; |
|---|
| 39 |
</script> |
|---|
| 40 |
<script type="text/javascript" src="{{ MEDIA_URL }}sphene/sphboard/js/inline.js"></script> |
|---|
| 41 |
{% endif %} |
|---|
| 42 |
</table> |
|---|
| 43 |
</script> |
|---|
| 44 |
{% if user.is_authenticated %} |
|---|
| 45 |
{% if thread.has_monitor or category.has_monitor %} |
|---|
| 46 |
<small>{% trans "You are already receiving email notifications for this thread or category." %}</small> |
|---|
| 47 |
{% else %} |
|---|
| 48 |
<input type="checkbox" name="addmonitor" value="1" id="addmonitor_id" {% if user|sphboard_default_notify_me %}checked="checked"{% endif %} /> <label for="addmonitor_id">{% trans "Notify me by email on new posts in this thread." %}</label> |
|---|
| 49 |
{% endif %} |
|---|
| 50 |
<br/><br/> |
|---|
| 51 |
{% endif %} |
|---|
| 52 |
|
|---|
| 53 |
{% if pollform %} |
|---|
| 54 |
<input type="checkbox" name="createpoll" value="1" onchange="javascript:document.getElementById( 'poll' ).style.display = (this.checked ? 'block' : 'none' )" id="createpoll_id"{% if createpoll %} checked="checked"{% endif %} /> <label for="createpoll_id">{% trans "Add a poll to this thread" %}</label><br/><br/> |
|---|
| 55 |
|
|---|
| 56 |
<div id="poll" style="display: none"> |
|---|
| 57 |
<table class="sphboard form"> |
|---|
| 58 |
<tr> |
|---|
| 59 |
<th colspan="2">{% trans "Poll" %}</th> |
|---|
| 60 |
</tr> |
|---|
| 61 |
{{ pollform }} |
|---|
| 62 |
</table> |
|---|
| 63 |
</div> |
|---|
| 64 |
<script language="JavaScript"> |
|---|
| 65 |
<!-- |
|---|
| 66 |
document.getElementById( 'poll' ).style.display = (document.postform.createpoll.checked ? 'block' : 'none'); |
|---|
| 67 |
|
|---|
| 68 |
</script> |
|---|
| 69 |
{% endif %} |
|---|
| 70 |
{% if attachmentForm %} |
|---|
| 71 |
<table class="sphboard form attachment"> |
|---|
| 72 |
<tr> |
|---|
| 73 |
<th colspan="2">{% trans "Upload Attachment" %}</th> |
|---|
| 74 |
</tr> |
|---|
| 75 |
{% if post %} |
|---|
| 76 |
{% for attachment in post.attachments.all %} |
|---|
| 77 |
<tr> |
|---|
| 78 |
<td><a href="{{ attachment.fileupload.url }}" target="_blank">{{ attachment.fileupload.name|sph_basename }}</a> ({{ attachment.fileupload.size|filesizeformat }})</td> |
|---|
| 79 |
</tr> |
|---|
| 80 |
{% endfor %} |
|---|
| 81 |
{% endif %} |
|---|
| 82 |
{{ attachmentForm }} |
|---|
| 83 |
<tr> |
|---|
| 84 |
<td colspan="2"><input type="submit" name="cmd_addfile" value="{% trans "Upload File" %}" style="width: auto;" /></td> |
|---|
| 85 |
</tr> |
|---|
| 86 |
</table> |
|---|
| 87 |
{% endif %} |
|---|
| 88 |
|
|---|
| 89 |
<input type="submit" value="{% trans "Post" %}" /> * <input type="button" value="{% trans "Preview" %}" onclick="javascript:doPreview()" /> |
|---|
| 90 |
|
|---|
| 91 |
</form> |
|---|