mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-20 05:46:34 +00:00
Side-by-side live editing for markdown
This commit is contained in:
10
InvenTree/part/templates/markdownx/widget.html
Normal file
10
InvenTree/part/templates/markdownx/widget.html
Normal file
@ -0,0 +1,10 @@
|
||||
{% load i18n %}
|
||||
|
||||
<div class="markdownx row">
|
||||
<div class="markdown col-md-6">
|
||||
{% include 'django/forms/widgets/textarea.html' %}
|
||||
</div>
|
||||
<div class="markdown col-md-6">
|
||||
<div class="markdownx-preview"></div>
|
||||
</div>
|
||||
</div>
|
@ -14,10 +14,11 @@
|
||||
|
||||
<form method='POST'>
|
||||
{% csrf_token %}
|
||||
|
||||
|
||||
{{ form }}
|
||||
|
||||
<input type="submit" value="Update" />
|
||||
<input type="submit" value='{% trans "Save Notes" %}'/>
|
||||
|
||||
</form>
|
||||
|
||||
{{ form.media }}
|
||||
@ -25,11 +26,23 @@
|
||||
{% else %}
|
||||
|
||||
<div class='panel panel-default'>
|
||||
<div class='panel-body'>
|
||||
<div class='panel-heading'>
|
||||
{% trans "Notes" %}
|
||||
<button class='btn btn-default' id='edit-notes'>Edit</button>
|
||||
</div>
|
||||
<div class='panel-content'>
|
||||
{{ part.notes | markdownify }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block js_ready %}
|
||||
|
||||
$("#edit-notes").click(function() {
|
||||
location.href = "{% url 'part-notes' part.id %}?edit=1";
|
||||
});
|
||||
|
||||
{% endblock %}
|
Reference in New Issue
Block a user