Merge branch 'dev_shcool' into develop
This commit is contained in:
commit
7e34062435
|
@ -26,7 +26,13 @@ class AccountController < ApplicationController
|
|||
if request.get?
|
||||
@login = params[:login] || true
|
||||
if User.current.logged?
|
||||
redirect_to user_path(User.current)
|
||||
# 判断用户基本资料是否完善,不完善讲强制完善基本资料,完善进入主页
|
||||
user = UserExtensions.where(:user_id => User.current.id).first
|
||||
if user.gender.nil? || user.school_id.nil? || User.current.lastname.nil?
|
||||
redirect_to my_account_path(:tip => 1)
|
||||
else
|
||||
redirect_to user_path(User.current)
|
||||
end
|
||||
else
|
||||
render :layout => 'login'
|
||||
end
|
||||
|
@ -127,7 +133,7 @@ class AccountController < ApplicationController
|
|||
session[:auth_source_registration] = nil
|
||||
self.logged_user = @user
|
||||
flash[:notice] = l(:notice_account_activated)
|
||||
redirect_to my_account_path
|
||||
redirect_to my_account_path(:tip=>1)
|
||||
end
|
||||
else
|
||||
us = UsersService.new
|
||||
|
@ -144,7 +150,7 @@ class AccountController < ApplicationController
|
|||
if !@user.new_record?
|
||||
self.logged_user = @user
|
||||
flash[:notice] = l(:notice_account_activated)
|
||||
redirect_to my_account_url
|
||||
redirect_to my_account_url(:tip=>1)
|
||||
else
|
||||
redirect_to signin_path
|
||||
end
|
||||
|
@ -347,9 +353,15 @@ class AccountController < ApplicationController
|
|||
else
|
||||
#by young
|
||||
#redirect_back_or_default my_page_path
|
||||
redirect_back_or_default User.current
|
||||
# 基本资料不完善的用户,将强制用户完善基本资料。
|
||||
user = UserExtensions.where(:user_id => User.current.id).first
|
||||
if user.gender.nil? || user.school_id.nil? || User.current.lastname.nil?
|
||||
redirect_to my_account_path(:tip => 1)
|
||||
else
|
||||
redirect_back_or_default User.current
|
||||
#redirect_to my_account_url
|
||||
#redirect_to User.current
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -698,7 +698,7 @@ class AdminController < ApplicationController
|
|||
apply_school_ids = apply_schools.empty? ? "(-1)" : "(" + apply_schools.map{|sc| sc.school_id}.join(',') + ")"
|
||||
if !params[:search].nil?
|
||||
search = "%#{params[:search].to_s.strip.downcase}%"
|
||||
@schools = School.where("id not in #{apply_school_ids} and #{School.table_name}.name like :p",:p=>search)
|
||||
@schools = School.where("id not in #{apply_school_ids} and #{School.table_name}.name like :p", :p => search)
|
||||
#@schools = School.all
|
||||
else
|
||||
#@course = @user.courses.where("is_delete = 0 and #{Course.table_name}.id != #{homework.course_id}").select { |course| @user.allowed_to?(:as_teacher,course)}
|
||||
|
|
|
@ -114,9 +114,15 @@ class MyController < ApplicationController
|
|||
applied_message.update_attribute(:viewed, true)
|
||||
end
|
||||
|
||||
# 基本资料不完善 @force为false, 完善 @force为true
|
||||
@force = false
|
||||
if params[:tip]
|
||||
@force = true
|
||||
end
|
||||
|
||||
@user = User.current
|
||||
|
||||
lg=@user.login
|
||||
lg = @user.login
|
||||
@pref = @user.pref
|
||||
diskfile = disk_filename('User', @user.id)
|
||||
diskfile1 = diskfile + 'temp'
|
||||
|
@ -178,7 +184,12 @@ class MyController < ApplicationController
|
|||
File.delete(diskfile1) if File.exist?(diskfile1)
|
||||
end
|
||||
|
||||
render :layout=>'new_base_user'
|
||||
# 基本资料不完善,无法使用其他功能,完善着可继续使用
|
||||
if @force
|
||||
render :layout => 'new_base_user_show'
|
||||
else
|
||||
render :layout => 'new_base_user'
|
||||
end
|
||||
end
|
||||
|
||||
# Destroys user's account
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
<div id="Footer" class="f12">
|
||||
<div class="footerAboutContainer">
|
||||
<ul class="footerAbout">
|
||||
<li class="fl"><a href="javascript:void(0);" disabled="true" class="f_grey mw20" target="_blank"><%= l(:label_about_us)%></a>|</li>
|
||||
<li class="fl"><a href="javascript:void(0);" disabled="true" class="f_grey mw20" target="_blank">服务协议</a>|</li>
|
||||
<li class="fl" style="display: none"><span class="f_grey mw20" title="暂未开放"><%= l(:label_recruitment_information)%></span>|</li>
|
||||
<li class="fl"><%= link_to l(:label_surpport_group), "javascript:void(0);", :class => "f_grey mw20", :target=>"_blank" %>|</li>
|
||||
<li class="fl"><a href="javascript:void(0);" disabled="true" class="f_grey mw20" target="_blank"><%= l(:label_forums)%></a></li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="cl"></div>
|
||||
<ul class="departments">
|
||||
<!--li class="fl mr10">
|
||||
<strong><%#= l(:label_hosted_organization)%></strong><a href="http://www.nudt.edu.cn/ArticleShow.asp?ID=47" class=" ml10 f_grey" target="_blank"><%#= l(:label_hosted_by)%></a>
|
||||
</li>
|
||||
<li class="fl">
|
||||
<a href="http://www.nudt.edu.cn/ArticleShow.asp?ID=41" class="mr45 f_grey" target="_blank"><%#= l(:label_sponsor)%></a>
|
||||
</li-->
|
||||
<li class="fl mr10">
|
||||
<strong><%= l(:label_partners)%></strong>
|
||||
</li>
|
||||
<li class="fl mr20">
|
||||
<a href="http://eecs.pku.edu.cn" class="f_grey" target="_blank"><%#= l(:label_co_organizer_EECS)%><img src="/images/footer_logo/PekingUniversity.png" width="121" height="40" style="display: inline-block;" alt="北京大学" /></a>
|
||||
</li>
|
||||
<li class="fl mr20">
|
||||
<a href="http://scse.buaa.edu.cn/" class="f_grey" target="_blank"><%#= l(:label_co_organizer_BHU)%><img src="/images/footer_logo/BeiHang_university.png" width="173" height="40" style="display: inline-block;" alt="北京航空航天大学" /></a>
|
||||
</li>
|
||||
<li class="fl mr20">
|
||||
<a href="http://www.iscas.ac.cn/" class="f_grey" target="_blank"><%#= l(:label_co_organizer_CAS)%><img src="/images/footer_logo/ISCAS_logo.png" width="91" height="40" style="display: inline-block;" alt="ISCAS" /></a>
|
||||
</li>
|
||||
<li class="fl mr20">
|
||||
<a href="http://www.inforbus.com/" class="f_grey" target="_blank"><%#= l(:label_co_organizer_InforS)%><img src="/images/footer_logo/CVICSE.png" width="165" height="40" style="display: inline-block;" alt="中创软件" /></a>
|
||||
</li>
|
||||
<li class="fl"><a href="http://www.webxmf.com/" target="_blank"><img src="/images/footer_logo/bee_logo.png" width="167" height="40" style="display: inline-block;" alt="web小蜜蜂" /></a></li>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
<ul class="copyright">
|
||||
<li class="fl mr30"><%= l(:label_rights_reserved)%></li>
|
||||
<li class="fl"><a href="http://www.miibeian.gov.cn/" class="fl f_grey" target="_blank"><%= l(:label_license)%></a></li>
|
||||
</ul>
|
||||
</div><!--Footer end-->
|
|
@ -0,0 +1,111 @@
|
|||
<div class="navHomepage">
|
||||
<div class="navHomepageLogo fl">
|
||||
<a href ="javascript:void(0);" disabled="true" class="mt3"><%= image_tag("../images/nav_logo.png",width:"51px", height: "45px",class: "mt3")%></a>
|
||||
</div>
|
||||
<div class="fl">
|
||||
<ul>
|
||||
<li class="navHomepageMenu fl">
|
||||
<a href ="javascript:void(0);" disabled="true" class="c_white f16 db p10">首页</a>
|
||||
</li>
|
||||
<li class="navHomepageMenu fl">
|
||||
<a href ="javascript:void(0);" disabled="true" class="c_white f16 db p10">资源库</a>
|
||||
</li>
|
||||
<li class="navHomepageMenu fl">
|
||||
<a href ="javascript:void(0);" disabled="true" class="c_white f16 db p10">题库</a>
|
||||
</li>
|
||||
<li class="navHomepageMenu fl mr30">
|
||||
<a href ="javascript:void(0);" disabled="true" class="c_white f16 db p10">帮助中心</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="fl" id="navHomepageSearch">
|
||||
<!--<form class="navHomepageSearchBox">-->
|
||||
<% name = name%>
|
||||
<a href ="javascript:void(0);" disabled="true"><%= form_tag({controller: :welcome, action: :search },:class=>'navHomepageSearchBox', method: :get) do %>
|
||||
<input type="text" name="q" value="<%= name.nil? ? "" : name%>" id="navHomepageSearchInput" class="navHomepageSearchInput" placeholder="请输入关键词搜索公开的班级、项目、用户、资源以及帖子"/>
|
||||
<input type="hidden" name="search_type" id="type" value="all"/>
|
||||
<input type="text" style="display: none;"/>
|
||||
<a href="javascript:void(0);" class="homepageSearchIcon" disabled="true"></a>
|
||||
<% end %></a>
|
||||
</div>
|
||||
|
||||
<div class="navHomepageProfile" id="navHomepageProfile">
|
||||
<ul>
|
||||
<li class="homepageProfileMenuIcon" id="homepageProfileMenuIcon">
|
||||
<div class="mt5 mb8" id="user_avatar"></div>
|
||||
<a href ="javascript:void(0);" disabled="true"><%= image_tag(url_to_avatar(User.current),:width =>"40",:height => "40",:alt=>"头像", :id => "nh_user_logo", :class => "portraitRadius") %></a>
|
||||
<ul class="topnav_login_list none" id="topnav_login_list">
|
||||
<li>
|
||||
<a href ="javascript:void(0);" class="menuGrey" disabled="true">修改资料</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href ="javascript:void(0);" class="menuGrey" disabled="true">我的组织</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href ="javascript:void(0);" class="menuGrey" disabled="true">新建组织</a>
|
||||
</li>
|
||||
<!--<li><a href="javascript:void(0);" class="menuGrey">账号设置</a> </li>-->
|
||||
<li>
|
||||
<%= link_to "退出",logout_url_without_domain,:class => "menuGrey",:method => "post"%>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="navHomepageNews" id="user_messages">
|
||||
<a href ="javascript:void(0);" class="homepageNewsIcon" disabled="true" title = "您的所有消息" ></a>
|
||||
<%#= link_to User.current.count_new_message, user_message_path(User.current), :class => "homepageNewsIcon" %>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
var onUserMessages = false;
|
||||
var onNotice = false;
|
||||
//搜索相关
|
||||
$("#navHomepageSearch").mouseover(function(){
|
||||
$("#navHomepageSearchType").show();
|
||||
}).mouseout(function(){
|
||||
$("#navHomepageSearchType").hide();
|
||||
});
|
||||
|
||||
$("#user_messages").mouseenter(function(){
|
||||
onNotice = true;
|
||||
$("#user_messages_list").show();
|
||||
if($("#message_list_detail").length == 0){
|
||||
$.get('<%=user_messages_unviewed_users_path %>');
|
||||
$("#ajax-indicator").hide();
|
||||
}
|
||||
var obj = $("#user_messages_list");
|
||||
clearTimeout(obj.timer);
|
||||
}).mouseleave(function(){
|
||||
onNotice = false;
|
||||
var obj = $("#user_messages_list");
|
||||
setTimeout(function(){
|
||||
if(!onNotice && !onUserMessages) {
|
||||
obj.hide();
|
||||
obj.html("<%=escape_javascript(render :partial => 'layouts/message_loading') %>");
|
||||
} }, 500);
|
||||
});
|
||||
$("#message_list_detail").mouseenter(function(event){
|
||||
event.stopPropagation();
|
||||
onUserMessages = true;
|
||||
}).mouseleave(function(){
|
||||
onUserMessages = false;
|
||||
});
|
||||
|
||||
$("#navHomepageProfile").mouseenter(function(){
|
||||
$("#homepageProfileMenuIcon").addClass("homepageProfileMenuIconhover");
|
||||
$("#topnav_login_list").show();
|
||||
});
|
||||
$("#navHomepageProfile").mouseleave(function(){
|
||||
$("#homepageProfileMenuIcon").removeClass("homepageProfileMenuIconhover");
|
||||
$("#topnav_login_list").hide();
|
||||
});
|
||||
|
||||
function signout(){
|
||||
$.post(
|
||||
'<%= signout_path%>',
|
||||
{}
|
||||
);
|
||||
}
|
||||
</script>
|
|
@ -103,7 +103,7 @@
|
|||
<div class="homepageLeft mt10" id="LSide">
|
||||
<div class="user_leftinfo mb10">
|
||||
<% if User.current.logged?%>
|
||||
<%=link_to image_tag(url_to_avatar(@user),width:"74", height: "74", :id=>'nh_user_tx'), my_clear_user_avatar_temp_path, :class => "user_leftinfo_img", :remote => true%>
|
||||
<%=link_to image_tag(url_to_avatar(@user),width:"74", height: "74", :id => 'nh_user_tx'), my_clear_user_avatar_temp_path, :class => "user_leftinfo_img", :remote => true%>
|
||||
<% else %>
|
||||
<img src="images/user/male.jpg" width="74" height="74" />
|
||||
<% end %>
|
||||
|
|
|
@ -0,0 +1,335 @@
|
|||
<!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','syllabus',: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");
|
||||
})
|
||||
$(".homepagePostPortrait").mouseover(function(){
|
||||
onImage = true;
|
||||
$(this).children(".userCard").css("display","block");
|
||||
})
|
||||
$(".homepagePostPortrait").mouseout(function(){
|
||||
var cur = $(this);
|
||||
onImage = false;
|
||||
setTimeout(function(){
|
||||
if (onUserCard == false && onImage == false) {
|
||||
$(cur).children(".userCard").css("display","none");
|
||||
}
|
||||
},500);
|
||||
})
|
||||
$(".userCard").mouseover(function(){
|
||||
onUserCard = true;
|
||||
$(this).css("display","block");
|
||||
})
|
||||
$(".userCard").mouseout(function(){
|
||||
onUserCard = false;
|
||||
$(this).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_show' %>
|
||||
<% else%>
|
||||
<%= render :partial => 'layouts/unlogin_header' %>
|
||||
<% end%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div class="homepageContentContainer" id="">
|
||||
<!--div class="homepageRightBannerImg"></div-->
|
||||
<div class="cl"></div>
|
||||
<div class="homepageContent">
|
||||
<div class="homepageLeft mt10" id="LSide">
|
||||
<div class="user_leftinfo mb10">
|
||||
<% if User.current.logged?%>
|
||||
<a href ="javascript:void(0);" disabled="true" class="user_leftinfo_img"><%= image_tag(url_to_avatar(@user),width:"74", height: "74", :id=>'nh_user_tx')%></a>
|
||||
<% else %>
|
||||
<img src="images/user/male.jpg" width="74" height="74" />
|
||||
<% end %>
|
||||
<% if (@user.user_extensions && (@user.user_extensions.identity != 2) ) %>
|
||||
<span class="<%= @user.user_extensions.gender == 1 ? 'user_leftinfo_female' : 'user_leftinfo_male' %> "></span>
|
||||
<% end %>
|
||||
<div class="user_info_inner">
|
||||
<div class=" user_leftinfo_namebox" >
|
||||
<a href="javascript:void(0);" class="user_leftinfo_name"><%=@user.show_name %></a>
|
||||
<% 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">
|
||||
<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="javascript:void(0);" disabled="true">
|
||||
<strong>博客</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="javascript:void(0);" disabled="true">
|
||||
<strong>关注</strong><br />
|
||||
<span class="sy_cgrey"><%=User.watched_by(@user.id).count %></span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="javascript:void(0);" disabled="true">
|
||||
<strong>粉丝</strong><br />
|
||||
<span class="sy_cgrey"><%= @user.watcher_users.count %></span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="watch_user_btn_div">
|
||||
<a href="javascript:void(0);" class="user_editinfo" disabled="true">编辑个人资料</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="user_leftnav ">
|
||||
<% hidden_courses = Setting.find_by_name("hidden_courses") %>
|
||||
<% unvisiable = hidden_courses && hidden_courses.value == "1"%>
|
||||
<% if !unvisiable %>
|
||||
<ul class="users_accordion mb10">
|
||||
<li id="user_01" class="user_icons_course">
|
||||
<a href ="javascript:void(0);" disabled="true">课程</a>
|
||||
<% courses = @user.courses.visible.where("is_delete =?", 0).select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc").limit(10) %>
|
||||
<% all_count = @user.courses.visible.where("is_delete =?", 0).count%>
|
||||
<div class="<%= courses.empty? ? 'none' : ''%>" >
|
||||
<div id="homepageLeftMenuCourses">
|
||||
<ul class="user_sub_menu" id="user_courses_li">
|
||||
</ul>
|
||||
</div>
|
||||
<% if !courses.empty? %>
|
||||
<a class="user_navmorebox" href="javascript:void(0);" id="user_hide_course" >
|
||||
<span id="hide_show_courseicon" class="user_icons_closeclass"></span>
|
||||
</a>
|
||||
<% end %>
|
||||
</div>
|
||||
</li>
|
||||
<% if is_current_user %>
|
||||
<li id="user_02" class="user_icons_new">
|
||||
<a href ="javascript:void(0);" disabled="true">新建课程</a>
|
||||
</li>
|
||||
<li id="user_03" class="user_icons_new">
|
||||
<a href ="javascript:void(0);" disabled="true">新建班级</a>
|
||||
</li>
|
||||
<li id="user_04" class="user_icons_addclass">
|
||||
<a href ="javascript:void(0);" disabled="true">加入班级</a>
|
||||
</li>
|
||||
<% if @user == User.current %>
|
||||
<li id="user_05" class="user_icons_myhw">
|
||||
<a href ="javascript:void(0);" disabled="true">我的作业</a>
|
||||
</li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
||||
<ul class="users_accordion mb10">
|
||||
<li id="user_06" class="user_icons_project">
|
||||
<a href ="javascript:void(0);" disabled="true">项目</a>
|
||||
<% all_count = @user.projects.visible.count%>
|
||||
<% projects = @user.projects.visible.select("projects.*, (SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS a").order("a desc").limit(10)%>
|
||||
<div class="<%= projects.empty? ? 'none' : ''%>" >
|
||||
<div id="homepageLeftMenuForge">
|
||||
<ul class="user_sub_menu" id="user_projects_li">
|
||||
</ul>
|
||||
</div>
|
||||
<% if !projects.empty? %>
|
||||
<a class="user_navmorebox" href="javascript:void(0);" id="user_hide_project" onclick="leftProjectslistChange();">
|
||||
<span id="hide_show_projecticon" class="user_icons_closeclass"></span>
|
||||
</a>
|
||||
<% end %>
|
||||
</div>
|
||||
</li>
|
||||
<% if is_current_user %>
|
||||
<li id="user_07" class="user_icons_new">
|
||||
<a href ="javascript:void(0);" disabled="true">新建项目</a>
|
||||
</li>
|
||||
<li id="user_08" class="user_icons_addproject">
|
||||
<a href ="javascript:void(0);" disabled="true">加入项目</a>
|
||||
</li>
|
||||
<!--<li id="user_09" class="user_icons_myissues">-->
|
||||
<!--<a href="#user_09" >我的任务</a>-->
|
||||
<!--</li>-->
|
||||
<% end %>
|
||||
</ul>
|
||||
<ul class="users_accordion mb10">
|
||||
<li id="user_10" class="user_icons_mes">
|
||||
<a href ="javascript:void(0);" disabled="true">留言</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div><!--sy_class_leftnav end-->
|
||||
|
||||
<div class="fontGrey5 mt10 ml20">访问计数 <%= @user.visits.to_i %> (自2016年5月)</div>
|
||||
</div>
|
||||
<div class="homepageRight">
|
||||
<%= yield %>
|
||||
</div>
|
||||
</div>
|
||||
<%= render :partial => 'layouts/new_feedback' %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<%= render :partial => 'layouts/footer_show' %>
|
||||
<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;">
|
||||
<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">
|
||||
<input type="button" class="uppic_btn" onclick="$('#upload_user_image').click();" value="浏览.."/>
|
||||
<%= file_field_tag 'avatar[image]',
|
||||
:id => "upload_user_image",
|
||||
:style => 'display:none;',#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') %>
|
||||
<br/>
|
||||
<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>
|
||||
<a href="javascript:void(0);" class=" fr grey_btn mr15 f14"> 取 消</a>
|
||||
<a href="javascript:void(0);" data-remote="true" class="blue_btn fr mr10 f14">确 定</a>
|
||||
</div><!--talknew end-->
|
||||
<div class="cl"></div>
|
||||
</div><!--floatbox end-->
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$('#user_hide_course').hide();
|
||||
$('#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();
|
||||
});
|
||||
function leftCourseslistChange(){
|
||||
var target = $('#user_courses_li>li');
|
||||
for(var i = 10; i < target.length; i++){
|
||||
target.eq(i).slideToggle();
|
||||
}
|
||||
$('#hide_show_courseicon').toggleClass("user_icons_closeclass");
|
||||
$('#hide_show_courseicon').toggleClass("user_icons_moreclass");
|
||||
|
||||
}
|
||||
function leftProjectslistChange(){
|
||||
var target = $('#user_projects_li>li');
|
||||
for(var i = 10; i < target.length; i++){
|
||||
target.eq(i).slideToggle();
|
||||
}
|
||||
$('#homepageLeftMenuForge').slideToggle();
|
||||
$('#hide_show_projecticon').toggleClass("user_icons_closeclass");
|
||||
$('#hide_show_projecticon').toggleClass("user_icons_moreclass");
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,4 +1,15 @@
|
|||
|
||||
<% if @force %>
|
||||
<% message = AppliedMessage.where(:status => 3, :user_id => User.current.id, :viewed => 0).first %>
|
||||
<% unless message.nil? %>
|
||||
<div class="homepageRightBanner">
|
||||
<div class="polls_head" style="font-size:8px;"> 消息: 您添加新的单位“<%= message.name %>”的申请,经确认为无效的单位信息,已被删除,请重新编辑您的单位资料。谢谢!</div>
|
||||
<% message.update_attribute(:viewed, true)%>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="homepageRightBanner" style="border-bottom:2px solid #ddd;">
|
||||
<div class="polls_head" style="color:red; font-size:17px;"> 提示: 您尚未完善您的基本资料,完善后可使用更多功能</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<div id="RSide" style="margin-left:0px; margin-bottom:0px; width:728px;">
|
||||
<div id="users_tb_" class="users_tb_">
|
||||
<ul>
|
||||
|
@ -29,9 +40,12 @@
|
|||
<li> </li>
|
||||
</ul>
|
||||
<ul class="setting_right ">
|
||||
<li><%= f.text_field :login,:no_label=>true, :required => true,:style=>"color:grey", :nh_required=>"1",:disabled=>'disabled', :name => "login",:class=>"w210"%></li>
|
||||
<li><%= f.text_field :mail,:no_label=>true, :required => true,:nh_required=>"1",:class=>"w210"%></li>
|
||||
|
||||
<li><%= f.text_field :login,:no_label=>true, :required => true,:style => "color:grey", :nh_required => "1",:disabled => 'disabled', :name => "login",:class => "w210"%></li>
|
||||
<% if @force %>
|
||||
<li><%= f.text_field :mail,:no_label=>true, :required => true,:nh_required => "1",:class=>"w210",:disabled=>'disabled'%></li>
|
||||
<% else %>
|
||||
<li><%= f.text_field :mail,:no_label=>true, :required => true,:nh_required=>"1",:class=>"w210"%></li>
|
||||
<% end %>
|
||||
<li>
|
||||
<select onchange="showtechnical_title(this.value);" required = true, nh_required="1" name="identity" id="userIdentity" class="location" class="w70" style="height:28px;margin-left:2px;">
|
||||
<option value="-1">
|
||||
|
@ -81,7 +95,7 @@
|
|||
<input nhname="tag" nh_tag_4="true" id="occupation" name="occupation" style="display: none;" class="w210" type="text" value="" placeholder=" --请选择您所属的单位--"/>
|
||||
<p class="fl ml10">
|
||||
<!-- <span id="errortip" class="icons_warning fl mt5" style="display: none;"></span> -->
|
||||
<span id="hint" style="color: #7f7f7f;display: none">平台找到了<a id="school_num" href="javascript:void(0)" style="color: red" >0</a>个包含<a id="search_condition" href="javascript:void(0)">"国防"</a>的高校</span>
|
||||
<span id="hint" style="color: #7f7f7f;display: none"><a id="school_num" href="javascript:void(0)" style="color: red" ></a><a id="search_condition" href="javascript:void(0)"></a></span>
|
||||
</p>
|
||||
<!--<input nhname="tag" nh_tag_0="true" nh_tag_1="true" id="occupation_name" type="text" style="display: none;width:117px;" readonly/>-->
|
||||
<% elsif User.current.user_extensions.identity == 3 || User.current.user_extensions.identity == 2 %>
|
||||
|
@ -89,7 +103,7 @@
|
|||
<input nhname="tag" nh_tag_4="true" id="occupation" name="occupation" style="display: none;" class="w210" type="text" value="<%= @user.user_extensions.occupation %>" />
|
||||
<p class="fl ml10">
|
||||
<!-- <span id="errortip" class="icons_warning fl mt5" style="display: none;"></span> -->
|
||||
<span id="hint" style="color: #7f7f7f;display: none">平台找到了<a id="school_num" href="javascript:void(0)" style="color: red" >0</a>个包含<a id="search_condition" href="javascript:void(0)">"国防"</a>的高校</span>
|
||||
<span id="hint" style="color: #7f7f7f;display: none"><a id="school_num" href="javascript:void(0)" style="color: red" ></a><a id="search_condition" href="javascript:void(0)"></a></span>
|
||||
</p>
|
||||
<!--<input nhname="tag" nh_tag_0="true" nh_tag_1="true" id="occupation_name" type="text" style="display: none;width:117px;" readonly/>-->
|
||||
<% elsif User.current.user_extensions.school.nil? %>
|
||||
|
@ -97,7 +111,7 @@
|
|||
<input nhname="tag" nh_tag_4="true" id="occupation" name="occupation" style="display: none;" class="w210" type="text" placeholder=" --请选择您所属的单位--" />
|
||||
<p class="fl ml10">
|
||||
<!-- <span id="errortip" class="icons_warning fl mt5" style="display: none;"></span> -->
|
||||
<span id="hint" style="color: #7f7f7f;display: none">平台找到了<a id="school_num" href="javascript:void(0)" style="color: red" >0</a>个包含<a id="search_condition" href="javascript:void(0)">"国防"</a>的高校</span>
|
||||
<span id="hint" style="color: #7f7f7f;display: none"><a id="school_num" href="javascript:void(0)" style="color: red" ></a><a id="search_condition" href="javascript:void(0)"></a></span>
|
||||
</p>
|
||||
<!--<input nhname="tag" nh_tag_0="true" nh_tag_1="true" id="occupation_name" type="text" style="display: none;width:117px;" readonly/>-->
|
||||
<% else %>
|
||||
|
@ -105,7 +119,7 @@
|
|||
<input nhname="tag" nh_tag_4="true" id="occupation" name="occupation" type="text" style="display: none;" class="w210" value="<%= User.current.user_extensions.school.id %>"/>
|
||||
<p class="fl ml10">
|
||||
<!-- <span id="errortip" class="icons_warning fl mt5" style="display: none;"></span> -->
|
||||
<span id="hint" style="color: #7f7f7f;display: none">平台找到了<a id="school_num" href="javascript:void(0)" style="color: red" >0</a>个包含<a id="search_condition" href="javascript:void(0)">"国防"</a>的高校</span>
|
||||
<span id="hint" style="color: #7f7f7f;display: none"><a id="school_num" href="javascript:void(0)" style="color: red" ></a><a id="search_condition" href="javascript:void(0)"></a></span>
|
||||
</p>
|
||||
<!--<input nhname="tag" nh_tag_0="true" nh_tag_1="true" id="occupation_name" type="text" style="display: none;width:117px;" value="<%#= User.current.user_extensions.school.name %>" readonly="true" style="background-color: #E2E2E2;"/>-->
|
||||
<% end %>
|
||||
|
@ -155,7 +169,7 @@
|
|||
|
||||
<li>
|
||||
<%= select_tag( 'user[mail_notification]', options_for_select( user_mail_notification_options(@user), @user.mail_notification) ) %>
|
||||
<label class="ml10"><%= check_box_tag 'no_self_notified', 1, @user.pref[:no_self_notified],:style=>"height:14px;" %>不要发送对我自己提交的修改的通知</label>
|
||||
<label class="ml10"><%= check_box_tag 'no_self_notified', 1, @user.pref[:no_self_notified],:style => "height:14px;" %>不要发送对我自己提交的修改的通知</label>
|
||||
</li>
|
||||
<!--<li><input name="brief_introduction" class="w450" type="text" maxlength="255" value="<%#= (@user.user_extensions.nil?) ? '' : @user.user_extensions.brief_introduction %>"></li>-->
|
||||
<li style="height:auto;"><textarea name="description" class="w450 h200" maxlength="255" style="resize:none;"><%= (@user.user_extensions.nil?) ? '' : @user.user_extensions.description %></textarea></li>
|
||||
|
@ -466,7 +480,7 @@
|
|||
}else{
|
||||
$("#search_school_result_list").html('');
|
||||
str = e.target.value.length > 4 ? e.target.value.substr(0, 4)+"..." : e.target.value;
|
||||
$("#hint").html('如果找不到自己的单位,您可以<a style="color:#64bdd9" onclick="apply_add_school();" href="javascript:void(0);">添加单位</a>');
|
||||
$("#hint").html('如果找不到自己的单位,您可以 <a style="color:#64bdd9" onclick="apply_add_school();" href="javascript:void(0);">添加单位</a>');
|
||||
$("#hint").show();
|
||||
$("#errortip").show();
|
||||
}
|
||||
|
@ -477,7 +491,6 @@
|
|||
if($(e.target).attr("id") != 'search_school_result_list' && $(e.target).attr("id") != 'province')
|
||||
{
|
||||
$("#search_school_result_list").hide();
|
||||
$("#hint").hide();
|
||||
$("#errortip").hide();
|
||||
}
|
||||
});
|
||||
|
@ -516,7 +529,7 @@
|
|||
}else{
|
||||
$("#search_school_result_list").html('');
|
||||
str = e.target.value.length > 4 ? e.target.value.substr(0, 4)+"..." : e.target.value;
|
||||
$("#hint").html('您输入的名称尚不存在,<a style="color:#64bdd9" onclick="apply_add_school();" href="javascript:void(0);">申请添加</a>');
|
||||
$("#hint").html('如果找不到自己的单位,您可以 <a style="color:#64bdd9" onclick="apply_add_school();" href="javascript:void(0);">添加单位</a>');
|
||||
$("#hint").show();
|
||||
$("#errortip").show();
|
||||
}
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
<% if ma.class == AppliedMessage %>
|
||||
<!--申请加入项目-->
|
||||
<!-- 申请添加单位 -->
|
||||
<% if ma.applied_type == "ApplyAddSchools" %>
|
||||
<ul class="homepageNewsList fl">
|
||||
<li class="homepageNewsPortrait fl">
|
||||
<a href="javascript:void(0);">
|
||||
<% if ma.status == 0 %>
|
||||
<%= link_to image_tag(url_to_avatar(ma.user), :width => "30", :height => "30"), user_path(ma.user), :target => '_blank' %>
|
||||
<% applied_user = User.find(ma.applied_user_id) %>
|
||||
<%= link_to image_tag(url_to_avatar(applied_user), :width => "30", :height => "30"), user_path(applied_user), :target => '_blank' %>
|
||||
<% else %>
|
||||
<%= image_tag("/images/trustie_logo1.png", width: "30px", height: "30px", class: "mt3") %>
|
||||
<% end %>
|
||||
|
@ -19,6 +20,7 @@
|
|||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</li>
|
||||
</ul>
|
||||
<!-- 申请加入项目 -->
|
||||
<% elsif ma && ma.applied_type == "AppliedProject" %>
|
||||
<ul class="homepageNewsList fl" id="applied_project_<%= ma.id %>">
|
||||
<%= render :partial => "users/applied_project_content", :locals =>{:ma => ma} %>
|
||||
|
|
Loading…
Reference in New Issue