diaspora/app/views/users/edit.html.haml
2010-09-23 15:21:15 -07:00

91 lines
2.2 KiB
Text

-# Copyright (c) 2010, Diaspora Inc. This file is
-# licensed under the Affero General Public License version 3. See
-# the COPYRIGHT file.
- content_for :publish do
%h1
Editing profile
- 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
#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