From 4becaed7fb1b40f980fc7844ceee94ad2d1aacd6 Mon Sep 17 00:00:00 2001 From: Todd Wacker Date: Sat, 22 Feb 2014 09:05:47 -0600 Subject: [PATCH 1/5] CSS file updated, put photo in HTML instead --- public/application.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/application.css b/public/application.css index 64c15c2..9c8e244 100644 --- a/public/application.css +++ b/public/application.css @@ -3,7 +3,7 @@ } #pic_display { - background-size: 200px 200px; - background-color: blue; + height: 200px; + width: 200px; border: 10px solid black; } From ec51cc60991ad6528590a8ce61e13f58e04775d0 Mon Sep 17 00:00:00 2001 From: Todd Wacker Date: Sat, 22 Feb 2014 10:03:24 -0600 Subject: [PATCH 2/5] Server and form changes undone --- server.rb | 4 ++++ views/form.erb | 25 +++++++++++++------------ 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/server.rb b/server.rb index 7effd05..bf8cb33 100644 --- a/server.rb +++ b/server.rb @@ -31,9 +31,13 @@ @price3 = params[:price3] @pic3 = params[:pic3] @items = [@item, @item2, @item3] + @serial_numbers = [@serial_number, @serial_number2, @serial_number3] + @prices = [@price, @price2, @price3] + @pics = [@pic, @pic2, @pic3] + erb :inventory end diff --git a/views/form.erb b/views/form.erb index 7ca57ef..ea54943 100644 --- a/views/form.erb +++ b/views/form.erb @@ -15,25 +15,26 @@


+
-
+



-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+

-
+
From a000ce9dad30df7d2c6a6e1b9a15197f4e65e4b3 Mon Sep 17 00:00:00 2001 From: Todd Wacker Date: Sat, 22 Feb 2014 11:22:04 -0600 Subject: [PATCH 3/5] Remove button added, Add button added, calculates total price of items --- public/application.js | 5 +++++ views/inventory.erb | 44 +++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 47 insertions(+), 2 deletions(-) diff --git a/public/application.js b/public/application.js index 2c4c4a4..399f338 100644 --- a/public/application.js +++ b/public/application.js @@ -13,3 +13,8 @@ $('.default-value').each(function() { } }); }); + +$('#remove').on('click', function (e) { + e.preventDefault(); + $('.row.item').remove(); +}); diff --git a/views/inventory.erb b/views/inventory.erb index bb751a4..90692bb 100644 --- a/views/inventory.erb +++ b/views/inventory.erb @@ -4,6 +4,7 @@ +

Summary of Inventory for <%= @user_name %>

@@ -12,14 +13,22 @@

Phone: <%= @phone %>

Email: <%= @email %>

Zip: <%= @zip %>

+ <% @sum = 0.00 %> +

Total Value: $<% @prices.each do |x| %> + <% @sum += x.to_f.round(2) %> + <% end %> + <%= @sum %> +

+
<% i = 0 %> <% while i < @items.length %> -
+

Item Name: <%= @items[i] %>

Serial Number: <%= @serial_numbers[i] %>

-

Retail Price: <%= @prices[i] %>

+

Retail Price: $<%= @prices[i] %>

+
@@ -29,6 +38,37 @@
<%= i += 1 %> <% end %> +
+
+ +
+ + From 697261bf9e5e51bcb78e97d7e6d4c8dd393d77f1 Mon Sep 17 00:00:00 2001 From: Todd Wacker Date: Sat, 22 Feb 2014 11:39:09 -0600 Subject: [PATCH 4/5] Add new item works on inventory page --- views/inventory.erb | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/views/inventory.erb b/views/inventory.erb index 90692bb..c72c636 100644 --- a/views/inventory.erb +++ b/views/inventory.erb @@ -28,7 +28,7 @@

Item Name: <%= @items[i] %>

Serial Number: <%= @serial_numbers[i] %>

Retail Price: $<%= @prices[i] %>

- +
@@ -44,7 +44,7 @@
From c66673a4d61d7076746b352942bd4269dff5a2f5 Mon Sep 17 00:00:00 2001 From: Todd Wacker Date: Sat, 22 Feb 2014 12:05:33 -0600 Subject: [PATCH 5/5] Lunch commit --- views/inventory.erb | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/views/inventory.erb b/views/inventory.erb index c72c636..a637b4e 100644 --- a/views/inventory.erb +++ b/views/inventory.erb @@ -13,11 +13,11 @@

Phone: <%= @phone %>

Email: <%= @email %>

Zip: <%= @zip %>

- <% @sum = 0.00 %> + <% @sum = 0.0 %>

Total Value: $<% @prices.each do |x| %> - <% @sum += x.to_f.round(2) %> + <% @sum += x.to_f %> <% end %> - <%= @sum %> + <%= @sum.round(2) %>

@@ -52,7 +52,18 @@ $('.remove').on('click', function (e) { $('#add').on('click', function (e) { e.preventDefault(); $('.items') - .append('

Item Name:

Serial Number:

Retail Price:

'); + .append('
' + + '
' + + '

Item Name:

' + + '

Serial Number:

' + + '

Retail Price:

' + + 'Upload photo: '+ + ''+ + '
'+ + '
'+ + ''+ + '
'+ + '
'); })