首页显示的个人信息区域需要更新显示

This commit is contained in:
daiao 2017-02-28 15:24:28 +08:00
parent dda9858e21
commit 7fbfeef8f3
6 changed files with 95 additions and 63 deletions

View File

@ -7,7 +7,7 @@
<meta name="keywords" content="issue,bug,tracker" />
<%= csrf_meta_tag %>
<%= favicon %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common', 'css/structure','css/public', 'prettify','css/project','css/courses','css/popup','css/syllabus','css/moduel', 'css/user', :media => 'all' %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common', 'css/structure','css/public', 'prettify','css/project','css/courses','css/popup','css/syllabus','css/moduel', 'css/user', 'css/font-awesome.css', :media => 'all' %>
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
<%= javascript_heads %>
<%= javascript_include_tag "bootstrap","avatars","new_user",'attachments','prettify'%>
@ -79,61 +79,72 @@
<div class="cl"></div>
<div class="homepageContent">
<div class="homepageLeft mt10" id="LSide">
<div class="user_leftinfo mb10">
<div class="home-user-new-img mb10">
<% if User.current.logged? && User.current == @user %>
<div class="pr" style="width: 80px; margin:0 auto;">
<%= link_to image_tag(url_to_avatar(@user),width:"74", height: "74", :id => 'nh_source_tx'),
my_clear_user_avatar_temp_path, :class => "user_leftinfo_img", :remote => true %>
<div class="homepageEditProfile undis">
<%=link_to '', my_clear_user_avatar_temp_path, :class => 'homepageEditProfileIcon', :remote => true, :title => '点击编辑Logo' %>
</div>
</div>
<%= link_to image_tag(url_to_avatar(@user),width:"238", height: "200", :id => 'nh_source_tx'),
my_clear_user_avatar_temp_path, :remote => true %>
<% else %>
<a href="javascript:void(0)" class="user_leftinfo_img" style="cursor: default">
<%=image_tag(url_to_avatar(@user),width:"74", height: "74", :id=>'nh_source_tx') %>
</a>
<% end %>
<% if (@user.user_extensions && (@user.user_extensions.identity != 2) ) %>
<span class="<%= @user.user_extensions.gender == 1 ? 'user_leftinfo_female' : 'user_leftinfo_male' %> "></span>
<%=image_tag(url_to_avatar(@user),width:"238", height: "200", :id=>'nh_source_tx') %>
<% end %>
<div class="user_info_inner">
<div class=" user_leftinfo_namebox" >
<%= link_to @user.show_name, user_path(@user), :class => "user_leftinfo_name" %>
<% if @user.user_extensions && @user.user_extensions.identity %>
<span class="user_cirbtn_yellow" ><%= get_user_roll @user %></span>
<% end%>
</div>
<div>
<div class="user_info_intro" style="word-wrap:break-word; text-align:justify;">
<div id="user_brief_introduction_show">
<%= render :partial => 'layouts/user_brief_introduction', :locals => {:user => @user} %>
</div>
</div>
<!-- <textarea class="homepageSignatureTextarea none" placeholder="请编辑签名" id="user_brief_introduction_edit" onblur="edit_user_introduction('<%#= edit_brief_introduction_user_path(@user.id)%>');"><%#= @user.user_extensions.brief_introduction %></textarea>-->
</div>
<ul class="user_atten clear">
<li>
<a href="<%= user_blogs_path(:user_id => @user) %>">
<strong style="font-weight:normal;">博客</strong><br />
<span class="sy_cgrey"><%= @user.blog.blog_comments.where("#{BlogComment.table_name}.parent_id is null").count %></span>
</a>
</li>
<li>
<a href="<%= user_watchlist_user_path(@user) %>">
<strong style="font-weight:normal;">关注</strong><br />
<span class="sy_cgrey" id="user_watchers_number"><%= User.watched_by(@user).count %></span>
</a>
</li>
<li>
<a href="<%= user_fanslist_user_path(@user) %>">
<strong style="font-weight:normal;">粉丝</strong><br />
<span id="user_fans_number" class="sy_cgrey"><%= @user.watcher_users.count %></span>
</a>
</li>
</ul>
</div>
<div id="watch_user_btn_div">
<%= render :partial => 'layouts/user_watch_btn', :locals => {:target => @user} %>
</div>
<div class="home-user-newinfo-box mb10">
<h3 class="mb5 fontGrey3 break_full_word">
<%= link_to @user.show_name, user_path(@user), :class => "mb5 fontGrey3" %>
<% if @user.user_extensions && @user.user_extensions.identity %>
<%= get_user_roll @user %>
<% end%>
<% if (@user.user_extensions && (@user.user_extensions.identity != 2) ) %>
<span class="<%= @user.user_extensions.gender == 1 ? 'user_leftinfo_female fr' : 'user_leftinfo_male fr' %> "></span>
<% end %>
</h3>
<h4 class="fontGrey2 mb5"><%= @user.login %></h4>
<p class="fontGrey2">
<% if !@user.user_extensions.school_id.blank? %>
<%= @user.user_extensions.school.name %>
<% end %>
</p>
<span class="border-line mt10 mb10"></span>
<ul class="home-user-newinfo-ul ">
<li class="clear">
<a href="<%= user_blogs_path(:user_id => @user) %>" class="fl linkGrey7 f14">博客</a>
<span class="issues_nav_tag fr"><%= @user.blog.blog_comments.where("#{BlogComment.table_name}.parent_id is null").count %></span>
</li>
<li class="clear">
<a href="<%= user_watchlist_user_path(@user) %>" class="fl linkGrey7 f14" >关注</a>
<span class="issues_nav_tag fr" id="user_watchers_number"><%= User.watched_by(@user).count %></span>
</li>
<li class="clear">
<a href="<%= user_fanslist_user_path(@user) %>" class="fl linkGrey7 f14">粉丝</a>
<span class="issues_nav_tag fr" id="user_fans_number"><%= @user.watcher_users.count %></span>
</li>
</ul>
<div class="clear">
<% if User.current.logged?%>
<% if User.current == @user %>
<%= link_to '个人主页', homepage_user_path(@user), :class => "home-big-btn-grey", :target => '_blank' %>
<% else %>
<% if(@user.watched_by?(User.current)) %>
<%= link_to "取消关注",
watch_path(:object_type => 'user', :object_id => @user.id, :target_id => @user.id),
:class => "home-btn-grey fl mr12",
:method => "delete",
:remote => "true",
:title => "取消关注" %>
<% else %>
<%= link_to "添加关注",
watch_path(:object_type => 'user', :object_id => @user.id, :target_id => @user.id),
:class => "home-btn-grey fl mr12",
:method => "post",
:remote => "true",
:title => "添加关注" %>
<% end %>
<% if @user.base_homepage.nil? %>
<a href="javascript:void(0)" class ="home-btn-grey fl" title="该用户暂未设置主页">TA的主页</a>
<% else %>
<%= link_to "TA的主页", homepage_user_path(@user.login), :class => 'home-btn-grey fl', :target => '_blank' %>
<% end %>
<% end %>
<% end %>
</div>
</div>
<% if is_current_user %>
@ -217,19 +228,19 @@
<ul>
<% if hidden_unproject_infos && user_course_count > 0 %>
<li class="home-user-leftnav-li icons-class clear">
<%= link_to user_course_count > 0 ? "课程<span class='issues_nav_tag ml140'>#{user_course_count}</span>".html_safe : "课程",
<%= link_to user_course_count > 0 ? "课程<span class='issues_nav_tag ml140' style='line-height:18px;margin-top:9px;font-size:11px;background-color:#f5f2f2;color:#666;'>#{user_course_count}</span>".html_safe : "课程",
user_course_community_path(@user), :id => "user_course_list", :class => "fl", :target => "_blank" %>
</li>
<% end %>
<% if user_project_count > 0 %>
<li class="home-user-leftnav-li icons-project clear">
<%= link_to user_project_count > 0 ? "项目<span class='issues_nav_tag ml140'>#{user_project_count}</span>".html_safe : "项目",
<%= link_to user_project_count > 0 ? "项目<span class='issues_nav_tag ml140' style='line-height:18px;margin-top:9px;font-size:11px;background-color:#f5f2f2;color:#666;'>#{user_project_count}</span>".html_safe : "项目",
user_project_community_path(@user), :id => 'user_project_list', :class => "fl", :target => "_blank" %>
</li>
<% end %>
<% if hidden_unproject_infos && user_contest_count > 0 %>
<li class="home-user-leftnav-li icons-project clear">
<%= link_to user_contest_count > 0 ? "竞赛<span class='issues_nav_tag ml140'>#{user_contest_count}</span>".html_safe : "竞赛",
<%= link_to user_contest_count > 0 ? "竞赛<span class='issues_nav_tag ml140' style='line-height:18px;margin-top:9px;font-size:11px;background-color:#f5f2f2;color:#666;'>#{user_contest_count}</span>".html_safe : "竞赛",
user_contest_community_path(@user), :id => 'user_contest_list', :class => "fl", :target => "_blank" %>
</li>
<% end %>
@ -246,7 +257,15 @@
<%# 更新访问数,刷新的时候更新访问次数 %>
<% update_visiti_count @user %>
<div class="fontGrey5 mt10 ml20">访问计数 <%= @user.visits.to_i %> 自2016年5月</div>
<div class="">
<ul class="home-user-footerinfo">
<li><i class="icon-map-marker mr5 ml10 f14"></i>
<span><%= @user.user_extensions.location %><% unless @user.user_extensions.location_city.blank? %>-<%= @user.user_extensions.location_city %><% end %></span>
</li>
<li><i class="icon-time mr5 ml10 f14"></i><span><%= @user.created_on.strftime('%Y-%m-%d') %>开始使用</span></li>
<li style="color:#b3b3b3"><i class="icon-eye-open mr5 ml10 f14"></i><span><%= @user.visits.to_i %>次访问自2016年5月</span></li>
</ul>
</div>
</div>
<div class="homepageRight">
<%= yield %>

View File

@ -1,6 +1,6 @@
<% if @user %>
$("#nh_source_tx").replaceWith('<%= image_tag(url_to_avatar(@user), :id=>'nh_source_tx',:style=>"width:78px;height:78px;overflow:hidden",:alt=>"头像") %>');
$("#nh_user_logo").replaceWith('<%= image_tag(url_to_avatar(@user), :id=>'nh_user_logo',:width =>"40",:height => "40",:alt=>"头像") %>');
$("#nh_source_tx").replaceWith('<%= image_tag(url_to_avatar(@user), :id=>'nh_source_tx',:style=>"width:238px;height:200px;overflow:hidden",:alt=>"头像") %>');
$("#nh_user_logo").replaceWith('<%= image_tag(url_to_avatar(@user), :id=>'nh_user_logo',:width =>"40",:height => "40", :style=>"border-radius: 50px;", :alt=>"头像") %>');
<% elsif @course %>
$("#nh_source_tx").replaceWith('<%= image_tag(url_to_avatar(@course), :id=>'nh_source_tx',:style=>"width:96px;height:96px;overflow:hidden",:alt=>"班级logo") %>');
if($("#course_avatar_form").length > 0) {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -452,8 +452,8 @@ a.shadowbox_news_all{ display:block; width:305px; height:40px; line-height:40px;
.user_leftinfo{ width:238px;border:1px solid #e5e5e5; background:#fff url(/images/user/user_bg_info.jpg) 0 0 no-repeat; position:relative; }
a.user_leftinfo_img { display:block; width:80px; height:80px; margin:15px auto;}
.user_leftinfo_img img{ width:74px; height:74px;-webkit-border-radius:50px;-moz-border-radius:50px;-o-border-radius:50px;border-radius:50px; border:3px solid #dcdcdc; }
.user_leftinfo_female{ display:block; width:20px; height:20px;background:url(/images/user/icons_user_leftnav.png) 5px -378px no-repeat; position:absolute; top:80px; left:160px;}
.user_leftinfo_male{ display:block; width:20px; height:20px;background:url(/images/user/icons_user_leftnav.png) -25px -378px no-repeat; position:absolute; top:80px; left:160px;}
.user_leftinfo_female{ display:block; width:20px; height:20px;background:url(/images/user/icons_user_leftnav.png) 5px -378px no-repeat;}
.user_leftinfo_male{ display:block; width:20px; height:20px;background:url(/images/user/icons_user_leftnav.png) -25px -378px no-repeat;}
.user_leftinfo_namebox{ text-align:center; height:16px; line-height:16px; }
.user_leftinfo_name{ display: inline-block; max-width:160px; font-size:14px; font-weight:bold; overflow:hidden;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.user_leftinfo_namebox a{ color: #333;}

View File

@ -87,8 +87,8 @@ a:hover.pro_new_topbtn_left{background-image: linear-gradient(#ededed, #dddddd);
.user_leftdata_background{ width:238px;border:1px solid #e5e5e5; background:#fff url(/images/user/user_bg_info2.jpg) 0 0 no-repeat; position:relative; }
a.user_leftinfo_img { display:block; width:80px; height:80px; margin:15px auto;}
.user_leftinfo_img img{ width:74px; height:74px;-webkit-border-radius:50px;-moz-border-radius:50px;-o-border-radius:50px;border-radius:50px; border:3px solid #dcdcdc; }
.user_leftinfo_female{ display:block; width:20px; height:20px;background:url(/images/user/icons_user_leftnav.png) 5px -378px no-repeat; position:absolute; top:80px; left:160px;}
.user_leftinfo_male{ display:block; width:20px; height:20px;background:url(/images/user/icons_user_leftnav.png) -25px -378px no-repeat; position:absolute; top:80px; left:160px;}
.user_leftinfo_female{ display:block; width:20px; height:20px;background:url(/images/user/icons_user_leftnav.png) 5px -378px no-repeat;}
.user_leftinfo_male{ display:block; width:20px; height:20px;background:url(/images/user/icons_user_leftnav.png) -25px -378px no-repeat;}
.user_leftinfo_namebox{ text-align:center; height:16px; line-height:16px; }
.user_leftinfo_name{ display: inline-block; max-width:160px; font-size:14px; font-weight:bold; overflow:hidden;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.user_cirbtn_yellow{ color:#fff; background:#ffb400; padding:0 5px;-webkit-border-radius:10px;-moz-border-radius:10px;-o-border-radius:10px;border-radius:10px; line-height:16px; }
@ -179,3 +179,16 @@ a.user_navmorebox .user_icons_closeclass{display:block;position: absolute;top:5p
.homepageTabPollTitle { max-width:490px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;}
.homepageTabAvatar img{border: 3px solid #fff;-webkit-border-radius:30px;-moz-border-radius:30px;-o-border-radius:30px;border-radius:30px;}
.homepageTabAvatar img:hover{border: 3px solid #e6e6e6;}
/* 新版个人主页左侧信息170214byLB */
.home-user-new-img{ width: 238px; height: 200px; border-radius:5px;border: 1px solid #ddd;}
.home-user-new-img img{border-radius:5px;}
.home-user-newinfo-box{ width: 218px; padding:10px; border: 1px solid #e5e5e5; background:#fff;}
.issues_nav_tag{ background-color:#eaeaea; padding:2px 8px;border-radius:15px; font-size:12px; display: inline-block; color: #666;}
.home-user-newinfo-ul li{ height: 40px;}
.border-line{ width:100%; display: block; border-top: 1px solid #e5e5e5;}
a.home-btn-grey{ display:inline-block; width:100px; height: 28px; line-height:28px; font-size: 14px; color: #666; text-align: center; background:#fff; border:1px solid #e5e5e5; border-radius:5px; }
a:hover.home-btn-grey{ background:#f0f0f0;}
a.home-big-btn-grey{ display:inline-block; width:212px; height: 28px; line-height:28px; font-size: 14px; color: #666; text-align: center; background:#fff; border:1px solid #e5e5e5; border-radius:5px; }
a:hover.home-big-btn-grey{ background:#f0f0f0;}
.home-user-footerinfo li{ height: 24px; color: #888; }