From 126e7bdc9c317aa2196a903653accb47cde8714a Mon Sep 17 00:00:00 2001 From: flaburgan Date: Fri, 13 Sep 2013 14:01:33 -0700 Subject: [PATCH] Refactor getting_started page, test if facebook is available, fix #4520 --- Changelog.md | 1 + app/assets/stylesheets/application.css.sass | 32 ++++++++ app/assets/stylesheets/mobile.css.scss | 17 ++++ app/views/people/_add_contact.html.haml | 2 +- app/views/photos/_new_profile_photo.haml | 6 -- .../photos/_new_profile_photo.mobile.haml | 6 -- app/views/users/getting_started.haml | 79 ++++++------------- app/views/users/getting_started.mobile.haml | 77 +++++++----------- 8 files changed, 104 insertions(+), 116 deletions(-) diff --git a/Changelog.md b/Changelog.md index c3bd5f787..4e1ecdb73 100644 --- a/Changelog.md +++ b/Changelog.md @@ -20,6 +20,7 @@ * Disable submit button in sign up form after submission to avoid email already exists error [#4506](https://github.com/diaspora/diaspora/issues/4506) * Do not pull the 404 pages assets from Amazon S3 [#4501](https://github.com/diaspora/diaspora/pull/4501) * Fix counter background does not cover more than 2 digits on profile [#4499](https://github.com/diaspora/diaspora/issues/4499) +* Refactor getting_started page, test if facebook is available, fix [#4520](https://github.com/diaspora/diaspora/issues/4520) ## Features * Add oEmbed content to the mobile view [#4343](https://github.com/diaspora/diaspora/pull/4353) diff --git a/app/assets/stylesheets/application.css.sass b/app/assets/stylesheets/application.css.sass index 2832832e0..c009f7d1d 100644 --- a/app/assets/stylesheets/application.css.sass +++ b/app/assets/stylesheets/application.css.sass @@ -2508,6 +2508,38 @@ a.toggle_selector :-moz-box-shadow none :box-shadow none +#hello-there + p + :font-size medium + h1 + :margin 0px + h2 + :margin + :top 80px + :bottom 12px + h3 + :font + :size large + :weight 200 + :margin 0px + form, p + :margin-left 30px + input + :margin-bottom 15px + .hero-unit + :margin 20px 42px + :padding 40px 80px + .awesome + :text-align center + :margin-top 60px + .creation + :font-size 16px + +#profile_photo_upload + #fileInfo + :margin-top 12px + :text-align left + #welcome-to-diaspora :-webkit-box-shadow inset 0 -2px 10px rgba(0,0,0,0.35) :-moz-box-shadow inset 0 -2px 10px rgba(0,0,0,0.35) diff --git a/app/assets/stylesheets/mobile.css.scss b/app/assets/stylesheets/mobile.css.scss index 3b3d0b149..6a4f8c37b 100644 --- a/app/assets/stylesheets/mobile.css.scss +++ b/app/assets/stylesheets/mobile.css.scss @@ -1282,3 +1282,20 @@ input#q.search { .remove_comment { opacity: 0.5; } + +.center { + text-align: center; +} + +/* --- Getting started page --- */ +#hello-there { + h1, h2, h3 { line-height: normal; } + h1 { font-size: 25px; } + h2 { font-size: 20px; } + h3 { font-size: 15px; } + + h2, #awesome_button { + margin-top: 30px; + } +} + diff --git a/app/views/people/_add_contact.html.haml b/app/views/people/_add_contact.html.haml index 2631a4582..156f32e88 100644 --- a/app/views/people/_add_contact.html.haml +++ b/app/views/people/_add_contact.html.haml @@ -1,4 +1,4 @@ -.span7.offset1.well +.well = t('.invited_by') .media .float-right diff --git a/app/views/photos/_new_profile_photo.haml b/app/views/photos/_new_profile_photo.haml index 26dad191a..b6d1acb3a 100644 --- a/app/views/photos/_new_profile_photo.haml +++ b/app/views/photos/_new_profile_photo.haml @@ -60,17 +60,11 @@ #profile_photo_upload = owner_image_tag(:thumb_medium) - -if !aspect.nil? && aspect == :getting_started - %br - %br - #file-upload.button =t('.upload') = image_tag('mobile-spinner.gif', :class => 'hidden', :style => "z-index:-1", :id => 'file-upload-spinner') - %br - %br %p #fileInfo diff --git a/app/views/photos/_new_profile_photo.mobile.haml b/app/views/photos/_new_profile_photo.mobile.haml index 4cd9510a6..5677f4ed5 100644 --- a/app/views/photos/_new_profile_photo.mobile.haml +++ b/app/views/photos/_new_profile_photo.mobile.haml @@ -43,17 +43,11 @@ #profile_photo_upload = owner_image_tag(:thumb_medium) - -if !aspect.nil? && aspect == :getting_started - %br - %br - #file-upload.button =t('.upload') = image_tag('mobile-spinner.gif', :class => 'hidden', :style => "z-index:-1", :id => 'file-upload-spinner') - %br - %br %p #fileInfo diff --git a/app/views/users/getting_started.haml b/app/views/users/getting_started.haml index 0dd140c0d..a1e24b752 100644 --- a/app/views/users/getting_started.haml +++ b/app/views/users/getting_started.haml @@ -4,72 +4,43 @@ - content_for :head do = javascript_include_tag :profile -:css - .media, .bd{ overflow: visible;} - -%br %section#hello-there .hero-unit %h1.center = t('.well_hello_there') - %p.center + %h3.center = t(".community_welcome") = invited_by_message + + %h2 + = t(".who_are_you") - .clearfix - %br - %br + - if AppConfig.configured_services.include? :facebook + %p + != t('.connect_to_facebook', :link => link_to(t('.connect_to_facebook_link'), "auth/facebook?callback_url=#{getting_started_url}")) - .clearfix - .row - %h2 - = t(".who_are_you") + = form_tag profile_path, :method => :put, :remote => true, :id => 'edit_profile' do + %fieldset + = label_tag 'profile[first_name]', t('profiles.edit.your_name') + = text_field_tag 'profile[first_name]', current_user.first_name + = image_tag 'ajax-loader.gif', :id => "gs-name-form-spinner", :class => "hidden" + = label_tag :your_photo, t('profiles.edit.your_photo') + = render 'photos/new_profile_photo', :aspect => :getting_started, :person => current_user.person - .row - %p - != t('.connect_to_facebook', :link => link_to(t('.connect_to_facebook_link'), "auth/facebook?callback_url=#{getting_started_url}")) + %h2 + = t('.what_are_you_in_to') - .row - .span6 - = form_tag profile_path, :method => :put, :remote => true, :id => 'edit_profile' do - %fieldset - .clearfix - = label_tag 'profile[first_name]', t('profiles.edit.your_name'), :class => "bootstrapped" - .input - = text_field_tag 'profile[first_name]', current_user.first_name - = image_tag 'ajax-loader.gif', :id => "gs-name-form-spinner", :class => "hidden" + %p + = t('.hashtag_explanation') - .clearfix - = label_tag :your_photo, t('profiles.edit.your_photo'), :class => "bootstrapped" - .input{:style => "position:relative;"} - = render 'photos/new_profile_photo', :aspect => :getting_started, :person => current_user.person - %br - %br + = form_tag(tag_followings_path, :method => 'get', :class => "tag_input search_form") do + %fieldset + = label_tag 'follow_tags', t('.hashtag_suggestions') + #tags_list + = text_field_tag 'follow_tags', nil, :class => "nostrap" - .clearfix - .row - %h2 - = t('.what_are_you_in_to') - - .row - %p - = t('.hashtag_explanation') - - .row - .span13 - = form_tag(tag_followings_path, :method => 'get', :class => "tag_input search_form") do - %fieldset - .clearfix - = label_tag 'follow_tags', t('.hashtag_suggestions'), :class => "bootstrapped" - .input - = text_field_tag 'follow_tags', nil, :class => "nostrap" - - .clearfix - %br - %br - %br - .input - = link_to "#{t('.awesome_take_me_to_diaspora')} »", stream_path, :id => "awesome_button", :class => "btn primary" + .awesome + = link_to "#{t('.awesome_take_me_to_diaspora')} »", stream_path, :id => "awesome_button", :class => "button creation" diff --git a/app/views/users/getting_started.mobile.haml b/app/views/users/getting_started.mobile.haml index bc90efcdb..321178bf4 100644 --- a/app/views/users/getting_started.mobile.haml +++ b/app/views/users/getting_started.mobile.haml @@ -42,64 +42,43 @@ %section#hello-there .hero-unit-mobile - %h3.center + %h1.center = t('.well_hello_there') - %p.center + %h3.center = t(".community_welcome") = invited_by_message - .clearfix + %h2 + = t(".who_are_you") - .clearfix - .row - %h3 - = t(".who_are_you") + - if AppConfig.configured_services.include? :facebook + %p + != t('.connect_to_facebook', :link => link_to(t('.connect_to_facebook_link'), "auth/facebook?callback_url=#{getting_started_url}")) - .row - %p - != t('.connect_to_facebook', :link => link_to(t('.connect_to_facebook_link'), "auth/facebook?callback_url=#{getting_started_url}")) + = form_tag profile_path, :method => :put, :remote => true, :id => 'edit_profile' do + %fieldset + = label_tag 'profile[first_name]', t('profiles.edit.your_name'), :class => "bootstrapped" + = text_field_tag 'profile[first_name]', current_user.first_name + = image_tag 'ajax-loader.gif', :id => "gs-name-form-spinner", :class => "hidden" + %span.saved{:class => "hidden"} + = image_tag 'icons/check_yes_ok.png' + = t(".saved") - .row - .span6 - = form_tag profile_path, :method => :put, :remote => true, :id => 'edit_profile' do - %fieldset - .clearfix - = label_tag 'profile[first_name]', t('profiles.edit.your_name'), :class => "bootstrapped" - .input - = text_field_tag 'profile[first_name]', current_user.first_name - = image_tag 'ajax-loader.gif', :id => "gs-name-form-spinner", :class => "hidden" + = label_tag :your_photo, t('profiles.edit.your_photo'), :class => "bootstrapped" + = render 'photos/new_profile_photo', :aspect => :getting_started, :person => current_user.person - %span.saved{:class => "hidden"} - = image_tag 'icons/check_yes_ok.png' - = t(".saved") + %h2 + = t('.what_are_you_in_to') - .clearfix - = label_tag :your_photo, t('profiles.edit.your_photo'), :class => "bootstrapped" - = render 'photos/new_profile_photo', :aspect => :getting_started, :person => current_user.person + %p + = t('.hashtag_explanation') - .clearfix - .row - %h3 - = t('.what_are_you_in_to') - - .row - %p - = t('.hashtag_explanation') - - .row - .span13 - = form_tag(tag_followings_path, :method => 'get', :class => "tag_input search_form") do - %fieldset - .clearfix - = label_tag 'follow_tags', t('.hashtag_suggestions'), :class => "bootstrapped" - .input - = text_field_tag 'follow_tags', nil, :class => "nostrap" - - .clearfix - %br - %br - %br - .input - = link_to "#{t('.awesome_take_me_to_diaspora')} »", stream_path, :id => "awesome_button", :class => "btn primary" + = form_tag(tag_followings_path, :method => 'get', :class => "tag_input search_form") do + %fieldset + = label_tag 'follow_tags', t('.hashtag_suggestions'), :class => "bootstrapped" + = text_field_tag 'follow_tags', nil, :class => "nostrap" + + .center + = link_to "#{t('.awesome_take_me_to_diaspora')} »", stream_path, :id => "awesome_button", :class => "button creation"