349 lines
18 KiB
Plaintext
349 lines
18 KiB
Plaintext
<% current_user = @user == User.current %>
|
|
<% str = current_user ? '我' : 'TA' %>
|
|
<div class="-task-con">
|
|
|
|
<div class="-task-con-per user_bg_shadow cl">
|
|
<div class="photo fl" onclick="window.open('<%=avatar_account_path%>')">
|
|
<%= image_tag(url_to_avatar(@user), :class => "person",:width => 100, :height => 100, :alt => "头像") %>
|
|
<% if current_user %>
|
|
<div class="changephoto font-14"><a href="<%= avatar_account_path %>" class="subchange" style="display: block" target="_blank" >更换头像</a></div>
|
|
<% end %>
|
|
</div>
|
|
<div class="-task-con-data fl">
|
|
<div class="top cl">
|
|
<div class="top-left fl">
|
|
<p class="p1 font-16">
|
|
<span><%= @user.show_name %></span>
|
|
<% if @user.user_extensions && @user.user_extensions.gender && @user.user_extensions.gender == 1 %>
|
|
<i class="pl20 fa fa-venus color-orange" aria-hidden="true"></i>
|
|
<% else %>
|
|
<i class="pl20 fa fa-mars color-blue" aria-hidden="true"></i>
|
|
<% end %>
|
|
</p>
|
|
|
|
<p class="p2 font-16">
|
|
<span class="fl lector"><%= @user.identity %></span>
|
|
<span class="fl">
|
|
<% if !@user.user_extensions.school_id.blank? && @user.user_extensions.school %>
|
|
<%= @user.user_extensions.school.name %>
|
|
<% end %>
|
|
</span>
|
|
<!---<%# if @user.authentication %>
|
|
<span class="color-green fl">
|
|
<i class="fa fa-check-circle-o" aria-hidden="true"></i>
|
|
已认证
|
|
</span>
|
|
<%# else %>
|
|
<span class="color-grey fl">
|
|
<i class="fa fa-times-circle-o" aria-hidden="true"></i>
|
|
未认证
|
|
</span>
|
|
<%# end %>--->
|
|
<ul class="fl ml20">
|
|
|
|
<% if @user.authentication %>
|
|
<li class="pr user-info-span" data-tip-down="已实名认证">
|
|
<i class="fa fa-user color-light-green" aria-hidden="true"></i><!--已实名认证-->
|
|
</li>
|
|
<% else %>
|
|
<% apply_auth = ApplyUserAuthentication.where(:user_id => @user.id, :auth_type => 1).last %>
|
|
<% if apply_auth && apply_auth.status == 0 %>
|
|
<li class="pr user-info-span" data-tip-down="实名认证中">
|
|
<i class="fa fa-user u-color-light-red" aria-hidden="true"></i><!--实名认证中-->
|
|
</li>
|
|
<% else %>
|
|
<li class="pr user-info-span" data-tip-down="未实名认证">
|
|
<i class="fa fa-user u-color-light-grey" aria-hidden="true"></i><!--还未实名认证-->
|
|
</li>
|
|
<% end %>
|
|
<% end %>
|
|
|
|
<% if @user.professional_certification %>
|
|
<li class="pr user-info-span" data-tip-down="已职业认证">
|
|
<i class="fa fa-list-alt color-light-green" aria-hidden="true"></i><!--已职业认证-->
|
|
</li>
|
|
<% else %>
|
|
<% apply_auth = ApplyUserAuthentication.where(:user_id => @user.id, :auth_type => 2).last %>
|
|
<% if apply_auth && apply_auth.status == 0 %>
|
|
<li class="pr user-info-span" data-tip-down="职业认证中">
|
|
<i class="fa fa-list-alt u-color-light-red" aria-hidden="true"></i><!--职业认证中-->
|
|
</li>
|
|
<% else %>
|
|
<li class="pr user-info-span" data-tip-down="未职业认证">
|
|
<i class="fa fa-list-alt u-color-light-grey" aria-hidden="true"></i><!--还未职业认证-->
|
|
</li>
|
|
<% end %>
|
|
<% end %>
|
|
|
|
<% if @user.try(:phone).blank? %>
|
|
<li class="pr user-info-span font-16" data-tip-down="未绑定手机">
|
|
<i class="fa fa-mobile u-color-light-grey" aria-hidden="true"></i><!--还未绑定手机-->
|
|
</li>
|
|
<% else %>
|
|
<li class="pr user-info-span font-16" data-tip-down="已绑定手机">
|
|
<i class="fa fa-mobile color-light-green" aria-hidden="true"></i><!--已绑定手机-->
|
|
</li>
|
|
<% end %>
|
|
<% if @user.try(:mail).blank? %>
|
|
<li class="pr user-info-span" data-tip-down="未绑定邮箱">
|
|
<i class="fa fa-envelope u-color-light-grey" aria-hidden="true"></i><!--还未绑定邮箱-->
|
|
</li>
|
|
<% else %>
|
|
<li class="pr user-info-span" data-tip-down="已绑定邮箱">
|
|
<i class="fa fa-envelope color-light-green" aria-hidden="true"></i><!--已绑定邮箱-->
|
|
</li>
|
|
<% end %>
|
|
</ul>
|
|
</p>
|
|
</div>
|
|
<div class="top-right fr font-14 mr10">
|
|
<% if current_user %>
|
|
<div class="mynew">
|
|
<!--<p class="mt5">-->
|
|
<!--<%#= link_to '编辑我的资料', my_account_path %>-->
|
|
<!--</p>-->
|
|
|
|
<p class="p2 font-12">
|
|
<i class="fa fa-eye font-12" aria-hidden="true"></i>
|
|
<% update_visiti_count @user %>
|
|
<span><%= @user.visits.to_i %></span> 次访问
|
|
</p>
|
|
<p class="p3 fr font-14 mt20">
|
|
<% onclick_time = User.current.onclick_time.onclick_time %>
|
|
<% new_message_count = User.current.journals_for_messages.where("created_on > '#{onclick_time}'").count %>
|
|
<% if new_message_count > 0 %>
|
|
<a href="<%= feedback_path(User.current) %>" class="fl mr10 link-color-grey">新留言<span style="margin-top: 5px;" class="user_filtrate_span2 user_filtrate_span2_bg ml10"><%= new_message_count %></span></a>
|
|
<% end %>
|
|
<span class="fl mr10 color-grey-8 undis">技能勋章<%= link_to @user.challenge_tags.count, growth_record_user_path(@user), :class => "ml5 color-orange03" %></span>
|
|
<span class="fl mr10 color-grey-8">经验值<%= link_to @user.experience, growth_record_user_path(@user, :tab => 2), :class => "ml5 color-orange03" %></span>
|
|
<span class="fl color-grey-8">金币<%= link_to @user.grade, growth_record_user_path(@user, :tab => 3), :class => "ml5 color-orange03" %></span>
|
|
</p>
|
|
<!-- <p class="p3">帐户安全:
|
|
<a class="<%#= @user.phone.blank? ? 'color-grey' : 'color-green' %>" href="<%#= security_settings_path %>">
|
|
<%# if @user.phone.blank? %>
|
|
<img class="tubiao1" src="../images/edu_user/edu-cons1.png"/>
|
|
<%# else %>
|
|
<img src="../images/edu_user/edu-cons1.png"/>
|
|
<%# end %>
|
|
</a>
|
|
|
|
<a class="<%#= @user.mail.blank? ? 'color-grey' : 'color-green' %>" href="<%#= security_settings_path %>">
|
|
<%# if @user.mail.blank? %>
|
|
<img class="tubiao2" src="../images/edu_user/edu-cons1.png"/>
|
|
<%# else %>
|
|
<img class="tubiao3" src="../images/edu_user/edu-cons1.png"/>
|
|
<%# end %>
|
|
</a>
|
|
</p>-->
|
|
|
|
</div>
|
|
<% else %>
|
|
<div class="itnew">
|
|
<p class="p2 font-14 mt10 mb10">
|
|
<i class="fa fa-eye" aria-hidden="true"></i>
|
|
<span><%= @user.visits.to_i %></span> 次访问
|
|
</p>
|
|
|
|
<p class="sub clearfix">
|
|
<a href="<%= feedback_path(@user, :host=> Setting.host_user) %>" class="fr font-14 ml10">给TA留言</a>
|
|
<% if(@user.watched_by?(User.current)) %>
|
|
<%= link_to "已关注",
|
|
watch_path(:object_type => 'user', :object_id => @user.id, :target_id => @user.id),
|
|
:class => "fr font-14 user_watch",
|
|
:id => "cancel_watch",
|
|
:method => "delete",
|
|
:remote => "true",
|
|
:title => "取消关注" %>
|
|
<% else %>
|
|
<%= link_to "添加关注",
|
|
watch_path(:object_type => 'user', :object_id => @user.id, :target_id => @user.id),
|
|
:class => "fr font-14 user_watch",
|
|
:method => "post",
|
|
:remote => "true",
|
|
:title => "添加关注" %>
|
|
<% end %>
|
|
|
|
</p>
|
|
<!--<div class="alert">-->
|
|
<!--<p>你确定不再关注<span>kosasa</span>?</p>-->
|
|
<!--<p><span>确定</span><span>取消</span></p>-->
|
|
<!--</div>-->
|
|
</div>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
<div class="bot">
|
|
<% if current_user %>
|
|
<input type="hidden" id="current_user_id" value="<%= @user.id %>">
|
|
<input type="text" class="font-14 task-hide color-grey" id="user_breif_introduction" placeholder="一句话介绍一下自己吧~" value="<%= @user.user_extensions.brief_introduction %>"/>
|
|
<% else %>
|
|
<p class="font-14 task-hide color-grey" title="<%= @user.user_extensions.brief_introduction.blank? ? "这家伙很懒,什么都没留下~" : @user.user_extensions.brief_introduction %>">
|
|
<%= @user.user_extensions.brief_introduction.blank? ? "这家伙很懒,什么都没留下~" : @user.user_extensions.brief_introduction %>
|
|
</p>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="-task-con-int">
|
|
<!--<div class="blog">-->
|
|
<!--<p class="p1 font-16 "><%#= str %>的博客-->
|
|
<!--<span class="font-12" id="blog"><%#= @blog_count %></span>-->
|
|
<!--</p>-->
|
|
<!--<%# if @blog_count == 0 %>-->
|
|
<!--<p class="p2 font-16">-->
|
|
<!--<%# if current_user %>-->
|
|
<!--<span>你一篇博客也没写过,</span>-->
|
|
<!--<a href="<%#= user_blogs_path(:user_id => @user) %>" target="_blank" class="changecolor">现在写博客</a>-->
|
|
<!--<%# else %>-->
|
|
<!--<span><%#= @user.show_name %>很懒,一篇博客也没写过</span>-->
|
|
<!--<%# end %>-->
|
|
<!--</p>-->
|
|
<!--<%# else %>-->
|
|
<!--<div class="p3 clearfix">-->
|
|
<!--<div class="check">-->
|
|
<!--<%# if current_user %>-->
|
|
<!--<%#= link_to '发布博客', user_blogs_path(:user_id => @user), :target => '_blank', :class => 'mr5 color-grey' %>-->
|
|
<!--<%# end %>-->
|
|
<!--<%# if @blog_count > 3 %>-->
|
|
<!--<%#= link_to '查看更多', user_blogs_path(:user_id => @user), :target => '_blank', :class => 'color-grey' %>-->
|
|
<!--<%# end %>-->
|
|
<!--</div>-->
|
|
<!--<%# @blog_list.each_with_index do |blog, index| %>-->
|
|
<!--<div class="blognew fl pl10 <%#= index == 0 ? '' : 'hasborder' %>">-->
|
|
<!--<%#= link_to blog.title.to_s.html_safe, user_blog_blog_comment_path(:user_id => blog.author, :blog_id => blog.blog.id, :id => blog), :class => "font-14 changecolor" %>-->
|
|
<!--<p>-->
|
|
<!--<span calss="font-12 pr10"><%#= format_time blog.created_at %> 发布</span>-->
|
|
<!--<i class="fa fa-eye font-12" style="color:#999;" aria-hidden="true"></i>-->
|
|
<!--<span class="font-12"><%#= blog.visits %></span>-->
|
|
<!--</p>-->
|
|
<!--</div>-->
|
|
<!--<%# end %>-->
|
|
<!--</div>-->
|
|
<!--<%# end %>-->
|
|
<!--</div>-->
|
|
|
|
<div class="passageway mt30">
|
|
<!-- <div class="hint">
|
|
<div class="pr10 color-blue play font-14">
|
|
<i class="fa fa-sort-down zhuan mr5" aria-hidden="true"></i>开始
|
|
</div>
|
|
<div class="list">
|
|
<div>
|
|
<p><%#= link_to '创建课程', new_syllabus_path(:host => Setting.host_course), :target => "_blank" %></p>
|
|
<p><%#= link_to '创建班级', new_course_path(:host => Setting.host_course), :target => "_blank" %></p>
|
|
<p><%#= link_to "加入班级", join_private_courses_courses_path, :remote => true, :method => "post" %></p>
|
|
<p><%#= link_to "发现实训", new_shixun_path, :target => "_blank" %></p>
|
|
<p><%#= link_to '发起求助', new_forum_memo_path(:forum_id => Forum.first.id, :forum_index => true), :target => "_blank" %></p>
|
|
</div>
|
|
</div>
|
|
</div> -->
|
|
<div class="hascon">
|
|
<% str = current_user ? '我' : 'TA' %>
|
|
<ul id="edu-user-tab-nav">
|
|
<li class="edu-user-tab-hover new-tab-nav">
|
|
<a href="javascript:void(0);" class="tab_type font-16"><%= str %>的实训<!--<span id="user_shixun_count"> <%#= @shixuns_count %></span>--></a>
|
|
</li>
|
|
|
|
</ul>
|
|
<div style="margin-left: 28px;height: 70px">
|
|
<a href="<%= shixuns_or_courses_filter_user_path(@user, :index => "shixun", :filter => "all") %>" data-remote="true" class="user_course_filtrate fl mt20 mr30"><span class="user_filtrate_span1 user_filtrate_span1_bg">全部</span><span class="user_filtrate_span2 user_filtrate_span2_bg ml10"><%= @shixuns_count %></span></a>
|
|
<a href="<%= shixuns_or_courses_filter_user_path(@user, :index => "shixun", :filter => "create") %>" class="user_course_filtrate fl mt20 mr30" data-remote="true"><span class="user_filtrate_span1"><%= str %>创建的</span><span class="user_filtrate_span2 ml10"><%= @create_num %></span></a>
|
|
<a href="<%= shixuns_or_courses_filter_user_path(@user, :index => "shixun", :filter => "cooperative") %>" class="user_course_filtrate fl mt20 mr30" data-remote="true"><span class="user_filtrate_span1"><%= str %>合作的</span><span class="user_filtrate_span2 ml10"><%= @cooperative_num %></span></a>
|
|
<a href="<%= shixuns_or_courses_filter_user_path(@user, :index => "shixun", :filter => "challenge") %>" class="user_course_filtrate fl mt20 mr30" data-remote="true"><span class="user_filtrate_span1"><%= str %>挑战的</span><span class="user_filtrate_span2 ml10"><%= @challenge_num %></span></a>
|
|
<% if User.current.mail.blank? %>
|
|
<li><a href="javascript:void(0)" class="color-light-green fr font-14 mr20" style="line-height:56px" onclick="shixun_valication()">+ 新建</a></li>
|
|
<% else %>
|
|
<li><%= link_to "+ 新建", new_shixun_path, :target => "_blank", :class => "color-light-green fr font-14 mr20", :style => "line-height:56px" %></li>
|
|
<% end %>
|
|
</div>
|
|
<div class="lesson clearfix user_bg_shadow_notop" id="my_shixuns_list">
|
|
<%= render :partial => "my_homepage_shixuns_list" %>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="passageway mt30" id="user_homepage_course_show">
|
|
<div class="hascon">
|
|
<ul id="edu-user-tab-nav">
|
|
<li class="edu-user-tab-hover new-tab-nav">
|
|
<a href="javascript:void(0);" class="font-16 tab_type"><%= str %>的课堂 </a>
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
<div style="margin-left: 28px;height: 70px">
|
|
<a href="<%= shixuns_or_courses_filter_user_path(@user, :index => "course", :filter => "all") %>" class="user_course_filtrate fl mt20 mr30" data-remote="true"><span class="user_filtrate_span1 user_filtrate_span1_bg">全部</span><span class="user_filtrate_span2 user_filtrate_span2_bg ml10"><%= @all_courses_count %></span></a>
|
|
<a href="<%= shixuns_or_courses_filter_user_path(@user, :index => "course", :filter => "manage") %>" class="user_course_filtrate fl mt20 mr30" data-remote="true"><span class="user_filtrate_span1"><%= str %>管理的</span><span class="user_filtrate_span2 ml10"><%= @create_courses_count %></span></a>
|
|
<a href="<%= shixuns_or_courses_filter_user_path(@user, :index => "course", :filter => "join") %>" class="user_course_filtrate fl mt20 mr30" data-remote="true"><span class="user_filtrate_span1"><%= str %>参与的</span><span class="user_filtrate_span2 ml10"><%= @join_courses_count %></span></a>
|
|
<a href="/courses/new" class="color-light-green fr font-14 mr30" style="line-height:56px">+ 新建</a>
|
|
<a href="/courses/join_private_courses" class="color-light-green fr mr20 font-14" data-method="post" data-remote="true" rel="nofollow" style="line-height:56px">+ 加入</a>
|
|
</div>
|
|
<div class="lesson clearfix user_bg_shadow_notop" id="my_courses_list">
|
|
<%#= render :partial => "my_homepage_courses_list" %>
|
|
</div>
|
|
</div>
|
|
|
|
<%#= render :partial => "my_homepage_course_show" %>
|
|
</div>
|
|
|
|
<div class="favour mt30" id="watcher_fan_list">
|
|
<%= render :partial => 'edu_user_watch_fan_list', :locals => {:current_user => current_user} %>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!----------------------左侧导航栏 ------------------------->
|
|
<%= render :partial => 'layouts/public_left_info' %>
|
|
<!-------------------侧边提示区域-------------------------->
|
|
<div class="-task-sidebar">
|
|
<div class="feedback" tooltips="意见反馈">
|
|
<i class="fa fa-envelope-o" aria-hidden="true"></i>
|
|
</div>
|
|
<div class="scan" tooltips="快来扫一扫">
|
|
<i class="fa fa-qrcode" aria-hidden="true"></i>
|
|
</div>
|
|
<div class="consult" tooltips="在线咨询">
|
|
<a target="_blank" class="color_white" href="http://shang.qq.com/wpa/qunwpa?idkey=064e805dac955b8aea158c4b0dd3f033b8841bcee175fd619613f0e4ac4d8151"><i class="fa fa-qq" aria-hidden="true"></i></a>
|
|
</div>
|
|
<div class="gotop" style="display:none" tooltips="返回顶部">
|
|
<i class="fa fa-arrow-up" aria-hidden="true"></i>
|
|
</div>
|
|
</div>
|
|
|
|
<script type="text/javascript">
|
|
$(function(){
|
|
$.ajax({
|
|
url: "<%= user_show_course_list_users_path(:id => @user) %>",
|
|
dataType: "script"
|
|
});
|
|
});
|
|
|
|
function HoverLi(n){
|
|
for(var i=1;i<=2;i++){
|
|
$('#edu-tab-nav-'+i).removeClass('edu-user-tab-hover');
|
|
$('#edu-tab-con-'+i).hide();
|
|
}
|
|
$('#edu-tab-con-'+n).show();
|
|
$('#edu-tab-nav-'+n).addClass('edu-user-tab-hover');
|
|
}
|
|
|
|
function HoverLi2(n){
|
|
$('#edu-tab-nav-course').removeClass('edu-new-tab-hover');
|
|
$('#edu-tab-con-course').addClass('undis');
|
|
$('#edu-tab-nav-shixun').removeClass('edu-new-tab-hover');
|
|
$('#edu-tab-con-shixun').addClass('undis');
|
|
$('#edu-tab-con-'+n).removeClass('undis');
|
|
$('#edu-tab-nav-'+n).addClass('edu-new-tab-hover');
|
|
}
|
|
/* --------------- 课程/实训 tab小图标的点击效果---------------------- */
|
|
$(".user_course_filtrate").live("click", function(ev){
|
|
$(this).parent().find(".user_filtrate_span1").removeClass("user_filtrate_span1_bg");
|
|
$(this).parent().find(".user_filtrate_span2").removeClass("user_filtrate_span2_bg");
|
|
$(this).find(".user_filtrate_span1").addClass("user_filtrate_span1_bg");
|
|
$(this).find(".user_filtrate_span2").addClass("user_filtrate_span2_bg");
|
|
|
|
/*$(this).find(".user_filtrate_span1").find(".course_filtrate_bg").removeClass("course_filtrate_bg");
|
|
$(ev.target).addClass("course_filtrate_bg");*/
|
|
})
|
|
</script> |