Permalink
Browse files

resend invitation, confirm delete

  • Loading branch information...
gerad committed Jun 16, 2010
1 parent 4650d76 commit c6fce2ae943104122990c5da5a00b6d00bfe61b5
Showing with 26 additions and 2 deletions.
  1. +12 −0 nodeko.coffee
  2. +12 −0 views/application.js.coffee
  3. +2 −2 views/teams/show.html.haml
View
@@ -78,6 +78,18 @@ del '/teams/:id', -> # delete not working
team.remove (error, result) =>
@redirect '/teams'
+# resend invitation
+get '/teams/:teamId/invite/:personId', ->
+ Team.first @param('teamId'), (error, team) =>
+ @ensurePermitted team, =>
+ Person.first @param('personId'), (error, person) =>
+ person.inviteTo team, =>
+ if @isXHR
+ @respond 200, 'OK'
+ else
+ # TODO flash "Sent a new invitation to $@person.email"
+ @redirect '/teams/' + team.id()
+
# edit person
get '/people/:id/edit', ->
Person.first @param('id'), (error, person) =>
@@ -1,4 +1,16 @@
$ ->
+ $('a.resend').click ->
+ a: $ this
+ a.hide().after '<span>Resending&hellip;</span>'
+ $.get @href, ->
+ a.next('span').html('Sent!').fadeOut 'slow', ->
+ a.next('span').remove()
+ a.fadeIn()
+ false
+
+ $('a.delete').click ->
+ confirm 'Are you sure?'
+
if $('time').length > 0
[y, m, d, h, i, s]: $('time').attr('datetime').split(/[-:TZ]/)...
ms: Date.UTC y, m-1, d, h, i, s
@@ -40,8 +40,8 @@
- each invite in this.invites
%li
%a{ href: 'mailto:' + invite.email }= invite.email
- %a{ href: '/teams' + this.team.id() + '/invite/' + invite.id() } Resend
+ %a.resend{ href: '/teams/' + this.team.id() + '/invite/' + invite.id() } Resend
- if (this.editAllowed)
%a.button{ href: '/teams/' + this.team.id() + '/edit' } Edit
- %a.button{ href: '/teams/' + this.team.id() + '?_method=DELETE' } Delete
+ %a.delete.button{ href: '/teams/' + this.team.id() + '?_method=DELETE' } Delete

0 comments on commit c6fce2a

Please sign in to comment.