From 0cbf5811764426a176aeebee94d9b61fa7076ba2 Mon Sep 17 00:00:00 2001 From: Augier Date: Mon, 1 Jun 2015 21:08:31 +0200 Subject: [PATCH] Better settings display --- app/assets/stylesheets/mobile/header.scss | 5 +- app/assets/stylesheets/mobile/mobile.scss | 24 +- app/assets/stylesheets/profile.scss | 10 + app/helpers/people_helper.rb | 3 +- app/views/admins/_user_entry.haml | 2 +- .../conversations/_conversation.mobile.haml | 2 +- app/views/layouts/application.mobile.haml | 4 +- app/views/people/_person.mobile.haml | 2 +- app/views/photos/_new_profile_photo.haml | 6 +- .../photos/_new_profile_photo.mobile.haml | 55 ---- app/views/profiles/_edit.haml | 77 ------ app/views/profiles/_edit.mobile.haml | 72 ------ app/views/profiles/_edit_private.haml | 57 ++++ app/views/profiles/_edit_public.haml | 22 +- app/views/profiles/_edit_public.mobile.haml | 72 ------ app/views/profiles/edit.haml | 20 +- app/views/profiles/edit.mobile.haml | 18 +- app/views/services/index.html.haml | 23 +- app/views/shared/_settings_nav.haml | 15 +- app/views/shared/_settings_nav.mobile.haml | 1 + app/views/users/_edit.haml | 244 ++++++++---------- app/views/users/privacy_settings.html.haml | 20 +- 22 files changed, 258 insertions(+), 496 deletions(-) delete mode 100644 app/views/photos/_new_profile_photo.mobile.haml delete mode 100644 app/views/profiles/_edit.haml delete mode 100644 app/views/profiles/_edit.mobile.haml create mode 100644 app/views/profiles/_edit_private.haml delete mode 100644 app/views/profiles/_edit_public.mobile.haml diff --git a/app/assets/stylesheets/mobile/header.scss b/app/assets/stylesheets/mobile/header.scss index 0bea56be3..e1edf903d 100644 --- a/app/assets/stylesheets/mobile/header.scss +++ b/app/assets/stylesheets/mobile/header.scss @@ -158,11 +158,12 @@ header { ul { list-style: none; - margin: 0px; + margin: 0; + padding: 0; } } /* This class is added when the user open the drawer */ #app.draw > * { - transform: translateX(-80%); + transform: translateX(-450px); } diff --git a/app/assets/stylesheets/mobile/mobile.scss b/app/assets/stylesheets/mobile/mobile.scss index cc70c0988..9909811cf 100644 --- a/app/assets/stylesheets/mobile/mobile.scss +++ b/app/assets/stylesheets/mobile/mobile.scss @@ -840,17 +840,14 @@ form p.checkbox_select { margin-top: 5px; min-height: 100px; position: relative; - margin-bottom: 20px; + margin-bottom: 15px; + text-align: center; + padding: 0; img { border-radius: 5px; box-shadow: 0 1px 2px #666; - position: absolute; - left: 0; - height: auto; - width: auto; - &.avatar { @include transition(opacity, 0.5s); &.loading { @@ -858,7 +855,16 @@ form p.checkbox_select { } } } - padding-left: 120px; +} + +#birth-date{ + text-align: center; + select{ + width: 32%; + display: inline; + &:first-of-type{ float: left; } + &:last-of-type{ float: right; } + } } #file-upload.button { @@ -896,7 +902,9 @@ form p.checkbox_select { font-size: 1em; ul { - margin: 0 0 0 15px; + margin: 0; + padding: 0; + text-align: center; } li { diff --git a/app/assets/stylesheets/profile.scss b/app/assets/stylesheets/profile.scss index 9353fd781..ce915c30e 100644 --- a/app/assets/stylesheets/profile.scss +++ b/app/assets/stylesheets/profile.scss @@ -136,3 +136,13 @@ margin-right: 0; } } + +#birth-date{ + text-align: center; + select{ + width: 32%; + display: inline; + &:first-of-type{ float: left; } + &:last-of-type{ float: right; } + } +} diff --git a/app/helpers/people_helper.rb b/app/helpers/people_helper.rb index 63d39af21..ffee117c6 100644 --- a/app/helpers/people_helper.rb +++ b/app/helpers/people_helper.rb @@ -32,7 +32,8 @@ module PeopleHelper end def person_image_tag(person, size = :thumb_small) - image_tag(person.profile.image_url(size), :alt => person.name, :class => 'avatar', :title => person.name, 'data-person_id' => person.id) + image_tag(person.profile.image_url(size), alt: person.name, class: "avatar img-responsive center-block", + title: person.name, "data-person_id" => person.id) end def person_image_link(person, opts={}) diff --git a/app/views/admins/_user_entry.haml b/app/views/admins/_user_entry.haml index 40ef42c09..13ac091b0 100644 --- a/app/views/admins/_user_entry.haml +++ b/app/views/admins/_user_entry.haml @@ -3,7 +3,7 @@ %div.pull-left - if user.person %span.media-object - = person_image_tag(user.person) + = person_image_tag(user.person, size: :thumb_small) %div.media-body.row %div.pull-right diff --git a/app/views/conversations/_conversation.mobile.haml b/app/views/conversations/_conversation.mobile.haml index 7c30d0e1f..59ed20290 100644 --- a/app/views/conversations/_conversation.mobile.haml +++ b/app/views/conversations/_conversation.mobile.haml @@ -2,7 +2,7 @@ .stream_element.conversation{:data=>{:guid=>conversation.id}, :class => ('unread' if unread_counts[conversation.id].to_i > 0)} .media .img - = person_image_tag(conversation.author) + = person_image_tag(conversation.author, size: :thumb_small) .bg = render(:partial => 'conversation_subject', diff --git a/app/views/layouts/application.mobile.haml b/app/views/layouts/application.mobile.haml index 89a453683..390b84367 100644 --- a/app/views/layouts/application.mobile.haml +++ b/app/views/layouts/application.mobile.haml @@ -24,7 +24,7 @@ / For Nokia devices %link{rel: "shortcut icon", href: image_path("apple-touch-icon.png")} / For desktop - %link{rel: 'shortcut icon', href: image_path("favicon.png")} } + %link{rel: 'shortcut icon', href: image_path("favicon.png")} / iOS mobile web app indicator / NOTE(we will enable these once we don't have to rely on back/forward buttons anymore) @@ -106,7 +106,7 @@ %li = link_to user_profile_path(current_user.username) do = t('layouts.header.profile') - = person_image_tag(current_user) + = person_image_tag(current_user, size: :thumb_small) %li = link_to t('_contacts'), contacts_path %li diff --git a/app/views/people/_person.mobile.haml b/app/views/people/_person.mobile.haml index 72cf44737..6c565f8ce 100644 --- a/app/views/people/_person.mobile.haml +++ b/app/views/people/_person.mobile.haml @@ -5,7 +5,7 @@ .stream_element{id: person.id} .content - =person_image_link(person) + =person_image_link(person, size: :thumb_small) %span.from =person_link(person, size: :thumb_small) diff --git a/app/views/photos/_new_profile_photo.haml b/app/views/photos/_new_profile_photo.haml index 26b52522b..bee13208a 100644 --- a/app/views/photos/_new_profile_photo.haml +++ b/app/views/photos/_new_profile_photo.haml @@ -60,9 +60,9 @@ #profile_photo_upload = owner_image_tag(:thumb_large) .clearfix - - #file-upload.btn.btn-primary.pull-right - =t('.upload') + .small-horizontal-spacer + #file-upload.btn.btn-primary.pull-right + =t('.upload') = image_tag('mobile-spinner.gif', :class => 'hidden', :style => "z-index:-1", :id => 'file-upload-spinner') diff --git a/app/views/photos/_new_profile_photo.mobile.haml b/app/views/photos/_new_profile_photo.mobile.haml deleted file mode 100644 index 08bc3b4f2..000000000 --- a/app/views/photos/_new_profile_photo.mobile.haml +++ /dev/null @@ -1,55 +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 :head do - :javascript - function createUploader(){ - var uploader = new qq.FileUploaderBasic({ - element: document.getElementById('file-upload'), - params: {'photo' : {'pending' : true, 'aspect_ids' : "all", 'set_profile_photo': true}}, - allowedExtensions: ['jpg', 'jpeg', 'png'], - action: "#{photos_path}", - button: document.getElementById('file-upload'), - sizeLimit: 4194304, - - onProgress: function(id, fileName, loaded, total){ - var progress = Math.round(loaded / total * 100 ); - $('#fileInfo').text(fileName + ' ' + progress + '%'); - }, - - messages: { - typeError: "#{t('photos.new_photo.invalid_ext')}", - sizeError: "#{t('photos.new_photo.size_error')}", - emptyError: "#{t('photos.new_photo.empty')}" - }, - - onSubmit: function(id, fileName){ - $('#file-upload').addClass("loading"); - $("#profile_photo_upload").find(".avatar").addClass('loading'); - $("#file-upload-spinner").removeClass("hidden"); - }, - - onComplete: function(id, fileName, result){ - $("#file-upload-spinner").addClass("hidden"); - $('#fileInfo').text(fileName + ' completed').fadeOut(2000); - $('#file-upload').removeClass("loading"); - location.reload(); - } - }); - } - window.onload = createUploader; - -#profile_photo_upload - = owner_image_tag(:thumb_medium) -.clearfix - - #file-upload.btn.btn-primary.pull-right - =t('.upload') - - = image_tag('mobile-spinner.gif', class: 'hidden', style: "z-index:-1", id: 'file-upload-spinner') - - %p - #fileInfo - - #publisher_photo_upload diff --git a/app/views/profiles/_edit.haml b/app/views/profiles/_edit.haml deleted file mode 100644 index c2854c28b..000000000 --- a/app/views/profiles/_edit.haml +++ /dev/null @@ -1,77 +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_profile') - -= form_tag profile_path, method: :put, multipart: true, id: 'update_profile_form' do - = render 'profiles/edit_public', profile: profile, aspect: aspect, person: person - - %hr - %h3 - = t('profiles.edit.your_private_profile') - - %h4 - = t('profiles.edit.your_bio') - .row - .col-md-12 - = text_area_tag 'profile[bio]', profile.bio, rows: 5, placeholder: t('fill_me_out'), class: 'col-md-12 form-control' - - .small-horizontal-spacer - - %h4 - = t('profiles.edit.your_location') - .row - .col-md-12 - = text_field_tag 'profile[location]', profile.location, placeholder: t('fill_me_out'), class: 'col-md-12 form-control' - - .small-horizontal-spacer - - %h4 - = t('profiles.edit.your_gender') - .row - .col-md-12 - = text_field_tag 'profile[gender]', profile.gender, placeholder: t("fill_me_out"), class: 'col-md-12 form-control' - - .small-horizontal-spacer - - %h4 - = t('profiles.edit.your_birthday') - - .row - .col-md-12.form-inline - = select_date profile.birthday, { prompt: true, default: true, order: t('date.order'), - :start_year => upper_limit_date_of_birth, :end_year => lower_limit_date_of_birth, prefix: 'profile[date]' }, - { class: 'form-control', style: 'width: 32.7%;'} - - .small-horizontal-spacer - - %h4 - = t('search') - - .well.checkbox - = label_tag 'profile[searchable]', class: "checkbox-inline" do - = check_box_tag 'profile[searchable]', true, profile.searchable - = t('profiles.edit.allow_search') - - .small-horizontal-spacer - - %h4 - = t('nsfw') - %p - = t('profiles.edit.nsfw_explanation') - .well.checkbox - = label_tag 'profile[nsfw]', class: "checkbox-inline" do - = check_box_tag 'profile[nsfw]', true, profile.nsfw? - = t('profiles.edit.nsfw_check') - - .small-horizontal-spacer - - = t('profiles.edit.nsfw_explanation2') - - .small-horizontal-spacer - - .submit_block - = yield(:submit_block) - diff --git a/app/views/profiles/_edit.mobile.haml b/app/views/profiles/_edit.mobile.haml deleted file mode 100644 index 3d2a84185..000000000 --- a/app/views/profiles/_edit.mobile.haml +++ /dev/null @@ -1,72 +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_profile') - -= form_tag profile_path, method: :put, multipart: true, id: 'update_profile_form' do - = render 'profiles/edit_public', profile: profile, aspect: aspect, person: person - - %hr - %h4 - = t('profiles.edit.your_private_profile') - - %h4 - = t('profiles.edit.your_bio') - .row - .col-md-12 - = text_area_tag 'profile[bio]', profile.bio, rows: 5, placeholder: t('fill_me_out'), class: 'col-md-12 form-control' - - %br - - %h4 - = t('profiles.edit.your_location') - .row - .col-md-12 - = text_field_tag 'profile[location]', profile.location, placeholder: t('fill_me_out'), class: 'col-md-12 form-control' - - %br - - %h4 - = t('profiles.edit.your_gender') - .row - .col-md-12 - = text_field_tag 'profile[gender]', profile.gender, placeholder: t("fill_me_out"), class: 'col-md-12 form-control' - - %br - - %h4 - = t('profiles.edit.your_birthday') - - .row - .col-md-12.form-inline - = select_date profile.birthday, { prompt: true, default: true, order: t('date.order'), - :start_year => upper_limit_date_of_birth, :end_year => lower_limit_date_of_birth, prefix: 'profile[date]' }, - { class: 'form-control', style: 'width: 33%;'} - - %br - - %h4 - = t('search') - - .well.checkbox - = label_tag 'profile[searchable]', class: "checkbox-inline" do - = check_box_tag 'profile[searchable]', true, profile.searchable - = t('profiles.edit.allow_search') - - %br - - %h4 - = t('nsfw') - %p - = t('profiles.edit.nsfw_explanation') - .well.checkbox - = label_tag 'profile[nsfw]', class: "checkbox-inline" do - = check_box_tag 'profile[nsfw]', true, profile.nsfw? - = t('profiles.edit.nsfw_check') - %p - = t('profiles.edit.nsfw_explanation2') - - .submit_block - =yield(:submit_block) diff --git a/app/views/profiles/_edit_private.haml b/app/views/profiles/_edit_private.haml new file mode 100644 index 000000000..777488c8b --- /dev/null +++ b/app/views/profiles/_edit_private.haml @@ -0,0 +1,57 @@ +-# Copyright (c) 2010-2011, Diaspora Inc. This file is +-# licensed under the Affero General Public License version 3 or later. See +-# the COPYRIGHT file. + +%hr +%h3= t('profiles.edit.your_private_profile') + +%h4= t('profiles.edit.your_bio') + +.clearfix + = text_area_tag 'profile[bio]', profile.bio, rows: 5, placeholder: t('fill_me_out'), class: 'col-md-12 form-control' + +.small-horizontal-spacer +.row + .col-md-6 + %h4= t('profiles.edit.your_location') + = text_field_tag 'profile[location]', profile.location, placeholder: t('fill_me_out'), class: 'col-md-12 form-control' + .col-md-6 + %h4= t('profiles.edit.your_gender') + = text_field_tag 'profile[gender]', profile.gender, placeholder: t("fill_me_out"), class: 'col-md-12 form-control' + +.small-horizontal-spacer + +%h4= t('profiles.edit.your_birthday') + +#birth-date.form-inline + = select_date profile.birthday, { prompt: true, default: true, order: t('date.order'), + :start_year => upper_limit_date_of_birth, :end_year => lower_limit_date_of_birth, prefix: 'profile[date]' }, + { class: 'form-control'} + +.small-horizontal-spacer + +%h4= t('search') + +.well.checkbox + = label_tag 'profile[searchable]', class: "checkbox-inline" do + = check_box_tag 'profile[searchable]', true, profile.searchable + = t('profiles.edit.allow_search') + +.small-horizontal-spacer + +%h4= t('nsfw') +%p + = t('profiles.edit.nsfw_explanation') +.well.checkbox + = label_tag 'profile[nsfw]', class: "checkbox-inline" do + = check_box_tag 'profile[nsfw]', true, profile.nsfw? + = t('profiles.edit.nsfw_check') + +.small-horizontal-spacer + += t('profiles.edit.nsfw_explanation2') + +.small-horizontal-spacer + +.submit_block + = yield(:submit_block) diff --git a/app/views/profiles/_edit_public.haml b/app/views/profiles/_edit_public.haml index 986621e52..532a0b9cd 100644 --- a/app/views/profiles/_edit_public.haml +++ b/app/views/profiles/_edit_public.haml @@ -1,4 +1,6 @@ - content_for :head do + - if mobile + = javascript_include_tag :jquery :javascript $(document).ready(function () { var data = $.parseJSON( '#{@tags_array.to_json.gsub("'", "\\\\'")}' ), @@ -28,34 +30,28 @@ }); }); -%h3 - = t('profiles.edit.your_public_profile') +%h3= t('profiles.edit.your_public_profile') = error_messages_for profile -%h4 - = t('profiles.edit.your_name') +%h4= t('profiles.edit.your_name') .row .col-md-6 = label_tag 'profile[first_name]', t('profiles.edit.first_name') - = text_field_tag 'profile[first_name]', profile.first_name, class: 'col-md-12 form-control' + = text_field_tag 'profile[first_name]', profile.first_name, class: 'form-control' .col-md-6 = label_tag 'profile[last_name]', t('profiles.edit.last_name') - = text_field_tag 'profile[last_name]', profile.last_name, class: 'col-md-12 form-control' + = text_field_tag 'profile[last_name]', profile.last_name, class: 'form-control' .small-horizontal-spacer -%h4 - = t('profiles.edit.your_tags') +%h4= t('profiles.edit.your_tags') -= text_field_tag 'profile[tag_string]', "", placeholder: t('profiles.edit.your_tags_placeholder'), class: "form-control" += text_field_tag 'profile[tag_string]', "", placeholder: t('profiles.edit.your_tags_placeholder'),class: "form-control" .small-horizontal-spacer -%h4 - = t('profiles.edit.your_photo') +%h4= t('profiles.edit.your_photo') = render 'photos/new_profile_photo', aspect: aspect, person: person - -.small-horizontal-spacer diff --git a/app/views/profiles/_edit_public.mobile.haml b/app/views/profiles/_edit_public.mobile.haml deleted file mode 100644 index a8fd0c31e..000000000 --- a/app/views/profiles/_edit_public.mobile.haml +++ /dev/null @@ -1,72 +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 :head do - = javascript_include_tag :jquery - - :javascript - $(document).ready(function () { - var data = $.parseJSON( '#{@tags_array.to_json.gsub("'", "\\\\'")}' ), - autocompleteInput = $("#profile_tag_string"); - - autocompleteInput.autoSuggest("#{tags_path}", { - selectedItemProp: "name", - selectedValuesProp: "name", - searchObjProps: "name", - asHtmlID: "tags", - neverSubmit: true, - retrieveLimit: 10, - minChars: 2, - keyDelay: 200, - startText: "", - emptyText: "#{t('no_results')}", - preFill: data - }); - - autocompleteInput.bind('keydown', function(evt){ - if(evt.keyCode == 13 || evt.keyCode == 9 || evt.keyCode == 32){ - evt.preventDefault(); - if( $('li.as-result-item.active').length == 0 ){ - $('li.as-result-item').first().click(); - } - } - }); - }); - -.stream - - flash.each do |name, msg| - %div{id: "flash_#{name}", class: "expose"} - .message= msg - .stream - %p{class: "conversation_#{name}"}= msg - -%h4 - = t('profiles.edit.your_public_profile') - -= error_messages_for profile - -%h4 - = t('profiles.edit.your_name') -.row - .col-md-6 - = label_tag 'profile[first_name]', t('profiles.edit.first_name') - = text_field_tag 'profile[first_name]', profile.first_name, class: 'col-md-12 form-control' - .col-md-6 - = label_tag 'profile[last_name]', t('profiles.edit.last_name') - = text_field_tag 'profile[last_name]', profile.last_name, class: 'col-md-12 form-control' -%br - -%h4 - = t('profiles.edit.your_tags') - -= text_field_tag 'profile[tag_string]', "", placeholder: t('profiles.edit.your_tags_placeholder'), class: "form-control" - -%br - -%h4 - = t('profiles.edit.your_photo') - -= render 'photos/new_profile_photo', aspect: aspect, person: person - -%br diff --git a/app/views/profiles/edit.haml b/app/views/profiles/edit.haml index 557f39120..c90b66bc8 100644 --- a/app/views/profiles/edit.haml +++ b/app/views/profiles/edit.haml @@ -2,21 +2,15 @@ -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. -.container - .row - .col-md-12 - #section_header - %h2 - = t("settings") - = render "shared/settings_nav" +.container-fluid + = render "shared/settings_nav" -.container - .row - .col-md-3 - .col-md-6 + .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" - = render partial: "edit", locals: {person: @person, profile: @profile, aspect: @aspect, step: @step} - .col-md-3 + = 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 2ae5a331f..2b69ef298 100644 --- a/app/views/profiles/edit.mobile.haml +++ b/app/views/profiles/edit.mobile.haml @@ -2,15 +2,13 @@ -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. += render "shared/settings_nav" -#section_header - %h3 - = t('settings') - = render 'shared/settings_nav' - -.col-md-12.prepend-5.last +.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" - = render partial: 'edit', locals: {person: @person, - profile: @profile, aspect: @aspect, step: @step} + = 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 diff --git a/app/views/services/index.html.haml b/app/views/services/index.html.haml index 23bc36c7d..4c9f79ff7 100644 --- a/app/views/services/index.html.haml +++ b/app/views/services/index.html.haml @@ -5,18 +5,15 @@ - content_for :page_title do = t('.edit_services') -.container - .row - .col-md-12 - #section_header - %h2 - = t('settings') - = render 'shared/settings_nav' +.container-fluid + = render 'shared/settings_nav' - .row{ :style=>"margin-top: 20px;" } - .col-md-7 - = render 'add_remove_services' + .container-fluid + .small-horizontal-spacer + .col-lg-8.col-lg-offset-2 + .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/shared/_settings_nav.haml b/app/views/shared/_settings_nav.haml index e095322fe..76f0a0c95 100644 --- a/app/views/shared/_settings_nav.haml +++ b/app/views/shared/_settings_nav.haml @@ -1,5 +1,10 @@ -%ul.nav.nav-tabs#settings_nav - %li{class: current_page?(edit_profile_path) && 'active'}= link_to t('profile'), edit_profile_path - %li{class: current_page?(edit_user_path) && 'active'}= link_to t('account'), edit_user_path - %li{class: current_page?(privacy_settings_path) && 'active'}= link_to t('privacy'), privacy_settings_path - %li{class: current_page?(services_path) && 'active'}= link_to t('_services'), services_path +.container-fluid + .col-lg-10.col-lg-offset-1 + #section_header + %h2 + = t('settings') + %ul.nav.nav-tabs#settings_nav + %li{class: current_page?(edit_profile_path) && 'active'}= link_to t('profile'), edit_profile_path + %li{class: current_page?(edit_user_path) && 'active'}= link_to t('account'), edit_user_path + %li{class: current_page?(privacy_settings_path) && 'active'}= link_to t('privacy'), privacy_settings_path + %li{class: current_page?(services_path) && 'active'}= link_to t('_services'), services_path diff --git a/app/views/shared/_settings_nav.mobile.haml b/app/views/shared/_settings_nav.mobile.haml index 9c673d74c..06283a10f 100644 --- a/app/views/shared/_settings_nav.mobile.haml +++ b/app/views/shared/_settings_nav.mobile.haml @@ -1,3 +1,4 @@ +%h2.container-fluid.col-md-offset-2= t('settings') #span-24 %h3 #settings_nav diff --git a/app/views/users/_edit.haml b/app/views/users/_edit.haml index d615b4617..9bf6ae3b0 100644 --- a/app/views/users/_edit.haml +++ b/app/views/users/_edit.haml @@ -5,176 +5,158 @@ - content_for :page_title do = t('.edit_account') -.container - .row - .col-md-12 - #section_header - %h2 - = t('settings') - = render 'shared/settings_nav' +.container-fluid + = render 'shared/settings_nav' - .row - .col-md-2 - .col-md-8 + .container-fluid + .col-lg-8.col-lg-offset-2 .row .col-md-6 - %h3 - = t('.your_handle') + %h3= t('.your_handle') + %p %b= current_user.diaspora_handle .col-md-6 - %h3 - = t('.your_email') - = form_for 'user', url: user_path, html: { method: :put, class: "form-horizontal" , id: "email-form"} do |f| + %h3= t('.your_email') + + = 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 - = f.submit t('.change_email'), class: "btn btn-primary pull-right" + .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 - %div.form-group - = f.label :current_password, t('.current_password'), class: "col-sm-3 control-label" - %div.col-sm-9 - = f.password_field :current_password, placeholder: t('.current_password_expl'), class: "form-control col-sm-10" - %div.form-group - = f.label :password, t('.new_password'), class: "col-sm-3 control-label" - %div.col-sm-9 - = 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-3 control-label" - %div.col-sm-9 - = f.password_field :password_confirmation, placeholder: t('.character_minimum_expl'), class: "form-control" + %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" - .submit_block - = link_to t('cancel'), edit_user_path, class: "btn btn-default" - = f.submit t('.change_password'), class: "btn btn-primary pull-right", name: 'change_password' + .submit_block + = link_to t('cancel'), edit_user_path, class: "btn btn-default" + = 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 - = f.select :language, available_language_options, {}, { class: 'form-control' } - = f.submit t('.change_language'), 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 - .row - .col-md-12 - %h3#stream-preferences - = t('.stream_preferences') - = form_for current_user, url: user_path, html: { method: :put } do |f| + %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.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') + = f.label :getting_started, class: "checkbox-inline" do + = f.check_box :getting_started + = t('.show_getting_started') - = f.submit t('.change'), class: 'btn btn-primary pull-right' + .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 - %div.form-group.row - %label.col-sm-5.control-label= t('.auto_follow_aspect') - %div.col-sm-7 - = f.select :auto_follow_back_aspect_id, aspect_options_for_select(current_user.aspects), {}, { class: 'form-control' } + %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 - = f.submit t('.change'), class: 'btn btn-primary pull-right' + .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') + %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 - = f.submit t('.change'), class: 'btn btn-primary pull-right', id: "change_email_preferences" + = 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-md-7 + #account_data.col-lg-7 .row %h3.col-md-12= t('.export_data') - .col-md-6 + .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, class: "btn btn-default btn-block" + = 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 @@ -183,20 +165,20 @@ - else = link_to t('.request_export'), export_profile_user_path, method: :post, class: "btn btn-default btn-block" - .col-md-6 + .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, class: "btn btn-success btn-block" + = 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-md-5 + .col-lg-5 %h3{ style: "text-align: right;" } = t('.close_account_text') @@ -251,6 +233,4 @@ .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') } - - .col-md-2 .small-horizontal-spacer diff --git a/app/views/users/privacy_settings.html.haml b/app/views/users/privacy_settings.html.haml index 335fca651..323679977 100644 --- a/app/views/users/privacy_settings.html.haml +++ b/app/views/users/privacy_settings.html.haml @@ -5,17 +5,11 @@ - content_for :page_title do = t('.title') -.container - .row - .col-md-12 - #section_header - %h2 - = t('privacy') - = render 'shared/settings_nav' +.container-fluid + = render 'shared/settings_nav' - .row - .col-md-3 - .col-md-5 + .container-fluid + .col-lg-8.col-lg-offset-2 %h3 = t('.title') @@ -33,10 +27,7 @@ = f.submit t('users.edit.change'), class: 'btn btn-primary pull-right' %hr - - .row - .col-md-3 - .col-md-5 + .small-horizontal-spacer %h3 = t('.ignored_users') @@ -49,4 +40,3 @@ = link_to t('.stop_ignoring'), block_path(block), method: :delete %br - .col-md-3