From be017bfb0a6e0ebfbddf54f59be1ba057d3058c9 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Mon, 11 Oct 2010 14:16:24 -0700 Subject: [PATCH] DG MS; invite is now a lightbox on feed and manage pages --- app/views/aspects/manage.html.haml | 11 +++++++++-- app/views/invitations/_new.haml | 8 ++++++++ app/views/invitations/new.html.haml | 6 ++---- app/views/shared/_aspect_friends.haml | 6 ++++++ public/javascripts/view.js | 1 + 5 files changed, 26 insertions(+), 6 deletions(-) create mode 100644 app/views/invitations/_new.haml diff --git a/app/views/aspects/manage.html.haml b/app/views/aspects/manage.html.haml index c03b332d3..85296669f 100644 --- a/app/views/aspects/manage.html.haml +++ b/app/views/aspects/manage.html.haml @@ -21,13 +21,20 @@ = request.person.real_name %h3=t('.ignore_remove') - %li.remove + .remove %ul.dropzone %li.grey Drag to ignore/remove + %h3= link_to "Invite a friend!", "#invite_user_pane", :id => "invite_user_button", :class => "invite_user_button", :title => "Invite a friend" + + .yo{ :style => "display:none;"} + #invite_user_pane + = render "invitations/new" + - content_for :publish do = link_to(t('.add_a_new_aspect'), "#add_aspect_pane", :id => "add_aspect_button", :class => "new_aspect button", :title => t('.add_a_new_aspect')) - = link_to "invite a friend!", new_user_invitation_path + + %ul#aspect_list - for aspect in @aspects %li.aspect diff --git a/app/views/invitations/_new.haml b/app/views/invitations/_new.haml new file mode 100644 index 000000000..208e77640 --- /dev/null +++ b/app/views/invitations/_new.haml @@ -0,0 +1,8 @@ +%h2 Send invitation += form_for User.new, :url => invitation_path(User) do |f| + /= devise_error_messages! + %p + = f.label :email + = f.text_field :email + %p= f.submit "Send an invitation" +/= link_to "Home", after_sign_in_path_for(resource_name) diff --git a/app/views/invitations/new.html.haml b/app/views/invitations/new.html.haml index 4b41f06c6..598b16a3d 100644 --- a/app/views/invitations/new.html.haml +++ b/app/views/invitations/new.html.haml @@ -1,10 +1,8 @@ %h2 Send invitation -= form_for resource, :as => resource_name, :url => invitation_path(resource_name) do |f| += form_for User.new, :url => invitation_path(User) do |f| = devise_error_messages! %p = f.label :email - %br/ = f.text_field :email %p= f.submit "Send an invitation" -= link_to "Home", after_sign_in_path_for(resource_name) -%br/ +/= link_to "Home", after_sign_in_path_for(resource_name) diff --git a/app/views/shared/_aspect_friends.haml b/app/views/shared/_aspect_friends.haml index 03da4ee9b..343272dff 100644 --- a/app/views/shared/_aspect_friends.haml +++ b/app/views/shared/_aspect_friends.haml @@ -19,5 +19,11 @@ = render "requests/new_request", :aspect => @aspect -else .clear + %br = link_to t('.add_friends'), aspects_manage_path +%br += link_to "Invite a friend!", "#invite_user_pane", :id => "invite_user_button", :class => "invite_user_button", :title => "Invite a friend" +.yo{ :style => "display:none;"} + #invite_user_pane + = render "invitations/new" diff --git a/public/javascripts/view.js b/public/javascripts/view.js index 4155a593d..eec063bcd 100644 --- a/public/javascripts/view.js +++ b/public/javascripts/view.js @@ -28,6 +28,7 @@ $(document).ready(function(){ //buttons////// $("#add_aspect_button").fancybox({ 'titleShow' : false }); $("#add_request_button").fancybox({ 'titleShow': false }); + $("#invite_user_button").fancybox({ 'titleShow': false }); $(".add_request_button").fancybox({ 'titleShow': false }); $("input[type='submit']").addClass("button");