edit.html 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. {% extends 'editor/editor.html' %}
  2. {% block css %}
  3. <link href = "{{ url('static_assets', filename='js/codemirror/lib/codemirror.css') }}"
  4. rel = "stylesheet" />
  5. {{ super() }}
  6. {% endblock %}
  7. {% block javascript %}
  8. {{ super() }}
  9. <script src="{{ url('static_assets', filename='js/codemirror/lib/codemirror.js') }}"></script>
  10. <script src="{{ url('static_assets', filename='js/codemirror/mode/jinja2/jinja2.js') }}"></script>
  11. <script src="{{ url('static_assets', filename='js/codemirror/mode/markdown/markdown.js') }}"></script>
  12. <script src="{{ url('static_assets', filename='js/codemirror/mode/sparql/sparql.js') }}"></script>
  13. <script src="{{ url('static_assets', filename='js/codemirror/mode/turtle/turtle.js') }}"></script>
  14. <script src="{{ url('static_assets', filename='js/commonmark.js') }}"></script>
  15. <script src="{{ url('static_assets', filename='js/editor/edit.js') }}" id="editor_script" data-type="{{ type }}"></script>
  16. {% endblock %}
  17. {% block main %}
  18. {# The form used for submitting changes #}
  19. <form id="form_content" method="post" action=""></form>
  20. {% if type == 'article' %}
  21. <div class="article">
  22. <div>
  23. <textarea id="content" name="content" maxlength="10485760" form="form_content">{{ content }}</textarea>
  24. </div>
  25. <div id="preview"></div>
  26. </div>
  27. {% endif %}
  28. {% if type == 'file' %}
  29. <div class="file">
  30. <p class="padding">
  31. Direct link: <a href="{{ url('blob', filename=node_id) }}" target="_blank">{{ node_id }}</a>
  32. </p>
  33. <textarea id="content" name="content" maxlength="10485760" form="form_content">{{ content }}</textarea>
  34. </div>
  35. {% endif %}
  36. {% if type == 'query' %}
  37. <div class="query">
  38. <textarea id="content" name="content" maxlength="10485760" form="form_content">{{ content }}</textarea>
  39. </div>
  40. {% endif %}
  41. {% if type == 'template' %}
  42. <div class="template">
  43. <textarea id="content" name="content" maxlength="10485760" form="form_content">{{ content }}</textarea>
  44. </div>
  45. {% endif %}
  46. {% if type == 'topic' %}
  47. <div class="topic">
  48. <textarea id="content" name="content" maxlength="10485760" form="form_content">{{ content }}</textarea>
  49. </div>
  50. {% endif %}
  51. <footer>
  52. <div>
  53. Describe your changes
  54. </div>
  55. <div>
  56. <input type="text" name="edit_summary" maxlength="1024" placeholder="" required form="form_content" />
  57. </div>
  58. <div class="licensing">
  59. By publishing changes, you irrevocably agree to release your contribution
  60. under the CC-BY-SA 4.0 License. You agree that a hyperlink or URL is
  61. sufficient attribution under the Creative Commons license.
  62. </div>
  63. <div>
  64. <input type="hidden" name="revision" value="{{ revision_number if revision_number is number }}"
  65. form="form_content" />
  66. <input type="submit" value="Save" form="form_content" class="button button_default" />
  67. {# "Cancel" button #}
  68. {% if type == 'article' or type == 'topic' %}
  69. <a href="{{ url('node', id=node_id) }}">Cancel</a>
  70. {% elif type == 'file' %}
  71. <a href="{{ url('files') }}">Cancel</a>
  72. {% elif type == 'template' %}
  73. <a href="{{ url('templates') }}">Cancel</a>
  74. {% elif type == 'query' %}
  75. <a href="{{ url('queries') }}">Cancel</a>
  76. {% endif %}
  77. </div>
  78. </footer>
  79. {% endblock %}