profile page: use old-style canvas layout
Change-Id: Ie0a2f074c3a8b498195f7c9508e9e33a2db90d72
This commit is contained in:
parent
3da42266a8
commit
55297d05d3
|
@ -31,6 +31,7 @@ class ProfileController < ApplicationController
|
|||
@user ||= @current_user
|
||||
|
||||
@use_new_styles = true
|
||||
|
||||
@active_tab = "profile"
|
||||
@context = UserProfile.new(@current_user) if @user == @current_user
|
||||
|
||||
|
@ -52,16 +53,16 @@ class ProfileController < ApplicationController
|
|||
|
||||
if @user.private? && @user != @current_user
|
||||
if @user.grants_right?(@current_user, :view_statistics)
|
||||
return render :action => :show, :layout => "new_application"
|
||||
return render :action => :show
|
||||
elsif @current_user.messageable_users(:ids => [@user.id]) == [@user]
|
||||
return render :action => :show_limited, :layout => "new_application"
|
||||
return render :action => :show_limited
|
||||
# TODO: also show full profile if user is following other user?
|
||||
else
|
||||
return render :action => :unauthorized, :layout => "new_application"
|
||||
return render :action => :unauthorized
|
||||
end
|
||||
end
|
||||
|
||||
render :action => :show, :layout => "new_application"
|
||||
render :action => :show
|
||||
end
|
||||
|
||||
# @API Get user profile
|
||||
|
|
|
@ -1,46 +1,46 @@
|
|||
<%
|
||||
jammit_css :profile
|
||||
js_bundle :profile_show
|
||||
@body_classes << 'no-page-block'
|
||||
%>
|
||||
<% content_for :page_title do %>
|
||||
<%= @user.short_name %>
|
||||
<% end %>
|
||||
<div class="container">
|
||||
<div class="row v-gutter">
|
||||
<div class="span2 profile-pic-container">
|
||||
<%= image_tag avatar_image_url(User.avatar_key @user.id), :class => 'profile-pic' %>
|
||||
</div>
|
||||
<div class="span5">
|
||||
<h1><%= @user.short_name %></h1>
|
||||
<p><%= format_message(@user.bio || "").first.html_safe %></p>
|
||||
<% if @can_follow %>
|
||||
<p><button id="follow_user" class="button">Follow</button></p>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="span3">
|
||||
<table class="stats">
|
||||
<tr class="stats-header">
|
||||
<th colspan="2">Stats</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Followers</th>
|
||||
<td><%= @followers_count %></td>
|
||||
</tr><tr>
|
||||
<th>Collections</th>
|
||||
<td><%= @user.collections.public.count %></td>
|
||||
</tr><tr>
|
||||
<th>Items</th>
|
||||
<td><%= @items_count %></td>
|
||||
</table>
|
||||
|
||||
<% if @user.show_user_services? && @services.present? %>
|
||||
<div class="social-header border border-b">Find Me On</div>
|
||||
<ul class="social-links">
|
||||
<% @services.each do |s| %>
|
||||
<li><a href="<%= s.service_user_link %>" class="social <%= s.service %>"><%= s.service_name %></a></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="row v-gutter">
|
||||
<div class="span2 profile-pic-container">
|
||||
<%= image_tag avatar_image_url(User.avatar_key @user.id), :class => 'profile-pic' %>
|
||||
</div>
|
||||
<div class="span5">
|
||||
<h1><%= @user.short_name %></h1>
|
||||
<p><%= format_message(@user.bio || "").first.html_safe %></p>
|
||||
<% if @can_follow %>
|
||||
<p><button id="follow_user" class="button">Follow</button></p>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% content_for :right_side do %>
|
||||
<table class="stats">
|
||||
<tr class="stats-header">
|
||||
<th colspan="2">Stats</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Followers</th>
|
||||
<td><%= @followers_count %></td>
|
||||
</tr><tr>
|
||||
<th>Collections</th>
|
||||
<td><%= @user.collections.public.count %></td>
|
||||
</tr><tr>
|
||||
<th>Items</th>
|
||||
<td><%= @items_count %></td>
|
||||
</table>
|
||||
|
||||
<% if @user.show_user_services? && @services.present? %>
|
||||
<div class="social-header border border-b">Find Me On</div>
|
||||
<ul class="social-links">
|
||||
<% @services.each do |s| %>
|
||||
<li><a href="<%= s.service_user_link %>" class="social <%= s.service %>"><%= s.service_name %></a></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
|
Loading…
Reference in New Issue