merge.html 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. {% extends 'editor/editor.html' %}
  2. {% block css %}
  3. <link href = "{{ url('static_assets', filename='js/codemirror/lib/codemirror.css') }}"
  4. rel = "stylesheet" />
  5. <link href = "{{ url('static_assets', filename='js/codemirror/addon/merge/merge.css') }}"
  6. rel = "stylesheet" />
  7. {{ super() }}
  8. {% endblock %}
  9. {% block javascript %}
  10. {{ super() }}
  11. <script src="{{ url('static_assets', filename='js/codemirror/lib/codemirror.js') }}"></script>
  12. <script src="{{ url('static_assets', filename='js/codemirror/mode/markdown/markdown.js') }}"></script>
  13. <script src="{{ url('static_assets', filename='js/codemirror/mode/turtle/turtle.js') }}"></script>
  14. <script src="{{ url('static_assets', filename='js/codemirror/addon/merge/merge.js') }}"></script>
  15. <script src="{{ url('static_assets', filename='js/diff_match_patch_uncompressed.js') }}"></script>
  16. <script src="{{ url('static_assets', filename='js/editor/merge.js') }}" id="editor_script" data-type="{{ type }}"></script>
  17. {% endblock %}
  18. {% block main %}
  19. {# The form used for submitting content #}
  20. <form id="form_content" method="post" action=""></form>
  21. <div class="merge">
  22. <div class="alert">
  23. <p>
  24. <strong>Someone else has changed this page since you started
  25. editing it.</strong>
  26. </p>
  27. <p>
  28. On the left you can see the current revision with the most recent
  29. changes. Your last changes are shown on the right. Please use the
  30. central text area for reviewing your changes. You can edit it, or
  31. you can insert/replace lines using the editors' left/right arrows.
  32. <strong>Only the content in the central text area will be saved.</strong>
  33. </p>
  34. </div>
  35. <div class="three_way">
  36. <div>CURRENT</div>
  37. <div>MERGE</div>
  38. <div>YOUR CHANGES</div>
  39. <div>
  40. <textarea id="current_content" name="current_content" maxlength="10485760" disabled>{{ current_revision['content'] }}</textarea>
  41. </div>
  42. <div>
  43. <textarea id="content" name="content" maxlength="10485760" required form="form_content">{{ current_revision['content'] }}</textarea>
  44. </div>
  45. <div>
  46. <textarea id="changed_content" name="changed_content" maxlength="10485760" disabled>{{ content }}</textarea>
  47. </div>
  48. </div>
  49. {# CodeMirror 3-way editor will be created here #}
  50. <div id="three_way_editor"></div>
  51. </div>
  52. <footer>
  53. <div>
  54. Describe your changes
  55. </div>
  56. <div>
  57. <input type="text" name="edit_summary" value="{{ edit_summary }}" maxlength="1024" placeholder="" required form="form_content" />
  58. </div>
  59. <div class="licensing">
  60. By publishing changes, you irrevocably agree to release your contribution
  61. under the CC-BY-SA 4.0 License. You agree that a hyperlink or URL is
  62. sufficient attribution under the Creative Commons license.
  63. </div>
  64. <div>
  65. <input type="hidden" name="revision" value="{{ revision_number if revision_number is not none }}" form="form_content" />
  66. <input type="submit" value="Save" form="form_content" class="button button_default" />
  67. <a href="{{ url('node', id=node_id) }}">Cancel</a>
  68. </div>
  69. </footer>
  70. {% endblock %}