bborn/communityengine

View on GitHub
app/views/users/dashboard.html.haml

Summary

Maintainability
Test Coverage

- @page_title= :greeting.l :name => @user.login
- @section = 'my_profile'

=render :partial => "users/dashboard_nav"


-if @user.pending_friendships.any?
  %p
    =link_to fa_icon('user', :text => :you_have_pending_friendship_requests.l), pending_user_friendships_path(@user)


-if @network_activity.empty? && @recommended_posts.empty?
  %p
    =:this_is_your_dashboard.l
  %p
    =:dashboard_friends.l :site => configatron.community_name
    %br
    =:to_start_adding_friends.l
    =link_to :browse_all_members.l, users_path
    \.
  %p
    =link_to :update_profile_and_tag_yourself.l, edit_user_path(current_user)
    =:to_get_recommended_content_on_your_dashboard.l


-unless @network_activity.empty?
  %h2=:activity_from_your_network.l
  -box :class => "fresh" do
    =render :partial => "activities/activity", :collection => @network_activity
    =link_to fa_icon('plus-circle', :text => :see_all_activity.l), network_user_activities_path(current_user)

-unless @recommended_posts.empty?
  %h2=:recommended_posts.l
  #posts
    %ul
      -@recommended_posts.each do |post|
        %li
          = link_to( "#{post.tag_for_first_image_in_body} #{truncate(post.display_title, :length => 75)} <span class='post_excerpt'>#{ truncate_words(post.post, 35, '...' )} (#{:by.l :login => post.user.login})</span>".html_safe, user_post_path(post.user, post), :title => :by.l(:login => post.user.login) )