-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Because the app should have more independence from the project.
- Loading branch information
Showing
7 changed files
with
117 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.9.3 on 2016-04-17 02:31 | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
initial = True | ||
|
||
dependencies = [ | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='Order', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('customer_name', models.CharField(max_length=64)), | ||
('item_quantity', models.PositiveIntegerField()), | ||
('order_price', models.DecimalField(decimal_places=2, max_digits=17)), | ||
('is_paid', models.BooleanField()), | ||
], | ||
), | ||
migrations.CreateModel( | ||
name='StockItem', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('item_name', models.CharField(max_length=255)), | ||
('item_count', models.PositiveIntegerField()), | ||
('unit_cost', models.DecimalField(decimal_places=2, max_digits=17)), | ||
], | ||
), | ||
migrations.AddField( | ||
model_name='order', | ||
name='item', | ||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='rapid_sales_tool.StockItem'), | ||
), | ||
] |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
var orderModal = $('#newOrderModal') | ||
var orderForm = $('#orderForm'); | ||
$( document ).ready( | ||
orderForm.submit(function() { | ||
orderModal.find(".modalResponse").first().empty().attr('class','modalResponse'); | ||
$.ajax({ | ||
type: orderForm.attr('method'), | ||
url: orderForm.attr('action'), | ||
data: orderForm.serialize(), | ||
success: function(data) { | ||
orderModal.modal('hide'); | ||
location.reload(); | ||
}, | ||
error: function(data) { | ||
orderModal.find(".modalResponse").first().empty().append('<a href="#" class="close" data-dismiss="alert">×</a>'); | ||
orderModal.find(".modalResponse").first().append(data.responseText); | ||
orderModal.find(".modalResponse").first().addClass("alert alert-danger fade in"); | ||
} | ||
}); | ||
return false; | ||
}), | ||
$(".modal").each( function() { | ||
$(this).on('hidden.bs.modal', function () { | ||
$(this).find(".modalResponse").first().empty().attr('class','modalResponse'); | ||
}) | ||
}) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
var addItemModal = $('#newItemModal'); | ||
var addStockModal = $('#addStockModal') | ||
var itemForm = $('#addItemForm'); | ||
var stockForm = $('#addStockForm'); | ||
$( document ).ready( | ||
addItemModal.submit(function() { | ||
addItemModal.find(".modalResponse").first().empty().attr('class','modalResponse'); | ||
$.ajax({ | ||
type: itemForm.attr('method'), | ||
url: itemForm.attr('action'), | ||
data: itemForm.serialize(), | ||
success: function(data) { | ||
addItemModal.modal('hide'); | ||
location.reload(); | ||
}, | ||
error: function(data) { | ||
addItemModal.find(".modalResponse").first().empty().append('<a href="#" class="close" data-dismiss="alert">×</a>'); | ||
addItemModal.find(".modalResponse").first().append(data.responseText); | ||
addItemModal.find(".modalResponse").first().addClass("alert alert-danger fade in"); | ||
} | ||
}); | ||
return false; | ||
}), | ||
stockForm.submit(function() { | ||
addStockModal.find(".modalResponse").first().empty().attr('class','modalResponse'); | ||
$.ajax({ | ||
type: stockForm.attr('method'), | ||
url: stockForm.attr('action'), | ||
data: stockForm.serialize(), | ||
success: function(data) { | ||
addStockModal.modal('hide'); | ||
location.reload(); | ||
}, | ||
error: function(data) { | ||
addStockModal.find(".modalResponse").first().empty().append('<a href="#" class="close" data-dismiss="alert">×</a>'); | ||
addStockModal.find(".modalResponse").first().append(data.responseText); | ||
addStockModal.find(".modalResponse").first().addClass("alert alert-danger fade in"); | ||
} | ||
}); | ||
return false; | ||
}), | ||
$(".modal").each( function() { | ||
$(this).on('hidden.bs.modal', function () { | ||
$(this).find(".modalResponse").first().empty().attr('class','modalResponse'); | ||
}) | ||
}) | ||
); |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters