# form for user sign in class Pettanr.Views.UserSeeeion.New extends Backbone.View tagName: 'div' initialize: (options) -> @operators = options.operators render: () -> this.$el.html('') t = _.template($("#sign_in").html()) this.$el.append(t()) @delegateEvents({'submit': 'sign_in'}) this sign_in: () -> m = $('#user_email').val() p = $('#user_password').val() user = new Pettanr.User.Current() user.save({user: {email: m, password: p}}, (current_user) -> r = new Pettanr.Views.Top.Account({operators: window.operators}) $('#account').html(r.render().el) window.router.home() ) return false