Skip to content

Commit bea30ca

Browse files
author
Paul Kelly
committed
Jumping to windows
1 parent 4ac7ef1 commit bea30ca

15 files changed

+215
-142
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.tmp_*

app/controllers/quotes_controller.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,8 @@ def calculate
6464
end
6565
end
6666
end
67+
def validate_shipping
68+
@quote = Quote.new params[:quote]
69+
head 200
70+
end
6771
end

app/models/price.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,7 @@ class Price < ActiveRecord::Base
66
belongs_to :disk
77
belongs_to :ram
88
belongs_to :grade
9+
10+
validates_presence_of :computer, :processor, :disk, :ram, :grade
11+
validates_numericality_of :value
912
end

app/views/quotes/_laptop_body.html.erb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
<% remote_form_for @quote, :url => calculate_quotes_path do |f|%>
21
<%- flash[:error].each do | msg| -%>
32
<%= content_tag :div, msg %>
43
<%- end if flash[:error] -%>
@@ -136,4 +135,3 @@
136135
</td>
137136
</tr>
138137
</table>
139-
<% end %>

app/views/quotes/_location_body.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<td class="footer-text">House Name/No.</td>
2626
<td class="footer-text">
2727
<label>
28-
<%= f.text_field :housename, :tabindex => 2, :class => "box" %>
28+
<%= f.text_field :houseid, :tabindex => 2, :class => "box" %>
2929
</label>
3030
</td>
3131
<td class="footer-text">Telephone No.</td>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<div>
2+
&nbsp;
3+
</div>
4+
<div>
5+
<%= link_to_function image_tag("desktop.jpg", :border => 0, :width => 184), shuffle(:contract =>["mac_body"], :expand =>["desktop_body"]) -%>
6+
</div>
7+
<div>
8+
&nbsp;
9+
</div>
10+
<div>
11+
<%= link_to_function image_tag("laptop.jpg", :border => 0, :width => 184), shuffle(:contract =>["mac_body"], :expand =>["laptop_body"]) -%>
12+
</div>
13+
<div>
14+
&nbsp;
15+
</div>

app/views/quotes/_payment.html.erb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<table cellspacing="0" cellpadding="0" border="0" width="100%">
2+
<tr>
3+
<td>
4+
<div id="payment_header" class="tab-bg">
5+
3. payment within days!
6+
</div>
7+
<div id="payment_body" style="display:none;">
8+
<%= render "payment_body", :f => f -%>
9+
</div>
10+
</td>
11+
</tr>
12+
</table>
Lines changed: 113 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,115 @@
11
<div id="div5" style="height: auto;">
2-
<table width="100%" cellspacing="0" cellpadding="0" border="0">
3-
<tbody><tr>
4-
<td class="four-border"><table align="center" width="96%" cellspacing="2" cellpadding="2" border="0">
5-
<tbody><tr>
6-
<td class="simple-text">
7-
<div id="macboxyes"><p>To finish, you need to pick a time and date convenient to you in the calender below. You will also need to accept our terms and condition by checking the tickbox and then clicking "I Accept". Once you have accepted, you will receive a confirmation email with all your order's information in it. Our courier will bring a label with them unless you are instructed otherwise, so you will not need to print anything off.</p></div>
8-
<div id="macboxno"><p>To finish, you need to pick a time and date convenient to you in the calendar below. You will also need to accept our terms and conditions by clicking "I Accept". Once you have accepted, you will receive a confirmation email and a second email with the tracking number of the box we will send for you to place your Mac in. This will arrive on the day you selected. All you will need to do is place your Mac inside securely, affix the enclosed return shipping label to the item and hand it to the courier.</p>
9-
</div>
10-
</td>
11-
</tr>
12-
<tr>
13-
<td><table width="100%" cellspacing="0" cellpadding="0" border="0">
14-
<tbody><tr>
15-
<td width="29%" valign="top"><table width="100%" cellspacing="2" cellpadding="2" border="0">
16-
<tbody><tr>
17-
<td><select id="timedate" class="box" name="timedate">
18-
<option selected="selected" value="">Select Date</option>
19-
<option value="1302732000">14/04/2011</option><option value="1302818400">15/04/2011</option><option value="1303077600">18/04/2011</option><option value="1303164000">19/04/2011</option><option value="1303250400">20/04/2011</option><option value="1303336800">21/04/2011</option><option value="1303423200">22/04/2011</option></select></td>
20-
</tr>
21-
<tr>
22-
<td><textarea id="additionalinformation" class="box" rows="5" name="additionalinformation">Additional shipping information</textarea></td>
23-
</tr>
24-
25-
</tbody></table></td>
26-
<td align="right" width="71%" valign="top">&nbsp;</td>
27-
</tr>
28-
</tbody></table></td>
29-
</tr>
2+
<table width="100%" cellspacing="0" cellpadding="0" border="0">
3+
<tbody>
304
<tr>
31-
<td class="footer-text"> <input type="checkbox" value="Yes" id="donate" name="donate">
32-
I confirm that the information I have provided, to the best of my knowledge, is accurate and true. </td>
33-
</tr>
34-
<tr>
35-
<td class="footer-text"><p><strong>Important Payment Information. We only issue payment by the following methods:<br>
36-
</strong></p><li><strong>Direct Bank Transfer - We will need your Bank Account Number and Sort Code to process this.</strong></li><strong><br>
37-
</strong><li><strong>Paypal Transfer - We will need the email address that you are registered to PayPal with to process this.</strong></li><strong><br>You will be contacted upon receipt of your Mac regarding your preferred payment method.</strong> </td>
38-
</tr>
39-
<tr>
40-
<td class="footer-text"><input type="checkbox" value="Yes" tabindex="9" code="Yes" id="iagree" class="box1" name="iagree">I agree to the
41-
<a class="footer-text" onclick="javascript:window.open(&quot;terms-condition.php&quot;,&quot;asd&quot;,&quot;scrollbars=no,width=645,height=700,scrollbars=yes&quot;)" href="#">
42-
43-
<u>terms and conditions</u></a> of this contract
44-
</td>
45-
</tr>
46-
47-
<tr>
48-
<td align="right" class="footer-text"><a onclick="toggleItem('4');" href="javascript:;"><img width="184" height="28" border="0" alt="" src="images/back.jpg"></a>&nbsp; &nbsp;<a onclick="doValidate3()" href="javascript:;"><img width="184" height="28" border="0" alt="" src="images/iaccept.jpg"></a></td>
49-
</tr>
50-
</tbody></table></td>
51-
</tr>
52-
<tr>
53-
<td valign="top"><img width="2" height="5" alt="" src="images/white.jpg"></td>
54-
</tr>
55-
</tbody></table>
56-
</div>
5+
<td class="four-border">
6+
<table align="center" width="96%" cellspacing="2" cellpadding="2" border="0">
7+
<tbody>
8+
<tr>
9+
<td class="simple-text">
10+
<div id="macboxyes">
11+
<p>
12+
To finish, you need to pick a time and date convenient to you in the calender below. You will also need to accept our terms and condition by checking the tickbox and then clicking "I Accept". Once you have accepted, you will receive a confirmation email with all your order's information in it. Our courier will bring a label with them unless you are instructed otherwise, so you will not need to print anything off.
13+
</p>
14+
</div>
15+
<div id="macboxno">
16+
<p>
17+
To finish, you need to pick a time and date convenient to you in the calendar below. You will also need to accept our terms and conditions by clicking "I Accept". Once you have accepted, you will receive a confirmation email and a second email with the tracking number of the box we will send for you to place your Mac in. This will arrive on the day you selected. All you will need to do is place your Mac inside securely, affix the enclosed return shipping label to the item and hand it to the courier.
18+
</p>
19+
</div>
20+
</td>
21+
</tr>
22+
<tr>
23+
<td>
24+
<table width="100%" cellspacing="0" cellpadding="0" border="0">
25+
<tbody>
26+
<tr>
27+
<td width="29%" valign="top">
28+
<table width="100%" cellspacing="2" cellpadding="2" border="0">
29+
<tbody>
30+
<tr>
31+
<td>
32+
<select id="timedate" class="box" name="timedate">
33+
<option selected="selected" value="">Select Date</option>
34+
<option value="1302732000">14/04/2011</option>
35+
<option value="1302818400">15/04/2011</option>
36+
<option value="1303077600">18/04/2011</option>
37+
<option value="1303164000">19/04/2011</option>
38+
<option value="1303250400">20/04/2011</option>
39+
<option value="1303336800">21/04/2011</option>
40+
<option value="1303423200">22/04/2011</option>
41+
</select>
42+
</td>
43+
</tr>
44+
<tr>
45+
<td>
46+
<textarea id="additionalinformation" class="box" rows="5" name="additionalinformation">
47+
Additional shipping information
48+
</textarea>
49+
</td>
50+
</tr>
51+
</tbody>
52+
</table>
53+
</td>
54+
<td align="right" width="71%" valign="top">
55+
&nbsp;
56+
</td>
57+
</tr>
58+
</tbody>
59+
</table>
60+
</td>
61+
</tr>
62+
<tr>
63+
<td class="footer-text">
64+
<input type="checkbox" value="Yes" id="donate" name="donate"> I confirm that the information I have provided, to the best of my knowledge, is accurate and true.
65+
</td>
66+
</tr>
67+
<tr>
68+
<td class="footer-text">
69+
<p>
70+
<strong>Important Payment Information. We only issue payment by the following methods:
71+
<br>
72+
</strong>
73+
</p>
74+
<li>
75+
<strong>Direct Bank Transfer - We will need your Bank Account Number and Sort Code to process this.</strong>
76+
</li>
77+
<strong>
78+
<br>
79+
</strong>
80+
<li>
81+
<strong>Paypal Transfer - We will need the email address that you are registered to PayPal with to process this.</strong>
82+
</li>
83+
<strong>
84+
<br>
85+
You will be contacted upon receipt of your Mac regarding your preferred payment method.
86+
</strong>
87+
</td>
88+
</tr>
89+
<tr>
90+
<td class="footer-text">
91+
<input type="checkbox" value="Yes" tabindex="9" code="Yes" id="iagree" class="box1" name="iagree">I agree to the <a class="footer-text" onclick="javascript:window.open(&quot;terms-condition.php&quot;,&quot;asd&quot;,&quot;scrollbars=no,width=645,height=700,scrollbars=yes&quot;)" href="#">
92+
<u>
93+
terms and conditions
94+
</u>
95+
</a>
96+
of this contract
97+
</td>
98+
</tr>
99+
<tr>
100+
<td align="right" class="footer-text">
101+
<a onclick="toggleItem('4');" href="javascript:;"><img width="184" height="28" border="0" alt="" src="images/back.jpg"></a>&nbsp; &nbsp;<a onclick="doValidate3()" href="javascript:;"><img width="184" height="28" border="0" alt="" src="images/iaccept.jpg"></a>
102+
</td>
103+
</tr>
104+
</tbody>
105+
</table>
106+
</td>
107+
</tr>
108+
<tr>
109+
<td valign="top">
110+
<img width="2" height="5" alt="" src="images/white.jpg">
111+
</td>
112+
</tr>
113+
</tbody>
114+
</table>
115+
</div>
Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,12 @@
11
<table cellspacing="0" cellpadding="0" border="0" width="100%">
22
<tr>
33
<td>
4-
<div id="mac_header" class="tab-bg">
5-
<%= link_to_function "Where are you", shuffle(:expand =>["mac_body"]), {:class => "tab-bg tab-text1"} -%>
4+
<div id="where_header" class="tab-bg">
5+
2. Tell us where to pick up your mac
66
</div>
7-
<div id="mac_body" style="display:none;">
8-
<div>
9-
&nbsp;
10-
</div>
11-
<div>
12-
<%= link_to_function image_tag("desktop.jpg", :border => 0, :width => 184), shuffle(:contract =>["mac_body"], :expand =>["desktop_body"]) -%>
13-
</div>
14-
<div>
15-
&nbsp;
16-
</div>
17-
<div>
18-
<%= link_to_function image_tag("laptop.jpg", :border => 0, :width => 184), shuffle(:contract =>["mac_body"], :expand =>["laptop_body"]) -%>
19-
</div>
20-
<div>
21-
&nbsp;
22-
</div>
7+
<div id="location_body" style="display:none;">
8+
<%= render "location_body", :f => f -%>
239
</div>
24-
<div id="desktop_body" style="display:none">
25-
<%= render "desktop_body" -%>
26-
</div>
27-
<div id="laptop_body" style="display:none">
28-
<%= render "laptop_body" -%>
29-
</div>
3010
</td>
3111
</tr>
3212
</table>

app/views/quotes/_worth_body.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
Would you like to accept and continue?
1414
</div>
1515
<div>
16-
<%= link_to_function image_tag("back.jpg", :size => "184x28", :border => "0"), shuffle(:contract => ["laptop_body"], :expand => "mac_body")%>
16+
<%= link_to_function image_tag("back.jpg", :size => "184x28", :border => "0"), shuffle(:contract => ["worth_body"], :expand => "laptop_body")%>
1717
</div>
1818
<div>
1919
<%= link_to_function image_tag("continue.jpg", :size => "184x28", :border => "0"), shuffle(:contract => ["worth_body"], :expand => "location_body")%>

0 commit comments

Comments
 (0)