mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-17 05:22:16 +00:00
Improvements to layout of event form notes section
Added nl2br support in interactions
This commit is contained in:
@@ -6,6 +6,11 @@ function setupItemTable(items_json) {
|
|||||||
newitem = -1;
|
newitem = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function nl2br (str, is_xhtml) {
|
||||||
|
var breakTag = (is_xhtml || typeof is_xhtml === 'undefined') ? '<br />' : '<br>';
|
||||||
|
return (str + '').replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '$1'+ breakTag +'$2');
|
||||||
|
}
|
||||||
|
|
||||||
function updatePrices() {
|
function updatePrices() {
|
||||||
// individual rows
|
// individual rows
|
||||||
var sum = 0;
|
var sum = 0;
|
||||||
@@ -92,7 +97,7 @@ $('body').on('submit', '#item-form', function (e) {
|
|||||||
// update the table
|
// update the table
|
||||||
$row = $('#item-' + pk);
|
$row = $('#item-' + pk);
|
||||||
$row.find('.name').html(fields.name);
|
$row.find('.name').html(fields.name);
|
||||||
$row.find('.description').html(fields.description);
|
$row.find('.description').html(nl2br(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);
|
||||||
|
|
||||||
|
|||||||
@@ -323,9 +323,11 @@
|
|||||||
<div class="col-sm-12">
|
<div class="col-sm-12">
|
||||||
<div class="panel panel-default form-hws form-is_rig {% if object.pk and not object.is_rig %}hidden{% endif %}">
|
<div class="panel panel-default form-hws form-is_rig {% if object.pk and not object.is_rig %}hidden{% endif %}">
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
<div class="form-group">
|
<div class="col-sm-12">
|
||||||
<label for="{{ form.notes.id_for_label }}">{{ form.notes.label }}</label>
|
<div class="form-group">
|
||||||
{% render_field form.notes class+="form-control" %}
|
<label for="{{ form.notes.id_for_label }}">{{ form.notes.label }}</label>
|
||||||
|
{% render_field form.notes class+="form-control" %}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% include "RIGS/item_table.html" %}
|
{% include "RIGS/item_table.html" %}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user