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'
%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"

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.
: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
\.
%ul#settings_nav
%li=link_to 'Profile', '#', :class => 'profile'
%li=link_to 'Services', '#', :class => 'services'
= form_for @user do |f|
= f.error_messages
#profile.settings_pane{:style=>"display:block;"}
= render 'users/profile'
= f.fields_for :profile do |p|
#services.settings_pane
= render 'users/services'
%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
#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;
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; }

View file

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