From 264f41a09d6edec1755e8234194094d45dad970c Mon Sep 17 00:00:00 2001 From: fla Date: Mon, 8 Jun 2015 19:41:57 +0200 Subject: [PATCH 1/4] Add Services and Privacy settings page to mobile --- app/assets/stylesheets/mobile/mobile.scss | 70 ++-- app/assets/stylesheets/mobile/settings.scss | 31 ++ app/views/profiles/edit.mobile.haml | 17 +- app/views/services/index.mobile.haml | 15 + app/views/shared/_settings_nav.mobile.haml | 16 +- app/views/users/edit.haml | 361 +++++++++++-------- app/views/users/edit.mobile.haml | 2 + app/views/users/privacy_settings.html.haml | 1 - app/views/users/privacy_settings.mobile.haml | 41 +++ 9 files changed, 343 insertions(+), 211 deletions(-) create mode 100644 app/assets/stylesheets/mobile/settings.scss create mode 100644 app/views/services/index.mobile.haml create mode 100644 app/views/users/edit.mobile.haml create mode 100644 app/views/users/privacy_settings.mobile.haml diff --git a/app/assets/stylesheets/mobile/mobile.scss b/app/assets/stylesheets/mobile/mobile.scss index 3a65e1022..b68f34e98 100644 --- a/app/assets/stylesheets/mobile/mobile.scss +++ b/app/assets/stylesheets/mobile/mobile.scss @@ -9,6 +9,7 @@ @import "header"; @import "mobile/tags"; @import "mobile/conversations"; +@import "mobile/settings"; a { color: #2489ce; @@ -137,6 +138,7 @@ h3 { margin-top: 0; } } } +.settings_container, .stream_element, #login_form { border-radius: 5px; @@ -149,15 +151,37 @@ h3 { margin-top: 0; } border-bottom-color: #aaa; } -.stream_element div.img img.avatar { - margin: 10px; -} +.stream_element { + padding: 0px; -.stream_element .bd { - padding-top: 10px; -} + div.img img.avatar { + margin: 10px; + } -.stream_element .media { padding: 0; } + .bd { + padding-top: 10px; + } + + .media { + padding: 0; + } + + .photo_attachments { + border-radius: 3px 3px 0 0; + + border: { + bottom: 1px solid #ccc; + } + + img.big-stream-photo { + border-radius: 3px 3px 0 0; + width: 100%; + } + a { + padding: 0; } + margin-top: 0; + } +} .photo_attachments { position: relative; @@ -430,22 +454,7 @@ h3 { margin-top: 0; } } .floater { - float: right; } - -.stream_element .photo_attachments { - border-radius: 3px 3px 0 0; - - border: { - bottom: 1px solid #ccc; - } - - img.big-stream-photo { - border-radius: 3px 3px 0 0; - width: 100%; - } - a { - padding: 0; } - margin-top: 0; + float: right; } .photo_area { @@ -602,7 +611,6 @@ select { overflow: hidden; } -.stream_element { padding: 0; } .notifications { list-style: none; @@ -882,20 +890,6 @@ form p.checkbox_select { } } -#settings_nav { - font-size: 1em; - - ul { - margin: 0; - padding: 0; - text-align: center; - } - - li { - display: inline; - } -} - form#update_profile_form { select { padding: 3px; diff --git a/app/assets/stylesheets/mobile/settings.scss b/app/assets/stylesheets/mobile/settings.scss new file mode 100644 index 000000000..d2e62ef32 --- /dev/null +++ b/app/assets/stylesheets/mobile/settings.scss @@ -0,0 +1,31 @@ +#settings_nav { + border-bottom: 1px solid $border-grey; + margin-bottom: 1rem; + padding-bottom: 1rem; + + ul { + padding: 0px; + margin: 0px; + } + + li { + display: inline; + font-size: 1.7rem; + padding: 0px 0.3rem; + + &:first-child { padding-left: 0px; } + &:last-child { padding-right: 0px; } + } +} + +.services_page { + h3 { + margin: 1rem 0px; + } + + .services_explanation { + border-top: 1px solid $border-grey; + margin-top: 1rem; + padding: 1rem; + } +} diff --git a/app/views/profiles/edit.mobile.haml b/app/views/profiles/edit.mobile.haml index 2b69ef298..4fe5c49a7 100644 --- a/app/views/profiles/edit.mobile.haml +++ b/app/views/profiles/edit.mobile.haml @@ -2,13 +2,14 @@ -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. -= render "shared/settings_nav" +.settings_container + = render "shared/settings_nav" -.col-lg-8.col-lg-offset-2 - - content_for :submit_block do - = link_to t("cancel"), local_or_remote_person_path(current_user.person), class: "btn btn-default button" - = submit_tag t(".update_profile"), class: "btn btn-primary pull-right", id: "update_profile" + .col-lg-8.col-lg-offset-2 + - content_for :submit_block do + = link_to t("cancel"), local_or_remote_person_path(current_user.person), class: "btn btn-default button" + = submit_tag t(".update_profile"), class: "btn btn-primary pull-right", id: "update_profile" - = form_tag profile_path, method: :put, multipart: true, id: "update_profile_form" do - = render "edit_public", profile: @profile, aspect: @aspect, person: @person, mobile: true - = render "edit_private", person: @person, profile: @profile, aspect: @aspect, step: @step + = form_tag profile_path, method: :put, multipart: true, id: "update_profile_form" do + = render "edit_public", profile: @profile, aspect: @aspect, person: @person, mobile: true + = render "edit_private", person: @person, profile: @profile, aspect: @aspect, step: @step diff --git a/app/views/services/index.mobile.haml b/app/views/services/index.mobile.haml new file mode 100644 index 000000000..be1735c43 --- /dev/null +++ b/app/views/services/index.mobile.haml @@ -0,0 +1,15 @@ +-# Copyright (c) 2010-2011, Diaspora Inc. This file is +-# licensed under the Affero General Public License version 3 or later. See +-# the COPYRIGHT file. + +.settings_container.services_page + - content_for :page_title do + = t('.edit_services') + + = render 'shared/settings_nav' + + .col-md-12 + = render 'add_remove_services' + + .col-md-12.services_explanation + = t('.services_explanation') diff --git a/app/views/shared/_settings_nav.mobile.haml b/app/views/shared/_settings_nav.mobile.haml index 06283a10f..e771f1d79 100644 --- a/app/views/shared/_settings_nav.mobile.haml +++ b/app/views/shared/_settings_nav.mobile.haml @@ -1,8 +1,8 @@ -%h2.container-fluid.col-md-offset-2= t('settings') -#span-24 - %h3 - #settings_nav - %ul - %li= link_to_unless_current t('profile'), edit_profile_path - | - %li= link_to_unless_current t('account'), edit_user_path +#settings_nav.container-fluid + %h2= t('settings') + %nav + %ul + %li= link_to_unless_current t('profile'), edit_profile_path + %li= link_to_unless_current t('account'), edit_user_path + %li= link_to_unless_current t('privacy'), privacy_settings_path + %li= link_to_unless_current t('_services'), services_path diff --git a/app/views/users/edit.haml b/app/views/users/edit.haml index 14fc6c2e2..d5e32906f 100644 --- a/app/views/users/edit.haml +++ b/app/views/users/edit.haml @@ -5,192 +5,241 @@ - content_for :page_title do = t('.edit_account') += render 'shared/settings_nav' + .container-fluid - = render 'shared/settings_nav' + .col-lg-8.col-lg-offset-2 + .row + .col-md-6 + %h3= t('.your_handle') - .container-fluid - .col-lg-8.col-lg-offset-2 - .row - .col-md-6 - %h3= t('.your_handle') - - %p - %b= current_user.diaspora_handle - .col-md-6 - %h3 - = t(".your_email") - %i.entypo.lock.gray.settings_visibility{title: t("users.edit.your_email_private")} + %p + %b= current_user.diaspora_handle + .col-md-6 + %h3 + = t(".your_email") + %i.entypo.lock.gray.settings_visibility{title: t("users.edit.your_email_private")} - = form_for 'user', url: user_path, html: { method: :put, class: "form-horizontal col-md-12" , id: "email-form"} do |f| - = f.error_messages - .form-group - = f.text_field :email, value: @user.unconfirmed_email || @user.email, class: "col-md-7 form-control" - .form-group - .clearfix= f.submit t('.change_email'), class: "btn btn-primary pull-right" - - if @user.unconfirmed_email.present? - %div= t('.email_awaiting_confirmation', email: @user.email, :unconfirmed_email => @user.unconfirmed_email) - - %hr - - %h3= t('.change_password') - = form_for @user, url: user_path, html: { method: :put, class: "form-horizontal" } do |f| - - if (@user.errors.keys & [:password, :password_confirmation, :current_password]).present? + = form_for 'user', url: user_path, html: { method: :put, class: "form-horizontal col-md-12" , id: "email-form"} do |f| = f.error_messages - %div.form-group - = f.label :current_password, t('.current_password'), class: "col-sm-6 control-label" - %div.col-sm-6 - = f.password_field :current_password, placeholder: t('.current_password_expl'), class: "form-control" - %div.form-group - = f.label :password, t('.new_password'), class: "col-sm-6 control-label" - %div.col-sm-6 - = f.password_field :password, placeholder: t('.character_minimum_expl'), class: "form-control" - %div.form-group - = f.label :password_confirmation, t('password_confirmation'), class: "col-sm-6 control-label" - %div.col-sm-6 - = f.password_field :password_confirmation, placeholder: t('.character_minimum_expl'), class: "form-control" + .form-group + = f.text_field :email, value: @user.unconfirmed_email || @user.email, class: "col-md-7 form-control" + .form-group + .clearfix= f.submit t('.change_email'), class: "btn btn-primary pull-right" + - if @user.unconfirmed_email.present? + %div= t('.email_awaiting_confirmation', email: @user.email, :unconfirmed_email => @user.unconfirmed_email) - .clearfix - = f.submit t('.change_password'), class: "btn btn-primary pull-right", name: 'change_password' + %hr - %hr + %h3= t('.change_password') + = form_for @user, url: user_path, html: { method: :put, class: "form-horizontal" } do |f| + - if (@user.errors.keys & [:password, :password_confirmation, :current_password]).present? + = f.error_messages + %div.form-group + = f.label :current_password, t('.current_password'), class: "col-sm-6 control-label" + %div.col-sm-6 + = f.password_field :current_password, placeholder: t('.current_password_expl'), class: "form-control" + %div.form-group + = f.label :password, t('.new_password'), class: "col-sm-6 control-label" + %div.col-sm-6 + = f.password_field :password, placeholder: t('.character_minimum_expl'), class: "form-control" + %div.form-group + = f.label :password_confirmation, t('password_confirmation'), class: "col-sm-6 control-label" + %div.col-sm-6 + = f.password_field :password_confirmation, placeholder: t('.character_minimum_expl'), class: "form-control" - %h3= t('.change_language') - = form_for 'user', url: user_path, html: { method: :put} do |f| - .form-inline.clearfix - = f.select :language, available_language_options, {}, { class: 'form-control form-group' } - = f.submit t('.change_language'), class: "btn btn-primary pull-right" + .clearfix + = f.submit t('.change_password'), class: "btn btn-primary pull-right", name: 'change_password' - %hr + %hr - %h3= t(".change_color_theme") - = form_for "user", url: user_path, html: {method: :put} do |f| - .form-inline.clearfix - = f.select :color_theme, available_color_themes, {}, {class: "form-control form-group"} - = f.submit t(".change_color_theme"), class: "btn btn-primary pull-right" + %h3= t('.change_language') + = form_for 'user', url: user_path, html: { method: :put} do |f| + .form-inline.clearfix + = f.select :language, available_language_options, {}, { class: 'form-control form-group' } + = f.submit t('.change_language'), class: "btn btn-primary pull-right" - %hr + %hr - %h3#stream-preferences - = t('.stream_preferences') - = form_for current_user, url: user_path, html: { method: :put } do |f| + %h3= t(".change_color_theme") + = form_for "user", url: user_path, html: {method: :put} do |f| + .form-inline.clearfix + = f.select :color_theme, available_color_themes, {}, {class: "form-control form-group"} + = f.submit t(".change_color_theme"), class: "btn btn-primary pull-right" - = f.fields_for :stream_preferences do |type| - #stream_prefs - - if AppConfig.settings.community_spotlight.enable? - = f.label :show_community_spotlight_in_stream, class: "checkbox-inline" do - = f.check_box :show_community_spotlight_in_stream - = t('.show_community_spotlight') + %hr - = f.label :getting_started, class: "checkbox-inline" do - = f.check_box :getting_started - = t('.show_getting_started') + %h3#stream-preferences + = t('.stream_preferences') + = form_for current_user, url: user_path, html: { method: :put } do |f| - .clearfix= f.submit t('.change'), class: 'btn btn-primary pull-right' + = f.fields_for :stream_preferences do |type| + #stream_prefs + - if AppConfig.settings.community_spotlight.enable? + = f.label :show_community_spotlight_in_stream, class: "checkbox-inline" do + = f.check_box :show_community_spotlight_in_stream + = t('.show_community_spotlight') - %hr + = f.label :getting_started, class: "checkbox-inline" do + = f.check_box :getting_started + = t('.show_getting_started') - %h3#auto-follow-back-preferences - = t('.following') - = form_for current_user, url: user_path, html: { method: :put, class: "form-horizontal"} do |f| - = f.label :auto_follow_back, class: "checkbox-inline" do - = f.check_box :auto_follow_back - = t('.auto_follow_back') - .small-horizontal-spacer - %div.form-group.row - %label.col-sm-6.control-label= t('.auto_follow_aspect') - %div.col-sm-6 - = f.select :auto_follow_back_aspect_id, aspect_options_for_select(current_user.aspects), {}, { class: 'form-control' } - - .small-horizontal-spacer .clearfix= f.submit t('.change'), class: 'btn btn-primary pull-right' - %hr + %hr - %h3 - = t('.receive_email_notifications') - = form_for 'user', url: user_path, html: { method: :put } do |f| - = f.fields_for :email_preferences do |type| - #email_prefs - - if current_user.admin? - = type.label :someone_reported, class: "checkbox-inline" do - = type.check_box :someone_reported, {checked: @email_prefs['someone_reported']}, false, true - = t('.someone_reported') + %h3#auto-follow-back-preferences + = t('.following') + = form_for current_user, url: user_path, html: { method: :put, class: "form-horizontal"} do |f| + = f.label :auto_follow_back, class: "checkbox-inline" do + = f.check_box :auto_follow_back + = t('.auto_follow_back') + .small-horizontal-spacer + %div.form-group.row + %label.col-sm-6.control-label= t('.auto_follow_aspect') + %div.col-sm-6 + = f.select :auto_follow_back_aspect_id, aspect_options_for_select(current_user.aspects), {}, { class: 'form-control' } - .small-horizontal-spacer + .small-horizontal-spacer + .clearfix= f.submit t('.change'), class: 'btn btn-primary pull-right' - = type.label :started_sharing, class: "checkbox-inline" do - = type.check_box :started_sharing, {checked: @email_prefs['started_sharing']}, false, true - = t('.started_sharing') - .small-horizontal-spacer + %hr - = type.label :mentioned, class: "checkbox-inline" do - = type.check_box :mentioned, {checked: @email_prefs['mentioned']}, false, true - = t('.mentioned') - .small-horizontal-spacer + %h3 + = t('.receive_email_notifications') + = form_for 'user', url: user_path, html: { method: :put } do |f| + = f.fields_for :email_preferences do |type| + #email_prefs + - if current_user.admin? + = type.label :someone_reported, class: "checkbox-inline" do + = type.check_box :someone_reported, {checked: @email_prefs['someone_reported']}, false, true + = t('.someone_reported') - = type.label :liked, class: "checkbox-inline" do - = type.check_box :liked, {checked: @email_prefs['liked']}, false, true - = t('.liked') - .small-horizontal-spacer + .small-horizontal-spacer - = type.label :reshared, class: "checkbox-inline" do - = type.check_box :reshared, {checked: @email_prefs['reshared']}, false, true - = t('.reshared') - .small-horizontal-spacer + = type.label :started_sharing, class: "checkbox-inline" do + = type.check_box :started_sharing, {checked: @email_prefs['started_sharing']}, false, true + = t('.started_sharing') + .small-horizontal-spacer - = type.label :comment_on_post, class: "checkbox-inline" do - = type.check_box :comment_on_post, {checked: @email_prefs['comment_on_post']}, false, true - = t('.comment_on_post') - .small-horizontal-spacer + = type.label :mentioned, class: "checkbox-inline" do + = type.check_box :mentioned, {checked: @email_prefs['mentioned']}, false, true + = t('.mentioned') + .small-horizontal-spacer - = type.label :also_commented, class: "checkbox-inline" do - = type.check_box :also_commented, {checked: @email_prefs['also_commented']}, false, true - = t('.also_commented') - .small-horizontal-spacer + = type.label :liked, class: "checkbox-inline" do + = type.check_box :liked, {checked: @email_prefs['liked']}, false, true + = t('.liked') + .small-horizontal-spacer - = type.label :private_message, class: "checkbox-inline" do - = type.check_box :private_message, {checked: @email_prefs['private_message']}, false, true - = t('.private_message') + = type.label :reshared, class: "checkbox-inline" do + = type.check_box :reshared, {checked: @email_prefs['reshared']}, false, true + = t('.reshared') + .small-horizontal-spacer - .small-horizontal-spacer + = type.label :comment_on_post, class: "checkbox-inline" do + = type.check_box :comment_on_post, {checked: @email_prefs['comment_on_post']}, false, true + = t('.comment_on_post') + .small-horizontal-spacer - .clearfix= f.submit t('.change'), class: 'btn btn-primary pull-right', id: "change_email_preferences" + = type.label :also_commented, class: "checkbox-inline" do + = type.check_box :also_commented, {checked: @email_prefs['also_commented']}, false, true + = t('.also_commented') + .small-horizontal-spacer - %hr - .row - #account_data.col-lg-7 - .row - %h3.col-md-12= t('.export_data') - .col-md-6.form-group - - if current_user.exporting - .export-in-progress= t('.export_in_progress') - - elsif current_user.export.present? - = link_to t('.request_export_update'), export_profile_user_path, method: :post, class: "btn btn-default btn-block" - .small-horizontal-spacer - = link_to t('.download_export'), download_profile_user_path, class: "btn btn-success btn-block" - .small-horizontal-spacer - %h6 - = t('.last_exported_at', timestamp: current_user.exported_at) - - else - = link_to t('.request_export'), export_profile_user_path, method: :post, class: "btn btn-default btn-block" + = type.label :private_message, class: "checkbox-inline" do + = type.check_box :private_message, {checked: @email_prefs['private_message']}, false, true + = t('.private_message') - .col-md-6.form-group - - if current_user.exporting_photos - .export-in-progress= t('.export_photos_in_progress') - - elsif current_user.exported_photos_file.present? - = link_to t('.request_export_photos_update'), export_photos_user_path, class: "btn btn-default btn-block" - .small-horizontal-spacer - = link_to t('.download_export_photos'), download_photos_user_path, method: :post, class: "btn btn-success btn-block" - .small-horizontal-spacer - %h6 - = t('.last_exported_at', timestamp: current_user.exported_photos_at) - - else - = link_to t('.request_export_photos'), export_photos_user_path, method: :post, class: "btn btn-default btn-block" + .small-horizontal-spacer - .col-lg-5 - %h3.text-right - = t('.close_account_text') - .btn.btn-danger.pull-right{ id: "close_account", data: {toggle: "modal", target: "#closeAccountModal"}} - = t(".close_account_text") - = render "close_account_modal" + .clearfix= f.submit t('.change'), class: 'btn btn-primary pull-right', id: "change_email_preferences" + + %hr + .row + #account_data.col-lg-7 + .row + %h3.col-md-12= t('.export_data') + .col-md-6.form-group + - if current_user.exporting + .export-in-progress= t('.export_in_progress') + - elsif current_user.export.present? + = link_to t('.request_export_update'), export_profile_user_path, method: :post, class: "btn btn-default btn-block" + .small-horizontal-spacer + = link_to t('.download_export'), download_profile_user_path, class: "btn btn-success btn-block" + .small-horizontal-spacer + %h6 + = t('.last_exported_at', timestamp: current_user.exported_at) + - else + = link_to t('.request_export'), export_profile_user_path, method: :post, class: "btn btn-default btn-block" + + .col-md-6.form-group + - if current_user.exporting_photos + .export-in-progress= t('.export_photos_in_progress') + - elsif current_user.exported_photos_file.present? + = link_to t('.request_export_photos_update'), export_photos_user_path, class: "btn btn-default btn-block" + .small-horizontal-spacer + = link_to t('.download_export_photos'), download_photos_user_path, method: :post, class: "btn btn-success btn-block" + .small-horizontal-spacer + %h6 + = t('.last_exported_at', timestamp: current_user.exported_photos_at) + - else + = link_to t('.request_export_photos'), export_photos_user_path, method: :post, class: "btn btn-default btn-block" + + .col-lg-5 + %h3.text-right + = t('.close_account_text') + + - if mobile + = form_for "user", url: user_path, html: { method: :delete } do |f| + = f.error_messages + .form-group + .clearfix= f.label :close_account_password, t("users.edit.current_password"), for: :close_account_password, + class: "pull-right", style: "padding-top: 9px;" + .small-horizontal-spacer + .clearfix= f.password_field :current_password, id: :close_account_password, class: "form-control" + %p + .clearfix= f.submit t('users.edit.close_account_text'), class: "btn btn-danger pull-right", + id: "close_account_confirm", data: { confirm: t("are_you_sure_delete_account") } + + - if not mobile + =link_to t('.close_account_text'), '#close_account_pane', rel: 'facebox', + class: "btn btn-danger pull-right", id: "close_account" + + .hidden#close_account_pane{rel: 'facebox'} + #inner_account_delete + %h1 + = t('.close_account.dont_go') + %p + = t('.close_account.make_diaspora_better') + .row + .col-md-6 + = image_tag 'sadcat.jpg' + .small-horizontal-spacer + %small + %b + = t('.close_account.mr_wiggles') + .col-md-6 + %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 + .small-horizontal-spacer + = f.submit t('.close_account_text'), class: "btn btn-danger", id: "close_account_confirm", + data: { confirm: t('are_you_sure_delete_account') } +.small-horizontal-spacer diff --git a/app/views/users/edit.mobile.haml b/app/views/users/edit.mobile.haml new file mode 100644 index 000000000..e795627a8 --- /dev/null +++ b/app/views/users/edit.mobile.haml @@ -0,0 +1,2 @@ +.settings_container + = render "edit", mobile: true diff --git a/app/views/users/privacy_settings.html.haml b/app/views/users/privacy_settings.html.haml index 323679977..cdcd90f26 100644 --- a/app/views/users/privacy_settings.html.haml +++ b/app/views/users/privacy_settings.html.haml @@ -39,4 +39,3 @@ \- = link_to t('.stop_ignoring'), block_path(block), method: :delete - %br diff --git a/app/views/users/privacy_settings.mobile.haml b/app/views/users/privacy_settings.mobile.haml new file mode 100644 index 000000000..f89abe4e4 --- /dev/null +++ b/app/views/users/privacy_settings.mobile.haml @@ -0,0 +1,41 @@ +-# Copyright (c) 2010-2011, Diaspora Inc. This file is +-# licensed under the Affero General Public License version 3 or later. See +-# the COPYRIGHT file. + +.settings_container + - content_for :page_title do + = t('.title') + + = render 'shared/settings_nav' + + .container-fluid + .col-lg-8.col-lg-offset-2 + %h3 + = t('.title') + + = form_for current_user, url: user_path, html: { method: :put } do |f| + = f.error_messages + + = f.fields_for :stream_preferences do |type| + #stream_prefs + = f.label :strip_exif, class: "checkbox" do + = f.check_box :strip_exif + = t('.strip_exif') + + .small-horizontal-spacer + .clearfix + = f.submit t('users.edit.change'), class: 'btn btn-primary pull-right' + + %hr + .small-horizontal-spacer + %h3 + = t('.ignored_users') + + - if @blocks.length.zero? + = t('.no_user_ignored_message') + + - @blocks.each do |block| + = block.person_name + \- + = link_to t('.stop_ignoring'), block_path(block), + method: :delete From 5537e8687bb3c609175430f5547e5c3f25f920bb Mon Sep 17 00:00:00 2001 From: fla Date: Mon, 8 Jun 2015 23:20:59 +0200 Subject: [PATCH 2/4] Extract privacy_settings content in a partial --- app/views/users/_privacy_settings.haml | 33 +++++++++++++++++++ app/views/users/privacy_settings.html.haml | 34 +------------------- app/views/users/privacy_settings.mobile.haml | 34 +------------------- 3 files changed, 35 insertions(+), 66 deletions(-) create mode 100644 app/views/users/_privacy_settings.haml diff --git a/app/views/users/_privacy_settings.haml b/app/views/users/_privacy_settings.haml new file mode 100644 index 000000000..1c91a637b --- /dev/null +++ b/app/views/users/_privacy_settings.haml @@ -0,0 +1,33 @@ += render 'shared/settings_nav' + +.container-fluid + .col-lg-8.col-lg-offset-2 + %h3 + = t('.title') + + = form_for current_user, url: user_path, html: { method: :put } do |f| + = f.error_messages + + = f.fields_for :stream_preferences do |type| + #stream_prefs + = f.label :strip_exif, class: "checkbox" do + = f.check_box :strip_exif + = t('.strip_exif') + + .small-horizontal-spacer + .clearfix + = f.submit t('users.edit.change'), class: 'btn btn-primary pull-right' + + %hr + .small-horizontal-spacer + %h3 + = t('.ignored_users') + + - if @blocks.length.zero? + = t('.no_user_ignored_message') + + - @blocks.each do |block| + = block.person_name + \- + = link_to t('.stop_ignoring'), block_path(block), + method: :delete diff --git a/app/views/users/privacy_settings.html.haml b/app/views/users/privacy_settings.html.haml index cdcd90f26..16db316be 100644 --- a/app/views/users/privacy_settings.html.haml +++ b/app/views/users/privacy_settings.html.haml @@ -6,36 +6,4 @@ = t('.title') .container-fluid - = render 'shared/settings_nav' - - .container-fluid - .col-lg-8.col-lg-offset-2 - %h3 - = t('.title') - - = form_for current_user, url: user_path, html: { method: :put } do |f| - = f.error_messages - - = f.fields_for :stream_preferences do |type| - #stream_prefs - = f.label :strip_exif, class: "checkbox" do - = f.check_box :strip_exif - = t('.strip_exif') - - .small-horizontal-spacer - .clearfix - = f.submit t('users.edit.change'), class: 'btn btn-primary pull-right' - - %hr - .small-horizontal-spacer - %h3 - = t('.ignored_users') - - - if @blocks.length.zero? - = t('.no_user_ignored_message') - - - @blocks.each do |block| - = block.person_name - \- - = link_to t('.stop_ignoring'), block_path(block), - method: :delete + = render "privacy_settings" diff --git a/app/views/users/privacy_settings.mobile.haml b/app/views/users/privacy_settings.mobile.haml index f89abe4e4..8b2822c1a 100644 --- a/app/views/users/privacy_settings.mobile.haml +++ b/app/views/users/privacy_settings.mobile.haml @@ -6,36 +6,4 @@ - content_for :page_title do = t('.title') - = render 'shared/settings_nav' - - .container-fluid - .col-lg-8.col-lg-offset-2 - %h3 - = t('.title') - - = form_for current_user, url: user_path, html: { method: :put } do |f| - = f.error_messages - - = f.fields_for :stream_preferences do |type| - #stream_prefs - = f.label :strip_exif, class: "checkbox" do - = f.check_box :strip_exif - = t('.strip_exif') - - .small-horizontal-spacer - .clearfix - = f.submit t('users.edit.change'), class: 'btn btn-primary pull-right' - - %hr - .small-horizontal-spacer - %h3 - = t('.ignored_users') - - - if @blocks.length.zero? - = t('.no_user_ignored_message') - - - @blocks.each do |block| - = block.person_name - \- - = link_to t('.stop_ignoring'), block_path(block), - method: :delete + = render "privacy_settings" From 3e4b8500a4d5d7f46d62a561ad6e1de549427fa3 Mon Sep 17 00:00:00 2001 From: Flaburgan Date: Mon, 15 Jun 2015 17:27:06 +0200 Subject: [PATCH 3/4] Refactor Account settings page with bootstrap grid --- app/views/profiles/edit.haml | 15 +- app/views/profiles/edit.mobile.haml | 16 +- app/views/services/index.html.haml | 15 +- app/views/services/index.mobile.haml | 11 +- app/views/users/_edit.haml | 204 ++++++++++++++++++++ app/views/users/_privacy_settings.haml | 54 +++--- app/views/users/edit.haml | 245 ------------------------- app/views/users/edit.html.haml | 2 + app/views/users/edit.mobile.haml | 2 +- config/locales/diaspora/en.yml | 1 + 10 files changed, 268 insertions(+), 297 deletions(-) create mode 100644 app/views/users/_edit.haml delete mode 100644 app/views/users/edit.haml create mode 100644 app/views/users/edit.html.haml diff --git a/app/views/profiles/edit.haml b/app/views/profiles/edit.haml index c90b66bc8..5caf542f2 100644 --- a/app/views/profiles/edit.haml +++ b/app/views/profiles/edit.haml @@ -6,11 +6,12 @@ = render "shared/settings_nav" .container-fluid - .col-lg-8.col-lg-offset-2 - - content_for :submit_block do - = link_to t("cancel"), local_or_remote_person_path(current_user.person), class: "btn btn-default" - = submit_tag t(".update_profile"), class: "btn btn-primary pull-right", id: "update_profile" + .row + .col-lg-8.col-lg-offset-2 + - content_for :submit_block do + = link_to t("cancel"), local_or_remote_person_path(current_user.person), class: "btn btn-default" + = submit_tag t(".update_profile"), class: "btn btn-primary pull-right", id: "update_profile" - = form_tag profile_path, method: :put, multipart: true, id: "update_profile_form" do - = render "edit_public", profile: @profile, aspect: @aspect, person: @person, mobile: false - = render "edit_private", person: @person, profile: @profile, aspect: @aspect, step: @step + = form_tag profile_path, method: :put, multipart: true, id: "update_profile_form" do + = render "edit_public", profile: @profile, aspect: @aspect, person: @person, mobile: false + = render "edit_private", person: @person, profile: @profile, aspect: @aspect, step: @step diff --git a/app/views/profiles/edit.mobile.haml b/app/views/profiles/edit.mobile.haml index 4fe5c49a7..847909e73 100644 --- a/app/views/profiles/edit.mobile.haml +++ b/app/views/profiles/edit.mobile.haml @@ -5,11 +5,13 @@ .settings_container = render "shared/settings_nav" - .col-lg-8.col-lg-offset-2 - - content_for :submit_block do - = link_to t("cancel"), local_or_remote_person_path(current_user.person), class: "btn btn-default button" - = submit_tag t(".update_profile"), class: "btn btn-primary pull-right", id: "update_profile" + .container-fluid + .row + .col-lg-8.col-lg-offset-2 + - content_for :submit_block do + = link_to t("cancel"), local_or_remote_person_path(current_user.person), class: "btn btn-default" + = submit_tag t(".update_profile"), class: "btn btn-primary pull-right", id: "update_profile" - = form_tag profile_path, method: :put, multipart: true, id: "update_profile_form" do - = render "edit_public", profile: @profile, aspect: @aspect, person: @person, mobile: true - = render "edit_private", person: @person, profile: @profile, aspect: @aspect, step: @step + = form_tag profile_path, method: :put, multipart: true, id: "update_profile_form" do + = render "edit_public", profile: @profile, aspect: @aspect, person: @person, mobile: true + = render "edit_private", person: @person, profile: @profile, aspect: @aspect, step: @step diff --git a/app/views/services/index.html.haml b/app/views/services/index.html.haml index 4c9f79ff7..81b720318 100644 --- a/app/views/services/index.html.haml +++ b/app/views/services/index.html.haml @@ -9,11 +9,12 @@ = render 'shared/settings_nav' .container-fluid - .small-horizontal-spacer - .col-lg-8.col-lg-offset-2 - .col-md-7 - = render 'add_remove_services' + .row + .col-lg-8.col-lg-offset-2 + %h3= t('.title') + .col-md-7 + = render 'add_remove_services' - .col-md-5 - %p - = t('.services_explanation') + .col-md-5 + %p + = t('.services_explanation') diff --git a/app/views/services/index.mobile.haml b/app/views/services/index.mobile.haml index be1735c43..e20f3f5ac 100644 --- a/app/views/services/index.mobile.haml +++ b/app/views/services/index.mobile.haml @@ -8,8 +8,11 @@ = render 'shared/settings_nav' - .col-md-12 - = render 'add_remove_services' + .container-fluid + .row + .col-md-12 + = render 'add_remove_services' - .col-md-12.services_explanation - = t('.services_explanation') + .row + .col-md-12.services_explanation + = t('.services_explanation') diff --git a/app/views/users/_edit.haml b/app/views/users/_edit.haml new file mode 100644 index 000000000..fd67fcf50 --- /dev/null +++ b/app/views/users/_edit.haml @@ -0,0 +1,204 @@ +-# Copyright (c) 2010-2011, Diaspora Inc. This file is +-# licensed under the Affero General Public License version 3 or later. See +-# the COPYRIGHT file. + +- content_for :page_title do + = t('.edit_account') + += render 'shared/settings_nav' + +.container-fluid + .row + .col-lg-8.col-lg-offset-2 + .row + .col-md-6 + %h3= t('.your_handle') + + %p + %b= current_user.diaspora_handle + .col-md-6 + %h3 + = t(".your_email") + %i.entypo.lock.gray.settings_visibility{title: t("users.edit.your_email_private")} + + + = form_for 'user', url: user_path, html: { method: :put, class: "form-horizontal col-md-12" , id: "email-form"} do |f| + = f.error_messages + .form-group + = f.text_field :email, value: @user.unconfirmed_email || @user.email, class: "col-md-7 form-control" + .clearfix= f.submit t('.change_email'), class: "btn btn-primary pull-right" + - if @user.unconfirmed_email.present? + %div= t('.email_awaiting_confirmation', email: @user.email, :unconfirmed_email => @user.unconfirmed_email) + %hr + + .row + .col-md-12 + %h3= t('.change_password') + = form_for @user, url: user_path, html: { method: :put, class: "form-horizontal" } do |f| + - if (@user.errors.keys & [:password, :password_confirmation, :current_password]).present? + = f.error_messages + .form-group + = f.label :current_password, t('.current_password'), class: "col-sm-6 control-label" + .col-sm-6 + = f.password_field :current_password, placeholder: t('.current_password_expl'), class: "form-control" + .form-group + = f.label :password, t('.new_password'), class: "col-sm-6 control-label" + %div.col-sm-6 + = f.password_field :password, placeholder: t('.character_minimum_expl'), class: "form-control" + .form-group + = f.label :password_confirmation, t('password_confirmation'), class: "col-sm-6 control-label" + .col-sm-6 + = f.password_field :password_confirmation, placeholder: t('.character_minimum_expl'), class: "form-control" + + .clearfix + = f.submit t('.change_password'), class: "btn btn-primary pull-right", name: 'change_password' + %hr + + .row + .col-md-12 + %h3= t('.change_language') + = form_for 'user', url: user_path, html: { method: :put} do |f| + .form-inline.clearfix + = f.select :language, available_language_options, {}, { class: 'form-control form-group' } + = f.submit t('.change_language'), class: "btn btn-primary pull-right" + %hr + + .row + .col-md-12 + %h3= t(".change_color_theme") + = form_for "user", url: user_path, html: {method: :put} do |f| + .form-inline.clearfix + = f.select :color_theme, available_color_themes, {}, {class: "form-control form-group"} + = f.submit t(".change_color_theme"), class: "btn btn-primary pull-right" + %hr + + .row + .col-md-12 + %h3#stream-preferences + = t('.stream_preferences') + = form_for current_user, url: user_path, html: { method: :put } do |f| + + = f.fields_for :stream_preferences do |type| + #stream_prefs + - if AppConfig.settings.community_spotlight.enable? + = f.label :show_community_spotlight_in_stream, class: "checkbox-inline" do + = f.check_box :show_community_spotlight_in_stream + = t('.show_community_spotlight') + + = f.label :getting_started, class: "checkbox-inline" do + = f.check_box :getting_started + = t('.show_getting_started') + + .clearfix= f.submit t('.change'), class: 'btn btn-primary pull-right' + %hr + + .row + .col-md-12 + %h3#auto-follow-back-preferences + = t('.following') + = form_for current_user, url: user_path, html: { method: :put, class: "form-horizontal"} do |f| + = f.label :auto_follow_back, class: "checkbox-inline" do + = f.check_box :auto_follow_back + = t('.auto_follow_back') + .small-horizontal-spacer + .form-group.row + %label.col-sm-6.control-label= t('.auto_follow_aspect') + .col-sm-6 + = f.select :auto_follow_back_aspect_id, aspect_options_for_select(current_user.aspects), {}, { class: 'form-control' } + + .small-horizontal-spacer + .clearfix= f.submit t('.change'), class: 'btn btn-primary pull-right' + %hr + + + .row + .col-md-12 + %h3 + = t('.receive_email_notifications') + = form_for 'user', url: user_path, html: { method: :put } do |f| + = f.fields_for :email_preferences do |type| + #email_prefs + - if current_user.admin? + = type.label :someone_reported, class: "checkbox-inline" do + = type.check_box :someone_reported, {checked: @email_prefs['someone_reported']}, false, true + = t('.someone_reported') + + .small-horizontal-spacer + + = type.label :started_sharing, class: "checkbox-inline" do + = type.check_box :started_sharing, {checked: @email_prefs['started_sharing']}, false, true + = t('.started_sharing') + .small-horizontal-spacer + + = type.label :mentioned, class: "checkbox-inline" do + = type.check_box :mentioned, {checked: @email_prefs['mentioned']}, false, true + = t('.mentioned') + .small-horizontal-spacer + + = type.label :liked, class: "checkbox-inline" do + = type.check_box :liked, {checked: @email_prefs['liked']}, false, true + = t('.liked') + .small-horizontal-spacer + + = type.label :reshared, class: "checkbox-inline" do + = type.check_box :reshared, {checked: @email_prefs['reshared']}, false, true + = t('.reshared') + .small-horizontal-spacer + + = type.label :comment_on_post, class: "checkbox-inline" do + = type.check_box :comment_on_post, {checked: @email_prefs['comment_on_post']}, false, true + = t('.comment_on_post') + .small-horizontal-spacer + + = type.label :also_commented, class: "checkbox-inline" do + = type.check_box :also_commented, {checked: @email_prefs['also_commented']}, false, true + = t('.also_commented') + .small-horizontal-spacer + + = type.label :private_message, class: "checkbox-inline" do + = type.check_box :private_message, {checked: @email_prefs['private_message']}, false, true + = t('.private_message') + + .small-horizontal-spacer + + .clearfix= f.submit t('.change'), class: 'btn btn-primary pull-right', id: "change_email_preferences" + %hr + + .row + #account_data.col-lg-7 + .row + .col-md-6 + %h3= t('.export_data') + .form-group + - if current_user.exporting + .export-in-progress= t('.export_in_progress') + - elsif current_user.export.present? + = link_to t('.request_export_update'), export_profile_user_path, method: :post, class: "btn btn-default btn-block" + .small-horizontal-spacer + = link_to t('.download_export'), download_profile_user_path, class: "btn btn-success btn-block" + .small-horizontal-spacer + %h6 + = t('.last_exported_at', timestamp: current_user.exported_at) + - else + = link_to t('.request_export'), export_profile_user_path, method: :post, class: "btn btn-default btn-block" + + .form-group + - if current_user.exporting_photos + .export-in-progress= t('.export_photos_in_progress') + - elsif current_user.exported_photos_file.present? + = link_to t('.request_export_photos_update'), export_photos_user_path, class: "btn btn-default btn-block" + .small-horizontal-spacer + = link_to t('.download_export_photos'), download_photos_user_path, method: :post, class: "btn btn-success btn-block" + .small-horizontal-spacer + %h6 + = t('.last_exported_at', timestamp: current_user.exported_photos_at) + - else + = link_to t('.request_export_photos'), export_photos_user_path, method: :post, class: "btn btn-default btn-block" + + .col-lg-5 + %h3 + = t('.close_account_text') + .form-group + .btn.btn-danger{ id: "close_account", data: {toggle: "modal", target: "#closeAccountModal"}} + = t(".close_account_text") + = render "close_account_modal" diff --git a/app/views/users/_privacy_settings.haml b/app/views/users/_privacy_settings.haml index 1c91a637b..9784c7533 100644 --- a/app/views/users/_privacy_settings.haml +++ b/app/views/users/_privacy_settings.haml @@ -1,33 +1,35 @@ = render 'shared/settings_nav' .container-fluid - .col-lg-8.col-lg-offset-2 - %h3 - = t('.title') + .row + .col-lg-8.col-lg-offset-2 + .row + .col-md-12 + %h3 + = t('.title') - = form_for current_user, url: user_path, html: { method: :put } do |f| - = f.error_messages + = form_for current_user, url: user_path, html: { method: :put } do |f| + = f.error_messages - = f.fields_for :stream_preferences do |type| - #stream_prefs - = f.label :strip_exif, class: "checkbox" do - = f.check_box :strip_exif - = t('.strip_exif') + = f.fields_for :stream_preferences do |type| + #stream_prefs.checkbox + = f.label :strip_exif do + = f.check_box :strip_exif + = t('.strip_exif') + = f.submit t('users.edit.change'), class: 'btn btn-primary pull-right' + %hr + + .row + .col-md-12 + %h3 + = t('.ignored_users') - .small-horizontal-spacer - .clearfix - = f.submit t('users.edit.change'), class: 'btn btn-primary pull-right' + - if @blocks.length.zero? + %p + = t('.no_user_ignored_message') - %hr - .small-horizontal-spacer - %h3 - = t('.ignored_users') - - - if @blocks.length.zero? - = t('.no_user_ignored_message') - - - @blocks.each do |block| - = block.person_name - \- - = link_to t('.stop_ignoring'), block_path(block), - method: :delete + - @blocks.each do |block| + = block.person_name + \- + = link_to t('.stop_ignoring'), block_path(block), + method: :delete diff --git a/app/views/users/edit.haml b/app/views/users/edit.haml deleted file mode 100644 index d5e32906f..000000000 --- a/app/views/users/edit.haml +++ /dev/null @@ -1,245 +0,0 @@ --# Copyright (c) 2010-2011, Diaspora Inc. This file is --# licensed under the Affero General Public License version 3 or later. See --# the COPYRIGHT file. - -- content_for :page_title do - = t('.edit_account') - -= render 'shared/settings_nav' - -.container-fluid - .col-lg-8.col-lg-offset-2 - .row - .col-md-6 - %h3= t('.your_handle') - - %p - %b= current_user.diaspora_handle - .col-md-6 - %h3 - = t(".your_email") - %i.entypo.lock.gray.settings_visibility{title: t("users.edit.your_email_private")} - - - = form_for 'user', url: user_path, html: { method: :put, class: "form-horizontal col-md-12" , id: "email-form"} do |f| - = f.error_messages - .form-group - = f.text_field :email, value: @user.unconfirmed_email || @user.email, class: "col-md-7 form-control" - .form-group - .clearfix= f.submit t('.change_email'), class: "btn btn-primary pull-right" - - if @user.unconfirmed_email.present? - %div= t('.email_awaiting_confirmation', email: @user.email, :unconfirmed_email => @user.unconfirmed_email) - - %hr - - %h3= t('.change_password') - = form_for @user, url: user_path, html: { method: :put, class: "form-horizontal" } do |f| - - if (@user.errors.keys & [:password, :password_confirmation, :current_password]).present? - = f.error_messages - %div.form-group - = f.label :current_password, t('.current_password'), class: "col-sm-6 control-label" - %div.col-sm-6 - = f.password_field :current_password, placeholder: t('.current_password_expl'), class: "form-control" - %div.form-group - = f.label :password, t('.new_password'), class: "col-sm-6 control-label" - %div.col-sm-6 - = f.password_field :password, placeholder: t('.character_minimum_expl'), class: "form-control" - %div.form-group - = f.label :password_confirmation, t('password_confirmation'), class: "col-sm-6 control-label" - %div.col-sm-6 - = f.password_field :password_confirmation, placeholder: t('.character_minimum_expl'), class: "form-control" - - .clearfix - = f.submit t('.change_password'), class: "btn btn-primary pull-right", name: 'change_password' - - %hr - - %h3= t('.change_language') - = form_for 'user', url: user_path, html: { method: :put} do |f| - .form-inline.clearfix - = f.select :language, available_language_options, {}, { class: 'form-control form-group' } - = f.submit t('.change_language'), class: "btn btn-primary pull-right" - - %hr - - %h3= t(".change_color_theme") - = form_for "user", url: user_path, html: {method: :put} do |f| - .form-inline.clearfix - = f.select :color_theme, available_color_themes, {}, {class: "form-control form-group"} - = f.submit t(".change_color_theme"), class: "btn btn-primary pull-right" - - %hr - - %h3#stream-preferences - = t('.stream_preferences') - = form_for current_user, url: user_path, html: { method: :put } do |f| - - = f.fields_for :stream_preferences do |type| - #stream_prefs - - if AppConfig.settings.community_spotlight.enable? - = f.label :show_community_spotlight_in_stream, class: "checkbox-inline" do - = f.check_box :show_community_spotlight_in_stream - = t('.show_community_spotlight') - - = f.label :getting_started, class: "checkbox-inline" do - = f.check_box :getting_started - = t('.show_getting_started') - - .clearfix= f.submit t('.change'), class: 'btn btn-primary pull-right' - - %hr - - %h3#auto-follow-back-preferences - = t('.following') - = form_for current_user, url: user_path, html: { method: :put, class: "form-horizontal"} do |f| - = f.label :auto_follow_back, class: "checkbox-inline" do - = f.check_box :auto_follow_back - = t('.auto_follow_back') - .small-horizontal-spacer - %div.form-group.row - %label.col-sm-6.control-label= t('.auto_follow_aspect') - %div.col-sm-6 - = f.select :auto_follow_back_aspect_id, aspect_options_for_select(current_user.aspects), {}, { class: 'form-control' } - - .small-horizontal-spacer - .clearfix= f.submit t('.change'), class: 'btn btn-primary pull-right' - - %hr - - %h3 - = t('.receive_email_notifications') - = form_for 'user', url: user_path, html: { method: :put } do |f| - = f.fields_for :email_preferences do |type| - #email_prefs - - if current_user.admin? - = type.label :someone_reported, class: "checkbox-inline" do - = type.check_box :someone_reported, {checked: @email_prefs['someone_reported']}, false, true - = t('.someone_reported') - - .small-horizontal-spacer - - = type.label :started_sharing, class: "checkbox-inline" do - = type.check_box :started_sharing, {checked: @email_prefs['started_sharing']}, false, true - = t('.started_sharing') - .small-horizontal-spacer - - = type.label :mentioned, class: "checkbox-inline" do - = type.check_box :mentioned, {checked: @email_prefs['mentioned']}, false, true - = t('.mentioned') - .small-horizontal-spacer - - = type.label :liked, class: "checkbox-inline" do - = type.check_box :liked, {checked: @email_prefs['liked']}, false, true - = t('.liked') - .small-horizontal-spacer - - = type.label :reshared, class: "checkbox-inline" do - = type.check_box :reshared, {checked: @email_prefs['reshared']}, false, true - = t('.reshared') - .small-horizontal-spacer - - = type.label :comment_on_post, class: "checkbox-inline" do - = type.check_box :comment_on_post, {checked: @email_prefs['comment_on_post']}, false, true - = t('.comment_on_post') - .small-horizontal-spacer - - = type.label :also_commented, class: "checkbox-inline" do - = type.check_box :also_commented, {checked: @email_prefs['also_commented']}, false, true - = t('.also_commented') - .small-horizontal-spacer - - = type.label :private_message, class: "checkbox-inline" do - = type.check_box :private_message, {checked: @email_prefs['private_message']}, false, true - = t('.private_message') - - .small-horizontal-spacer - - .clearfix= f.submit t('.change'), class: 'btn btn-primary pull-right', id: "change_email_preferences" - - %hr - .row - #account_data.col-lg-7 - .row - %h3.col-md-12= t('.export_data') - .col-md-6.form-group - - if current_user.exporting - .export-in-progress= t('.export_in_progress') - - elsif current_user.export.present? - = link_to t('.request_export_update'), export_profile_user_path, method: :post, class: "btn btn-default btn-block" - .small-horizontal-spacer - = link_to t('.download_export'), download_profile_user_path, class: "btn btn-success btn-block" - .small-horizontal-spacer - %h6 - = t('.last_exported_at', timestamp: current_user.exported_at) - - else - = link_to t('.request_export'), export_profile_user_path, method: :post, class: "btn btn-default btn-block" - - .col-md-6.form-group - - if current_user.exporting_photos - .export-in-progress= t('.export_photos_in_progress') - - elsif current_user.exported_photos_file.present? - = link_to t('.request_export_photos_update'), export_photos_user_path, class: "btn btn-default btn-block" - .small-horizontal-spacer - = link_to t('.download_export_photos'), download_photos_user_path, method: :post, class: "btn btn-success btn-block" - .small-horizontal-spacer - %h6 - = t('.last_exported_at', timestamp: current_user.exported_photos_at) - - else - = link_to t('.request_export_photos'), export_photos_user_path, method: :post, class: "btn btn-default btn-block" - - .col-lg-5 - %h3.text-right - = t('.close_account_text') - - - if mobile - = form_for "user", url: user_path, html: { method: :delete } do |f| - = f.error_messages - .form-group - .clearfix= f.label :close_account_password, t("users.edit.current_password"), for: :close_account_password, - class: "pull-right", style: "padding-top: 9px;" - .small-horizontal-spacer - .clearfix= f.password_field :current_password, id: :close_account_password, class: "form-control" - %p - .clearfix= f.submit t('users.edit.close_account_text'), class: "btn btn-danger pull-right", - id: "close_account_confirm", data: { confirm: t("are_you_sure_delete_account") } - - - if not mobile - =link_to t('.close_account_text'), '#close_account_pane', rel: 'facebox', - class: "btn btn-danger pull-right", id: "close_account" - - .hidden#close_account_pane{rel: 'facebox'} - #inner_account_delete - %h1 - = t('.close_account.dont_go') - %p - = t('.close_account.make_diaspora_better') - .row - .col-md-6 - = image_tag 'sadcat.jpg' - .small-horizontal-spacer - %small - %b - = t('.close_account.mr_wiggles') - .col-md-6 - %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 - .small-horizontal-spacer - = f.submit t('.close_account_text'), class: "btn btn-danger", id: "close_account_confirm", - data: { confirm: t('are_you_sure_delete_account') } -.small-horizontal-spacer diff --git a/app/views/users/edit.html.haml b/app/views/users/edit.html.haml new file mode 100644 index 000000000..57479c619 --- /dev/null +++ b/app/views/users/edit.html.haml @@ -0,0 +1,2 @@ +.container-fluid + = render "edit" diff --git a/app/views/users/edit.mobile.haml b/app/views/users/edit.mobile.haml index e795627a8..a98f76645 100644 --- a/app/views/users/edit.mobile.haml +++ b/app/views/users/edit.mobile.haml @@ -1,2 +1,2 @@ .settings_container - = render "edit", mobile: true + = render "edit" diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index 28fb31ad6..6176942f7 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -1100,6 +1100,7 @@ en: twitter: "Twitter" wordpress: "WordPress" index: + title: "Manage connected services" connect: "Connect" disconnect: "Disconnect" logged_in_as: "Logged in as %{nickname}." From a7d88adde10c2a5ea9db5ee00f2d847d71823eb0 Mon Sep 17 00:00:00 2001 From: fla Date: Thu, 18 Jun 2015 20:36:18 +0200 Subject: [PATCH 4/4] Improve services setting translation --- config/locales/diaspora/en.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index 6176942f7..b2417d64d 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -1104,11 +1104,11 @@ en: connect: "Connect" disconnect: "Disconnect" logged_in_as: "Logged in as %{nickname}." - no_services_available: "There are no services on this pod available." + no_services_available: "There are no services available on this pod." not_logged_in: "Currently not logged in." really_disconnect: "Disconnect %{service}?" edit_services: "Edit services" - services_explanation: "Connecting to services gives you the ability to publish your posts to them as you write them in diaspora*." + services_explanation: "Connecting to third-party sharing services gives you the ability to publish your posts to them as you write them in diaspora*." create: success: "Authentication successful." failure: "Authentication failed."