Fixes for using markdown in asset comments

This commit is contained in:
2021-12-22 15:48:49 +00:00
parent 5406568d93
commit b9e763777f
3 changed files with 5 additions and 3 deletions

View File

@@ -5,11 +5,13 @@
{% block css %}
{{ block.super }}
<link rel="stylesheet" href="{% static 'css/selects.css' %}"/>
<link rel="stylesheet" type="text/css" href="{% static 'css/simplemde.min.css' %}">
{% endblock %}
{% block preload_js %}
{{ block.super }}
<script src="{% static 'js/selects.js' %}"></script>
<script src="{% static 'js/simplemde.min.js' %}"></script>
{% endblock %}
{% block js %}

View File

@@ -47,7 +47,7 @@
<dd>{{ object.asset_id }}</dd>
<dt>Description</dt>
<dd class="dont-break-out">{{ object.description }}</dd>
<dd>{{ object.description }}</dd>
<dt>Category</dt>
<dd>{{ object.category }}</dd>
@@ -59,7 +59,7 @@
<dd>{{ object.serial_number|default:'-' }}</dd>
<dt>Comments</dt>
<dd class="dont-break-out well">{{ object.comments|default:'-'|markdown }}</dd>
<dd style="overflow-wrap: break-word;">{{ object.comments|default:'-'|markdown }}</dd>
{% endif %}
</div>
</div>

View File

@@ -77,7 +77,7 @@ class AssetForm(FormPage):
'description': (regions.TextBox, (By.ID, 'id_description')),
'is_cable': (regions.CheckBox, (By.ID, 'id_is_cable')),
'serial_number': (regions.TextBox, (By.ID, 'id_serial_number')),
'comments': (regions.TextBox, (By.ID, 'id_comments')),
'comments': (regions.SimpleMDETextArea, (By.ID, 'id_comments')),
'purchase_price': (regions.TextBox, (By.ID, 'id_purchase_price')),
'salvage_value': (regions.TextBox, (By.ID, 'id_salvage_value')),
'date_acquired': (regions.DatePicker, (By.ID, 'id_date_acquired')),