diff --git a/Changelog.md b/Changelog.md index 52ae5cd08..f09eae8f1 100644 --- a/Changelog.md +++ b/Changelog.md @@ -31,6 +31,7 @@ Ruby 2.0 is no longer officially supported. * Fix CSS for bold links [#5887](https://github.com/diaspora/diaspora/pull/5887) * Correctly handle IE8 in the chrome frame middleware [#5878](https://github.com/diaspora/diaspora/pull/5878) * Fix code reloading for PostPresenter [#5888](https://github.com/diaspora/diaspora/pull/5888) +* Fix closing account from mobile view [#5913](https://github.com/diaspora/diaspora/pull/5913) ## Features * Hide post title of limited post in comment notification email [#5843](https://github.com/diaspora/diaspora/pull/5843) diff --git a/app/views/users/_close_account_modal.haml b/app/views/users/_close_account_modal.haml new file mode 100644 index 000000000..18d422c84 --- /dev/null +++ b/app/views/users/_close_account_modal.haml @@ -0,0 +1,41 @@ +.modal.hide.fade{ id: "closeAccountModal", tabindex: "-1", role: "dialog", aria: { labelledby: "closeAccountModalLabel", hidden: "true" }} + .modal-header + %button.close{type: "button", data: {dismiss: "modal"}, aria: {hidden: "true" }} + × + %h3{ id:"closeAccountModalLabel"} + = t("users.edit.close_account.dont_go") + .modal-body + .row-fluid + .text-center + = image_tag "sadcat.jpg" + %h4 + %strong + = t("users.edit.close_account.mr_wiggles") + + .small-horizontal-spacer + + .row-fluid + .span12 + = t("users.edit.close_account.make_diaspora_better") + + .small-horizontal-spacer + + %ul + %li + = t("users.edit.close_account.what_we_delete") + %li + = t("users.edit.close_account.locked_out") + %li + = t("users.edit.close_account.lock_username") + %p + %strong + = t("users.edit.close_account.no_turning_back") + + = form_for "user", url: user_path, html: { method: :delete } do |f| + = f.error_messages + + %p + = f.label :close_account_password, t("users.edit.current_password"), for: :close_account_password + = f.password_field :current_password, id: :close_account_password + %p + = f.submit t('users.edit.close_account_text'), class: "btn btn-danger", id: "close_account_confirm", data: { confirm: t("are_you_sure_delete_account") } diff --git a/app/views/users/edit.html.haml b/app/views/users/edit.html.haml index d94681dbc..2c211e366 100644 --- a/app/views/users/edit.html.haml +++ b/app/views/users/edit.html.haml @@ -198,41 +198,8 @@ .span6 %h3 - = t('.close_account_text') - =link_to t('.close_account_text'), '#close_account_pane', :rel => 'facebox', :class => "btn btn-danger", :id => "close_account" + = t(".close_account_text") + .btn.btn-danger{ id: "close_account", data: {toggle: "modal", target: "#closeAccountModal"}} + = t(".close_account_text") - .hidden#close_account_pane{:rel => 'facebox'} - #inner_account_delete - %h1 - = t('.close_account.dont_go') - %p - = t('.close_account.make_diaspora_better') - .row-fluid - .span6 - = image_tag 'sadcat.jpg' - .small-horizontal-spacer - %small - %b - = t('.close_account.mr_wiggles') - .span6 - %ul - %li - = t('.close_account.what_we_delete') - %li - = t('.close_account.locked_out') - %li - = t('.close_account.lock_username') - %p - %b - = t('.close_account.no_turning_back') - - = form_for 'user', :url => user_path, :html => { :method => :delete } do |f| - = f.error_messages - - %p - = f.label :close_account_password, t('.current_password'), :for => :close_account_password - = f.password_field :current_password, :id => :close_account_password - %p - = f.submit t('.close_account_text'), :class => "btn btn-danger", :id => "close_account_confirm", :data => { :confirm => t('are_you_sure_delete_account') } - - .span3 + = render "close_account_modal" diff --git a/app/views/users/edit.mobile.haml b/app/views/users/edit.mobile.haml index 688db8b18..dfec1832f 100644 --- a/app/views/users/edit.mobile.haml +++ b/app/views/users/edit.mobile.haml @@ -87,12 +87,12 @@ = f.submit t('.change'), :class => 'button' %hr - + %h4#auto-follow-back-preferences = t('.following') = form_for current_user, :url => user_path, :html => { :method => :put } do |f| = f.error_messages - + %p.checkbox_select = f.label :auto_follow_back, t('.auto_follow_back') = f.check_box :auto_follow_back @@ -117,7 +117,7 @@ %p.checkbox_select = type.label :someone_reported, t('.someone_reported') = type.check_box :someone_reported, {:checked => @email_prefs['someone_reported']}, false, true - + %br %p.checkbox_select = type.label :started_sharing, t('.started_sharing') @@ -128,27 +128,27 @@ = type.label :mentioned, t('.mentioned') = type.check_box :mentioned, {:checked => @email_prefs['mentioned']}, false, true %br - + %p.checkbox_select = type.label :liked, t('.liked') = type.check_box :liked, {:checked => @email_prefs['liked']}, false, true %br - + %p.checkbox_select = type.label :reshared, t('.reshared') = type.check_box :reshared, {:checked => @email_prefs['reshared']}, false, true %br - + %p.checkbox_select = type.label :comment_on_post, t('.comment_on_post') = type.check_box :comment_on_post, {:checked => @email_prefs['comment_on_post']}, false, true %br - + %p.checkbox_select = type.label :also_commented, t('.also_commented') = type.check_box :also_commented, {:checked => @email_prefs['also_commented']}, false, true %br - + %p.checkbox_select = type.label :private_message, t('.private_message') = type.check_box :private_message, {:checked => @email_prefs['private_message']}, false, true @@ -186,39 +186,11 @@ .span-5.last %h4 = t('.close_account_text') - =link_to t('.close_account_text'), '#close_account_pane', :rel => 'facebox', :class => "btn btn-danger", :id => "close_account" + = form_for "user", url: user_path, html: { method: :delete } do |f| + = f.error_messages - .hidden#close_account_pane{:rel => 'facebox'} - #inner_account_delete - %h1 - = t('.close_account.dont_go') - %p - = t('.close_account.make_diaspora_better') - .span-10 - = image_tag 'http://itstrulyrandom.com/wp-content/uploads/2008/03/sadcat.jpg' - %br - %small - %b - = t('.close_account.mr_wiggles') - .span-10.last - %ul - %li - = t('.close_account.what_we_delete') - %li - = t('.close_account.locked_out') - %li - = t('.close_account.lock_username') - %p - %b - = t('.close_account.no_turning_back') - - - = form_for 'user', :url => user_path, :html => { :method => :delete } do |f| - = f.error_messages - - %p - = f.label :close_account_password, t('.current_password'), :for => :close_account_password - = f.password_field :current_password, :id => :close_account_password - %p - = f.submit t('.close_account_text'), :id => "close_account_confirm", :data => { :confirm => t('are_you_sure_delete_account') } - %br + %p + = f.label :close_account_password, t("users.edit.current_password"), for: :close_account_password + = f.password_field :current_password, id: :close_account_password + %p + = f.submit t('users.edit.close_account_text'), class: "btn btn-danger", id: "close_account_confirm", data: { confirm: t("are_you_sure_delete_account") } diff --git a/features/desktop/closes_account.feature b/features/desktop/closes_account.feature index 0388943dd..3f8cf71ab 100644 --- a/features/desktop/closes_account.feature +++ b/features/desktop/closes_account.feature @@ -7,9 +7,9 @@ Feature: Close account Scenario: user closes account Given I am signed in When I go to the users edit page - And I follow "close_account" - And I put in my password in "close_account_password" in the modal window - And I press "close_account_confirm" in the modal window + And I click on selector "#close_account" + And I put in my password in "close_account_password" + And I press "close_account_confirm" And I confirm the alert Then I should be on the new user session page diff --git a/features/mobile/closes_account.feature b/features/mobile/closes_account.feature new file mode 100644 index 000000000..d7c2a4ad9 --- /dev/null +++ b/features/mobile/closes_account.feature @@ -0,0 +1,18 @@ +@javascript +Feature: Close account + In order to close an existing account + As a user + I want to sign in, close my account and try to log in again + + Scenario: user closes account + Given I am signed in + When I toggle the mobile view + And I go to the users edit page + And I put in my password in "close_account_password" + And I press "close_account_confirm" + And I confirm the alert + + When I am on the new user session page + And I try to sign in manually + Then I should be on the new user session page + And I should see a flash message with a warning