Skip to content

Commit

Permalink
proposal views and messaging
Browse files Browse the repository at this point in the history
  • Loading branch information
marksupalla committed Sep 7, 2014
1 parent fc46d68 commit 4cd06fa
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/controllers/inbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
var User = require('../models/user'),
Message = require('../models/message'),
Proposal = require('../models/proposal'),
// Wink = require('../models/wink'),
moment = require('moment');

exports.sendMessage = function(req, res){
Expand Down Expand Up @@ -31,6 +30,7 @@ exports.message = function(req, res){
};

exports.sendProposal = function(req, res){
console.log('****************', req.body);
Proposal.send(req.body.senderId, req.body.receiverId, req.body, function(){
User.findById(req.body.receiverId, function(err, user){
res.redirect('/users/' + user.alias);
Expand Down
5 changes: 3 additions & 2 deletions app/static/js/user/proposal.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@

function geocodeAndSubmit(e){
var geocoder = new google.maps.Geocoder(),
loc = $('input[name=loc]').val();
loc = $('#loc').val();
console.log(loc);
geocoder.geocode({address:loc}, function(results, status){
console.log('results', results);
var name = results[0].formatted_address,
var loc = results[0].formatted_address,
lat = results[0].geometry.location.lat(),
lng = results[0].geometry.location.lng();
$('input[name=loc]').val(name);
Expand Down
3 changes: 0 additions & 3 deletions app/views/users/proposal.jade
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ block content
form(role='form', method='post', action='/proposals')
input(type='hidden', name='receiverId', value='#{receiverId}')
input(type='hidden', name='senderId', value='#{user._id}')
input(type='hidden', name='coordinates', data-name='lat')
input(type='hidden', name='coordinates', data-name='lng')
input(type='hidden', name='loc', data-name='loc')
.form-group
label Activity
input.form-control#activity(type='text', name='activity', placeholder='ie. Sailing, Skydiving...', autofocus=true)
Expand Down

0 comments on commit 4cd06fa

Please sign in to comment.