user edit is now divided into real sections

This commit is contained in:
danielvincent 2010-09-23 20:13:07 -07:00
parent eaea26e58d
commit 265753b5fe
6 changed files with 140 additions and 100 deletions

View file

@ -50,7 +50,7 @@
= text_field_tag 'q' = text_field_tag 'q'
%li= link_to current_user.real_name, current_user.person %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 %li= link_to "logout", destroy_user_session_path
= render "shared/aspect_nav" = render "shared/aspect_nav"

View file

@ -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

View file

@ -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

View file

@ -3,89 +3,29 @@
-# the COPYRIGHT file. -# 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 - content_for :publish do
%h1 %h1
Editing profile Settings
- content_for :left_pane do - content_for :left_pane do
\. %ul#settings_nav
%li=link_to 'Profile', '#', :class => 'profile'
= form_for @user do |f| %li=link_to 'Services', '#', :class => 'services'
= 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
#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

View file

@ -659,15 +659,19 @@ h1.big_text {
-moz-box-shadow: 0 2px 4px #333333; -moz-box-shadow: 0 2px 4px #333333;
opacity: 0.9; } opacity: 0.9; }
#notification_badge { ul#settings_nav {
position: fixed; list-style: none;
bottom: 0; padding: 0;
margin-left: 854px; } marign: 0;
#notification_badge a { font-size: larger; }
background-color: #eeeeee; ul#settings_nav > li a {
border: 1px solid #cccccc; display: block;
border-bottom: none; height: 100%;
padding: 3px 10px; } border-bottom: 1px solid #eeeeee;
padding: 5px 0; }
.settings_pane {
display: none; }
#fancybox-close:hover { #fancybox-close:hover {
background-color: transparent; } background-color: transparent; }

View file

@ -839,21 +839,30 @@ h1.big_text
:-moz-box-shadow 0 2px 4px #333 :-moz-box-shadow 0 2px 4px #333
:opacity 0.9 :opacity 0.9
#notification_badge ul#settings_nav
:position fixed :list
:bottom 0 :style none
:margin :padding 0
:left 854px :marign 0
a :font
:background :size larger
:color #eee
:border 1px solid #ccc > li
:bottom none
a
:display block
:height 100%
:border
:bottom 1px solid #eee
:padding 5px 0
.settings_pane
:display none
:padding 3px 10px
#fancybox-close:hover #fancybox-close:hover
:background :background
:color transparent :color transparent