diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 4a3ec2dbb..4226ef139 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -50,7 +50,7 @@ = text_field_tag 'q' %li= link_to current_user.real_name, current_user.person - %li= link_to "edit profile", edit_user_path(current_user) + %li= link_to "settings", edit_user_path(current_user) %li= link_to "logout", destroy_user_session_path = render "shared/aspect_nav" diff --git a/app/views/users/_profile.haml b/app/views/users/_profile.haml new file mode 100644 index 000000000..e1da95649 --- /dev/null +++ b/app/views/users/_profile.haml @@ -0,0 +1,59 @@ +-# Copyright (c) 2010, Diaspora Inc. This file is +-# licensed under the Affero General Public License version 3. See +-# the COPYRIGHT file. + + +%h2 Profile + += form_for @user do |f| + = f.error_messages + + = f.fields_for :profile do |p| + + %h3 Picture + %div#image_picker + = p.hidden_field :image_url, :value => (@profile.image_url if @profile.image_url), :id => 'image_url_field' + + - unless @photos.nil? || @photos.empty? + - for photo in @photos + - if @profile.image_url && @profile.image_url.include?(photo.url(:thumb_medium)) + %div.small_photo{:id => photo.url(:thumb_medium), :class=>'selected'} + = check_box_tag 'checked_photo', true, true + = link_to image_tag(photo.url(:thumb_medium)), "#" + - else + %div.small_photo{:id => photo.url(:thumb_medium)} + = check_box_tag 'checked_photo' + = link_to image_tag(photo.url(:thumb_medium)), "#" + + - else + You don't have any photos! Go to the + = link_to "albums", albums_path(:aspect => 'all') + page to upload some. + + =will_paginate @photos + + %br + + %h3 Info + + %p + %b + DIASPORA USERNAME: + = @user.diaspora_handle + + %p + = p.label :first_name + = p.text_field :first_name, :value => @profile.first_name + %p + = p.label :last_name + = p.text_field :last_name, :value => @profile.last_name + + #submit_block + = link_to "Cancel", root_path + or + = f.submit "Update Profile" + +#content_bottom + .back + = link_to "⇧ home", root_path + diff --git a/app/views/users/_services.haml b/app/views/users/_services.haml new file mode 100644 index 000000000..c6e31939a --- /dev/null +++ b/app/views/users/_services.haml @@ -0,0 +1,28 @@ +-# Copyright (c) 2010, Diaspora Inc. This file is +-# licensed under the Affero General Public License version 3. See +-# the COPYRIGHT file. + + +%h2 Services + +%h3 Facebook +%p + - if @logged_in + Connected to facebook as + - @response_hash = MiniFB.get(@access_token, 'me') + = @response_hash[:name] + + - @fb_friends = MiniFB.get(@access_token, 'me', :type => "friends") + - @fb_friends[:data].each do |friend| + = image_tag( "http://graph.facebook.com/#{friend[:id]}/picture" ) + + - form_tag "/services/fb_post" do + = text_area_tag "message" + = submit_tag "send it off" + = link_to "Disconnect from Facebook", services_destroy_path + - else + = link_to "Connect to Facebook", @fb_access_url + + #content_bottom + .back + = link_to "⇧ home", root_path diff --git a/app/views/users/edit.html.haml b/app/views/users/edit.html.haml index e4789e361..b4ef0226c 100644 --- a/app/views/users/edit.html.haml +++ b/app/views/users/edit.html.haml @@ -3,89 +3,29 @@ -# the COPYRIGHT file. +:javascript + $("#settings_nav li > a").click( function() { + var target = "#"+$(this).attr('class'); + if( !$(target).is(":visible") ) { + $(".settings_pane").fadeOut(200, function() { + $(target).delay(200).fadeIn(200); + }); + } + }); + + - content_for :publish do %h1 - Editing profile + Settings - content_for :left_pane do - \. - -= form_for @user do |f| - = f.error_messages - - = f.fields_for :profile do |p| - - %h3 Picture - %div#image_picker - = p.hidden_field :image_url, :value => (@profile.image_url if @profile.image_url), :id => 'image_url_field' - - - unless @photos.nil? || @photos.empty? - - for photo in @photos - - if @profile.image_url && @profile.image_url.include?(photo.url(:thumb_medium)) - %div.small_photo{:id => photo.url(:thumb_medium), :class=>'selected'} - = check_box_tag 'checked_photo', true, true - = link_to image_tag(photo.url(:thumb_medium)), "#" - - else - %div.small_photo{:id => photo.url(:thumb_medium)} - = check_box_tag 'checked_photo' - = link_to image_tag(photo.url(:thumb_medium)), "#" - - - else - You don't have any photos! Go to the - = link_to "albums", albums_path(:aspect => 'all') - page to upload some. - - =will_paginate @photos - - %br - - %h3 Info - - %p - %b - DIASPORA USERNAME: - = @user.diaspora_handle - - %p - = p.label :first_name - = p.text_field :first_name, :value => @profile.first_name - %p - = p.label :last_name - = p.text_field :last_name, :value => @profile.last_name - - %br - %br + %ul#settings_nav + %li=link_to 'Profile', '#', :class => 'profile' + %li=link_to 'Services', '#', :class => 'services' +#profile.settings_pane{:style=>"display:block;"} + = render 'users/profile' +#services.settings_pane + = render 'users/services' - - #submit_block - = link_to "Cancel", root_path - or - = f.submit "Update Profile" - - - -%h2 Services - -%h3 Facebook -%p - - if @logged_in - Connected to facebook as - - @response_hash = MiniFB.get(@access_token, 'me') - = @response_hash[:name] - - - @fb_friends = MiniFB.get(@access_token, 'me', :type => "friends") - - @fb_friends[:data].each do |friend| - = image_tag( "http://graph.facebook.com/#{friend[:id]}/picture" ) - - - form_tag "/services/fb_post" do - = text_area_tag "message" - = submit_tag "send it off" - = link_to "Disconnect from Facebook", services_destroy_path - - else - = link_to "Connect to Facebook", @fb_access_url - -#content_bottom - .back - = link_to "⇧ home", root_path diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 82bbd8b6d..4c83aa0c2 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -659,15 +659,19 @@ h1.big_text { -moz-box-shadow: 0 2px 4px #333333; opacity: 0.9; } -#notification_badge { - position: fixed; - bottom: 0; - margin-left: 854px; } - #notification_badge a { - background-color: #eeeeee; - border: 1px solid #cccccc; - border-bottom: none; - padding: 3px 10px; } +ul#settings_nav { + list-style: none; + padding: 0; + marign: 0; + font-size: larger; } + ul#settings_nav > li a { + display: block; + height: 100%; + border-bottom: 1px solid #eeeeee; + padding: 5px 0; } + +.settings_pane { + display: none; } #fancybox-close:hover { background-color: transparent; } diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 7c77a0b79..890ef7708 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -839,21 +839,30 @@ h1.big_text :-moz-box-shadow 0 2px 4px #333 :opacity 0.9 -#notification_badge - :position fixed - :bottom 0 - :margin - :left 854px +ul#settings_nav + :list + :style none + :padding 0 + :marign 0 - a - :background - :color #eee + :font + :size larger - :border 1px solid #ccc - :bottom none + > li + + a + :display block + :height 100% + :border + :bottom 1px solid #eee + :padding 5px 0 + + +.settings_pane + :display none - :padding 3px 10px #fancybox-close:hover :background :color transparent +