Browse files

Major

  • Loading branch information...
1 parent 0cf80a7 commit 4d9e4350f1ada90b8471a353cda2f2be64516559 @film42 committed Nov 5, 2012
View
4 webapp/app.js
@@ -36,6 +36,7 @@ app.configure('production', function(){
***********************************/
app.defineRoute('search', '/search');
app.defineRoute('payment', '/payment');
+app.defineRoute('thankyou', '/thankyou');
app.defineRoute('user', {
index: '/user/:username',
@@ -65,6 +66,7 @@ app.defineRoute('/blog/new', '/blog/new');
***********************************/
app.get('/', routes.index);
app.get('/payment', routes.payment);
+app.get('/thankyou', routes.thankyou);
// Users
app.get(app.lookupRoute('user.index'), routes.user_index);
app.get(app.lookupRoute('user.reservations'), routes.user_reservations);
@@ -102,7 +104,7 @@ app.post("/payment", function(req, res) {
var id = customer.id;
console.log('Success! Customer with Stripe ID ' + id + ' just signed up!');
// save this customer to your database here!
- res.send('ok');
+ res.redirect('/thankyou');
}
});
});
View
6 webapp/public/css/kitchenly.css
@@ -339,4 +339,10 @@ a:hover.day {
display: block;
background: #44A1E1;
color: #fff;
+}
+
+.logo-big {
+ background: #44A1E1 url('/img/logo-big.png') no-repeat center;
+ width: 500px;
+ height: 500px;
}
View
342 webapp/public/css2/kitchenly.css
@@ -0,0 +1,342 @@
+/*body.has-bg-photo {
+ position: relative;
+ min-width: 420px;
+ width: 100%;
+ height: 100%;
+ background: url('../img/cooking-woman.jpg')no-repeat center center fixed;
+ -webkit-background-size: cover;
+ -moz-background-size: cover;
+ -o-background-size: cover;
+ background-size: cover;
+ /*filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='.myBackground.jpg', sizingMethod='scale');
+ -ms-filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='myBackground.jpg', sizingMethod='scale')";*!/
+}*/
+
+.bg-img {
+ position: absolute;
+ z-index: -1;
+ min-width: 420px;
+ width: 100%;
+ height: 100%;
+ background: url('../img/cooking-woman.jpg')no-repeat center center fixed;
+ -webkit-background-size: cover;
+ -moz-background-size: cover;
+ -o-background-size: cover;
+ background-size: cover;
+ /*filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='.myBackground.jpg', sizingMethod='scale');
+ -ms-filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='myBackground.jpg', sizingMethod='scale')";*/
+}
+
+.site-header {
+ background: #A02654;
+ height: 68px;
+}
+
+.kitchenly-branding {
+ margin: 0px;
+ padding: 0px;
+}
+
+.kitchenly-branding a {
+ display: block;
+ margin: 0px;
+ color: #fff;
+ font-size: 22px;
+ letter-spacing: 0.8pt;
+ background: transparent url('../img/kitchenly-logo.png') no-repeat 0px 8px;
+ text-indent: 62px;
+ height: 68px;
+ line-height: 68px;
+ font-family: "mic-32-new-web", sans-serif;
+}
+
+.kitchenly-branding a:hover {
+ text-decoration: none;
+}
+
+h1.tag-line {
+ color: #fff;
+ font-size: 48px;
+ line-height: 52px;
+
+}
+
+h2.description {
+ color: #fff;
+ font-size: 22px;
+ line-height: 36px;
+ margin-top: 20px;
+ font-weight: normal;
+}
+
+.result-box {
+ background: #1F1F20;
+ margin-bottom: 28px;
+ color: #fff;
+ box-sizing: border-box;
+}
+
+#user-nav {
+ margin-top: 16px;
+}
+
+#user-nav li {
+ margin-left: 9px;
+}
+
+#user-nav li a {
+ color: #fff;
+}
+
+#user-nav li a:hover {
+ color: #333;
+}
+
+
+
+.host-user-img {
+ border-radius: 3px;
+}
+
+.host-user-img-big {
+ border-radius: 3px;
+ height: 60px;
+ width: 60px;
+ margin-right: 8px;
+}
+
+h4.result-title {
+ margin: 0px;
+ color: #fff;
+ padding: 10px;
+ padding-bottom: 3px;
+ font-weight: normal;
+}
+
+.venue {
+ padding-left: 10px;
+}
+
+.result-meta {
+ padding: 10px;
+ border-top: 1px solid #676767;
+ margin-top: 10px;
+}
+
+.host-name {
+ font-size: 14px;
+ position: relative;
+}
+
+.host-user-img {
+ width: 36px;
+ height: 36px;
+ border: 1px solid #676767;
+ margin-right: 7px;
+}
+
+#navbar-main {
+ clear: both;
+}
+
+#navbar-secondary {
+ clear: both;
+ margin-top: 20px;
+}
+
+#navbar-secondary input, #navbar-secondary .add-on {
+ top: -1px;
+ position: relative;
+}
+
+#navbar-main .navbar-inner, #navbar-secondary .navbar-inner {
+ padding-right: 0px;
+ padding-left: 0px;
+}
+
+#navbar-main .navbar-form {
+ margin-left: 4px;
+}
+
+#navbar-main .navbar-form div {
+ margin-right: 4px;
+}
+
+#navbar-main #guest-number-picker .btn{
+ width: 160px;
+ text-align: left;
+}
+
+#navbar-secondary .navbar-form {
+ margin-left: 8px;
+}
+
+#navbar-secondary .navbar-form div {
+ margin-right: 6px;
+}
+
+#navbar-main input {
+ height: 42px;
+ line-height: 42px;
+ font-size: 16px;
+ top: -1px;
+ border: none;
+ padding-left: 10px;
+}
+
+#navbar-main .add-on {
+ height: 33px;
+ width: 25px;
+ font-size: 16px;
+ line-height: 35px;
+ top: -1px;
+ padding-top: 5px;
+ position: relative;
+ color: #333;
+}
+
+.homepage-feature {
+ background: #2B2B29;
+ margin-left: 0px;
+ padding: 20px;
+ padding-bottom: 32px;
+ margin-bottom: 68px;
+}
+
+#guest-number-picker .btn{
+ text-align: left;
+}
+
+#search-button {
+ margin-left: 0;
+}
+
+.footer-contain {
+ display: none;
+}
+
+.footer {
+ padding-left: 16px;
+ padding-top: 22px;
+ background: #fff;
+ height: 54px;
+}
+
+a.social-link {
+ text-decoration: none;
+ font-size: 42px;
+ line-height: 42px;
+ color: #333;
+ margin: 6px;
+ display: inline-block;
+ padidng: 0px;
+ margin: 0px;
+ margin-right: 12px;
+}
+
+a:hover.social-link {
+ color: #44A1E1;
+}
+
+.rule {
+ margin-top: 32px;
+ border-top: #fff;
+}
+
+#calendar-picker {
+ width: 230px;
+ background: #fff;
+ box-sizing: border-box;
+}
+
+#calendar-picker .btn-group {
+ width: 100%;
+ margin: 0px;
+}
+
+#calendar-picker .btn-group .center-btn {
+ width: 120px;
+}
+
+#calendar-picker td, #calendar-picker th {
+ width: 32px;
+ height: 32px;
+ border-bottom: 1px solid #ccc;
+ padding: 0px;
+ text-align: center;
+ line-height: 32px;
+ color: #333;
+}
+
+#calendar-picker th {
+ padding-top: 2px;
+}
+
+.typeahead.dropdown-menu {
+ width: 365px;
+}
+
+.typeahead.dropdown-menu li a {
+ font-size: 16px;
+ line-height: 32px;
+ height: 32px;
+}
+
+.typeahead.dropdown-menu li a:hover {
+ color: #fff;
+ text-decoration: none;
+ background: #44A1E1;
+}
+
+.typeahead.dropdown-menu li.active a {
+ color: #fff;
+ text-decoration: none;
+ background: #44A1E1;
+}
+
+#calendar-picker th.day-of-week {
+ height: 24px;
+ line-height: 24px;
+ font-size: 12px;
+}
+
+#date-picker .popover {
+ width: 230px;
+ padding: 0px;
+}
+
+#date-picker .popover-title {
+ display: none;
+}
+
+#date-picker .popover .popover-inner, #date-picker .popover .popover-content {
+ padding: 0px;
+ margin: 0px;
+}
+
+#calendar-picker td.muted {
+ background: #ccc;
+}
+
+#calendar-picker td.muted a {
+ color: #928E88;
+}
+
+a.day {
+ display: block;
+ font-size: 14px;
+}
+
+a.day.today {
+ display: block;
+ font-size: 14px;
+ background: #952B47;
+ color: #fff;
+}
+
+a:hover.day {
+ text-decoration: none;
+ display: block;
+ background: #44A1E1;
+ color: #fff;
+}
View
BIN webapp/public/images/easy-ravioli.jpeg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN webapp/public/img2/cooking-woman.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN webapp/public/img2/kitchenly-logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN webapp/public/img2/lasagna.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN webapp/public/img2/logo-big.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN webapp/public/img2/melissa.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
68 webapp/public/scripts/map.js
@@ -9,46 +9,50 @@
initialize();
function initialize() {
- geocoder = new google.maps.Geocoder();
+ geocoder = new google.maps.Geocoder();
- var myOptions = {
- zoom: 10,
- mapTypeId: google.maps.MapTypeId.ROADMAP
- }
- map = new google.maps.Map(document.getElementById("map-canvas"), myOptions);
- codeAddress("84403");
- addMarker("253 25th Street, Ogden, UT", "Roosters Brewing");
- addMarker("2501 Wall Ave, Ogden, UT", "Union Grill");
- addMarker("195 25th Street, Ogden, UT", "jasoh!");
+ var myOptions = {
+ zoom: 10,
+ mapTypeId: google.maps.MapTypeId.ROADMAP
+ }
+ map = new google.maps.Map(document.getElementById("map-canvas"), myOptions);
+ codeAddress("84403");
+ addMarker("1948 W 1460 E, Provo, UT 84003", "Bountiful Bistro");
+ addMarker("1417 29th St, Ogden, UT 84403", "Fiesta Time");
+ addMarker("600 N 600 E, Provo, UT 84604", "Meatballs by Mike");
+ addMarker("42 N University Ave #204, Provo, UT 84601", "Saigon Kitchen");
+ addMarker("911 123rd Ave NE, Lake Stevens, WA 98258", "Homeland Thai Food");
+ addMarker("1750 Victor Street, Bellingham, WA 98225", "The Horn");
+ addMarker("1312 14th st Ogden, UT 84403", "The Veggie Yurt");
}
function codeAddress(address) {
- geocoder.geocode({
- 'address': address
- }, function(results, status) {
- if (status == google.maps.GeocoderStatus.OK) {
- map.setCenter(results[0].geometry.location);
- } else {
- alert("Geocode was not successful for the following reason: " + status);
- }
- });
+ geocoder.geocode({
+ 'address': address
+ }, function(results, status) {
+ if (status == google.maps.GeocoderStatus.OK) {
+ map.setCenter(results[0].geometry.location);
+ } else {
+ alert("Geocode was not successful for the following reason: " + status);
+ }
+ });
}
function addMarker(address, myTitle) {
- geocoder.geocode({
- 'address': address
- }, function(results, status) {
- if (status == google.maps.GeocoderStatus.OK) {
- var marker = new google.maps.Marker({
- map: map,
- title: myTitle,
- position: results[0].geometry.location
- });
- } else {
- alert("Geocode was not successful for the following reason: " + status);
- }
- });
+ geocoder.geocode({
+ 'address': address
+ }, function(results, status) {
+ if (status == google.maps.GeocoderStatus.OK) {
+ var marker = new google.maps.Marker({
+ map: map,
+ title: myTitle,
+ position: results[0].geometry.location
+ });
+ } else {
+ alert("Geocode was not successful for the following reason: " + status);
+ }
+ });
}
});
View
25 webapp/public/scripts/onload.js
@@ -20,7 +20,30 @@ $(document).ready(function() {
});
// list of cities for typeahead feature
- var cityList = ['Baltimore, MD', 'Boston, MA', 'New York, NY', 'Tampa Bay, FL', 'Chicago', 'Cleveland, OH', 'Detroit, MI', 'Kansas City, MO', 'Los Angeles, CA', 'Oakland, CA', 'Seattle, WA', 'Houston, TX ', 'Provo, UT', 'Salt Lake City, UT', 'Ogden, UT', 'Orem, UT', 'Sandy, UT', 'West Jordan, UT', 'Saint George, UT'].sort();
+ var cityList = ['Baltimore, MD', 'Boston, MA', 'New York, NY', 'Tampa Bay, FL', 'Chicago', 'Cleveland, OH', 'Detroit, MI', 'Kansas City, MO', 'Los Angeles, CA', 'Oakland, CA', 'Seattle, WA', 'Houston, TX ', 'Provo, Utah', 'Salt Lake City, Utah', 'Ogden, Utah', 'Orem, Utah', 'Sandy, Utah', 'West Jordan, Utah', 'Saint George, Utah'].sort();
$('#location').typeahead({source: cityList, items:5});
+
+
+ $('.searchly').submit(function(e) {
+ e.preventDefault();
+
+ var query = "search/?";
+
+ var loc = $("#city-picker input").val();
+ if(loc != "") {
+ var arr =loc.split(",");
+ arr[1] = arr[1].replace(" ","");
+ query += "&city="+arr[0]+"&state="+arr[1];
+ }
+
+ var guests = $("#guest-number-picker .dropdown-toggle .num").html();
+ guests = guests.slice(0,1);
+ if(guests != 1)
+ query += "&guests="+guests;
+
+ window.location = query;
+
+ });
+
});
View
14 webapp/routes/index.js
@@ -5,8 +5,18 @@ exports.index = function(req, res) {
res.render('index', viewData);
};
-exports.payment = function(req, res) {
- res.render('payment', { title: "payment" });
+exports.thankyou =function(req, res) {
+ res.render('thankyou', {title: "Thak You!"});
+}
+
+exports.payment = function(req, res) {
+ if(req.query.id)
+ couchdb.getVenueById(req.query.id, true, function(data) {
+ res.render('payment', { title: "payment", venue: data });
+ console.log(data);
+ });
+
+ else res.render('payment', { title: "payment", venue: null });
};
// Get the search results page.
View
6 webapp/views/index.jade
@@ -9,7 +9,7 @@ header.site-header
div.pull-right
ul#user-nav.unstyled.nav.nav-pills
li.pull-left
- a.sign-up-link(href='/') Sign Up
+ a.sign-up-link(href='/register') Sign Up
li.dropdown.pull-left
a.dropdown-toggle(href='#', data-toggle='dropdown') Login
.dropdown-menu(style='padding: 15px; margin-left: -203px; margin-top:-6px; padding-bottom: 0px;')
@@ -27,7 +27,7 @@ div.page-contain.container
div#navbar-main.navbar.navbar-inverse
div.navbar-inner
- form(class="navbar-form pull-left")
+ form(class="navbar-form pull-left searchly" )
div#city-picker.input-append.pull-left
input(type="input", data-provide="typeahead", placeholder="What city do you want to eat in?")#location.typeahead.span4
span.add-on
@@ -59,4 +59,4 @@ div.page-contain.container
li
a(href="#") 8 Guests
- a#search-button.btn.btn-primary.btn-large.pull-left(href="/search") Search for Dinner
+ button#search-button.btn.btn-primary.btn-large.pull-left(type="submit") Search for Dinner
View
80 webapp/views/payment.jade
@@ -22,33 +22,53 @@ header.site-header
input#sign-in.btn.btn-primary.btn-block(type='submit', value='Sign In')
div.page-contain.container
- h1 Make Payment
- div#stripe-form
- form(action="", method="POST",id="payment-form")
- div.form-row
- div.cc-type Card Type
- select.card-type
- option(value="Visa", selected) VISA
- option(value="American Express") American Express
- option(value="MasterCard") MasterCard
- option(value="Discover") Discover
- option(value="JCB") JCB
- option(value="Diners Club") Diners Club
- div.form-row
- div.cc-text Card card-number
- input(type="text",size="30",autocomplete="off",class="card-number",value="4242424242424242")
- div.form-row
- div.cc-text CVC
- input(type="text",size="4",autocomplete="off",class="card-cvc",value="123")
- div.form-row
- div.cc-text Expiration (MM/YYYY)
- input(type="text",size="2",class="card-expiry-month",value="12")
- span /
- input(type="text",size="4",class="card-expiry-year",value="2012")
- div.form-row
- input(type="hidden",name="amount",value="2000",id="cc-amount")
- input(type="hidden",name="currency",value="usd",id="cc-currency")
- div.form-row
- button(type="submit",class="submit-button btn btn-submit btn-primary") Submit Payment
- div.form-row
- div#errors.hidden
+ h1.span12 Reserve your dinner
+
+ table#payment-table.table-bordered.table-striped.table-collapsed.span7.pull-left
+ tr
+ th Item
+ th Price
+ th Quantity
+ th Total
+ tr
+ if(venue)
+ td= venue.description
+ td= venue.meals[0].price
+ td 4
+ td $#{parseInt(venue.meals[0].price.slice(1,10) * 4)}
+ else
+ td Romantic and Delicious Dinner
+ td $20 / person
+ td 2 guests
+ td $40
+
+ div#stripe-form.span7.pull-left
+ form(action="", method="POST",id="payment-form")
+ legend Enter Payment Info
+ div.form-row
+ div.cc-type Card Type
+ select.card-type
+ option(value="Visa", selected) VISA
+ option(value="American Express") American Express
+ option(value="MasterCard") MasterCard
+ option(value="Discover") Discover
+ option(value="JCB") JCB
+ option(value="Diners Club") Diners Club
+ div.form-row
+ div.cc-text Card card-number
+ input(type="text",size="30",autocomplete="off",class="card-number",value="4242424242424242")
+ div.form-row
+ div.cc-text CVC
+ input(type="text",size="4",autocomplete="off",class="card-cvc",value="123")
+ div.form-row
+ div.cc-text Expiration (MM/YYYY)
+ input(type="text",size="2",class="card-expiry-month",value="12")
+ span /
+ input(type="text",size="4",class="card-expiry-year",value="2012")
+ div.form-row
+ input(type="hidden",name="amount",value="2000",id="cc-amount")
+ input(type="hidden",name="currency",value="usd",id="cc-currency")
+ div.form-row
+ button(type="submit",class="submit-button btn btn-large btn-submit btn-primary") Send Payment
+ div.form-row
+ div#errors.hidden
View
51 webapp/views/search.jade
@@ -1,7 +1,7 @@
block scripts
script(src='http://maps.google.com/maps/api/js?sensor=false')
script(src='/scripts/map.js')
- script(src='/scripts/searchResults.js')
+ script(src='/scripts/searchResults.js')
header.site-header
div.container
@@ -37,7 +37,7 @@ div.page-contain.container
div#guest-number-picker.btn-group.pull-left
button.btn.dropdown-toggle.span2(data-toggle="dropdown")
- span.num 2 guests
+ span.num 4 guests
i.icon-user.pull-right
ul.dropdown-menu
li
@@ -82,7 +82,7 @@ div.page-contain.container
div.result-meta
div.host-bio
- img.host-user-img.pull-left(src="../images/#{user.photo_url}")
+ img.host-user-img.pull-left(src="#{user.photo_url}")
div.host-name #{user.name.first_name} #{user.name.last_name}
div.host-rating
i.icon-star.icon-white
@@ -99,33 +99,36 @@ div.page-contain.container
span.city-name #{user.venues[0].location.city}, #{user.venues[0].location.state}
div.modal-body
- img.result-main-img(src="../images/#{user.venues[0].photo_url}")
- div.meta
-
- div.modal-footer
- div.host-bio.span3.pull-left
- img.host-user-img-big.pull-left(src="../images/#{user.photo_url}")
+ img.pull-left(src="../images/#{user.venues[0].photo_url}",style="width:200px; min-width:200px;")
+ div.host-bio.span3.pull-right
+ img.host-user-img-big.pull-left(src="#{user.photo_url}")
div.host-name.pull-left #{user.name.first_name} #{user.name.last_name}
div.host-rating.pull-left
i.icon-star
i.icon-star
i.icon-star
i.icon-star
- div.pull-right
- span Description:
- span #{user.description}
- span Guest Limits:
+
+ div#description.tab-content
+ span Description:
+ span #{user.description}
+
+ div#specialties.tab-content
+ span Specialties:
+ - if (user.specialties)
+ span #{user.specialties}
+ each specialty in user.specialties
+ span #{specialty}
+ div#previews.tab-content
+ span Reviews:
+ - if (user.reviews)
+ each review in user.reviews
+ span #{review.comment}
+ span #{review.rating}
+ div.modal-footer
+ span
- if (user.guest_limit)
span #{user.guest_limit.minimum}
span #{user.guest_limit.maximum}
- span Specialties:
- - if (user.specialties)
- span #{user.specialties}
- each specialty in user.specialties
- span #{specialty}
- span Reviews:
- - if (user.reviews)
- each review in user.reviews
- span #{review.comment}
- span #{review.rating}
- a.book-now.btn.btn-primary.btn-large(id="book-now-modal-#{index}", href="#", data-uname="#{user.username}", data-uid="#{user._id}") Book It!
+
+ a.book-now.btn.btn-primary.btn-large(id="book-now-modal-#{index}", href="/payment?id=#{user.venues[0]._id}", data-uname="#{user.username}", data-uid="#{user._id}") Book It!
View
32 webapp/views/thankyou.jade
@@ -0,0 +1,32 @@
+block scripts
+ script(src='https://js.stripe.com/v1/')
+ script(src='http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js')
+ script(src='/scripts/payment.js')
+
+header.site-header
+ div.container
+ h1.kitchenly-branding.tk-mic-32-new-web.pull-left
+ a(href='/') kitchen.ly
+ div.pull-right
+ ul#user-nav.unstyled.nav.nav-pills
+ li.pull-left
+ a.sign-up-link(href='/') Sign Up
+ li.dropdown.pull-left
+ a.dropdown-toggle(href='#', data-toggle='dropdown') Login
+ .dropdown-menu(style='padding: 15px; margin-left: -203px; margin-top:-6px; padding-bottom: 0px;')
+ form(method='post', action='login', accept-charset='UTF-8')
+ input#username(style='margin-bottom: 15px;', type='text', placeholder='Username', name='username')
+ input#password(style='margin-bottom: 15px;', type='password', placeholder='Password', name='password')
+ input#remember-me(style='float: left; margin-right: 10px;', type='checkbox', name='remember-me', value='1')
+ label.string.optional(for='user_remember_me') Remember me
+ input#sign-in.btn.btn-primary.btn-block(type='submit', value='Sign In')
+
+div.page-contain.container
+ div.row
+ div.span6
+ h1 Thanks for using kitchen.ly!
+ h3.tk-pt-serif You're adventurous and awesome!
+ div.alert you will get an email conformation of you reservation
+
+ div.row
+ div.logo-big.span6

0 comments on commit 4d9e435

Please sign in to comment.