Merge remote-tracking branch 'origin/next' into next-memberships
[shapado:shapado.git] / app / views / users / show.html.haml
1 #users_show
2   %section.userData
3     .avatar
4       = avatar_img @user, :size => "big"
5       -if current_user == @user
6         %p
7           = link_to t('.edit_profile'), settings_path
8
9     %h3= t("activerecord.models.badges")
10     %ul.badges
11       -@badges.each do |badge|
12         %li
13           = render :partial => "badges/badge", :object => badge, :locals => {:hide_user => true}
14
15
16   %section.userHistory
17     .userDescription
18       .basicInfo
19         %h2
20           = @user.name
21         - config = @user.config_for(current_group)
22         - if config
23           %small
24             = t(:created_at, :scope => "activerecord.attributes.user")
25             %time{:datetime => @user.created_at.iso8601}
26               = t("time.ago", :time => time_ago_in_words(@user.created_at))
27           |
28           %small
29             = t(:last_logged_at, :scope => "activerecord.attributes.user")
30             %time{:datetime => @user.last_logged_at.iso8601}
31               = t("time.ago", :time => time_ago_in_words(@user.last_logged_at))
32
33         -if @user.website
34           %p
35             =t(:website, :scope => "activerecord.attributes.user")
36             %a{:rel => "nofollow", :href =>  @user.website }= @user.website
37
38         .description
39           %p
40             = markdown(@user.bio)
41
42       %ul.profile-stats
43         %li
44           %strong
45             =format_number(@user.reputation_on(current_group))
46           %small
47             = t(:reputation, :scope => "activerecord.attributes.user")
48
49         %li
50           %strong
51             =format_number(@user.views_on(current_group))
52           %small
53             = t(".views")
54         %li
55           %strong
56             = @user.following_count
57           %small
58             = t('.following')
59         %li
60           %strong
61             = @user.followers_count
62           %small
63             = t('.followers')
64         -if current_user != @user
65           -if logged_in? && current_user.following?(@user)
66             %li.follow
67               =link_to "- #{t(".unfollow")}", unfollow_user_path(@user), :class => "unfollow_link", 'data-class' => "follow_link", 'data-title' => t(".follow"), 'data-undo' => follow_user_path(@user)
68           -else
69             %li.follow
70               =link_to "+ #{t(".follow")}", follow_user_path(@user), :class => "follow_link", 'data-class' => "unfollow_link", 'data-title' => t(".unfollow"), 'data-undo' => unfollow_user_path(@user)
71       .clear
72
73     #main-content-wrap{:class => @active_tab}
74       %nav{:class => @active_subtab }
75         %ul.content-tabs
76           = tab_entry "li", t(:questions, :scope => "activerecord.models"), user_path(@user), {:selected => "active"}, {:class => "questions"}
77           = tab_entry "li", t(:answers, :scope => "activerecord.models"), answers_user_path(@user), {:selected => "active"}, {:class => "answers"}
78           = tab_entry "li", t('global.following'), follows_user_path(@user), {:selected => "active"}, {:class => "follow"}
79           = tab_entry "li", t(:activity, :scope => "activerecord.models"), activity_user_path(@user), {:selected => "active"}, {:class => "activity"} #i18n
80       %section.filters{:class => @active_subtab }
81         %ul
82           = render "users/show/user_#{params[:action]}_filters"
83
84       = render "users/show/user_#{params[:action]}_content"
85
86     .additional_info
87       = will_paginate @resources
88