{% extends "sphene/sphwiki/base.html" %}

{% load i18n %}
{% load sph_extras %}

{% block content %}
  <script language="JavaScript" type="text/javascript" src="{{ STATIC_URL }}sphene/community/xmlhttp.js"></script>
  <script language="JavaScript" type="text/javascript">
  <!--
   function doPreview() {
     showResponseInElement( 'previewarea', 'Loading Preview ....', "type=preview&body=" + encodeURIComponent( document.snipedit.body.value ) );
   }
  //-->
  </script>

  {% include "sphene/sphwiki/_snip_header.html" %}
  <a href="{{ snip.get_absolute_url }}">{% trans "Back to Snip" %}</a><br/><br/>
  <div id="previewarea" class="wiki_previewarea"></div>

  {% if version %}
    <div class="sphwiki_versionwarning"><strong>{% trans "Warning" %}:</strong> {% blocktrans with version.editor|sph_html_user as version_editor and version.edited|sph_date as version_editdate %}You are editing an old version: By {{ version_editor }} at {{ version_editdate }}{% endblocktrans %}</div>
  {% endif %}
  <form action="." method="post" name="snipedit" class="sphform">{% csrf_token %}
    <table class="form">
      {{ form }}
      <tr>
        <td><label for="message_id">{% trans "Change Message" %}:</label></td><td><input type="text" name="message" id="message_id" value="{{ changemessage }}" /></td>
      </tr>
   </table>
   <input type="submit" value="{% trans 'Save' %}" /> * <input type="button" value="{% trans 'Preview' %}" onclick="javascript:doPreview()" />
  </form>
  <br/>
  See <a href="http://sct.sphene.net/wiki/show/WikiDocumentation/" target="_blank">WikiDocumentation</a> on how to format your input.
{% endblock %}
