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

333 lines
16 KiB
Plaintext
Raw Normal View History

2015-07-09 15:27:49 +08:00
<% @nav_dispaly_home_path_label = 1
@nav_dispaly_main_course_label = 1
@nav_dispaly_main_project_label = 1
@nav_dispaly_main_contest_label = 1 %>
<% @nav_dispaly_forum_label = 1%>
<% @nav_dispaly_user_label = show_item_on_navbar(params) %>
<% @center_flag = (User.current == @user) %>
<!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', 'public_new', 'leftside_new','users', :media => 'all' %>
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
<%= javascript_heads %>
<%= heads_for_theme %>
<%= call_hook :view_layouts_base_html_head %>
<!-- page specific tags -->
<%= yield :header_tags -%>
<!--
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>个人中心st</title>
<link href="css/public.css" rel="stylesheet" type="text/css" />
<link href="css/leftside.css" rel="stylesheet" type="text/css" />
<link href="css/users.css" rel="stylesheet" type="text/css" />
<script src="js/jquery-1.3.2.js" type="text/javascript"></script>
<script src="js/jquery-1.8.3-ui-1.9.2-ujs-2.0.3.js" type="text/javascript"></script>
<script type="text/javascript" src="js/sidebar.js"></script>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.8.4.custom.min.js"></script>
<script type="text/javascript" src="js/jQuery.peSlider.js"></script>
</script>
<script type="text/javascript">
//头部导航
var menuids=["TopUserNav"] //Enter id(s) of SuckerTree UL menus, separated by commas
function buildsubmenus(){
for (var i=0; i<menuids.length; i++){
var ultags=document.getElementById(menuids[i]).getElementsByTagName("ul")
for (var t=0; t<ultags.length; t++){
ultags[t].parentNode.getElementsByTagName("a")[0].className="subfolderstyle"
ultags[t].parentNode.onmouseover=function(){
this.getElementsByTagName("ul")[0].style.display="block"
}
ultags[t].parentNode.onmouseout=function(){
this.getElementsByTagName("ul")[0].style.display="none"
}
}
}
}
if (window.addEventListener)
window.addEventListener("load", buildsubmenus, false)
else if (window.attachEvent)
window.attachEvent("onload", buildsubmenus)
</script>
<script type="text/javascript">//侧导航
$(function(){
$(".subNav").click(function(){
$(this).toggleClass("currentDd").siblings(".subNav").removeClass("currentDd")
$(this).toggleClass("currentDt").siblings(".subNav").removeClass("currentDt")
// 修改数字控制速度, slideUp(500)控制卷起速度
$(this).next(".navContent").slideToggle(500).siblings(".navContent").slideUp(500);
})
})
</script>
<script type="text/javascript">
function show_window () {
$('#light').css('display','block');
$('#fade').css('display','block');
}
function close_window(){
$('#light').css('display','none');
$('#fade').css('display','none');
}
//弹框l
</script> -->
</head>
<body>
<div id="Container">
<%= render :partial => 'layouts/base_header_new'%>
<div id="TopBar">
<div class="topbar_info02 fl">
<h2><a href="javascript:void(0);" target="_blank" class="c_blue"><%= @center_flag ? '个人中心' : '个人主页' %></h2>
<p>当前位置 :
<%=link_to l(:field_homepage), home_path %> &gt; <%=link_to (@center_flag ? '个人中心' : '个人主页'), user_path(@user) %> &gt; <%=link_to @user.name, user_path(@user) %>
</p>
</div>
<!--<div class="search fl">-->
<!--<form class="search">-->
<!--<input type="text" name="serach" placeholder="输入关键词进行搜索" class="search_text fl">-->
<!--<a href="javascript:void(0);" class="search_btn fl f14 c_white" >搜 索</a>-->
<!--</form>-->
<!--</div>-->
</div><!--TopBar end-->
<div class="cl"></div>
<div id="content">
<div id="LSide" class="fl">
<div class="users_info">
<div class="pic_head">
2015-07-21 11:59:15 +08:00
<%= image_tag(url_to_avatar(@user), :id=>'nh_user_tx',:style=>"width:214px;height:214px;overflow:hidden",:alt=>"头像") %>
2015-07-09 15:27:49 +08:00
<% if @center_flag %>
<a href="<%= url_for(:controller => 'my', :action => 'clear_user_avatar_temp') %>" data-remote="true" class="pic_edit usersphoto_edit"></a>
<% end %>
</div><!--pic_head end-->
<div class="users_name mt5">
<%=link_to @user.name, user_path(@user),:class=>"fl c_dark fb f14" %>
<% if (@user.user_extensions && (@user.user_extensions.identity != 2) ) %>
<span class="<%= @user.user_extensions.gender==1?'icon_female':'icon_male' %> fl mt3 ml5"></span>
<% end %>
<%= render :partial => 'layouts/user_watch_btn', :locals => {:target => @user} %>
</div>
<div class="cl"></div>
<div class="mt5 ">
<%=l(:label_user_watcher)%><%= link_to User.watched_by(@user.id).count.to_s, {:controller=>"users", :action=>"user_watchlist",:id=>@user.id},:class=>"c_blue",:nh_name=>"watcher_count" %>
<span>|&nbsp;</span>
<%=l(:label_x_user_fans, :count => User.current.watcher_users(User.current.id).count)%><%= link_to @user.watcher_users.count.to_s, {:controller=>"users", :action=>"user_fanslist",:id=>@user.id},:class=>"c_blue",:nh_name=>"fans_count"%>
<span>|&nbsp;</span>积分(<%= link_to(format("%.2f" ,get_option_number(@user,1).total_score ).to_i,
{:controller => 'users', :action => 'show_new_score', :remote => true, :id => @user.id }, :class => 'c_blue',:id => 'user_score') %>
</div>
<div class="cl"></div>
<% if (@user.user_extensions) %>
<div class="pf_intro"><%= @user.user_extensions.brief_introduction %></div>
<% end %>
</div><!--uers_info end-->
<div class="leftbox mt10">
<ul class="leftbox_ul_left">
<li>加入时间&nbsp;:</li>
<% if @user.user_extensions!=nil && @user.user_extensions.identity == 2 %>
<li><%= l(:label_company_name) %>&nbsp;:</li>
<% elsif !@user.firstname.empty? || !@user.lastname.empty? %>
<li>真实姓名&nbsp;:</li>
<% end %>
<% unless @user.user_extensions.nil? %>
<% if @user.user_extensions.identity == 0 %>
<li>职称&nbsp;:</li>
<% end %>
<% if @user.user_extensions && @user.user_extensions.location && !@user.user_extensions.location.empty?%>
<li>地区&nbsp;:</li>
<% end %>
<% if (@user.user_extensions.identity == 0 || @user.user_extensions.identity == 1) && !@user.user_extensions.school.nil? %>
<li>工作单位&nbsp;:</li>
<% elsif @user.user_extensions.identity == 3 && !@user.user_extensions.occupation.nil? && !@user.user_extensions.occupation.empty? %>
<li>工作单位&nbsp;:</li>
<% elsif @user.user_extensions.identity == 2 %>
<li>工作单位&nbsp;:</li>
<% end %>
<% if (!@user.user_extensions.description.nil? && !@user.user_extensions.description.empty?) %>
<li>个人简介&nbsp;:</li>
<% end %>
<% end %>
</ul>
<ul class="leftbox_ul_right c_dgrey">
<li><%= format_date(@user.created_on) %></li>
<li style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="<%= @user.show_name %>"><%= @user.show_name %></li>
<% unless @user.user_extensions.nil? %>
<% if @user.user_extensions.identity == 0 %>
<li><%= get_technical_title @user %></li>
<% end %>
<% if @user.user_extensions && @user.user_extensions.location && !@user.user_extensions.location.empty?%>
<li><%= @user.user_extensions.location %>&nbsp;&nbsp;<%= @user.user_extensions.location_city %></li>
<% end %>
<% if (@user.user_extensions.identity == 0 || @user.user_extensions.identity == 1) && !@user.user_extensions.school.nil? %>
2015-07-18 11:04:03 +08:00
<li style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="<%= @user.user_extensions.school.name %>"><a href="<%= url_for(:controller=>'welcome',:action => 'course', :school_id => @user.user_extensions.school.id,:host=>Setting.host_course) %>"><%= @user.user_extensions.school.name %></a></li>
2015-07-09 15:27:49 +08:00
<% elsif @user.user_extensions.identity == 3 && !@user.user_extensions.occupation.nil? && !@user.user_extensions.occupation.empty? %>
2015-07-18 11:04:03 +08:00
<li style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="<%= @user.user_extensions.occupation %>"><%= @user.user_extensions.occupation %></li>
2015-07-09 15:27:49 +08:00
<% elsif @user.user_extensions.identity == 2 %>
<li style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="<%= @user.show_name %>"><%= @user.show_name %></li>
<% end %>
<% if (!@user.user_extensions.description.nil? && !@user.user_extensions.description.empty?) %>
2015-07-10 14:17:19 +08:00
<li style="word-break:break-all;"><%= @user.user_extensions.description %></li>
2015-07-09 15:27:49 +08:00
<% end %>
<% end %>
</ul>
<div class="cl"></div>
</div>
2015-07-17 13:40:53 +08:00
<% if @center_flag %>
<div class="subNavBox ">
<div class="subNav "><a href="<%=url_for(:controller => 'users', :action => 'show',:id=>@user.id)%>" class=" f14 c_blue02">动态</a></div>
<div class="subNav subNav_jiantou"><a href="<%=url_for(:controller => 'users', :action => 'user_courses',:id=>@user.id)%>" class=" f14 c_blue02">我的课程<span style="font-weight:normal;font-size:12px;color:#FF5722;">(<%=@user.courses.count%>)</span></a></div>
<!--<ul class="navContent " >-->
<!--<li><a href="javascirpt:void();" >大学计算机基础</a></li>-->
<!--<li><a href="javascirpt:void();" >大牛软件核心知识开放课程</a></li>-->
<!--<li><a href="javascirpt:void();" >大学计算机基础</a></li>-->
<!--<li><a href="javascirpt:void();" >大牛软件核心知识开放课程</a></li>-->
<!--<li><a href="javascirpt:void();" >大学计算机基础</a></li>-->
<!--</ul>-->
<div class="subNav subNav_jiantou"><a href="<%=url_for(:controller => 'users', :action => 'user_projects',:id=>@user.id)%>" class=" f14 c_blue02">我的项目<span style="font-weight:normal;font-size:12px;color:#FF5722;">(<%=@user.projects.count%>)</span></a></div>
<!--<ul class="navContent " >-->
<!--<li><a href="javascirpt:void();" >Trustie-Forge</a></li>-->
<!--<li><a href="javascirpt:void();" >Trustie-weekly</a></li>-->
<!--<li><a href="javascirpt:void();" >大学计算机基础</a></li>-->
<!--<li><a href="javascirpt:void();" >大牛软件核心知识开放课程</a></li>-->
<!--<li><a href="javascirpt:void();" >大学计算机基础</a></li>-->
<!--</ul>-->
<div class="subNav "><a href="<%= url_for(:controller => 'my', :action => 'account') %>" class=" f14 c_blue02">编辑资料</a></div>
</div><!--侧导航 end-->
<% end %>
<div class="cl"></div>
2015-07-13 16:44:53 +08:00
<div class="leftbox mt10">
<ul class="leftbox_ul_left">
<% if !@user.user_extensions.nil? && @user.user_extensions.identity == 0 %>
<li>创建课程&nbsp;:</li>
<li>发布作业&nbsp;:</li>
<% end %>
<li>加入课程&nbsp;:</li>
<li>参加匿评&nbsp;:</li>
<li>发布资源&nbsp;:</li>
<li>创建项目&nbsp;:</li>
<li>加入项目&nbsp;:</li>
<li>发布缺陷&nbsp;:</li>
<li>解决缺陷&nbsp;:</li>
</ul>
<ul class="leftbox_ul_right c_dgrey">
<% if !@user.user_extensions.nil? && @user.user_extensions.identity == 0 %>
<li><%= get_create_course_count(@user) %></li>
<li><%= get_homework_commons_count(@user) %></li>
<% end %>
<li><%= get_join_course_count(@user) %></li>
<li><%= get_anonymous_evaluation_count(@user) %></li>
<li><%= get_projectandcourse_attachment_count(@user) %></li>
<li><%= get_create_project_count(@user) %></li>
<li><%= get_join_project_count(@user) %></li>
<li><%= get_create_issue_count(@user) %></li>
<li><%= get_resolve_issue_count(@user) %></li>
</ul>
<div class="cl"></div>
</div>
2015-07-09 15:27:49 +08:00
<div class="cl"></div>
<%= render :partial => 'layouts/user_watch_list', :locals => {:user => @user} %>
<%= render :partial => 'layouts/user_fans_list', :locals => {:user => @user} %>
2015-07-14 15:16:15 +08:00
<% visitor_count,visitor_list = get_visitor_users(@user) %>
<div class="leftbox mt10" style="display:<%= visitor_count==0 ? 'none' : 'block' %>">
<h4 class="fl">访客</h4><a href="<%=url_for(:controller => 'users', :action => 'user_visitorlist', :id=>@user.id)%>" data-count="<%= visitor_count %>" style="display:<%= visitor_count>10 ? 'block' : 'block' %>" class="more fr mr10">更多</a>
<div class="cl"></div>
<div class="mt5">
<% for visitor in visitor_list %>
<%= link_to image_tag(url_to_avatar(visitor.user), :style => "width:38px;height:38px;"), user_path(visitor.user), :class => "pic_members", :title => "#{visitor.user.name}" %>
<% end %>
<div class="cl"></div>
</div>
</div>
2015-07-09 15:27:49 +08:00
</div><!--LSide end-->
<%= yield %>
</div><!--Content end-->
<div class="cl"></div>
2015-07-17 16:20:58 +08:00
<%= render :partial => 'layouts/new_footer'%>
2015-07-09 15:27:49 +08:00
<div class="cl"></div>
</div><!--Container end-->
<%= render :partial => 'layouts/new_feedback' %>
<div id="ajax-modal" style="display:none;"></div>
<%= javascript_include_tag '/javascripts/avatars.js' %>
<div id="nh_tx_dialog_html" class="white_content" style="display:none;">
<div>
<div><a href="javascript:hideModal();" class="box_close"></a></div>
<div class="cl"></div>
<div class="pro_new">
<h3 class="box_h3 mb10">头像设置</h3>
<div class="uppicBox">
<%= file_field_tag 'avatar[image]',
:id => nil,
:class => 'uppic_btn',
:style => 'width:70px;',#added by young
:size => "1",
:multiple => false,
:onchange => 'addInputAvatar(this);',
:data => {
:max_file_size => Setting.attachment_max_size.to_i.kilobytes,
:max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)),
:max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i,
:file_type => Redmine::Configuration['pic_types'].to_s,
:type_support_message => l(:error_pic_type),
:upload_path => upload_avatar_path(:format => 'js'),
:description_placeholder => nil ,# l(:label_optional_description)
:source_type => @user.class.to_s,
:source_id => @user.id.to_s
} %>
<!--<br/>-->
<!--<span>只支持jpg,png,gif,大小不超过5M</span>-->
</div>
<div class="showpicBox">
<p>预览</p>
<%= image_tag(url_to_avatar(@user), :style=>"width:96px;height:96px;",:class=>"mb5 mt10",:nhname=>'avatar_image') %>
<span >96px*96px</span> <br />
<div class="mb20"></div>
<%= image_tag(url_to_avatar(@user), :style=>"width:48px;height:48px;",:class=>"mb5",:nhname=>'avatar_image') %>
<br />
<span>48px*48px</span> <br />
</div>
<div class="cl mb10"></div>
2015-07-21 11:59:15 +08:00
<a href="javascript:hideModal();" class=" fr grey_btn mr15"> 取&nbsp;&nbsp;消</a>
2015-07-09 15:27:49 +08:00
<a href="<%= url_for(:controller => 'my', :action => 'save_user_avatar') %>" data-remote="true" class="blue_btn fr mr10">确&nbsp;&nbsp;定</a>
</div><!--talknew end-->
<div class="cl"></div>
</div><!--floatbox end-->
</div>
</body>
</html>