Merge branch 'szzh' of http://repository.trustie.net/xianbo/trustie2 into szzh
This commit is contained in:
commit
c7caa08c70
|
@ -502,45 +502,7 @@ class CoursesController < ApplicationController
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_course_activity courses, activities
|
|
||||||
@course_ids=activities.keys()
|
|
||||||
|
|
||||||
days = Setting.activity_days_default.to_i
|
|
||||||
date_to ||= Date.today + 1
|
|
||||||
date_from = date_to - days-1.years
|
|
||||||
|
|
||||||
#file_count
|
|
||||||
Attachment.where(container_id: @course_ids, container_type: Course).where("created_on>?", date_from).each do |attachment|
|
|
||||||
activities[attachment.container_id]+=1
|
|
||||||
end
|
|
||||||
|
|
||||||
#message_count
|
|
||||||
Board.where(course_id: @course_ids).each do |board|
|
|
||||||
# activities[board.course_id]+=1
|
|
||||||
activities[board.course_id]+=board.messages.where("updated_on>?", date_from).count
|
|
||||||
end
|
|
||||||
|
|
||||||
#news
|
|
||||||
News.where(course_id: @course_ids).where("created_on>?",date_from).each do |news|
|
|
||||||
activities[news.course_id]+=1
|
|
||||||
end
|
|
||||||
|
|
||||||
#feedbackc_count
|
|
||||||
JournalsForMessage.where(jour_id: @course_ids, jour_type: Course).each do |jourformess|
|
|
||||||
activities[jourformess.jour_id]+=1
|
|
||||||
end
|
|
||||||
|
|
||||||
#activities!=0
|
|
||||||
i=0;
|
|
||||||
courses.each do |course|
|
|
||||||
id=course.id
|
|
||||||
if activities[id]==0
|
|
||||||
activities[id]=1
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
return activities
|
|
||||||
end
|
|
||||||
|
|
||||||
def toggleCourse
|
def toggleCourse
|
||||||
@course_prefs = Course.find_by_extra(@course.extra)
|
@course_prefs = Course.find_by_extra(@course.extra)
|
||||||
|
|
|
@ -235,6 +235,7 @@ class FilesController < ApplicationController
|
||||||
elsif @course
|
elsif @course
|
||||||
@containers = [ Course.includes(:attachments).reorder("#{Attachment.table_name}.created_on DESC").find(@course.id)]
|
@containers = [ Course.includes(:attachments).reorder("#{Attachment.table_name}.created_on DESC").find(@course.id)]
|
||||||
end
|
end
|
||||||
|
show_attachments @containers
|
||||||
|
|
||||||
@attachtype = params[:type].to_i
|
@attachtype = params[:type].to_i
|
||||||
@contenttype = params[:contentType].to_s
|
@contenttype = params[:contentType].to_s
|
||||||
|
|
|
@ -42,7 +42,7 @@ class ProjectsController < ApplicationController
|
||||||
before_filter :authorize_global, :only => [:new, :create,:view_homework_attaches]
|
before_filter :authorize_global, :only => [:new, :create,:view_homework_attaches]
|
||||||
before_filter :require_admin, :only => [ :copy, :archive, :unarchive, :destroy, :calendar]
|
before_filter :require_admin, :only => [ :copy, :archive, :unarchive, :destroy, :calendar]
|
||||||
before_filter :file, :statistics, :watcherlist
|
before_filter :file, :statistics, :watcherlist
|
||||||
before_filter :find_project_repository, :only => [:show]
|
#before_filter :find_project_repository, :only => [:show]
|
||||||
# 除非项目内人员,不可查看成员, TODO: 完了写报表里去
|
# 除非项目内人员,不可查看成员, TODO: 完了写报表里去
|
||||||
before_filter :memberAccess, only: :member
|
before_filter :memberAccess, only: :member
|
||||||
|
|
||||||
|
@ -106,7 +106,7 @@ class ProjectsController < ApplicationController
|
||||||
|
|
||||||
def index
|
def index
|
||||||
#调用存储过程更新提交次数
|
#调用存储过程更新提交次数
|
||||||
ActiveRecord::Base.connection.execute("CALL sp_project_status_cursor();")
|
#ActiveRecord::Base.connection.execute("CALL sp_project_status_cursor();")
|
||||||
#Modified by nie
|
#Modified by nie
|
||||||
@project_type = params[:project_type].to_i
|
@project_type = params[:project_type].to_i
|
||||||
per_page_option = 10
|
per_page_option = 10
|
||||||
|
|
|
@ -21,7 +21,7 @@ class TrackersController < ApplicationController
|
||||||
before_filter :require_admin, :except => :index
|
before_filter :require_admin, :except => :index
|
||||||
before_filter :require_admin_or_api_request, :only => :index
|
before_filter :require_admin_or_api_request, :only => :index
|
||||||
accept_api_auth :index
|
accept_api_auth :index
|
||||||
|
include CoursesHelper
|
||||||
def index
|
def index
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html {
|
format.html {
|
||||||
|
@ -37,8 +37,13 @@ class TrackersController < ApplicationController
|
||||||
def new
|
def new
|
||||||
@tracker ||= Tracker.new(params[:tracker])
|
@tracker ||= Tracker.new(params[:tracker])
|
||||||
@trackers = Tracker.sorted.all
|
@trackers = Tracker.sorted.all
|
||||||
@projects = Project.all
|
@projects = Project.where("project_type = #{Project::ProjectType_project}").all
|
||||||
@courses = Course.all
|
@courses = Course.all
|
||||||
|
@course_activity_count=Hash.new
|
||||||
|
@courses.each do |course|
|
||||||
|
@course_activity_count[course.id]=0
|
||||||
|
end
|
||||||
|
@course_activity_count=get_course_activity @courses,@course_activity_count
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
|
@ -58,7 +63,8 @@ class TrackersController < ApplicationController
|
||||||
|
|
||||||
def edit
|
def edit
|
||||||
@tracker ||= Tracker.find(params[:id])
|
@tracker ||= Tracker.find(params[:id])
|
||||||
@projects = Project.all
|
@projects = Project.where("project_type = #{Project::ProjectType_project}").all
|
||||||
|
@courses = Course.all
|
||||||
end
|
end
|
||||||
|
|
||||||
def update
|
def update
|
||||||
|
|
|
@ -46,6 +46,7 @@ class UsersController < ApplicationController
|
||||||
|
|
||||||
#william
|
#william
|
||||||
before_filter :require_login, :only => [:tag_save,:tag_saveEx]
|
before_filter :require_login, :only => [:tag_save,:tag_saveEx]
|
||||||
|
#before_filter :refresh_changests, :only =>[:user_activities,:user_courses,:user_projects,:user_newfeedback]
|
||||||
|
|
||||||
|
|
||||||
helper :sort
|
helper :sort
|
||||||
|
@ -68,6 +69,17 @@ class UsersController < ApplicationController
|
||||||
|
|
||||||
# fq
|
# fq
|
||||||
helper :words
|
helper :words
|
||||||
|
|
||||||
|
def refresh_changests
|
||||||
|
if !(@user.nil?) && !(@user.memberships.nil?)
|
||||||
|
@user.memberships.each do |member|
|
||||||
|
unless member.project.nil?
|
||||||
|
member.project.repository.fetch_changesets if Setting.autofetch_changesets?
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
#added by young
|
#added by young
|
||||||
def user_projects
|
def user_projects
|
||||||
|
|
||||||
|
|
|
@ -480,4 +480,45 @@ module CoursesHelper
|
||||||
type
|
type
|
||||||
end
|
end
|
||||||
|
|
||||||
|
#获取课程动态
|
||||||
|
def get_course_activity courses, activities
|
||||||
|
@course_ids=activities.keys()
|
||||||
|
|
||||||
|
days = Setting.activity_days_default.to_i
|
||||||
|
date_to ||= Date.today + 1
|
||||||
|
date_from = date_to - days-1.years
|
||||||
|
|
||||||
|
#file_count
|
||||||
|
Attachment.where(container_id: @course_ids, container_type: Course).where("created_on>?", date_from).each do |attachment|
|
||||||
|
activities[attachment.container_id]+=1
|
||||||
|
end
|
||||||
|
|
||||||
|
#message_count
|
||||||
|
Board.where(course_id: @course_ids).each do |board|
|
||||||
|
# activities[board.course_id]+=1
|
||||||
|
activities[board.course_id]+=board.messages.where("updated_on>?", date_from).count
|
||||||
|
end
|
||||||
|
|
||||||
|
#news
|
||||||
|
News.where(course_id: @course_ids).where("created_on>?",date_from).each do |news|
|
||||||
|
activities[news.course_id]+=1
|
||||||
|
end
|
||||||
|
|
||||||
|
#feedbackc_count
|
||||||
|
JournalsForMessage.where(jour_id: @course_ids, jour_type: Course).each do |jourformess|
|
||||||
|
activities[jourformess.jour_id]+=1
|
||||||
|
end
|
||||||
|
|
||||||
|
#activities!=0
|
||||||
|
i=0;
|
||||||
|
courses.each do |course|
|
||||||
|
id=course.id
|
||||||
|
if activities[id]==0
|
||||||
|
activities[id]=1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return activities
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -71,11 +71,24 @@ module ProjectScoreHelper
|
||||||
pss = ProjectScore.where("project_id = '#{project.id}'")
|
pss = ProjectScore.where("project_id = '#{project.id}'")
|
||||||
if pss.nil? || pss.count == 0
|
if pss.nil? || pss.count == 0
|
||||||
ps = ProjectScore.new
|
ps = ProjectScore.new
|
||||||
|
ps.issue_num = issue_num(project)
|
||||||
|
ps.board_message_num = board_message_num(project)
|
||||||
|
ps.changeset_num = changesets_num(project)
|
||||||
|
ps.documents_num = documents_num(project)
|
||||||
|
ps.issue_journal_num = issue_journal_num(project)
|
||||||
|
ps.news_num = news_num(project)
|
||||||
|
|
||||||
ps.score = result
|
ps.score = result
|
||||||
ps.project = project
|
ps.project = project
|
||||||
ps.save
|
ps.save
|
||||||
else
|
else
|
||||||
ps = pss.first
|
ps = pss.first
|
||||||
|
ps.issue_num = issue_num(project)
|
||||||
|
ps.board_message_num = board_message_num(project)
|
||||||
|
ps.changeset_num = changesets_num(project)
|
||||||
|
ps.documents_num = documents_num(project)
|
||||||
|
ps.issue_journal_num = issue_journal_num(project)
|
||||||
|
ps.news_num = news_num(project)
|
||||||
ps.score = result
|
ps.score = result
|
||||||
ps.save
|
ps.save
|
||||||
end
|
end
|
||||||
|
@ -95,4 +108,15 @@ module ProjectScoreHelper
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def get_project_score project
|
||||||
|
pss = ProjectScore.where("project_id = '#{project.id}'")
|
||||||
|
ps = nil
|
||||||
|
if pss.nil? || pss.count == 0
|
||||||
|
ps = nil
|
||||||
|
else
|
||||||
|
ps = pss.first
|
||||||
|
end
|
||||||
|
ps
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
|
@ -63,7 +63,7 @@ class Changeset < ActiveRecord::Base
|
||||||
includes(:repository => :project).where(Project.allowed_to_condition(args.shift || User.current, :view_changesets, *args))
|
includes(:repository => :project).where(Project.allowed_to_condition(args.shift || User.current, :view_changesets, *args))
|
||||||
}
|
}
|
||||||
|
|
||||||
after_create :scan_for_issues,:be_user_score # user_score
|
after_create :scan_for_issues,:refresh_changests#:be_user_score # user_score
|
||||||
after_update :be_user_score
|
after_update :be_user_score
|
||||||
after_destroy :down_user_score
|
after_destroy :down_user_score
|
||||||
before_create :before_create_cs
|
before_create :before_create_cs
|
||||||
|
@ -305,9 +305,9 @@ class Changeset < ActiveRecord::Base
|
||||||
# update user score
|
# update user score
|
||||||
def be_user_score
|
def be_user_score
|
||||||
UserScore.project(:push_code, self.user,self, { changeset_id: self.id })
|
UserScore.project(:push_code, self.user,self, { changeset_id: self.id })
|
||||||
|
unless self.user.nil?
|
||||||
#更新用户等级
|
#更新用户等级
|
||||||
UserLevels.update_user_level(self.user)
|
UserLevels.update_user_level(self.user)
|
||||||
unless self.user.nil?
|
|
||||||
update_changeset(self.user,1)
|
update_changeset(self.user,1)
|
||||||
update_changeset(self.user,2,self.repository.project)
|
update_changeset(self.user,2,self.repository.project)
|
||||||
end
|
end
|
||||||
|
@ -321,4 +321,11 @@ class Changeset < ActiveRecord::Base
|
||||||
update_changeset(self.user,2,self.repository.project)
|
update_changeset(self.user,2,self.repository.project)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
#刷新本次提交(补全相关信息如:user_id等)
|
||||||
|
def refresh_changests
|
||||||
|
unless self.repository.nil?
|
||||||
|
self.repository.fetch_changesets if Setting.autofetch_changesets?
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,14 @@
|
||||||
class OptionNumber < ActiveRecord::Base
|
class OptionNumber < ActiveRecord::Base
|
||||||
attr_accessible :attachment, :changeset, :document, :follow, :issue_done_ratio, :issues_status, :memo, :messages_for_issues, :post_issue, :praise_by_one, :praise_by_three, :praise_by_two, :replay_for_memo, :replay_for_message, :score_type, :total_score, :tread, :tread_by_one, :tread_by_three, :tread_by_two, :user_id
|
attr_accessible :attachment, :changeset, :document, :follow, :issue_done_ratio, :issues_status, :memo, :messages_for_issues, :post_issue, :praise_by_one, :praise_by_three, :praise_by_two, :replay_for_memo, :replay_for_message, :score_type, :total_score, :tread, :tread_by_one, :tread_by_three, :tread_by_two, :user_id
|
||||||
|
|
||||||
|
def self.get_user_option_number user_id
|
||||||
|
result = nil
|
||||||
|
unless user_id.nil?
|
||||||
|
ons = OptionNumber.find_all_by_user_id(user_id);
|
||||||
|
unless (ons .nil? && ons.count > 0)
|
||||||
|
result = ons.first
|
||||||
|
end
|
||||||
|
end
|
||||||
|
result
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -32,6 +32,7 @@ class Tracker < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
has_and_belongs_to_many :projects
|
has_and_belongs_to_many :projects
|
||||||
|
has_and_belongs_to_many :courses
|
||||||
has_and_belongs_to_many :custom_fields, :class_name => 'IssueCustomField', :join_table => "#{table_name_prefix}custom_fields_trackers#{table_name_suffix}", :association_foreign_key => 'custom_field_id'
|
has_and_belongs_to_many :custom_fields, :class_name => 'IssueCustomField', :join_table => "#{table_name_prefix}custom_fields_trackers#{table_name_suffix}", :association_foreign_key => 'custom_field_id'
|
||||||
acts_as_list
|
acts_as_list
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
|
|
||||||
<!-- <div class="borad-description"><%=h @board.description %></div> -->
|
<!-- <div class="borad-description"><%=h @board.description %></div> -->
|
||||||
<div class="borad-setitle">
|
<div class="borad-setitle">
|
||||||
<span class="borad-topic-count">共有 <%=link_to @topics.count %> 个贴子</span>
|
<span class="borad-topic-count">共有 <%=link_to @topic_count,:controller => 'boards',:action => 'index' %> 个贴子</span>
|
||||||
<span>
|
<span>
|
||||||
<%= link_to l(:label_message_new),
|
<%= link_to l(:label_message_new),
|
||||||
new_board_message_path(@board),
|
new_board_message_path(@board),
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
|
|
||||||
<!-- <div class="borad-description"><%= h @board.description %></div> -->
|
<!-- <div class="borad-description"><%= h @board.description %></div> -->
|
||||||
<div class="borad-setitle">
|
<div class="borad-setitle">
|
||||||
<span class="borad-topic-count">共有 <%= link_to @topics.count %> 个贴子</span>
|
<span class="borad-topic-count">共有 <%= link_to @topic_count,:controller => 'boards',:action => 'index' %> 个贴子</span>
|
||||||
<% if @project.enabled_modules.where("name = 'boards'").count > 0 %>
|
<% if @project.enabled_modules.where("name = 'boards'").count > 0 %>
|
||||||
<span>
|
<span>
|
||||||
<%= link_to l(:label_message_new),
|
<%= link_to l(:label_message_new),
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
<!-- <td class="created_on"><%#= format_time(file.created_on) %></td> -->
|
<!-- <td class="created_on"><%#= format_time(file.created_on) %></td> -->
|
||||||
<td class="filesize"><%= number_to_human_size(file.filesize) %></td>
|
<td class="filesize"><%= number_to_human_size(file.filesize) %></td>
|
||||||
<td class="attach_type">
|
<td class="attach_type">
|
||||||
<span id="attach_type_id_label<%= file.id %>" style="white-space:nowrap;"><%= file.attachmentstype.typeName %></span>
|
<span id="attach_type_id_label<%= file.id %>" style="white-space:nowrap;"><%= file.attachmentstype.nil? ? l(:lable_unknow_type):file.attachmentstype.typeName %></span>
|
||||||
|
|
||||||
<span id="attach_type_id_edit<%= file.id %>" style="white-space:nowrap;">
|
<span id="attach_type_id_edit<%= file.id %>" style="white-space:nowrap;">
|
||||||
<%= render :partial => 'attachments/course_type_edit', :locals => {:attachmenttypes => attachmenttypes,
|
<%= render :partial => 'attachments/course_type_edit', :locals => {:attachmenttypes => attachmenttypes,
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
<!-- <td class="created_on"><%#= format_time(file.created_on) %></td> -->
|
<!-- <td class="created_on"><%#= format_time(file.created_on) %></td> -->
|
||||||
<td class="filesize"><%= number_to_human_size(file.filesize) %></td>
|
<td class="filesize"><%= number_to_human_size(file.filesize) %></td>
|
||||||
<td class="attach_type">
|
<td class="attach_type">
|
||||||
<span id="attach_type_id_label<%= file.id %>" style="white-space:nowrap;"><%= file.attachmentstype.typeName %></span>
|
<span id="attach_type_id_label<%= file.id %>" style="white-space:nowrap;"><%= file.attachmentstype.nil? ? l(:lable_unknow_type):file.attachmentstype.typeName %></span>
|
||||||
|
|
||||||
<span id="attach_type_id_edit<%= file.id %>" style="white-space:nowrap;">
|
<span id="attach_type_id_edit<%= file.id %>" style="white-space:nowrap;">
|
||||||
<%= render :partial => 'attachments/type_edit', :locals => {:attachmenttypes => attachmenttypes,
|
<%= render :partial => 'attachments/type_edit', :locals => {:attachmenttypes => attachmenttypes,
|
||||||
|
|
|
@ -92,33 +92,6 @@
|
||||||
<% end %></td>
|
<% end %></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<!-- added by bai 增加个人得分 -->
|
|
||||||
<%# messages_count = @user.messages.count %>
|
|
||||||
<%# messages_score = messages_count * 0.05%>
|
|
||||||
<%# finall_messages_score = messages_score %>
|
|
||||||
|
|
||||||
<%# journals_count = @user.journals.count %>
|
|
||||||
<%# journals_score = journals_count * 0.1 %>
|
|
||||||
<%# user_changesets_count = @user.changesets.count %>
|
|
||||||
<%# user_changesets_score = user_changesets_count * 0.3 %>
|
|
||||||
<%# finall_user_project_score = journals_score + user_changesets_score %>
|
|
||||||
|
|
||||||
<%# journals_for_messages_count = @user.journals_messages.count %>
|
|
||||||
<%# activities_count = @user.activities.count %>
|
|
||||||
<%# journals_for_messages_score = journals_for_messages_count * 0.05 %>
|
|
||||||
<%# activities_score = activities_count * 0.2 %>
|
|
||||||
<%# finall_activity_score = journals_for_messages_score + activities_score %>
|
|
||||||
|
|
||||||
<%# news_count = @user.news.count %>
|
|
||||||
<%# news_score = news_count * 0.1 %>
|
|
||||||
<%# wiki_contents_count = @user.wiki_contents.count %>
|
|
||||||
<%# wiki_contents_score = wiki_contents_count * 0.1 %>
|
|
||||||
<%# comments_count = @user.comments.count %>
|
|
||||||
<%# comments_score = comments_count * 0.1 %>
|
|
||||||
<%# finall_influence_score = news_score + wiki_contents_score + comments_score %>
|
|
||||||
<%# finall_user_score = finall_messages_score + finall_user_project_score + finall_activity_score + finall_influence_score %>
|
|
||||||
|
|
||||||
<!-- modified by zjc 新得分显示 -->
|
|
||||||
<tr><td class="score">
|
<tr><td class="score">
|
||||||
<div id="score_div">
|
<div id="score_div">
|
||||||
<%= render :partial => 'users/user_score', :locals => {:user => @user}%>
|
<%= render :partial => 'users/user_score', :locals => {:user => @user}%>
|
||||||
|
|
|
@ -37,6 +37,17 @@
|
||||||
<td><%= image_tag "/images/praise_tread/tread_true.png",weight:"22px", height:"22px",:title => l(:label_issue_not_treed_over) %></td>
|
<td><%= image_tag "/images/praise_tread/tread_true.png",weight:"22px", height:"22px",:title => l(:label_issue_not_treed_over) %></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
<% else %>
|
||||||
|
<!-- 积分少于2分不能踩帖 -->
|
||||||
|
<% if OptionNumber.get_user_option_number(user_id).nil? || OptionNumber.get_user_option_number(user_id).total_score < 2 %>
|
||||||
|
<table style="line-height: 1px">
|
||||||
|
<tr>
|
||||||
|
<td ><%= link_to image_tag("/images/praise_tread/praise_true.png",weight:"22px", height:"22px",:title => l(:label_issue_praise)),
|
||||||
|
:controller=>"praise_tread",:action=>"praise_plus",:remote=>true,:obj_id => obj.id,:obj_type => obj.class,:horizontal => horizontal %></td>
|
||||||
|
<td align="center"><strong class="font_small_watch"><%= get_praise_num(obj)%></strong></td>
|
||||||
|
<td><%= image_tag "/images/praise_tread/tread_true.png",weight:"22px", height:"22px",:title => l(:label_issues_score_not_enough) %></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
<% else %>
|
<% else %>
|
||||||
<table style="line-height: 1px">
|
<table style="line-height: 1px">
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -49,6 +60,8 @@
|
||||||
</table>
|
</table>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<!-- end -->
|
<!-- end -->
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
@ -104,6 +117,21 @@
|
||||||
<td><%= image_tag "/images/praise_tread/tread_true.png",weight:"22px", height:"22px",:title => l(:label_issue_not_treed_over) %> </td>
|
<td><%= image_tag "/images/praise_tread/tread_true.png",weight:"22px", height:"22px",:title => l(:label_issue_not_treed_over) %> </td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
<% else %>
|
||||||
|
<% if OptionNumber.get_user_option_number(user_id).nil? || OptionNumber.get_user_option_number(user_id).total_score < 2 %>
|
||||||
|
<table style="line-height: 1px">
|
||||||
|
<tr>
|
||||||
|
<td > <%= link_to image_tag("/images/praise_tread/praise_true.png",weight:"22px", height:"22px",:title => l(:label_issue_praise)),
|
||||||
|
:controller=>"praise_tread",:action=>"praise_plus",:remote=>true,:obj_id => obj.id,:obj_type => obj.class ,:horizontal => horizontal %></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td align="center"><strong class="font_small_watch"><%= get_praise_num(obj)%></strong></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><%= image_tag "/images/praise_tread/tread_true.png",weight:"22px", height:"22px",:title => l(:label_issues_score_not_enough) %> </td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
<% else %>
|
<% else %>
|
||||||
<table style="line-height: 1px">
|
<table style="line-height: 1px">
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -120,6 +148,8 @@
|
||||||
</table>
|
</table>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<!-- end -->
|
<!-- end -->
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -46,7 +46,7 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td style="width: 40%;text-align: right;font-size: 17px;color: rgb(17, 102, 153)">
|
<td style="width: 40%;text-align: right;font-size: 17px;color: rgb(17, 102, 153)">
|
||||||
<!-- @project.repository.nil? || @project.project_status.nil? ? '0' : @project.project_status.changesets_count -->
|
<!-- @project.repository.nil? || @project.project_status.nil? ? '0' : @project.project_status.changesets_count -->
|
||||||
<strong><%= content_tag('span', "#{changesets_num(@project)}", :class => "info") %></strong>
|
<strong><%= content_tag('span', "#{get_project_score(@project).nil? ? 0:get_project_score(@project).changeset_num}", :class => "info") %></strong>
|
||||||
</td>
|
</td>
|
||||||
<td style="width: 60%;text-align: left">
|
<td style="width: 60%;text-align: left">
|
||||||
<%= content_tag('span', l(:label_commit_on)) %>
|
<%= content_tag('span', l(:label_commit_on)) %>
|
||||||
|
@ -87,7 +87,7 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="add-info">
|
<div class="add-info-project">
|
||||||
<div class="main-language">
|
<div class="main-language">
|
||||||
<!-- added by huang -->
|
<!-- added by huang -->
|
||||||
<% if(@project.project_type==1)%>
|
<% if(@project.project_type==1)%>
|
||||||
|
|
|
@ -52,7 +52,7 @@
|
||||||
<span class="font_title_tag"><%= l(:label_tag) %>:</span>
|
<span class="font_title_tag"><%= l(:label_tag) %>:</span>
|
||||||
|
|
||||||
<% if User.current.logged? %>
|
<% if User.current.logged? %>
|
||||||
<span><%= toggle_link (image_tag "/images/sidebar/add.png"), 'put-tag-form', {:focus => 'name'} %></span>
|
<span><%= toggle_link (image_tag "/images/sidebar/add.png"), 'put-tag-form', {:focus => 'tags_name'} %></span>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<div id="tags_show">
|
<div id="tags_show">
|
||||||
|
@ -62,7 +62,7 @@
|
||||||
<%= form_for "tag_for_save",:remote=>true,:url=>tag_path,
|
<%= form_for "tag_for_save",:remote=>true,:url=>tag_path,
|
||||||
:update => "tags_show",
|
:update => "tags_show",
|
||||||
:complete => '$("#put-tag-form").hide();' do |f| %>
|
:complete => '$("#put-tag-form").hide();' do |f| %>
|
||||||
<%= f.text_field :name ,:id => "name",:size=>"28",:require=>true,:maxlength => Setting.tags_max_length,:minlength=>Setting.tags_min_length %>
|
<%= f.text_field :name ,:id => "tags_name",:size=>"28",:require=>true,:maxlength => Setting.tags_max_length,:minlength=>Setting.tags_min_length %>
|
||||||
<%= f.text_field :object_id,:value=> obj.id,:style=>"display:none"%>
|
<%= f.text_field :object_id,:value=> obj.id,:style=>"display:none"%>
|
||||||
<%= f.text_field :object_flag,:value=> object_flag,:style=>"display:none"%>
|
<%= f.text_field :object_flag,:value=> object_flag,:style=>"display:none"%>
|
||||||
<%= f.submit l(:button_project_tags_add),:class => "small" %>
|
<%= f.submit l(:button_project_tags_add),:class => "small" %>
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
<% i += 1 %>
|
<% i += 1 %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<%= link_to l(:label_more_tags), :action => "show", :id => obj.id %>
|
<%= link_to l(:label_more_tags),:controller => "tags", :action => "show", :id => obj.id %>
|
||||||
|
|
||||||
<% else %>
|
<% else %>
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<%= error_messages_for 'tracker' %>
|
<%= error_messages_for 'tracker' %>
|
||||||
|
|
||||||
<div class="splitcontentleft">
|
<div> <!-- class="splitcontentleft" -->
|
||||||
<div class="box tabular">
|
<div class="box tabular">
|
||||||
<!--[form:tracker]-->
|
<!--[form:tracker]-->
|
||||||
<p><%= f.text_field :name, :required => true %></p>
|
<p><%= f.text_field :name, :required => true %></p>
|
||||||
|
@ -39,14 +39,27 @@
|
||||||
<%= submit_tag l(@tracker.new_record? ? :button_create : :button_save) %>
|
<%= submit_tag l(@tracker.new_record? ? :button_create : :button_save) %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="splitcontentright">
|
<div><!--class="splitcontentright" -->
|
||||||
<% if @projects.any? %>
|
<% if @projects.any? %>
|
||||||
<fieldset class="box" id="tracker_project_ids"><legend><%= l(:label_project_plural) %></legend>
|
<fieldset class="box" id="tracker_project_ids"><legend><%= l(:label_project_plural) %></legend>
|
||||||
|
<div style="overflow: scroll; height: 300px; width: 680px;">
|
||||||
<%= render_project_nested_lists(@projects) do |p|
|
<%= render_project_nested_lists(@projects) do |p|
|
||||||
content_tag('label', check_box_tag('tracker[project_ids][]', p.id, @tracker.projects.include?(p), :id => nil) + ' ' + h(p))
|
content_tag('label', check_box_tag('tracker[project_ids][]', p.id, @tracker.projects.include?(p), :id => nil) + ' ' + h(p))
|
||||||
end %>
|
end %>
|
||||||
|
</div>
|
||||||
<%= hidden_field_tag('tracker[project_ids][]', '', :id => nil) %>
|
<%= hidden_field_tag('tracker[project_ids][]', '', :id => nil) %>
|
||||||
|
|
||||||
<p><%= check_all_links 'tracker_project_ids' %></p>
|
<p><%= check_all_links 'tracker_project_ids' %></p>
|
||||||
|
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<!-- <#% if @courses.any? %>
|
||||||
|
<fieldset class="box" id="tracker_course_ids"><legend><#%= l(:label_course_all) %></legend>
|
||||||
|
<#%= render_course_nested_lists(@courses) do |p|
|
||||||
|
content_tag('label', check_box_tag('tracker[course_ids][]', p.id, @tracker.projects.include?(p), :id => nil) + ' ' + h(p))
|
||||||
|
end %>
|
||||||
|
<#%= hidden_field_tag('tracker[course_ids][]', '', :id => nil) %>
|
||||||
|
<p><#%= check_all_links 'tracker_course_ids' %></p>
|
||||||
|
</fieldset>
|
||||||
|
<#% end %> -->
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -6,5 +6,9 @@
|
||||||
<!-- <div> + <%#= l(:label_user_score_of_influence) %></div> -->
|
<!-- <div> + <%#= l(:label_user_score_of_influence) %></div> -->
|
||||||
<div> = <%= format("%.2f" ,collaboration(option_num)).to_i %> + <%= format("%.2f" , influence(option_num) ).to_i %>
|
<div> = <%= format("%.2f" ,collaboration(option_num)).to_i %> + <%= format("%.2f" , influence(option_num) ).to_i %>
|
||||||
+ <%= "(" if skill(option_num) < 0 %> <%= format("%.2f" , skill(option_num)).to_i %> <%= ")" if skill(option_num) < 0 %> + <%= format("%.2f" , active(option_num)).to_i %></div>
|
+ <%= "(" if skill(option_num) < 0 %> <%= format("%.2f" , skill(option_num)).to_i %> <%= ")" if skill(option_num) < 0 %> + <%= format("%.2f" , active(option_num)).to_i %></div>
|
||||||
|
<% if (format("%.2f" ,collaboration(option_num)).to_i + format("%.2f" , influence(option_num) ).to_i + format("%.2f" , skill(option_num)).to_i + format("%.2f" , active(option_num)).to_i) < 0 %>
|
||||||
|
<div><%= l(:lable_score_less_than_zero) %></div>
|
||||||
|
<% else %>
|
||||||
<div> = <%= format("%.2f" ,option_num.total_score).to_i %></div>
|
<div> = <%= format("%.2f" ,option_num.total_score).to_i %></div>
|
||||||
|
<% end %>
|
||||||
<!-- end -->
|
<!-- end -->
|
||||||
|
|
|
@ -1,32 +1,6 @@
|
||||||
<!-- added by bai -->
|
<!-- added by bai -->
|
||||||
<div class="autoscroll">
|
<div class="autoscroll">
|
||||||
<% for user in @users -%>
|
<% for user in @users -%>
|
||||||
<!-- added by bai -->
|
|
||||||
<% messages_count = user.messages.count %>
|
|
||||||
<% messages_score = messages_count * 0.05%>
|
|
||||||
<% finall_messages_score = messages_score %>
|
|
||||||
|
|
||||||
<% journals_count = user.journals.count %>
|
|
||||||
<% journals_score = journals_count * 0.1 %>
|
|
||||||
<% user_changesets_count = user.changesets.count %>
|
|
||||||
<% user_changesets_score = user_changesets_count * 0.3 %>
|
|
||||||
<% finall_user_project_score = journals_score + user_changesets_score %>
|
|
||||||
|
|
||||||
<% journals_for_messages_count = user.journals_messages.count %>
|
|
||||||
<% activities_count = user.activities.count %>
|
|
||||||
<% journals_for_messages_score = journals_for_messages_count * 0.05 %>
|
|
||||||
<% activities_score = activities_count * 0.2 %>
|
|
||||||
<% finall_activity_score = journals_for_messages_score + activities_score %>
|
|
||||||
|
|
||||||
<% news_count = user.news.count %>
|
|
||||||
<% news_score = news_count * 0.1 %>
|
|
||||||
<% wiki_contents_count = user.wiki_contents.count %>
|
|
||||||
<% wiki_contents_score = wiki_contents_count * 0.1 %>
|
|
||||||
<% comments_count = user.comments.count %>
|
|
||||||
<% comments_score = comments_count * 0.1 %>
|
|
||||||
<% finall_influence_score = news_score + wiki_contents_score + comments_score %>
|
|
||||||
<% finall_user_score = finall_messages_score + finall_user_project_score + finall_activity_score + finall_influence_score %>
|
|
||||||
<!-- end -->
|
|
||||||
<div class="well">
|
<div class="well">
|
||||||
|
|
||||||
<%= content_tag "p", "#{format_date(user.created_on)} #{l(:label_member_since)}", :class => "float_right member_since" %>
|
<%= content_tag "p", "#{format_date(user.created_on)} #{l(:label_member_since)}", :class => "float_right member_since" %>
|
||||||
|
|
|
@ -1807,3 +1807,5 @@ en:
|
||||||
|
|
||||||
label_company_name: Company Name
|
label_company_name: Company Name
|
||||||
notice_account_invalid_creditentials_new: You have not to the mailbox activation
|
notice_account_invalid_creditentials_new: You have not to the mailbox activation
|
||||||
|
lable_unknow_type: Unknow type
|
||||||
|
lable_score_less_than_zero: Score less than 0, revised to 0
|
|
@ -1589,6 +1589,7 @@ zh:
|
||||||
label_issue_tread_over: 我刚才踩过了~
|
label_issue_tread_over: 我刚才踩过了~
|
||||||
label_issue_not_praise_over: 不能顶自己~
|
label_issue_not_praise_over: 不能顶自己~
|
||||||
label_issue_not_treed_over: 不能踩自己~
|
label_issue_not_treed_over: 不能踩自己~
|
||||||
|
label_issues_score_not_enough: 积分不够,不能踩别人~
|
||||||
#end
|
#end
|
||||||
label_goto: 前往>>
|
label_goto: 前往>>
|
||||||
label_issue_appraise_over: 只能评价一次哦!
|
label_issue_appraise_over: 只能评价一次哦!
|
||||||
|
@ -2113,4 +2114,6 @@ zh:
|
||||||
|
|
||||||
lable_memos_max_length: 帖子内容最大长度为65535个字符
|
lable_memos_max_length: 帖子内容最大长度为65535个字符
|
||||||
lable_forums_max_length: 贴吧描述最大长度为65535个字符
|
lable_forums_max_length: 贴吧描述最大长度为65535个字符
|
||||||
|
lable_unknow_type: 未知类型
|
||||||
|
lable_score_less_than_zero: 得分小于0,修正为0
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
class ProjectScoreAddCloumn < ActiveRecord::Migration
|
||||||
|
def up
|
||||||
|
add_column("project_scores","issue_num",:integer,:default => 0)
|
||||||
|
add_column("project_scores","issue_journal_num",:integer,:default => 0)
|
||||||
|
add_column("project_scores","news_num",:integer,:default => 0)
|
||||||
|
add_column("project_scores","documents_num",:integer,:default => 0)
|
||||||
|
add_column("project_scores","changeset_num",:integer,:default => 0)
|
||||||
|
add_column("project_scores","board_message_num",:integer,:default => 0)
|
||||||
|
end
|
||||||
|
|
||||||
|
def down
|
||||||
|
remove_column("project_scores","issue_num")
|
||||||
|
remove_column("project_scores","issue_journal_num")
|
||||||
|
remove_column("project_scores","news_num")
|
||||||
|
remove_column("project_scores","documents_num")
|
||||||
|
remove_column("project_scores","changeset_num")
|
||||||
|
remove_column("project_scores","board_message_num")
|
||||||
|
end
|
||||||
|
end
|
|
@ -11,7 +11,7 @@
|
||||||
#
|
#
|
||||||
# It's strongly recommended to check this file into your version control system.
|
# It's strongly recommended to check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema.define(:version => 20140814062455) do
|
ActiveRecord::Schema.define(:version => 20140826072838) do
|
||||||
|
|
||||||
create_table "activities", :force => true do |t|
|
create_table "activities", :force => true do |t|
|
||||||
t.integer "act_id", :null => false
|
t.integer "act_id", :null => false
|
||||||
|
@ -743,6 +743,12 @@ ActiveRecord::Schema.define(:version => 20140814062455) do
|
||||||
t.integer "score"
|
t.integer "score"
|
||||||
t.datetime "created_at", :null => false
|
t.datetime "created_at", :null => false
|
||||||
t.datetime "updated_at", :null => false
|
t.datetime "updated_at", :null => false
|
||||||
|
t.integer "issue_num", :default => 0
|
||||||
|
t.integer "issue_journal_num", :default => 0
|
||||||
|
t.integer "news_num", :default => 0
|
||||||
|
t.integer "documents_num", :default => 0
|
||||||
|
t.integer "changeset_num", :default => 0
|
||||||
|
t.integer "board_message_num", :default => 0
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "project_statuses", :force => true do |t|
|
create_table "project_statuses", :force => true do |t|
|
||||||
|
|
|
@ -1634,7 +1634,7 @@ fieldset#filters td.field { width:230px; }
|
||||||
fieldset#filters td.operator { width:180px; }
|
fieldset#filters td.operator { width:180px; }
|
||||||
fieldset#filters td.operator select {max-width:170px;}
|
fieldset#filters td.operator select {max-width:170px;}
|
||||||
fieldset#filters td.values { white-space:nowrap; }
|
fieldset#filters td.values { white-space:nowrap; }
|
||||||
fieldset#filters td.values select {min-width:130px;}
|
fieldset#filters td.values select {min-width:130px;max-width: 220px;}
|
||||||
fieldset#filters td.values input {height:1em;}
|
fieldset#filters td.values input {height:1em;}
|
||||||
fieldset#filters td.add-filter { text-align: right; vertical-align: top; }
|
fieldset#filters td.add-filter { text-align: right; vertical-align: top; }
|
||||||
|
|
||||||
|
@ -1725,8 +1725,8 @@ ul.projects li {list-style-type:none;
|
||||||
#projects-index ul.projects div.root a.project {font-family:'微软雅黑', "Trebuchet MS", Verdana, sans-serif; font-weight: bold; font-size: 14px; margin: 0 0 10px 0; }
|
#projects-index ul.projects div.root a.project {font-family:'微软雅黑', "Trebuchet MS", Verdana, sans-serif; font-weight: bold; font-size: 14px; margin: 0 0 10px 0; }
|
||||||
.my-project { padding-left: 18px; background: url(../images/fav.png) no-repeat 0 50%; }
|
.my-project { padding-left: 18px; background: url(../images/fav.png) no-repeat 0 50%; }
|
||||||
|
|
||||||
#notified-projects ul, #tracker_project_ids ul {max-height:250px; overflow-y:auto;}
|
#notified-projects ul{max-height:250px; overflow-y:auto;}
|
||||||
|
#tracker_project_ids ul {max-height:250px; /*overflow-y:auto;*/}
|
||||||
#related-issues li img {vertical-align:middle;}
|
#related-issues li img {vertical-align:middle;}
|
||||||
|
|
||||||
ul.properties {padding:0; font-size: 0.9em; color: #777;}
|
ul.properties {padding:0; font-size: 0.9em; color: #777;}
|
||||||
|
|
|
@ -1071,14 +1071,14 @@ overflow: hidden;
|
||||||
.information {
|
.information {
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
margin-left: 690px;
|
margin-left: 690px;
|
||||||
float: left;
|
/*float: left;*/
|
||||||
height: auto;
|
height: auto;
|
||||||
width: 280px;
|
width: 280px;
|
||||||
font-family: '微软雅黑',helvetica,arial,sans-serif; /*modify by men*/
|
font-family: '微软雅黑',helvetica,arial,sans-serif; /*modify by men*/
|
||||||
color: rgb(0, 0, 0);
|
color: rgb(0, 0, 0);
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
line-height: 18px;
|
line-height: 18px;
|
||||||
position: absolute;
|
/*position: absolute;*/
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
a.project {
|
a.project {
|
||||||
|
@ -1216,6 +1216,15 @@ p.stats {
|
||||||
padding-top: 10px;
|
padding-top: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.add-info-project {
|
||||||
|
/*float: left;*/
|
||||||
|
margin-top: 0px;
|
||||||
|
height: 20px;
|
||||||
|
width: 908px;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
padding-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
.main-language {
|
.main-language {
|
||||||
float: left;
|
float: left;
|
||||||
height: 18px;
|
height: 18px;
|
||||||
|
|
Loading…
Reference in New Issue