Merge remote-tracking branch 'origin/szzh' into szzh

Conflicts:
	db/schema.rb
This commit is contained in:
sw 2014-07-01 09:23:16 +08:00
commit bc434a82a4
12 changed files with 33 additions and 13 deletions

View File

@ -94,7 +94,7 @@ class ApplicationController < ActionController::Base
Setting.check_cache
# Find the current user
User.current = find_current_user
logger.info(" Current user: " + (User.current.logged? ? "#{User.current.login} (id=#{User.current.id})" : "anonymous")) if logger
#logger.info(" Current user: " + (User.current.logged? ? "#{User.current.login} (id=#{User.current.id})" : "anonymous")) if logger
end
# Returns the current user or nil if no user is logged in
@ -300,7 +300,7 @@ class ApplicationController < ActionController::Base
render_404
end
#根据course_id找project
#<EFBFBD><EFBFBD><EFBFBD>course_id<EFBFBD><EFBFBD>project
def find_project_by_course_id
@bid = Bid.find params[:course_id]
@project = @bid.courses[0]
@ -354,7 +354,7 @@ class ApplicationController < ActionController::Base
end
#added by nwb
#获取课程
#<EFBFBD><EFBFBD>ȡ<EFBFBD>γ<EFBFBD>
def find_course
@course= Course.find(params[:id])
rescue ActiveRecord::RecordNotFound

View File

@ -179,6 +179,7 @@ class Attachment < ActiveRecord::Base
File.join(self.class.storage_path, disk_directory.to_s, disk_filename.to_s)
end
#标题
def title
title = filename.to_s
if description.present?

View File

@ -15,8 +15,8 @@ class JournalsForMessage < ActiveRecord::Base
"m_reply_id" # 回复某留言的留言id(a留言回复了b留言这是b留言的id)
acts_as_tree :foreign_key => 'm_parent_id', :counter_cache => :m_reply_count, :order => "#{JournalsForMessage.table_name}.created_on ASC"
belongs_to :project,
:foreign_key => 'jour_id',
belongs_to :project,
:foreign_key => 'jour_id',
:conditions => "#{self.table_name}.jour_type = 'Project' "
belongs_to :course,
:foreign_key => 'jour_id',

View File

@ -4,7 +4,7 @@ console.debug('课程修改成功:结束时间改为<%=Course.find_by_extra(@c
<% end %>
$('#content-title-top-div').html("<%= j(render partial: 'users/my_course_ex', :locals => {:memberships => @memberships,:user=>@user,
:memberships_doing=>@memberships_doing,:memberships_done=>@memberships_done} )%>")
//$('#finish_course_ <%=@course.id%>').replaceWith("<%= j(render partial: 'courses/set_course_time', :locals => {:course => @course} )%>")
$('#finish_course_<%=@course.id%>').replaceWith("<%= j(render partial: 'courses/set_course_time', :locals => {:course => @course} )%>")
<% else %>
alert('权限不足,设置失败,请在论坛提交问题,等待管理员处理。');
<% end %>

View File

@ -0,0 +1,8 @@
<div>技术得分:</div>
<div>&nbsp;&nbsp;&nbsp; 踩别人的帖子 -2</div>
<div>&nbsp;&nbsp;&nbsp; 帖子被一级会员顶 +4</div>
<div>&nbsp;&nbsp;&nbsp; 帖子被二级会员顶 +6</div>
<div>&nbsp;&nbsp;&nbsp; 帖子被三级会员顶 +8</div>
<div>&nbsp;&nbsp;&nbsp; 帖子被一级会员踩 -2</div>
<div>&nbsp;&nbsp;&nbsp; 帖子被二级会员踩 -4</div>
<div>&nbsp;&nbsp;&nbsp; 帖子被三级会员踩 -6</div>

View File

@ -0,0 +1,6 @@
<div>项目贡献得分:</div>
<div>&nbsp;&nbsp;&nbsp; 提交代码 +4</div>
<div>&nbsp;&nbsp;&nbsp; 提交文档 +4</div>
<div>&nbsp;&nbsp;&nbsp; 提交附件 +4</div>
<div>&nbsp;&nbsp;&nbsp; 更新缺陷完成度 +2</div>
<div>&nbsp;&nbsp;&nbsp; 发布缺陷 +4</div>

View File

@ -0,0 +1,2 @@
<div>影响力得分:</div>
<div>&nbsp;&nbsp;&nbsp; 被关注人数 +2/人</div>

View File

@ -48,23 +48,23 @@
<table style="border-bottom: solid 0px #80a6d2;" width="100%">
<tr>
<%= l(:label_user_score) %> :
<%= link_to l(:label_user_score) , {:controller => 'users', :action => 'score_new_index', :remote => true} %> :
<%= format("%.2f" , @user.user_score_attr.total_score).to_f %>
</tr><br>
<tr>
<%= l(:label_user_score_of_collaboration) %> :
<%= link_to l(:label_user_score_of_collaboration), {:controller => 'users',:action => 'topic_new_score_index', :remote => true} %> :
<%= format("%.2f" , @user.user_score_attr.collaboration.nil? ? 0:@user.user_score_attr.collaboration).to_f %>
</tr><br>
<tr>
<%= l(:label_user_score_of_influence) %> :
<%= link_to l(:label_user_score_of_influence), {:controller => 'users',:action => 'project_new_score_index', :remote => true} %> :
<%= format("%.2f" , @user.user_score_attr.influence.nil? ? 0:@user.user_score_attr.influence).to_f %>
</tr><br>
<tr>
<%= l(:label_user_score_of_skill) %> :
<%= link_to l(:label_user_score_of_skill), {:controller => 'users',:action => 'activity_new_score_index', :remote => true} %> :
<%= format("%.2f" , @user.user_score_attr.skill.nil? ? 0:@user.user_score_attr.skill).to_f %>
</tr><br>
<tr>
<%= l(:label_user_score_of_active) %>
<%= link_to l(:label_user_score_of_active), {:controller => 'users',:action => 'influence_new_score_index', :remote => true} %>
<%= format("%.2f" , @user.user_score_attr.active.nil? ? 0:@user.user_score_attr.active).to_f %>
</tr><br>
</table>

View File

@ -0,0 +1 @@
$('#show_score_detail').html('<%= escape_javascript(render :partial => 'users/activity_new_score_index', :locals => {:index =>0 }) %>');

View File

@ -0,0 +1 @@
$('#show_score_detail').html('<%= escape_javascript(render :partial => 'users/influence_new_score_index', :locals => {:index =>0 }) %>');

View File

@ -0,0 +1 @@
$('#show_score_detail').html('<%= escape_javascript(render :partial => 'users/project_new_score_index', :locals => {:index =>0 }) %>');

View File

@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20140618155324) do
ActiveRecord::Schema.define(:version => 20140626012511) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
@ -793,7 +793,7 @@ ActiveRecord::Schema.define(:version => 20140618155324) do
end
create_table "relative_memos", :force => true do |t|
t.integer "osp_id", :null => false
t.integer "osp_id"
t.integer "parent_id"
t.string "subject", :null => false
t.text "content", :null => false