From 5c236819f43bc453084910e5fee277376121f99b Mon Sep 17 00:00:00 2001 From: Tom Price Date: Thu, 22 Jan 2015 19:26:16 +0000 Subject: [PATCH] Fixed issue with item modals not displaying. Moved item modal code to an includable file. --- RIGS/static/js/interaction.js | 4 ++ RIGS/templates/RIGS/event_form.html | 68 +------------------------- RIGS/templates/RIGS/item_modal.html | 74 +++++++++++++++++++++++++++++ RIGS/templates/RIGS/item_row.html | 1 + 4 files changed, 80 insertions(+), 67 deletions(-) create mode 100644 RIGS/templates/RIGS/item_modal.html diff --git a/RIGS/static/js/interaction.js b/RIGS/static/js/interaction.js index 933179da..7d2617f4 100644 --- a/RIGS/static/js/interaction.js +++ b/RIGS/static/js/interaction.js @@ -42,6 +42,8 @@ $('#item-table').on('click', '.item-add', function () { $('#item_description').val(''); $('#item_quantity').val(''); $('#item_cost').val(''); + + $($(this).data('target')).modal('show'); }); $('#item-table').on('click', '.item-edit', function () { @@ -55,6 +57,8 @@ $('#item-table').on('click', '.item-edit', function () { $('#item_description').val(fields.description); $('#item_quantity').val(fields.quantity); $('#item_cost').val(fields.cost); + + $($(this).data('target')).modal('show'); }); $('body').on('submit', '#item-form', function (e) { diff --git a/RIGS/templates/RIGS/event_form.html b/RIGS/templates/RIGS/event_form.html index 9349463b..1701cdb1 100644 --- a/RIGS/templates/RIGS/event_form.html +++ b/RIGS/templates/RIGS/event_form.html @@ -346,71 +346,5 @@ - + {% include 'RIGS/item_modal.html' %} {% endblock %} \ No newline at end of file diff --git a/RIGS/templates/RIGS/item_modal.html b/RIGS/templates/RIGS/item_modal.html new file mode 100644 index 00000000..602f24ef --- /dev/null +++ b/RIGS/templates/RIGS/item_modal.html @@ -0,0 +1,74 @@ + \ No newline at end of file diff --git a/RIGS/templates/RIGS/item_row.html b/RIGS/templates/RIGS/item_row.html index 1ceb6f9f..fd240fc5 100644 --- a/RIGS/templates/RIGS/item_row.html +++ b/RIGS/templates/RIGS/item_row.html @@ -1,3 +1,4 @@ + {{ item.name }}