|
| 1 | +%h1= @hacker.username + "'s page" |
| 2 | +%img{:src => @hacker.gravatar_url} |
| 3 | +%h2 About #{@hacker.username}: |
| 4 | +%p= @hacker.about |
| 5 | +%hr |
| 6 | +%p Following: <a href="/hackers/#{@hacker.username}/following">#{@hacker.following.count}</a> |
| 7 | +%p Followers: <a href="/hackers/#{@hacker.username}/followers">#{@hacker.followers.count}</a> |
| 8 | +%hr |
| 9 | +%h2 Programs: |
| 10 | +%ul |
| 11 | + - @hacker.programs.each do |program| |
| 12 | + %li |
| 13 | + %a{:href => "/programs/#{@hacker.username}/#{program.slug}"}= program.title |
| 14 | + |
| 15 | +%hr |
| 16 | +- if logged_in? |
| 17 | + - if @hacker.username != current_user.username |
| 18 | + %a{:href => "/messages/new/to/#{@hacker.username}" }= "Send #{@hacker.username} a message" |
| 19 | + - if current_user.following? @hacker |
| 20 | + %a{:href => "/hackers/#{@hacker.username}/unfollow"} Unfollow #{@hacker.username} |
| 21 | + - else |
| 22 | + %a{:href => "/hackers/#{@hacker.username}/follow"} Follow #{@hacker.username} |
| 23 | + - else |
| 24 | + %h2 Your Account |
| 25 | + %p You can use these forms to update your information: |
| 26 | + %br |
| 27 | + %p |
| 28 | + %form{:action => "/hackers/update", :method => "POST"} |
| 29 | + %table |
| 30 | + %tr |
| 31 | + %td |
| 32 | + %label{:for => "password[new]"} New Password |
| 33 | + %td |
| 34 | + %input{:type => "password", :name => "password[new]"} |
| 35 | + %tr |
| 36 | + %td |
| 37 | + %label{:for => "password[confirm]"} Confirm New Password |
| 38 | + %td |
| 39 | + %input{:type => "password", :name => "password[confirm]"} |
| 40 | + %tr |
| 41 | + %td |
| 42 | + %td |
| 43 | + %input{:type => "submit", :value => "Change password"} |
| 44 | + %hr |
| 45 | + %p |
| 46 | + %form{:action => "/hackers/update", :method => "POST"} |
| 47 | + %label{:for => "hacker[about]"} About Me |
| 48 | + %br |
| 49 | + %textarea{:name => "hacker[about]", :rows => 10, :cols => 40} |
| 50 | + %br |
| 51 | + %input{:type => "submit", :value => "Update About"} |
| 52 | + |
0 commit comments