socialforge/app/views/layouts/new_base_user.html.erb

332 lines
18 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title><%= h html_title %></title>
<meta name="description" content="<%= Redmine::Info.app_name %>" />
<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', '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'%>
<%= heads_for_theme %>
<%= call_hook :view_layouts_base_html_head %>
<%= yield :header_tags -%>
<!-- MathJax的配置 -->
<script type="text/javascript"
src="/javascripts/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
<!-- 配置 在生成的公式图片上去掉Math定义的右键菜单$$ $$ \( \) \[ \] 中的公式给予显示-->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
showMathMenu: false,
showMathMenuMSIE: false,
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
});
</script>
<script>
var onUserCard = false;
var onImage = false;
$(document).ready(function(){
$("#relateProject,.relatePInfo").mouseover(function(){
$(".relatePInfo").css("display","block");
});
$("#relateProject,.relatePInfo").mouseout(function(){
$(".relatePInfo").css("display","none");
});
$(".coursesLineGrey").mouseover(function(){
$(this).css("color","#ffffff");
})
$(".coursesLineGrey").mouseout(function(){
$(this).css("color","#808080");
});
//侧导航栏配置设置
$(".homepageLeftMenuCoursesLine").mouseover(function(){
$(this).children(".shild").css("background","url(/images/hwork_icon.png) -82px -399px no-repeat");
$(this).children().css("color","#ffffff");
});
$(".homepageLeftMenuCoursesLine").mouseout(function(){
$(this).children(".shild").css("background","url(/images/hwork_icon.png) -6px -354px no-repeat");
$(this).children().css("color","#808080");
});
$(".subNavRow").mouseover(function(){
$(this).css("background-color","#269ac9");
$(this).children().css("color","#ffffff");
});
$(".subNavRow").mouseout(function(){
$(this).css("background-color","#ffffff");
$(this).children().css("color","#888888");
});
})
</script>
</head>
<body onload="prettyPrint();">
<div class="navContainer">
<% is_current_user = User.current.logged? && User.current == @user %>
<% if User.current.logged? %>
<%= render :partial => 'layouts/logined_header' %>
<% else%>
<%= render :partial => 'layouts/unlogin_header' %>
<% end%>
</div>
<div class="cl"></div>
<div class="homepageContentContainer">
<!--div class="homepageRightBannerImg"></div-->
<div class="cl"></div>
<div class="homepageContent">
<div class="homepageLeft mt10" id="LSide">
<div class="home-user-new-img mb10">
<% if User.current.logged? && User.current == @user %>
<%= link_to image_tag(url_to_avatar(@user),width:"238", height: "238", :id => 'nh_source_tx'),
my_clear_user_avatar_temp_path, :remote => true %>
<% else %>
<%=image_tag(url_to_avatar(@user),width:"238", height: "238", :id=>'nh_source_tx') %>
<% end %>
</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.nil?) %>
<%= @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 %>
<% if hidden_unproject_infos && user_course_count > 0 %>
<div class="home-user-leftnav">
<h3 >
<%= link_to "课程社区", user_course_community_path(User.current), :class => "fl" , :target => "_blank", :style => "color:#666" %>
</h3>
<%# if hidden_unproject_infos %>
<ul>
<li class="home-user-leftnav-li icons-class clear">
<%= link_to user_course_count > 0 ? "课程<span class='issues_nav_tag mr10 fr' 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.current), :id => "user_course_list", :target => "_blank" %>
</li>
<% if user_manage_homework_count > 0 %>
<li class="home-user-leftnav-li icons-homework clear">
<%= link_to user_manage_homework_count > 0 ? "我发布的作业<span class='issues_nav_tag mr10 fr' style='line-height:18px;margin-top:9px;font-size:11px;background-color:#f5f2f2;color:#666;'>#{user_manage_homework_count}</span>".html_safe : "我发布的作业",
user_manage_homeworks_user_path(@user), :target => "_blank" %>
</li>
<% end %>
<% if user_receive_homework_count > 0 %>
<li class="home-user-leftnav-li icons-homework clear">
<%= link_to "我收到的作业<span class='issues_nav_tag mr10 fr' style='line-height:18px;margin-top:9px;font-size:11px;background-color:#f5f2f2;color:#666;'>#{user_receive_homework_count}</span>".html_safe,
user_receive_homeworks_user_path(@user), :target => "_blank" %>
</li>
<% end %>
<li class="home-user-leftnav-li icons-doc clear">
<%= link_to "题库", user_homeworks_user_path(User.current), :target => "_blank", :class => "fl", :style => "color:#666" %>
</li>
<li class="home-user-leftnav-li icons-download clear">
<%= link_to "资源库", user_resource_user_path(User.current, :type => 1), :target => "_blank", :class => "fl", :style => "color:#666" %>
</li>
</ul>
<%# end %>
</div>
<% end %>
<% if user_project_count > 0%>
<div class="home-user-leftnav">
<h3 >
<%= link_to "项目社区", user_project_community_path(User.current), :class => "fl", :target => "_blank", :style => "color:#666" %>
</h3>
<ul>
<li class="home-user-leftnav-li icons-project clear">
<%= link_to user_project_count > 0 ? "项目<span class='issues_nav_tag mr10 fr' 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.current), :id => 'user_project_list', :target => "_blank" %>
</li>
<% if issues_author_is_self_count > 0 %>
<li class="home-user-leftnav-li icons-issue clear">
<%= link_to issues_author_is_self_count > 0 ? "我发布的issue<span class='issues_nav_tag mr10 fr'style='line-height:18px;margin-top:9px;font-size:11px;background-color:#f5f2f2;color:##666;'>#{issues_author_is_self_count}</span>".html_safe : "我发布的issue",
user_manage_issues_user_path(@user), :target => "_blank" %>
</li>
<% end %>
<% if issues_assigned_is_self_count > 0 %>
<li class="home-user-leftnav-li icons-issue clear">
<%= link_to issues_assigned_is_self_count > 0 ? "我收到的issue<span class='issues_nav_tag mr10 fr' style='line-height:18px;margin-top:9px;font-size:11px;background-color:#f5f2f2;color:#666;'>#{issues_assigned_is_self_count}</span>".html_safe : "我收到的issue",
user_receive_issues_user_path(@user), :target => "_blank" %>
</li>
<% end %>
</ul>
</div>
<% end %>
<% if hidden_unproject_infos && user_contest_count > 0 %>
<div class="home-user-leftnav">
<h3 >
<%= link_to "竞赛社区", user_contest_community_path(User.current), :class => "fl" , :target => "_blank"%>
</h3>
<ul>
<li class="home-user-leftnav-li icons-contest clear">
<%= link_to user_contest_count > 0 ? "竞赛<span class='issues_nav_tag mr10 fr' style='line-height:18px;margin-top: 9px;'>#{user_contest_count}</span>".html_safe : "竞赛",
user_contest_community_path(User.current), :id => "user_contest_list", :target => "_blank" %>
</li>
</ul>
<%# end %>
</div>
<% end %>
<% else %>
<div class="home-user-leftnav">
<h3 >Ta在确实
<span class="fr mr5" style="font-size:12px;color: #7f7f7f;"><%= time_tag(@user.created_on).html_safe %></span>
</h3>
<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' 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' 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' 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 %>
</ul>
</div>
<% end %>
<div class="user_leftnav ">
<ul class="users_accordion mb10">
<li id="user_10" class="user_icons_mes">
<%= link_to "留言", feedback_path(@user, :host=> Setting.host_user)%>
</li>
</ul>
</div>
<%# 更新访问数,刷新的时候更新访问次数 %>
<% update_visiti_count @user %>
<div class="">
<ul class="home-user-footerinfo">
<% unless @user.user_extensions.location.blank? %>
<li><i class="icon-map-marker mr5 ml10 f14"></i>
<span><%= @user.user_extensions.location %>-<%= @user.user_extensions.location_city %></span>
</li>
<% end %>
<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 %>
</div>
</div>
<% if hidden_unproject_infos %>
<%= render :partial => 'layouts/new_feedback' %>
<% end %>
</div>
<div class="cl"></div>
<%= render :partial => 'layouts/footer' %>
<div class="cl"></div>
<div id="ajax-modal" style="display:none;"></div>
<div id="ajax-indicator" style="display:none;">
<span><%= l(:label_loading) %></span>
</div>
<div id="nh_tx_dialog_html" class="white_content" style="display:none;">
<%=render :partial => 'layouts/upload_avatar', :locals => {:source => @user} %>
</div>
<script type="text/javascript">
$(function(){
$('#user_hide_project').hide();
autoUrl("user_brief_introduction_show");
if(<%= @is_course == 1 %>) {
$("#user_course_list").addClass('active');
} else if(<%= @is_project == 1 %>) {
$("#user_project_list").addClass('active');
}
});
$("#courseMenu").mouseenter(function(){
$("#topnav_course_menu").show();
});
$("#courseMenu").mouseleave(function(){
$("#topnav_course_menu").hide();
});
$("#projectMenu").mouseenter(function(){
$("#topnav_project_menu").show();
});
$("#projectMenu").mouseleave(function(){
$("#topnav_project_menu").hide();
});
// 如果是强制修改资料页面,则除退出按钮外,其他按钮的连接都失效
<% if @force %>
// 禁用所有a标签
var t = document.getElementsByTagName("a");
len = t.length;
for(var i=0;i<len;i++){
t[i].href = 'javascript:void(0)';
// 火狐浏览器点击弹开空白页
t[i].target = '_self';
}
// 退出按钮可用
var d = document.getElementById("logout_trustie");
d.href='<%= logout_url_without_domain %>';
// 提问按钮不可用
document.getElementById('inquiry_question').onclick = function (){return false;};
<% end %>
</script>
</body>
</html>