Merge branch 'develop' into weixin_guange

Conflicts:
	public/assets/wechat/class.html
	public/javascripts/wechat/controllers/class.js
weixin_guange
yuanke 9 years ago
commit aa11f39b2d

@ -23,6 +23,8 @@ module Mobile
(number_to_human_size(f.filesize)).gsub("ytes", "").to_s (number_to_human_size(f.filesize)).gsub("ytes", "").to_s
when :coursename when :coursename
f.course.nil? ? "" : f.course.name f.course.nil? ? "" : f.course.name
when :course_id
f.course.nil? ? 0 : f.course.id
end end
end end
@ -38,6 +40,7 @@ module Mobile
attachment_expose :file_dir attachment_expose :file_dir
attachment_expose :attafile_size attachment_expose :attafile_size
attachment_expose :coursename #所属班级名 attachment_expose :coursename #所属班级名
attachment_expose :course_id #所属班级名
expose :current_user_is_teacher, if: lambda { |instance, options| options[:user] } do |instance, options| expose :current_user_is_teacher, if: lambda { |instance, options| options[:user] } do |instance, options|
current_user = options[:user] current_user = options[:user]
current_user_is_teacher = false current_user_is_teacher = false

@ -26,7 +26,13 @@ class AccountController < ApplicationController
if request.get? if request.get?
@login = params[:login] || true @login = params[:login] || true
if User.current.logged? 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 else
render :layout => 'login' render :layout => 'login'
end end
@ -127,7 +133,7 @@ class AccountController < ApplicationController
session[:auth_source_registration] = nil session[:auth_source_registration] = nil
self.logged_user = @user self.logged_user = @user
flash[:notice] = l(:notice_account_activated) flash[:notice] = l(:notice_account_activated)
redirect_to my_account_path redirect_to my_account_path(:tip=>1)
end end
else else
us = UsersService.new us = UsersService.new
@ -144,7 +150,7 @@ class AccountController < ApplicationController
if !@user.new_record? if !@user.new_record?
self.logged_user = @user self.logged_user = @user
flash[:notice] = l(:notice_account_activated) flash[:notice] = l(:notice_account_activated)
redirect_to my_account_url redirect_to my_account_url(:tip=>1)
else else
redirect_to signin_path redirect_to signin_path
end end
@ -347,9 +353,15 @@ class AccountController < ApplicationController
else else
#by young #by young
#redirect_back_or_default my_page_path #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 my_account_url
#redirect_to User.current #redirect_to User.current
end
end end
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(',') + ")" apply_school_ids = apply_schools.empty? ? "(-1)" : "(" + apply_schools.map{|sc| sc.school_id}.join(',') + ")"
if !params[:search].nil? if !params[:search].nil?
search = "%#{params[:search].to_s.strip.downcase}%" 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 #@schools = School.all
else else
#@course = @user.courses.where("is_delete = 0 and #{Course.table_name}.id != #{homework.course_id}").select { |course| @user.allowed_to?(:as_teacher,course)} #@course = @user.courses.where("is_delete = 0 and #{Course.table_name}.id != #{homework.course_id}").select { |course| @user.allowed_to?(:as_teacher,course)}

@ -10,7 +10,7 @@ class AtController < ApplicationController
@users = users.uniq { |u| u.id }.delete_if { |u| u.id == User.current.id }.sort{|x,y| to_pinyin(x.show_name) <=> to_pinyin(y.show_name)} if users @users = users.uniq { |u| u.id }.delete_if { |u| u.id == User.current.id }.sort{|x,y| to_pinyin(x.show_name) <=> to_pinyin(y.show_name)} if users
#加上all #加上all
if @user && @users.size > 0 if User.current.logged? && @users.size > 0
allUser = Struct.new(:id, :name).new allUser = Struct.new(:id, :name).new
allUser.id = @users.map{|u| u.id}.join(",") allUser.id = @users.map{|u| u.id}.join(",")
allUser.name = "all" allUser.name = "all"

@ -114,9 +114,15 @@ class MyController < ApplicationController
applied_message.update_attribute(:viewed, true) applied_message.update_attribute(:viewed, true)
end end
# 基本资料不完善 @force为false 完善 @force为true
@force = false
if params[:tip]
@force = true
end
@user = User.current @user = User.current
lg=@user.login lg = @user.login
@pref = @user.pref @pref = @user.pref
diskfile = disk_filename('User', @user.id) diskfile = disk_filename('User', @user.id)
diskfile1 = diskfile + 'temp' diskfile1 = diskfile + 'temp'
@ -178,7 +184,12 @@ class MyController < ApplicationController
File.delete(diskfile1) if File.exist?(diskfile1) File.delete(diskfile1) if File.exist?(diskfile1)
end end
render :layout=>'new_base_user' # 基本资料不完善,无法使用其他功能,完善着可继续使用
if @force
render :layout => 'new_base_user_show'
else
render :layout => 'new_base_user'
end
end end
# Destroys user's account # Destroys user's account

@ -2169,7 +2169,7 @@ module ApplicationHelper
candown= User.current.member_of_course?(course) || (attachment.is_public == 1) || attachment.get_status_by_attach(User.current.id) == 2 candown= User.current.member_of_course?(course) || (attachment.is_public == 1) || attachment.get_status_by_attach(User.current.id) == 2
elsif attachment.container.is_a?(OrgSubfield) elsif attachment.container.is_a?(OrgSubfield)
org = attachment.container.organization org = attachment.container.organization
candown = User.current.member_of_org?(org) || (attachment.is_public == 1) || attachment.get_status_by_attach(User.current.id) == 2 candown = User.current.member_of_org?(org) || ((attachment.is_public == 1 || attachment.get_status_by_attach(User.current.id) == 2) && org.allow_guest_download == true)
elsif attachment.container.is_a?(OrgDocumentComment) elsif attachment.container.is_a?(OrgDocumentComment)
org = attachment.container.organization org = attachment.container.organization
candown = org.allow_guest_download || User.current.member_of_org?(org) || (org.is_public && attachment.is_public == 1) candown = org.allow_guest_download || User.current.member_of_org?(org) || (org.is_public && attachment.is_public == 1)
@ -3436,3 +3436,9 @@ def course_syllabus_option user = User.current
end end
type type
end end
# 获取项目动态更新时间
def get_forge_act_message(act, type)
forge_act = ForgeActivity.where(:forge_act_id => act.id, :forge_act_type => type).first
format_time(forge_act.nil? ? act.created_on : forge_act.try(:updated_at))
end

@ -338,15 +338,15 @@ class ProjectsService
remark = "点击详情查看issue" remark = "点击详情查看issue"
case priority_id case priority_id
when 1 when "1"
priority = "" priority = ""
when 2 when "2"
priority = "正常" priority = "正常"
when 3 when "3"
priority = "" priority = ""
when 4 when "4"
priority = "紧急" priority = "紧急"
when 5 when "5"
priority = "立刻" priority = "立刻"
end end

@ -1,11 +1,11 @@
[ [
<% @users && @users.each_with_index do |person,index| %> <% @users && @users.each_with_index do |person,index| %>
<% if index == 0 %> <% if index == 0 %>
{"id":<%=index%>, "userid": "<%=person.id%>", "name": "所有人", "login": "<%=person.name%>", "searchKey": "<%=person.name%>"} {"id":<%=index%>, "userid": "<%=person.id%>", "name": "所有人", "login": "<%=person.name%>", "searchKey": "<%=person.name%>"}
<%= index != @users.size-1 ? ',' : '' %> <%= index != @users.size-1 ? ',' : '' %>
<% else %> <% else %>
{"id":<%=index%>, "userid": <%=person.id%>, "name": "<%=person.show_name%>", "login": "<%=person.login%>", "searchKey": "<%=person.get_at_show_name%>"} {"id":<%=index%>, "userid": "<%=person.id%>", "name": "<%=person.show_name%>", "login": "<%=person.login%>", "searchKey": "<%=person.get_at_show_name%>"}
<%= index != @users.size-1 ? ',' : '' %> <%= index != @users.size-1 ? ',' : '' %>
<% end %> <% end %>
<% end %> <% end %>
] ]

@ -3,7 +3,7 @@
<div class="break_word"> <div class="break_word">
<span class="fl"> <span class="fl">
<span title="<%= attachment.filename %>" id="attachment_<%=attachment.id %>"> <span title="<%= attachment.filename %>" id="attachment_<%=attachment.id %>">
<%= link_to_short_attachment attachment,:length=> 58, :class => 'hidden link_file_a fl newsBlue mw380', :download => true -%> <%= link_to_short_attachment attachment,:length=> 58, :class => 'hidden link_file_a fl newsBlue mw380', :download => true %>
</span> </span>
</span> </span>
<span class="postAttSize">( <span class="postAttSize">(

@ -11,9 +11,9 @@
<div class="homepagePostTitle break_word"> <div class="homepagePostTitle break_word">
<%# 如果有历史版本则提供历史版本下载 %> <%# 如果有历史版本则提供历史版本下载 %>
<% if file.attachment_histories.count == 0 %> <% if file.attachment_histories.count == 0 %>
<%= link_to file.is_public? ? truncate(file.filename, length: 45) : truncate(file.filename,length: 35, omission: '...'), <%= link_to file.is_public? ? truncate(file.filename, length: 45) : truncate(file.filename,length: 35, omission: '...'),
download_named_attachment_path(file.id, file.filename), download_named_attachment_path(file.id, file.filename),
:title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "linkGrey3 f_14" %> :title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "linkGrey3 f_14" %>
<% else %> <% else %>
<%= link_to truncate(file.filename,length: 35, omission: '...'), attachment_history_download_path(file.id), <%= link_to truncate(file.filename,length: 35, omission: '...'), attachment_history_download_path(file.id),
:title => file.filename+"\n"+file.description.to_s, :title => file.filename+"\n"+file.description.to_s,

@ -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>

@ -102,8 +102,10 @@
<div class="homepageContent"> <div class="homepageContent">
<div class="homepageLeft mt10" id="LSide"> <div class="homepageLeft mt10" id="LSide">
<div class="user_leftinfo mb10"> <div class="user_leftinfo mb10">
<% if User.current.logged?%> <% if User.current.logged? && User.current == @user%>
<%=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%>
<% elsif User.current.logged? %>
<a href="javascript:void(0)" style="cursor: default;" class="user_leftinfo_img"><%=image_tag(url_to_avatar(@user),width:"74", height: "74", :id=>'nh_user_tx') %></a>
<% else %> <% else %>
<img src="images/user/male.jpg" width="74" height="74" /> <img src="images/user/male.jpg" width="74" height="74" />
<% end %> <% end %>

File diff suppressed because it is too large Load Diff

@ -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;">&nbsp;&nbsp;消息:&nbsp;&nbsp;您添加新的单位“<%= 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;">&nbsp;&nbsp;提示:&nbsp;&nbsp;您尚未完善您的基本资料,完善后可使用更多功能</div>
</div>
<% end %>
<div id="RSide" style="margin-left:0px; margin-bottom:0px; width:728px;"> <div id="RSide" style="margin-left:0px; margin-bottom:0px; width:728px;">
<div id="users_tb_" class="users_tb_"> <div id="users_tb_" class="users_tb_">
<ul> <ul>
@ -29,9 +40,12 @@
<li>&nbsp;&nbsp;</li> <li>&nbsp;&nbsp;</li>
</ul> </ul>
<ul class="setting_right "> <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 :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> <% 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> <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;"> <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"> <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=" --请选择您所属的单位--"/> <input nhname="tag" nh_tag_4="true" id="occupation" name="occupation" style="display: none;" class="w210" type="text" value="" placeholder=" --请选择您所属的单位--"/>
<p class="fl ml10"> <p class="fl ml10">
<!-- <span id="errortip" class="icons_warning fl mt5" style="display: none;"></span> --> <!-- <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> </p>
<!--<input nhname="tag" nh_tag_0="true" nh_tag_1="true" id="occupation_name" type="text" style="display: none;width:117px;" readonly/>--> <!--<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 %> <% 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 %>" /> <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"> <p class="fl ml10">
<!-- <span id="errortip" class="icons_warning fl mt5" style="display: none;"></span> --> <!-- <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> </p>
<!--<input nhname="tag" nh_tag_0="true" nh_tag_1="true" id="occupation_name" type="text" style="display: none;width:117px;" readonly/>--> <!--<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? %> <% 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=" --请选择您所属的单位--" /> <input nhname="tag" nh_tag_4="true" id="occupation" name="occupation" style="display: none;" class="w210" type="text" placeholder=" --请选择您所属的单位--" />
<p class="fl ml10"> <p class="fl ml10">
<!-- <span id="errortip" class="icons_warning fl mt5" style="display: none;"></span> --> <!-- <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> </p>
<!--<input nhname="tag" nh_tag_0="true" nh_tag_1="true" id="occupation_name" type="text" style="display: none;width:117px;" readonly/>--> <!--<input nhname="tag" nh_tag_0="true" nh_tag_1="true" id="occupation_name" type="text" style="display: none;width:117px;" readonly/>-->
<% else %> <% 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 %>"/> <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"> <p class="fl ml10">
<!-- <span id="errortip" class="icons_warning fl mt5" style="display: none;"></span> --> <!-- <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> </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;"/>--> <!--<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 %> <% end %>
@ -155,7 +169,7 @@
<li> <li>
<%= select_tag( 'user[mail_notification]', options_for_select( user_mail_notification_options(@user), @user.mail_notification) ) %> <%= 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>
<!--<li><input name="brief_introduction" class="w450" type="text" maxlength="255" value="<%#= (@user.user_extensions.nil?) ? '' : @user.user_extensions.brief_introduction %>"></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> <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{ }else{
$("#search_school_result_list").html(''); $("#search_school_result_list").html('');
str = e.target.value.length > 4 ? e.target.value.substr(0, 4)+"..." : e.target.value; 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('如果找不到自己的单位,您可以&nbsp;<a style="color:#64bdd9" onclick="apply_add_school();" href="javascript:void(0);">添加单位</a>');
$("#hint").show(); $("#hint").show();
$("#errortip").show(); $("#errortip").show();
} }
@ -477,7 +491,6 @@
if($(e.target).attr("id") != 'search_school_result_list' && $(e.target).attr("id") != 'province') if($(e.target).attr("id") != 'search_school_result_list' && $(e.target).attr("id") != 'province')
{ {
$("#search_school_result_list").hide(); $("#search_school_result_list").hide();
$("#hint").hide();
$("#errortip").hide(); $("#errortip").hide();
} }
}); });
@ -516,7 +529,7 @@
}else{ }else{
$("#search_school_result_list").html(''); $("#search_school_result_list").html('');
str = e.target.value.length > 4 ? e.target.value.substr(0, 4)+"..." : e.target.value; 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('如果找不到自己的单位,您可以&nbsp;<a style="color:#64bdd9" onclick="apply_add_school();" href="javascript:void(0);">添加单位</a>');
$("#hint").show(); $("#hint").show();
$("#errortip").show(); $("#errortip").show();
} }

@ -47,52 +47,52 @@
<!--<a href="javascript:void(0);" class="logoEnter fl linkGrey4">上传图片</a>--> <!--<a href="javascript:void(0);" class="logoEnter fl linkGrey4">上传图片</a>-->
<%#= form_for( @organization,{:controller => 'organizations',:action => 'update',:id=>@organization,:html=>{:id=>'update_org_form',:method=>'put'}}) do %> <%#= form_for( @organization,{:controller => 'organizations',:action => 'update',:id=>@organization,:html=>{:id=>'update_org_form',:method=>'put'}}) do %>
<%= labelled_form_for @organization do |f|%> <%= labelled_form_for @organization do |f|%>
<%= render :partial=>"new_org_avatar_form",:locals=> {source:@organization} %> <%= render :partial=>"new_org_avatar_form",:locals=> {source:@organization} %>
<!--<div class="cl"></div>--> <!--<div class="cl"></div>-->
<!--</div>--> <!--</div>-->
<div class="orgRow mb10"><span class="c_red">*&nbsp;</span>组织名称:<input type="text" name="organization[name]" id="organization_name" maxlength="100" onblur="check_uniq(<%=@organization.id %>);" onfocus="$('#check_name_hint').hide()" class="orgNameInput" value="<%= @organization.name%>" /> <div class="orgRow mb10"><span class="c_red">*&nbsp;</span>组织名称:<input type="text" name="organization[name]" id="organization_name" maxlength="100" onblur="check_uniq(<%=@organization.id %>);" onfocus="$('#check_name_hint').hide()" class="orgNameInput" value="<%= @organization.name%>" />
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div style="margin-left: 80px " id="check_name_hint"></div> <div style="margin-left: 80px " id="check_name_hint"></div>
<div class="orgRow mb10"><span class="ml10">组织描述:</span><textarea type="text" name="organization[description]" class="orgDes" id="org_desc" placeholder="最多3000个汉字或6000个英文字符"><%= @organization.description%></textarea> <div class="orgRow mb10"><span class="ml10">组织描述:</span><textarea type="text" name="organization[description]" class="orgDes" id="org_desc" placeholder="最多3000个汉字或6000个英文字符"><%= @organization.description%></textarea>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div style="margin-left: 80px " id="check_desc_hint"></div> <div style="margin-left: 80px " id="check_desc_hint"></div>
<div class="orgRow mb10"><span class="ml10">组织URL</span> <div class="orgRow mb10"><span class="ml10">组织URL</span>
<div class="w607 fr">http// <div class="w607 fr">http//
<input type="text" name="organization[domain]" id="domain" value="<%= domain.nil? ? '' : domain.subname %>" class="orgUrlInput" onfocus="observe_input_to_lowercase($(this));" /> <input type="text" name="organization[domain]" id="domain" value="<%= domain.nil? ? '' : domain.subname %>" class="orgUrlInput" onfocus="observe_input_to_lowercase($(this));" />
.trustie.net<a href="javascript:void(0);" class="linkBlue ml15" style="text-decoration:underline;" onclick="apply_subdomain(<%= @organization.id %>,$('#domain').val());">申请</a> .trustie.net<a href="javascript:void(0);" class="linkBlue ml15" style="text-decoration:underline;" onclick="apply_subdomain(<%= @organization.id %>,$('#domain').val());">申请</a>
<% record = OrgMessage.where("organization_id=? and message_type='ApplySubdomain'", @organization.id).order("updated_at desc").first %> <% record = OrgMessage.where("organization_id=? and message_type='ApplySubdomain'", @organization.id).order("updated_at desc").first %>
<% if domain.present? and record.present? and record.content == domain.subname %> <% if domain.present? and record.present? and record.content == domain.subname %>
<span>(已批准)</span> <span>(已批准)</span>
<% elsif record %> <% elsif record %>
<span>(您申请了子域名<%= OrgMessage.where("organization_id=? and message_type='ApplySubdomain'", @organization.id).order("updated_at desc").first.content %>,还未批准)</span> <span>(您申请了子域名<%= OrgMessage.where("organization_id=? and message_type='ApplySubdomain'", @organization.id).order("updated_at desc").first.content %>,还未批准)</span>
<% end %> <% end %>
<p class="c_green f12" id="apply_hint" ></p></div> <p class="c_green f12" id="apply_hint" ></p></div>
<!--class="c_green f12" 您的申请已提交,系统会以消息的形式通知您结果 --> <!--class="c_green f12" 您的申请已提交,系统会以消息的形式通知您结果 -->
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<div class="orgRow mb10 mt5"> <div class="orgRow mb10 mt5">
<span style="margin-left:10px;" >显示模式&nbsp;: </span> <span style="margin-left:10px;" >显示模式&nbsp;: </span>
<input type="radio" id="show_mode_ordinary" value="0" name="show_mode" style="margin-left:5px;" <%= @organization.show_mode == 0 ? "checked" : "" %> /> <input type="radio" id="show_mode_ordinary" value="0" name="show_mode" style="margin-left:5px;" <%= @organization.show_mode == 0 ? "checked" : "" %> />
<label for="show_mode_ordinary">简洁模式</label> <label for="show_mode_ordinary">简洁模式</label>
<input type="radio" id="show_mode_special" value="1" name="show_mode" style="margin-left:10px;" <%= @organization.show_mode == 1 ? "checked" : "" %> /> <input type="radio" id="show_mode_special" value="1" name="show_mode" style="margin-left:10px;" <%= @organization.show_mode == 1 ? "checked" : "" %> />
<label for="show_mode_special">门户模式</label> <label for="show_mode_special">门户模式</label>
</div> </div>
<div class="orgRow mb10 mt5"><span style="margin-left:38px;" >公开&nbsp;: </span> <div class="orgRow mb10 mt5"><span style="margin-left:38px;" >公开&nbsp;: </span>
<input type="checkbox" id="is_public" onclick="disable_down($(this), $('#allow_download'),$('#allow_down_hint'));" name="organization[is_public]" <%= @organization.is_public ? 'checked': ''%> class="ml3" /> <input type="checkbox" id="is_public" onclick="disable_down($(this), $('#allow_download'),$('#allow_down_hint'));" name="organization[is_public]" <%= @organization.is_public ? 'checked': ''%> class="ml3" />
</div> </div>
<div class="orgRow mb10 mt5"><span style="margin-left:10px;">下载支持&nbsp;: </span> <div class="orgRow mb10 mt5"><span style="margin-left:10px;">下载支持&nbsp;: </span>
<input id="allow_download" type="checkbox" style="margin-top:5px;" <%= @organization.is_public? ? "":"DISABLED" %> name="organization[allow_guest_download]" <%= @organization.allow_guest_download ? 'checked': ''%> class="ml3" /> <input id="allow_download" type="checkbox" style="margin-top:5px;" <%= @organization.is_public? ? "":"DISABLED" %> name="organization[allow_guest_download]" <%= @organization.allow_guest_download ? 'checked': ''%> class="ml3" />
&nbsp;<span>允许游客下载</span> &nbsp;<span>允许游客下载</span>
<span class="c_green f12" id="allow_down_hint"><%= @organization.is_public? ? "" : "(私有组织不允许游客下载资源)" %></span> <span class="c_green f12" id="allow_down_hint"><%= @organization.is_public? ? "" : "(私有组织不允许游客下载资源)" %></span>
</div> </div>
<!--<%# if User.current.admin? %>--> <!--<%# if User.current.admin? %>-->
<!--<div class="orgRow mb10 mt5"><span style="margin-left:10px;">允许设置名师榜&nbsp;: </span>--> <!--<div class="orgRow mb10 mt5"><span style="margin-left:10px;">允许设置名师榜&nbsp;: </span>-->
<!--<input id="allow_set_excellent_teachers" type="checkbox" style="margin-top:5px;" name="organization[allow_teacher]" <%#= @organization.allow_teacher==1 ? 'checked': ''%> class="ml3" />--> <!--<input id="allow_set_excellent_teachers" type="checkbox" style="margin-top:5px;" name="organization[allow_teacher]" <%#= @organization.allow_teacher==1 ? 'checked': ''%> class="ml3" />-->
<!--</div>--> <!--</div>-->
<!--<%# end %>--> <!--<%# end %>-->
<a href="javascript:void(0);" class="saveBtn ml80 db fl" onclick="update_org('<%=@organization.id %>','<%= @organization.name %>', $('#organization_name'));">保存</a> <a href="javascript:void(0);" class="saveBtn ml80 db fl" onclick="update_org('<%=@organization.id %>','<%= @organization.name %>', $('#organization_name'));">保存</a>
<% end %> <% end %>
</div> </div>
<div class="undis ml15 mr15" id="orgContent_2"> <div class="undis ml15 mr15" id="orgContent_2">

@ -12,7 +12,7 @@
</div> </div>
<div class="mb10"> <div class="mb10">
<div> <div>
<%= select_tag :language, options_for_select(["java","python","ruby","c++","c#","c"], "#{@quality_analysis.language}"), :id => 'branch', :class => "analysis-option-box" %> <%= select_tag :language, options_for_select(["java","python","c#"], "#{@quality_analysis.language}"), :id => 'branch', :class => "analysis-option-box" %>
</div> </div>
</div> </div>
<div class="courseSendSubmit mr15"><a href="javascript:void(0);" class="sendSourceText" onclick="$('#quality_analyses_edit_form').submit();hideModal()">提交</a></div> <div class="courseSendSubmit mr15"><a href="javascript:void(0);" class="sendSourceText" onclick="$('#quality_analyses_edit_form').submit();hideModal()">提交</a></div>

@ -14,7 +14,7 @@
<li class="analysis-result-edit fl fontBlue2" ></li> <li class="analysis-result-edit fl fontBlue2" ></li>
<div class="cl"></div> <div class="cl"></div>
</ul> </ul>
<% if @quality_analyses.count >0 %> <% if @quality_analyses && @quality_analyses.count >0 %>
<% @quality_analyses.each do |qa| %> <% @quality_analyses.each do |qa| %>
<ul class="analysis-result-list"> <ul class="analysis-result-list">
<li title="<%= qa.author_login+ ':' +qa.rep_identifier %>"><%=link_to "#{qa.author_login}:#{qa.rep_identifier}", project_quality_analysis_path(:resource_id => qa.sonar_name, :branch => (qa.branch.nil? ? "master" : qa.branch)), :class => "analysis-result-name fl fontBlue2 hidden" %></li> <li title="<%= qa.author_login+ ':' +qa.rep_identifier %>"><%=link_to "#{qa.author_login}:#{qa.rep_identifier}", project_quality_analysis_path(:resource_id => qa.sonar_name, :branch => (qa.branch.nil? ? "master" : qa.branch)), :class => "analysis-result-name fl fontBlue2 hidden" %></li>

@ -2,6 +2,7 @@
<div class="project_r_h"> <div class="project_r_h">
<h2 class="project_h2" style="width:180px;">质量分析</h2> <h2 class="project_h2" style="width:180px;">质量分析</h2>
</div> </div>
<div class="button-rep">当前分支:<%= params[:branch] %></div> <div class="button-rep">当前分支:<%= params[:branch] %></div>
<div class="cl"></div> <div class="cl"></div>
<div class="tac f20 fb mt35 mb30">项目代码质量分析报告</div> <div class="tac f20 fb mt35 mb30">项目代码质量分析报告</div>

@ -12,7 +12,7 @@
</div> </div>
<div class="mb10"> <div class="mb10">
<div> <div>
<%= select_tag :language, options_for_select(["java","python","ruby","c++","c#","c"]), :id => 'branch', :class => "analysis-option-box" %> <%= select_tag :language, options_for_select(["java","python","c#"]), :id => 'branch', :class => "analysis-option-box" %>
</div> </div>
</div> </div>
<div class="courseSendSubmit mr15"><a href="javascript:void(0);" class="sendSourceText" onclick="$('#ajax-indicator').css('opacity','0.8').text('正在分析中…………(大概需要30分钟请耐心等待)').show();$('#quality_analyses_form').submit();hideModal()">提交</a></div> <div class="courseSendSubmit mr15"><a href="javascript:void(0);" class="sendSourceText" onclick="$('#ajax-indicator').css('opacity','0.8').text('正在分析中…………(大概需要30分钟请耐心等待)').show();$('#quality_analyses_form').submit();hideModal()">提交</a></div>

@ -29,7 +29,7 @@
发帖时间:<%= format_time(activity.created_on) %> 发帖时间:<%= format_time(activity.created_on) %>
</div> </div>
<div class="homepagePostDate fl ml15"> <div class="homepagePostDate fl ml15">
更新时间:<%= format_time(ForgeActivity.where("forge_act_type='#{activity.class}' and forge_act_id =#{activity.id}").first.updated_at) %> 更新时间:<%= get_forge_act_message(activity, activity.class.to_s) %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<% if activity.parent_id.nil? %> <% if activity.parent_id.nil? %>

@ -1,11 +1,12 @@
<% if ma.class == AppliedMessage %> <% if ma.class == AppliedMessage %>
<!--申请加入项目--> <!-- 申请添加单位 -->
<% if ma.applied_type == "ApplyAddSchools" %> <% if ma.applied_type == "ApplyAddSchools" %>
<ul class="homepageNewsList fl"> <ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"> <li class="homepageNewsPortrait fl">
<a href="javascript:void(0);"> <a href="javascript:void(0);">
<% if ma.status == 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 %> <% else %>
<%= image_tag("/images/trustie_logo1.png", width: "30px", height: "30px", class: "mt3") %> <%= image_tag("/images/trustie_logo1.png", width: "30px", height: "30px", class: "mt3") %>
<% end %> <% end %>
@ -19,6 +20,7 @@
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li> <li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
</li> </li>
</ul> </ul>
<!-- 申请加入项目 -->
<% elsif ma && ma.applied_type == "AppliedProject" %> <% elsif ma && ma.applied_type == "AppliedProject" %>
<ul class="homepageNewsList fl" id="applied_project_<%= ma.id %>"> <ul class="homepageNewsList fl" id="applied_project_<%= ma.id %>">
<%= render :partial => "users/applied_project_content", :locals =>{:ma => ma} %> <%= render :partial => "users/applied_project_content", :locals =>{:ma => ma} %>

@ -37,8 +37,9 @@ app.controller('MyResourceController', ['$scope', '$http', 'auth', 'config', '$l
vm.myresource_sendIndex = index; vm.myresource_sendIndex = index;
rms.save('myresource_sendIndex',index); rms.save('myresource_sendIndex',index);
$location.path("/send_class_list").search({id: r.id}); // $location.path("/send_class_list").search({id: r.id});
} $location.path("/send_class_list").search({id: r.id,course_id: r.course_id});
};
vm.loadResourceData = function (index,page){ vm.loadResourceData = function (index,page){
if(index == 1){ if(index == 1){

@ -4,7 +4,7 @@
body,h1,h2,h3,h4,h5,h6,hr,p,blockquote,dl,dt,dd,ul,ol,li,pre,form,fieldset,legend,button,input,textarea,th,td{ margin:0; padding:0;} body,h1,h2,h3,h4,h5,h6,hr,p,blockquote,dl,dt,dd,ul,ol,li,pre,form,fieldset,legend,button,input,textarea,th,td{ margin:0; padding:0;}
body,table,input,textarea,select,button { font-family: "微软雅黑","宋体"; font-size:12px;line-height:1.5; background:#eaebec;} body,table,input,textarea,select,button { font-family: "微软雅黑","宋体"; font-size:12px;line-height:1.5; background:#eaebec;}
div,img,tr,td,table{ border:0;} div,img,tr,td,table{ border:0;}
table,tr,td{border:0;cellspacing:0; cellpadding:0;} table,tr,td{border:0;}
ol,ul,li{ list-style-type:none} ol,ul,li{ list-style-type:none}
blockquote { blockquote {
border:1px solid #d4d4d4; border:1px solid #d4d4d4;

@ -372,7 +372,7 @@ tr.entry td.filename_no_report { width: 40%; }
tr.entry td.size { text-align: right; font-size: 90%; } tr.entry td.size { text-align: right; font-size: 90%; }
tr.entry td.revision, tr.entry td.author { text-align: center; } tr.entry td.revision, tr.entry td.author { text-align: center; }
tr.entry td.age { text-align: right; } tr.entry td.age { text-align: right; }
tr.entry.file td.filename a { margin-center: 16px; } tr.entry.file td.filename a { }
tr.entry.file td.filename_no_report a { margin-left: 16px; } tr.entry.file td.filename_no_report a { margin-left: 16px; }
tr span.expander {background-image: url(/images/bullet_toggle_plus.png); padding-left: 8px; margin-left: 0; cursor: pointer;} tr span.expander {background-image: url(/images/bullet_toggle_plus.png); padding-left: 8px; margin-left: 0; cursor: pointer;}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save