|
1 | 1 | - content_for :title do |
2 | | - = "#{resource.username}'s page" |
| 2 | + = "#{resource.username}'s Profile" |
3 | 3 |
|
4 | 4 | -content_for :sidebar do |
5 | 5 | %section.about-user |
|
14 | 14 | = f.hidden_field :followee, :value => resource.id |
15 | 15 | = f.button :submit, :value => "Follow", :class => "primary btn" |
16 | 16 |
|
17 | | - %h2= "About #{resource.username}" |
18 | | - %h4= resource.about |
19 | | - %hr |
| 17 | + - unless resource.about.blank? |
| 18 | + %p= resource.about |
20 | 19 | %p |
21 | 20 | = link_to pluralize(resource.programs.count, "Program"), user_programs_path(resource), :class => "user-programs" |
22 | 21 | %p |
|
31 | 30 |
|
32 | 31 |
|
33 | 32 | - unless @user.questions.empty? |
34 | | - %section.questions |
35 | | - %header |
36 | | - %h2 Questions |
37 | | - - @user.questions.each do |question| |
38 | | - %article.question |
39 | | - %h4= link_to question.title, question_path(question) |
| 33 | + %section.user-questions |
| 34 | + .heading |
| 35 | + %h3= pluralize(@user.questions.count, "Question") |
| 36 | + %ul |
| 37 | + - @user.questions.each do |question| |
| 38 | + %li |
| 39 | + .title |
| 40 | + = link_to question.title, question_path(question) |
| 41 | + .meta |
| 42 | + asked #{question.created_at.strftime("%b %e, %l:%M %p")} |
40 | 43 |
|
41 | 44 | - unless @user.answers.empty? |
42 | | - %section.answers |
43 | | - %header |
44 | | - %h2 Answers |
45 | | - - @user.answers.each do |answer| |
46 | | - %article.answer |
47 | | - %h4 |
48 | | - = "#{@user.username} answered" |
49 | | - = link_to(answer.question.title, answer.question) |
50 | | - with: |
51 | | - %p= answer.description |
| 45 | + %section.user-answers |
| 46 | + .heading |
| 47 | + %h3= pluralize(@user.answers.count, "Answer") |
| 48 | + %ul |
| 49 | + - @user.answers.each do |answer| |
| 50 | + %li |
| 51 | + .description |
| 52 | + = answer.description.truncate(100) |
| 53 | + .meta |
| 54 | + = link_to("View Answer", answer.question) |
0 commit comments