mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-02-20 21:39:41 +00:00
Add parsing of markdown when editing event items
This commit is contained in:
@@ -9049,7 +9049,7 @@ textarea {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* line 57, ../scss/screen.scss */
|
/* line 57, ../scss/screen.scss */
|
||||||
.item-description {
|
.item_row .description {
|
||||||
margin-left: 1em;
|
margin-left: 1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ $('body').on('submit', '#item-form', function (e) {
|
|||||||
// update the table
|
// update the table
|
||||||
$row = $('#item-' + pk);
|
$row = $('#item-' + pk);
|
||||||
$row.find('.name').html(escapeHtml(fields.name));
|
$row.find('.name').html(escapeHtml(fields.name));
|
||||||
$row.find('.description').html(nl2br(escapeHtml(fields.description)));
|
$row.find('.description').html(marked(fields.description));
|
||||||
$row.find('.cost').html(parseFloat(fields.cost).toFixed(2));
|
$row.find('.cost').html(parseFloat(fields.cost).toFixed(2));
|
||||||
$row.find('.quantity').html(fields.quantity);
|
$row.find('.quantity').html(fields.quantity);
|
||||||
|
|
||||||
|
|||||||
6
RIGS/static/js/marked.min.js
vendored
Normal file
6
RIGS/static/js/marked.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@@ -54,7 +54,7 @@ textarea {
|
|||||||
max-width: 2em;
|
max-width: 2em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.item-description {
|
.item_row .description {
|
||||||
margin-left: 1em;
|
margin-left: 1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,13 +3,15 @@
|
|||||||
<tr id="item-{{ item.pk }}" data-pk="{{ item.pk }}" class="item_row">
|
<tr id="item-{{ item.pk }}" data-pk="{{ item.pk }}" class="item_row">
|
||||||
<td>
|
<td>
|
||||||
<span class="name">{{ item.name }}</span>
|
<span class="name">{{ item.name }}</span>
|
||||||
<div class="item-description">
|
|
||||||
<em class="description">{{item.description|markdown}}</em>
|
<div class="description">
|
||||||
|
{{ item.description|markdown }}
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td>£ <span class="cost">{{ item.cost|floatformat:2 }}</span></td>
|
<td>£ <span class="cost">{{ item.cost|floatformat:2 }}</span></td>
|
||||||
<td class="quantity">{{ item.quantity }}</td>
|
<td class="quantity">{{ item.quantity }}</td>
|
||||||
<td>£ <span class="sub-total" data-subtotal="{{item.total_cost}}">{{item.total_cost|floatformat:2}}</span></td>
|
<td>£ <span class="sub-total" data-subtotal="{{ item.total_cost }}">{{ item.total_cost|floatformat:2 }}</span>
|
||||||
|
</td>
|
||||||
{% if edit %}
|
{% if edit %}
|
||||||
<td class="vert-align text-right">
|
<td class="vert-align text-right">
|
||||||
<button type="button" class="item-edit btn btn-xs btn-default"
|
<button type="button" class="item-edit btn btn-xs btn-default"
|
||||||
|
|||||||
@@ -31,10 +31,12 @@
|
|||||||
<tr>
|
<tr>
|
||||||
{% if not object.pk %}
|
{% if not object.pk %}
|
||||||
<td id="vat-rate" data-rate="{{ currentVAT.rate }}">VAT @
|
<td id="vat-rate" data-rate="{{ currentVAT.rate }}">VAT @
|
||||||
{{currentVAT.as_percent|floatformat}}% (TBC)</td>
|
{{ currentVAT.as_percent|floatformat }}% (TBC)
|
||||||
|
</td>
|
||||||
{% else %}
|
{% else %}
|
||||||
<td id="vat-rate" data-rate="{{ object.vat_rate.rate }}">VAT @
|
<td id="vat-rate" data-rate="{{ object.vat_rate.rate }}">VAT @
|
||||||
{{object.vat_rate.as_percent|floatformat|default:"TBD"}}%</td>
|
{{ object.vat_rate.as_percent|floatformat|default:"TBD" }}%
|
||||||
|
</td>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<td colspan="2">£ <span id="vat">{{ object.vat|default:0|floatformat:2 }}</span></td>
|
<td colspan="2">£ <span id="vat">{{ object.vat|default:0|floatformat:2 }}</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -49,8 +51,8 @@
|
|||||||
<tr id="new-item-row" class="item_row">
|
<tr id="new-item-row" class="item_row">
|
||||||
<td>
|
<td>
|
||||||
<span class="name"></span>
|
<span class="name"></span>
|
||||||
<div class="item-description">
|
|
||||||
<em class="description"></em>
|
<div class="description">
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td>£ <span class="cost"></span></td>
|
<td>£ <span class="cost"></span></td>
|
||||||
|
|||||||
BIN
db.sqlite3
BIN
db.sqlite3
Binary file not shown.
@@ -176,6 +176,7 @@
|
|||||||
<script src="{% static "js/dropdown.js" %}"></script>
|
<script src="{% static "js/dropdown.js" %}"></script>
|
||||||
<script src="{% static "js/modal.js" %}"></script>
|
<script src="{% static "js/modal.js" %}"></script>
|
||||||
<script src="{% static "js/konami.js" %}"></script>
|
<script src="{% static "js/konami.js" %}"></script>
|
||||||
|
<script src="{% static "js/marked.min.js" %}"></script>
|
||||||
<script>
|
<script>
|
||||||
jQuery(document).ready(function () {
|
jQuery(document).ready(function () {
|
||||||
jQuery(document).on('click', '.modal-href', function (e) {
|
jQuery(document).on('click', '.modal-href', function (e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user