Permalink
Browse files

profile view showing up in body

  • Loading branch information...
1 parent e58dbb9 commit f17f719516bd8839256cdd17ab474e0e4340f889 @zmcartor committed May 9, 2012
View
@@ -9,9 +9,6 @@ class Router extends Backbone.Router
console.log 'starting up the router'
#setup our nav links at the bottom to point to various router funcs
self = @
- this.bind('route' , (e) ->
- console.log 'fired!' , e
- )
#make these just links, duhh. REFACTOR DUDE
$('#settings').on 'click' ,() -> self.settings()
@@ -25,7 +22,6 @@ class Router extends Backbone.Router
#based on the template name
$('.main_window').empty();
$('.main_window').append($('#'+name+'_template').html())
- console.log $('#'+name+'_template').html()
settings: ->
@prepare_route('settings')
@@ -39,8 +35,10 @@ class Router extends Backbone.Router
console.log 'showing some places'
profile: ->
- @prepare_route('profile')
- console.log "profile!!"
+ @prepare_route('no_thanks')
+ #read from LS
+ my_profile = new Profile_model
+ pv = new Profile_view(el:$('.main_window'), model:my_profile)
window.App = {}
window.start_router = ->
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -11,7 +11,6 @@ window.Map = class Map extends Backbone.View
#show like a little gif or something while location is determined.
geocode_success_callback: (location) ->
- console.log location
@location = new google.maps.LatLng location.coords.latitude, location.coords.longitude
@render()
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -1,17 +1,21 @@
window.Profile_view = class Profile extends Backbone.View
- events:
- 'click button#save' : 'save_profile'
+ events:{'click button#save' : 'save_profile'}
initialize: ->
_.bindAll @
+ @render()
+ 'blah'
render: ->
+ console.log 'AAAAAAAAAAAAAAA'
@template = _.template($('#profile_template').html())
- $(@el).html(@template(@model.toJSON()))
+ $(@el).html(@template({}))
#go through collection of fields and set values from model to form
- save_profile: ->
+ save_profile:(eve) ->
+ console.log 'save save!!'
+ eve.preventDefault()
#serialize form values to JSON
# @model.set( json)
# save to local storage @model.save()
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -18,6 +18,7 @@
<script src="lib/javascript/backbone.localStorage-min.js" type="text/javascript"></script>
<script src="app/javascript/maps.js" type="text/javascript"></script>
+<script src="app/javascript/profile.js" type="text/javascript"></script>
<script src="app/javascript/app.js" type="text/javascript"></script>
@@ -34,7 +35,17 @@
</div>
</script>
-
+<script type='text/template' id='profile_template'>
+ <div id='profile_contain'>
+ <form class='well' action='#'>
+ <input name='name' placeholder='name?'>
+ <input name='location' placeholder='location?'>
+ <input name='passion' placeholder='what do you love?'>
+ <br>
+ <button id ='save' class='btn btn-primary btn-large'>Update</button>
+ </form>
+</div>
+</script>
<script type="text/javascript">

0 comments on commit f17f719

Please sign in to comment.